texlive[47837] Master/texmf-dist: semantic-markup (25may18)

commits+karl at tug.org commits+karl at tug.org
Sat May 26 00:32:04 CEST 2018


Revision: 47837
          http://tug.org/svn/texlive?view=revision&revision=47837
Author:   karl
Date:     2018-05-26 00:32:04 +0200 (Sat, 26 May 2018)
Log Message:
-----------
semantic-markup (25may18)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/semantic-markup/semantic-markup.pdf
    trunk/Master/texmf-dist/doc/latex/semantic-markup/semantic-markup.tex
    trunk/Master/texmf-dist/tex/latex/semantic-markup/semantic-markup.sty

Modified: trunk/Master/texmf-dist/doc/latex/semantic-markup/semantic-markup.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/semantic-markup/semantic-markup.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/semantic-markup/semantic-markup.tex	2018-05-25 22:31:52 UTC (rev 47836)
+++ trunk/Master/texmf-dist/doc/latex/semantic-markup/semantic-markup.tex	2018-05-25 22:32:04 UTC (rev 47837)
@@ -39,7 +39,23 @@
 \subsection{\texttt{endnotes}}
 
 The \texttt{endnotes} option converts footnotes to endnotes, including footnotes created with this package's \texttt{Footnote} environment.
+On its own, this option loads the \texttt{endnotes} package and does everything
+necessary for endnotes.
+You can define the following commands to adjust the behavior:
 
+\begin{center}
+\begin{tabular}{ll}
+    Command & Default value \\ \hline
+    \verb|\DoBeforeEndnotes| & \verb|\clearpage| \\
+    \verb|\EndnoteFont| & Empty (normal font) \\
+\end{tabular}
+\end{center}
+
+If you want to setup the endnotes in a completely different way or avoid
+conflicts with another package, you can do
+\verb|\renewcommand{\SetupEndnotes}{}| to eliminate all of this or you can renew
+the command to do something else.
+
 \section{Semantic Commands Defined Without Arguments}
 
 The following commands are defined (using \texttt{xparse}) as aliases to standard \LaTeX{} commands or \verb|\textquote| from the \texttt{csquotes} package.
@@ -50,6 +66,9 @@
 \end{verbatim}
 To redefine it to be set in bold, for example, you can use the basic \LaTeX{} command \verb|\renewcommand{\term}{\textbf}|.
 
+The \verb|\strong| command is already defined in the \texttt{fontspec} package;
+if that package is loaded, this package will not redefine its command.
+
 \begin{center}
 \begin{tabularx}{\linewidth}{llX}
 \toprule
@@ -97,10 +116,10 @@
 
 \begin{verbatim}
 Body text.%
-  \begin{Footnote}
+\begin{Footnote}
   Footnote text.
   More footnote text.
-  \end{Footnote}
+\end{Footnote}
 Continuation of body text.
 \end{verbatim}
 
@@ -111,6 +130,10 @@
 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\ |.
 There is also a command for octave numbers, for the system in which middle C begins the fourth octave.
 
+If the \texttt{musicography} package is loaded, it will redefine the commands
+\verb|\fl|, \verb|\sh|, and \verb|\na| to use nicer symbols from the MusiX\TeX{}
+fonts.
+
 \begin{center}
 \begin{tabular}{ll}
 \toprule

