% LaTeX \documentclass[leqno]{article} \usepackage[utf8]{inputenc} \usepackage{url} \usepackage{graphicx} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsfonts} \usepackage{bm} \usepackage{gellmu} \usepackage[margin=100bp,nohead]{geometry} \setlength{\parskip}{6bp} \setlength{\parindent}{0bp} \pagestyle{plain} \thispagestyle{empty} \title{The Anchor Command \texttt{anch}} \newlength{\centerskip} \setlength{\centerskip}{\topsep} \newcommand{\hsf}{\hspace*{\fill}} \newcommand{\tdbc}[1]{\hsf\textbf{#1}\hsf} \newenvironment{menulist}{ \begin{list}{}{ \setlength{\topsep}{0bp} \setlength{\labelwidth}{0.03\linewidth} \setlength{\leftmargin}{0.06\linewidth} \setlength{\itemindent}{0bp} \setlength{\itemsep}{-6bp} \setlength{\parsep}{6bp}} }{\end{list}} \newenvironment{Menulist}{ \begin{list}{}{ \setlength{\topsep}{0bp} \setlength{\labelwidth}{0.03\linewidth} \setlength{\leftmargin}{0.06\linewidth} \setlength{\itemindent}{0bp} \setlength{\itemsep}{3bp} \setlength{\parsep}{6bp}} }{\end{list}} \newenvironment{toclist}{\normalsize \begin{list}{}{ }}{\end{list}} \newenvironment{Toclist}{\large \begin{list}{}{ }}{\end{list}} \newenvironment{citations}{ \begin{list}{}{ \setlength{\topsep}{0bp} \setlength{\labelwidth}{0bp} \setlength{\leftmargin}{0.04\linewidth} \setlength{\labelsep}{0bp} \setlength{\itemindent}{-0.2\leftmargin} \setlength{\itemsep}{3bp} \setlength{\parsep}{0bp}} }{\end{list}} \begin{document} \begin{center} {\LARGE\bfseries{}The Anchor Command \texttt{anch}} \end{center} \vspace*{-\centerskip} \par{The didactic \textsc{GELLMU} production system provides a command \texttt{"}\verb+\+\texttt{anch"} for anchors that is parallel to the \textsc{HTML} anchor tag \texttt{"\string"}. \ } \par{An example of basic usage is given by the following markup for an anchor to the World Wide Web Consortium (W3C): \begin{menulist} \item\texttt{}\verb+\+\texttt{anch[href=\texttt{"}http://www.w3.org/\texttt{"}]}\verb+{+\texttt{this\ anchor}\verb+}+\texttt{} \end{menulist} The markup is used here for this anchor\footnote{URI: http://www.w3.org/}. \ } \par{The \emph{urlanch} command provides a succinct way to insert an anchor whose visible content is the referenced \textsc{URI}.\footnote{The name \emph{urianch} would be more ``correct'' since its content is a \textsc{URI}.} Either of these commands may be used in a display, as here: \begin{center} \url{http://www.w3.org/}\,. \end{center} } \par{One may ask whether there is a difference between the use of a macro \emph{Urlanch} defined by \begin{center} \texttt{}\verb+\+\texttt{newcommand}\verb+{+\texttt{}\verb+\+\texttt{Urlanch}\verb+}+\texttt{[1]}\verb+{+\texttt{}\verb+\+\texttt{anch[href=\texttt{"}\#1\texttt{"}]}\verb+{+\texttt{}\verb+\+\texttt{path}\verb+{+\texttt{\#1}\verb+}+\texttt{}\verb+}+\texttt{}\verb+}+\texttt{} \end{center} and \emph{urlanch}. \ The latter is used here: \begin{center} \url{http://www.w3.org/}\footnote{URI: http://www.w3.org/}\,. \end{center} } \par{There \emph{is} a difference. \ The command \emph{urlanch} corresponds to an \textsc{SGML} element, while anything defined with \emph{newcommand} is fully expanded by the \textsc{GELLMU} syntactic translator before \textsc{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. \ } \par{Whether it is sensible to undertake the effort of coding formatters to handle the \textsc{SGML} element \emph{urlanch} in addition to the \textsc{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 \textsc{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.)} } \par{If one thinks about these issues solely in terms of formatting from \textsc{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: \begin{menulist} \item [{\label{macros}(a)}] Using macros such as \emph{newcommand} for \textsc{SGML} generation. \ \item [{\label{formatters}(b)}] Carefully crafting formatters from one's document type to \LaTeX{}. \ \item [{\label{packages}(c)}] Writing \LaTeX{} packages to ``receive'' various \textsc{SGML} (or \textsc{XML}, of course) document types.\footnote{In fact, it is generally easier to write formatters for document types that are formally \textsc{XML}. \ On the other hand, writing \textsc{SGML} is easier for authors. \ Since an \textsc{SGML} parser can, for most document types, convert \textsc{SGML} to \textsc{XML}, it is sensible for document types used with \textsc{GELLMU} to have both \textsc{SGML} and \textsc{XML} definitions.} \end{menulist} } \end{document}