| 1 |
\documentclass{article} |
| 2 |
\usepackage{lmodern} |
| 3 |
\usepackage[T1]{fontenc} |
| 4 |
\usepackage[utf8]{inputenc} |
| 5 |
\usepackage{tabularx} |
| 6 |
\usepackage{fancyvrb} |
| 7 |
\usepackage{booktabs} |
| 8 |
\usepackage{semantic-markup} |
| 9 |
\frenchspacing |
| 10 |
\usepackage |
| 11 |
[pdftitle={The semantic-markup Package for Meaningful Markup}, |
| 12 |
pdfauthor={Andrew A. Cashner}, |
| 13 |
pdfsubject={LaTeX package}, |
| 14 |
pdfkeywords={LaTeX, semantic markup, TEI, humanities}]{hyperref} |
| 15 |
|
| 16 |
|
| 17 |
\title{The \texttt{semantic-markup} Package for Meaningful Markup} |
| 18 |
\author{Andrew A. Cashner% |
| 19 |
\thanks{\href{mailto:[email protected]}{\nolinkurl{[email protected]}}}% |
| 20 |
} |
| 21 |
\date{January 29, 2020} |
| 22 |
|
| 23 |
\begin{document} |
| 24 |
\maketitle |
| 25 |
|
| 26 |
The \texttt{semantic-markup} package provides a set of simple commands to allow for semantic markup. |
| 27 |
The commands are inspired by the XML elements of the Text Encoding Initiative (\url{http://www.tei-c.org}). |
| 28 |
They are intended especially for scholarly writing in the humanities, including about music. |
| 29 |
The goal is simply to allow scholars to write with attention to meaning and content rather than to formatting. |
| 30 |
|
| 31 |
\tableofcontents |
| 32 |
|
| 33 |
\section{Package Options} |
| 34 |
|
| 35 |
\subsection{\texttt{defaultquotes}} |
| 36 |
|
| 37 |
The package configures \texttt{csquotes} to place end punctuation inside quotation marks, according to United States usage. |
| 38 |
Use the \texttt{defaultquotes} package option to restore the default behavior of \texttt{csquotes}. |
| 39 |
|
| 40 |
\subsection{\texttt{endnotes}} |
| 41 |
|
| 42 |
The \texttt{endnotes} option converts footnotes to endnotes, including footnotes created with this package's \texttt{Footnote} environment. |
| 43 |
On its own, this option loads the \texttt{endnotes} package and does everything |
| 44 |
necessary for endnotes. |
| 45 |
You can define the following commands to adjust the behavior: |
| 46 |
|
| 47 |
\begin{center} |
| 48 |
\begin{tabular}{ll} |
| 49 |
Command & Default value \\ \hline |
| 50 |
\verb|\DoBeforeEndnotes| & \verb|\clearpage| \\ |
| 51 |
\verb|\EndnoteFont| & Empty (normal font) \\ |
| 52 |
\end{tabular} |
| 53 |
\end{center} |
| 54 |
|
| 55 |
If you want to setup the endnotes in a completely different way or avoid |
| 56 |
conflicts with another package, you can do |
| 57 |
\verb|\renewcommand{\SetupEndnotes}{}| to eliminate all of this or you can renew |
| 58 |
the command to do something else. |
| 59 |
|
| 60 |
\section{Semantic Commands Defined Without Arguments} |
| 61 |
|
| 62 |
The following commands are defined (using \texttt{xparse}) as aliases to standard \LaTeX{} commands or \verb|\textquote| from the \texttt{csquotes} package. |
| 63 |
In other words, they are not defined with an argument. |
| 64 |
For example, the command for a technical term, typically set in italics is defined this way: |
| 65 |
\begin{verbatim} |
| 66 |
\NewDocumentCommand{\term}{}{\emph} |
| 67 |
\end{verbatim} |
| 68 |
To redefine it to be set in bold, for example, you can use the basic \LaTeX{} command \verb|\renewcommand{\term}{\textbf}|. |
| 69 |
|
| 70 |
The \verb|\strong| command is already defined in the \texttt{fontspec} package; |
| 71 |
if that package is loaded, this package will not redefine its command. |
| 72 |
|
| 73 |
\begin{center} |
| 74 |
\begin{tabularx}{\linewidth}{llX} |
| 75 |
\toprule |
| 76 |
Package Command & Alias & Use\\ |
| 77 |
\midrule |
| 78 |
\verb|\quoted| & \verb|\textquote| & Quoted material, taking care of end punctuation: instead of \verb|``word,''| write \verb|\quoted{word},|\\ |
| 79 |
\verb|\soCalled| & \verb|\textquote| & Scare quotes\\ |
| 80 |
\verb|\strong| & \verb|\textbf| & Highlight emphasis just as in HTML\\ |
| 81 |
\verb|\code| & \verb|\texttt| & Computer code in teletype font (not verbatim)\\ |
| 82 |
\verb|\term| & \verb|\emph| & Technical terms, set in italics\\ |
| 83 |
\verb|\mentioned| & \verb|\emph| & Referring to a word as a word rather than to its meaning, as in philological discussion\\ |
| 84 |
\verb|\foreign| & \verb|\emph| & Foreign term\\ |
| 85 |
\verb|\worktitle| & \verb|\emph| & Title of a complete work (of literature, art, music), set in italics; use for books, journal titles\\ |
| 86 |
\verb|\parttitle| & \verb|\textquote| & Title of a portion of a work, set in quotation marks, such as a journal article, song on an album\\ |
| 87 |
\bottomrule |
| 88 |
\end{tabularx} |
| 89 |
\end{center} |
| 90 |
|
| 91 |
\section{Semantic Commands With Arguments} |
| 92 |
|
| 93 |
These commands have slightly more complex definitions, but can still be easily redefined. |
| 94 |
See the \texttt{xparse} documentation on the syntax of these commands. |
| 95 |
|
| 96 |
\begin{center} |
| 97 |
\begin{tabularx}{\linewidth}{lXX} |
| 98 |
\toprule |
| 99 |
Command & Definition & Usage\\ |
| 100 |
\midrule |
| 101 |
\verb|\add| & One argument: Put square brackets around argument & For editorial additions\\ |
| 102 |
\verb|\Dots| & Put ellipsis in square brackets & For editorial omissions from quotations\\ |
| 103 |
\verb|\gloss| & Two arguments: Put first in italics and second in parentheses & Use a technical or foreign term and give its definition\\ |
| 104 |
\verb|\quotedgloss| & Two arguments: Put first in quotation marks and second in parentheses & Same as \verb|\gloss| but using \verb|\quoted| for the first argument instead of \verb|\mentioned|\\ |
| 105 |
\verb|\XXX| & One optional argument with default value of \verb|\add{FIX}| & Identify problem spot in draft\\ |
| 106 |
\verb|\citXXX| & One optional argument & Make footnote indicating a missing citation; optional argument may be used for reminder of the citation name or description\\ |
| 107 |
\bottomrule |
| 108 |
\end{tabularx} |
| 109 |
\end{center} |
| 110 |
|
| 111 |
\section{Footnote Environment} |
| 112 |
|
| 113 |
When writing many long footnotes it can be useful to have an environment for footnotes. |
| 114 |
Here one is defined using the \texttt{environ} package. |
| 115 |
You still have to escape the end of the line before the footnote begins. |
| 116 |
Use like so: |
| 117 |
|
| 118 |
\begin{verbatim} |
| 119 |
Body text.% |
| 120 |
\begin{Footnote} |
| 121 |
Footnote text. |
| 122 |
More footnote text. |
| 123 |
\end{Footnote} |
| 124 |
Continuation of body text. |
| 125 |
\end{verbatim} |
| 126 |
|
| 127 |
\section{Musical Symbols} |
| 128 |
|
| 129 |
Shorthands are defined for musical accidentals, using \LaTeX{} math-mode symbols. |
| 130 |
These could be redefined to use Unicode symbols if the font contains them, or with commands from the \texttt{lilyglyphs} package. |
| 131 |
Remember that like all commands without arguments, \LaTeX{} will ignore the space after the command-name, so you will need to write \verb|\fl{}| or \verb|\fl\ |. |
| 132 |
There is also a command for octave numbers, for the system in which middle C begins the fourth octave. |
| 133 |
|
| 134 |
If the \texttt{musicography} package is loaded, it will redefine the commands |
| 135 |
\verb|\fl|, \verb|\sh|, and \verb|\na| to use nicer symbols from the MusiX\TeX{} |
| 136 |
fonts. |
| 137 |
|
| 138 |
\begin{center} |
| 139 |
\begin{tabular}{ll} |
| 140 |
\toprule |
| 141 |
Command & Alias\\ |
| 142 |
\midrule |
| 143 |
\verb|\fl| & \verb|$\flat$|\\ |
| 144 |
\verb|\na| & \verb|$\natural$|\\ |
| 145 |
\verb|\sh| & \verb|$\sharp$|\\ |
| 146 |
\verb|\octave| & \verb|\textsubscript|\\ |
| 147 |
\bottomrule |
| 148 |
\end{tabular} |
| 149 |
\end{center} |
| 150 |
|
| 151 |
For stacked numerals, as in meter signatures or figured bass, we provide two |
| 152 |
simple options, \verb|\musfig| using \verb|\Shortstack| from |
| 153 |
\texttt{stackengine}, and \verb|\meter|, which is an alias for the same thing. |
| 154 |
Both commands take two arguments, one for the top numeral and the second for the bottom numeral. |
| 155 |
You could write, for example: |
| 156 |
|
| 157 |
\begin{verbatim} |
| 158 |
There is a \musfig{6--5}{4--3} cadential pattern |
| 159 |
before the shift to \meter{3}{4} time. |
| 160 |
The melody begins on F\sh\octave{4}. |
| 161 |
\end{verbatim} |
| 162 |
|
| 163 |
\begin{center} |
| 164 |
\fbox{\parbox{\textwidth}{% |
| 165 |
There is a \musfig{6--5}{4--3} cadential pattern |
| 166 |
before the shift to \meter{3}{4} time. |
| 167 |
The melody begins on F\sh\octave{4}. |
| 168 |
}} |
| 169 |
\end{center} |
| 170 |
|
| 171 |
For more complex notation, such as three-level numerals, or stacked figured-bass symbols with accidentals or slashes, you will have to devise your own solution. |
| 172 |
|
| 173 |
\section{Code} |
| 174 |
|
| 175 |
\VerbatimInput{semantic-markup.sty} |
| 176 |
|
| 177 |
\end{document} |