Modified: trunk/Master/texmf-dist/tex/latex/semantic-markup/semantic-markup.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/semantic-markup/semantic-markup.sty	2018-05-25 22:31:52 UTC (rev 47836)
+++ trunk/Master/texmf-dist/tex/latex/semantic-markup/semantic-markup.sty	2018-05-25 22:32:04 UTC (rev 47837)
@@ -1,7 +1,7 @@
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{semantic-markup}[2016/10/28
+\ProvidesPackage{semantic-markup}[2018/05/21
   Macros for TEI-like semantic markup]
-% Copyright 2016 Andrew A. Cashner, andrewacashner at gmail.com
+% Copyright 2018 Andrew A. Cashner, andrewacashner at gmail.com
 
 % This work may be distributed and/or modified under the 
 % conditions of the LaTeX Project Public License, either
@@ -18,8 +18,14 @@
 % and the documentation file semantic-markup.tex.
 
 % CHANGE LOG
-% 2016-09-22 `endnotes' option added
-% 2016-09-01 First version on CTAN
+% 2018-05-21 - Use fontspec's definition of `\strong` if it is loaded
+%            - Use musicography's definition of `\fl`, `\sh`, `\na` commands if
+%              it is loaded
+%            - `\wtitle` and `\ptitle` shorthands added 
+%            - Customizable commands added for endnotes option
+%
+% 2016-09-22 - `endnotes' option added
+% 2016-09-01 - First version on CTAN
 
 % Option to use csquotes default behavior instead of the 
 % US localized punctuation used in this package
@@ -46,12 +52,19 @@
   \DeclareAutoPunct{.,!?}
 \fi
 
+% NB: fontspec defines its own \strong command, so only define this if fontspec
+% not loaded
+\@ifpackageloaded{fontspec}{}{%
+    \NewDocumentCommand{\strong}{}	
+    {\textbf}
+}
+
+
 \NewDocumentCommand{\quoted}{}	
 {\textquote}
 \NewDocumentCommand{\soCalled}{}
 {\textquote}
-\NewDocumentCommand{\strong}{}	
-{\textbf}
+
 \NewDocumentCommand{\code}{}	
 {\texttt}
 \NewDocumentCommand{\term}{}	
@@ -60,11 +73,16 @@
 {\emph}
 \NewDocumentCommand{\foreign}{}
 {\emph}
+
 \NewDocumentCommand{\worktitle}{}
 {\emph}
 \NewDocumentCommand{\parttitle}{}
 {\textquote}
 
+% Shorter versions of these frequently used commands
+\NewDocumentCommand{\wtitle}{}{\worktitle}
+\NewDocumentCommand{\ptitle}{}{\parttitle}
+
 % editorial addition
 \NewDocumentCommand{\add}{ m }
 {[#1]}
@@ -82,12 +100,12 @@
 %*******************
 % Identify problem spot in draft
 \NewDocumentCommand{\XXX}{ O{\add{FIX}} }{%
-  \textbf{#1}%
+  \strong{#1}%
 }
 % Indicate citation to be filled in later
 % Optional argument for indicating the source
 \NewDocumentCommand{\citXXX}{ o }{%
-  \footnote{\textbf{[Citation needed]\IfValueTF{#1}{#1}{}}}%
+    \footnote{\strong{\add{Citation needed}\IfValueTF{#1}{#1}{}}}%
 }
 
 %*******************
@@ -97,21 +115,39 @@
 
 %******************
 % Endnotes, if desired
-% Footnote environment adjusted to fix expansion problem
+
 \ifendnotes
-  \RequirePackage{endnotes}
-  \RenewEnviron{Footnote}{\expandafter\footnote\expandafter{\BODY}}[]
-  \let\footnote=\endnote
-  \AtEndDocument{\theendnotes}
+    \RequirePackage{endnotes}
+
+    % Customize these commands with \renewcommand
+    \NewDocumentCommand{\DoBeforeEndnotes}{}{\clearpage}
+    \NewDocumentCommand{\EndnoteFont}{}{}
+
+    % Optionally remove this (\renewcommand{\MakeEndnotes}{})
+    % to avoid conflicts with endnotes or other packages
+    \NewDocumentCommand{\SetupEndnotes}{}{%
+      \let\footnote=\endnote
+      \AtEndDocument{\DoBeforeEndnotes{\EndnoteFont\theendnotes}}%
+    }
+
+    \AtBeginDocument{%
+        \SetupEndnotes{}%
+        % Footnote environment adjusted to fix expansion problem
+        \RenewEnviron{Footnote}{\expandafter\footnote\expandafter{\BODY}}[]%
+    }%
 \fi
+%******************
 
 %****************************************
 % MUSIC SYMBOLS
 
 % Accidentals using LaTeX symbols
-\NewDocumentCommand{\fl}{}{$\flat$}
-\NewDocumentCommand{\na}{}{$\natural$}
-\NewDocumentCommand{\sh}{}{$\sharp$}
+% Use better definitions from musicography if it was loaded first
+\@ifpackageloaded{musicography}{}{%
+    \NewDocumentCommand{\fl}{}{$\flat$}
+    \NewDocumentCommand{\na}{}{$\natural$}
+    \NewDocumentCommand{\sh}{}{$\sharp$}
+}
 
 % Octave subscripts 
 \NewDocumentCommand{\octave}{ }{\textsubscript}



More information about the tex-live-commits mailing list