%!latex-faq \documenttype{article} \baseloc{http://www.albany.edu/\tld;hammond/gellmu/} \surtitle{The GELLMU Archive} \title{The Anchor Command \quostr{anch}} \compacttitle \newcommand{\gellmu}{\abbr{GELLMU}} \newcommand{\html}{\abbr{HTML}} \newcommand{\sgml}{\abbr{SGML}} \newcommand{\xml}{\abbr{XML}} \nobaseprint \nobanner \begin{document} The didactic \gellmu; production system provides a command \qquostr{\bsl;anch} for anchors that is parallel to the \html anchor tag \qquostr{}. An example of basic usage is given by the following markup for an anchor to the World Wide Web Consortium (W3C): \begin{verbatim} \anch[href="http://www.w3.org/"]{this anchor} \end{verbatim} The markup is used here for \anch[href="http://www.w3.org/"]{this anchor}. The \emph{urlanch} command provides a succinct way to insert an anchor whose visible content is the referenced \abbr{URI}.\footnote{ The name \emph{urianch} would be more \quophrase{correct} since its content is a \abbr{URI}.} Either of these commands may be used in a display, as here: \display{\urlanch{http://www.w3.org/}\,.} One may ask whether there is a difference between the use of a macro \emph{Urlanch} defined by \newcommand{\Urlanch}[1]{\anch[href="#1"]{\path{#1}}} \display{|\newcommand{\Urlanch}[1]{\anch[href="#1"]{\path{#1}}}|} and \emph{urlanch}. The latter is used here: \display{\Urlanch{http://www.w3.org/}\,.} There \emph{is} a difference. The command \emph{urlanch} corresponds to an \sgml; element, while anything defined with \emph{newcommand} is fully expanded by the \gellmu; syntactic translator before \sgml generation. This means that the treatment of \emph{urlanch} by a formatter is completely independent of the treatment of \emph{anch} and \emph{path} by a formatter, while the treatment of \emph{Urlanch}, if so defined, is entirely dependent on the formatter's treatment of the other two names. Whether it is sensible to undertake the effort of coding formatters to handle the \sgml element \emph{urlanch} in addition to the \sgml elements \emph{anch} and \emph{path} depends upon whether or not one imagines that there is at least one hypothetical output format for one's document type that might benefit from independent treatment.\footnote{ With the default \gellmu formatter for \latex;, for example, a footnote is created with \emph{Urlanch} but not with \emph{urlanch}. (A footnote might also be avoided by using a different attribute name \emph{Href} instead of \emph{href}, but that still does not make the issue vanish.) } If one thinks about these issues solely in terms of formatting from \gellmu markup to \latex;, one will come to realize that there are several approaches to the needs traditionally met in the \latex; world with packages: \newcommand{\ita}[2][]{% \item[\label[:series="ita"]{#1}(\series[:type="a"]{\evalref{\popkey}})]#2% } \begin{menu} \ita[macros]{Using macros such as \emph{newcommand} for \sgml generation.} \ita[formatters]{Carefully crafting formatters from one's document type to \latex;.} \ita[packages]{Writing \latex; packages to \quophrase{receive} various \sgml (or \abbr{XML}, of course) document types.\footnote{ In fact, it is generally easier to write formatters for document types that are formally \xml. On the other hand, writing \sgml is easier for authors. Since an \sgml parser can, for most document types, convert \sgml to \xml, it is sensible for document types used with \gellmu to have both \sgml and \xml definitions.}} \end{menu} \end{document}