diff options
author | Norbert Preining <norbert@preining.info> | 2022-05-07 03:00:36 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-05-07 03:00:36 +0000 |
commit | 689536ecd7f688909820f27ed2938273c2e3ae44 (patch) | |
tree | 65f59e8d7e28a66525c2e72c2c969a101df4750a /macros/latex | |
parent | 3e3ecb7f722d0904c12ee0648c343b865dc99187 (diff) |
CTAN sync 202205070300
Diffstat (limited to 'macros/latex')
25 files changed, 2628 insertions, 525 deletions
diff --git a/macros/latex/contrib/begingreek/README b/macros/latex/contrib/begingreek/README.txt index a04c4b04ef..b9264dedd4 100644 --- a/macros/latex/contrib/begingreek/README +++ b/macros/latex/contrib/begingreek/README.txt @@ -1,12 +1,26 @@ -Package: begingreek version 1.5 of 2015/02/16 -Copyright 2015 Claudio Beccari +Package: begingreek version 1.6 of 2022/05/06 +Copyright 2015-2022 Claudio Beccari Licence: LaTeX Project Public Licence LPPL v.1.3 (or later) -Maintainer: claudio dot beccari at gmail dot com + +This work has the LPPL maintenance status "author-maintained". + +This work consists of the following files + begingreek.dtx + README.txt + +The files derived from the work are the following: + + begingreek.sty + begingreek.pdf + +The begingreek.dtx file is self extracting and self documenting; if you run +pdflatex on it you get at the same time the .sty file besides and the +English documented .pdf file. This little package (module) contains the definition of the environment greek and the command \greektxt to typeset Greek text with pdfLaTeX only. In a certain way the environment greek mimics the homonymous -environment defined by polyglossia (to be used withXeLaTeX or LuaLaTeX). +environment defined by polyglossia (to be used with XeLaTeX or LuaLaTeX). This module must be loaded after the babel package and after the babel option greek has been specified either directly to the babel package, @@ -19,12 +33,12 @@ in order to control that the NFSS font file .fd does actually exist. The documentation file shows several examples and, in particular, some specimens of most, if not all, LGR encoded Greek font families available -with TeX Live 2014. +with TeX Live. By running pdfLaTeX on the begingreek.dtx file, both the .sty file -and the documentation in PDF format are generated. +and the PDF documentation are generated. -It is suggested that the .dtx file, is stored in a .../source/latex/begingreek/ -folder; the .pdf file, together with the manifest.txt and README files, -in a .../doc/latex/begingreek/ folder; and the .sty file in a -.../tex/latex/begingreek/ folder. +It is suggested that the various files are stored in the following folders: +the .dtx file, in .../source/latex/begingreek/ +the .pdf and the README.txt file in .../doc/latex/begingreek/ +the .sty file in .../tex/latex/begingreek/ diff --git a/macros/latex/contrib/begingreek/begingreek.dtx b/macros/latex/contrib/begingreek/begingreek.dtx index 3e760b9e85..c5a084de0d 100644 --- a/macros/latex/contrib/begingreek/begingreek.dtx +++ b/macros/latex/contrib/begingreek/begingreek.dtx @@ -5,28 +5,28 @@ \input docstrip.tex \keepsilent \preamble -Copyright 2015 Claudio Beccari All rights reserved. +Copyright 2015-2022 Claudio Beccari All rights reserved. This system is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -This file is distributed under the LPPL licence, version 1.3c -dated 2008-05-04 or later as it appears in -CTAN/macros/latex/base/lppl.tex. +This file beginngreek.sty, derived from the begingreek.dtx file, +is distributed under the LPPL licence, version 1.3c dated 2008-05-04 or +later as it appears in CTAN/macros/latex/base/lppl.tex. IMPORTANT NOTICE: -You are not allowed to change this file. +You are allowed to modify this file ONLY if you change its name and the name of the source .dtx file. You cannot distribute a modified version of the source and the derived files under the same original name. According to the LPPL, you must keep the original author name, but you must assume the role of the modified version maintenance. You are allowed to distribute this file under the condition that it is specified in the source file begingreek.dtx. If you receive only some of these files from someone, complain! -You are NOT ALLOWED to distribute this file alone. You are NOT +You are NOT ALLOWED to distribute this file alone. You are NOT ALLOWED to take money for the distribution or use of either this -file or a changed version, except for a nominal charge for copying +file or a modified version, except for a nominal charge for copying etc. \endpreamble \askforoverwritefalse @@ -39,19 +39,15 @@ etc. %\fi % \iffalse %<*dtx> -\ProvidesFile{begingreek.dtx}[2015/02/16 v.1.5 describes environment greek (CB)] +\ProvidesFile{begingreek.dtx}[2022/05/06 v.1.6 Dedescribes environment greek] %</dtx> -%<package>\NeedsTeXFormat{LaTeX2e}[2011/06/27] -%<package>\ProvidesPackage{begingreek}[2015/02/16 v.1.5 defines environment greek (CB)] +%<package>\NeedsTeXFormat{LaTeX2e}[2018/01/01] +%<package>\ProvidesPackage{begingreek}[2022/05/06 v.1.6 Defines environment greek] % %<*driver> \documentclass{ltxdoc} \GetFileInfo{begingreek.dtx} - \title{The \textsf{begingreek} package% -% \thanks{This file -% has version number \fileversion, last -% revised on \filedate.}% -} + \title{The \textsf{begingreek} package} \author{Claudio Beccari -- \texttt{claudio dot beccari at gmail dot com}} \date{Version \fileversion\ of \filedate} \providecommand\babel{\textsf{babel}} @@ -68,13 +64,12 @@ etc. \end{quote}\ignorespaces } \newcommand*\acro[1]{\expandafter\textsc\expandafter{\MakeLowercase{#1}}} - \usepackage[greek.polutoniko,english]{babel} - \usepackage[utf8]{inputenc} + \usepackage[greek.ancient,english]{babel} \usepackage[T1]{fontenc} \usepackage{lmodern,textalpha} - \usepackage{multicol,booktabs}\renewcommand\columnseprule{0.4pt} + \usepackage{multicol,booktabs,color}\renewcommand\columnseprule{0.4pt} \usepackage{begingreek} - \def\alfabeto{abgdezhjiklmnxoprsctufqyw} + \def\alfabeto{αβγδεζηθικλμνξοπρσςτυφχψω} \begin{document} @@ -83,34 +78,35 @@ etc. \end{document} %</driver> % \fi -% \CheckSum{82} +%\CheckSum{86} %\begin{multicols}{2}\tableofcontents\end{multicols} % % \begin{abstract} -% This small extension module defines the environment |greek| to be used with -% |pdfLaTeX| so as to imitate the similar environment defined in |polyglossia|. -% A corresponding command, |\greektxt|, is also defined. -% Of course there are some differences, but it has been used extensively and -% it is useful. +% This small extension module defines the environment |greek| to be used +% with |pdfLaTeX| so as to perform as the similar environment defined in +% |polyglossia|. A corresponding command, |\greektxt|, is also defined. +% Of course there are some differences, but it has been used extensively +% and proved to be quite useful. % \end{abstract} % \section{Introduction} -% When using |pdfLaTeX| and |babel|, language changes are done with |babel|'s -% language switching commands |\selectlanguage|, |\foreignlanguage| or with the -% environments |otherlanguage| and |otherlanguage*|. They work fine, but -% sometimes it is better to have a more ``agile'' command or environment -% that can be used at least in place of the last three commands or -% environments. Some more extra functionalities may be desirable, such -% as the possibility of specifying a different default font family or to +% When using |pdfLaTeX| and |babel|, language changes are done with +% |babel|'s language switching commands |\selectlanguage|, +% |\foreignlanguage| or with the environments |otherlanguage| and +% |otherlanguage*|. They work fine, but sometimes it is better to have a +% more friendly command or environment that can be used at least in place +% of the last three commands or environments. +% +% Some more extra functionalities may be desirable, such as the +% possibility of specifying a different font family or to % switch font family for a particular stretch of Greek text. % -% This small module does exactly what is described above; it has been created -% only to be used with |pdfLaTeX|, therefore if it gets loaded with a package that -% will be run with |XeLaTeX| or |LuaLaTex| it will complain loudly and its -% loading will be aborted; no, not simply that: the only way to exit from -% this wrong situation is to quit compilation. The strong error message is -% such that the user is forced to quit and either change compiler or comment -% out the call to this module. +% This small module does exactly what is described above; it has been +% created only to be used with |pdfLaTeX|, therefore if it gets loaded +% with a package that is to be run with |XeLaTeX| or |LuaLaTex| it will +% complain loudly and its loading will be aborted. The strong error +% message is such that the user is forced to quit and either change +% compiler or comment out the call to this module. % % \section{Usage} % This module is loaded in the preamble in the usual way: @@ -119,18 +115,19 @@ etc. %\end{sintassi} % % The \meta{greek font family} must be specified with the exact name that -% appears in the \emph{font definition file} with file extension |.fd|; for -% example, if the Didot fonts produced by the Greek Font Society (GFS) are -% desired, it must be specified as |udidot| because the |.fd| file is named -% |lgrudidot.fd|; we recall that the names of the |.fd| files result from -% the agglutination of the encoding code and the family name, everything in -% lower case: |lgr| is the lower case code of the LGR encoding, and |udidot| -% is the family name. As another example, if the Greek -% Baskerville font, also distributed by the same GFS, is required, the font family -% name is |gfsbaskerville| as it can be deduced from the name of the |.fd| file. +% appears in the \emph{font description file} with file extension |.fd|; +% for example, if the Didot fonts produced by the Greek Font Society (GFS) +% are desired, the \emph{font description file} must be specified as +% |udidot| because the |.fd| file is named |lgrudidot.fd|; we recall that +% the names of the |.fd| files result from the agglutination of the +% encoding code and the family name, everything in lower case: |lgr| +% is the lower case code of the LGR encoding, and |udidot| is the family +% name. As another example, if the Greek Baskerville font, also distributed +% by the same GFS, is required, the font family name is |gfsbaskerville| +% as it can be deduced from the name of the |.fd| file. % The same similar attention must be paid for the other available Greek -% fonts. Table~\ref{tab:greek-fonts} gives an overview of the correspondence -% between font names, font families, and their appearance. +% fonts. Table~\ref{tab:greek-fonts} gives an overview of the +% correspondence% between font names, font families, and their appearance. % % If no optional \meta{greek font family} is specified, the default Latin % Modern compatible LGR encoded Greek fonts are selected. @@ -139,9 +136,9 @@ etc. % collections, not only those distributed by the Greek Font Society; % table~\ref{tab:greek-fonts} displays some families already available at % the time of writing this documentation. This table shows only the normal -% upright shape of each listed family, but each collection may contain also -% other families, other shapes and the matching Latin fonts in encodings -% T1 and/or~OT1. +% upright shape of each listed family, but each collection might contain +% also other families, other shapes and the matching Latin fonts in codings +% T1 or~OT1. % %\begin{table} %\centering @@ -166,51 +163,54 @@ etc. %\bottomrule %\end{tabular} % -%\caption{Some greek font families available with \TeX\ Live 2014; the first font group is made available by the Greek Font Society; the second group is made available by different authors. The last font is just the default.} +%\caption{Some greek font families available with \TeX\ Live; the first +% font group is made available by the Greek Font Society; the second group +% is made available by different authors. The last font is just the default +% one.} %\label{tab:greek-fonts} %\end{table} % % Another point should be stressed; the fonts distributed by the Greek Font -% Society are pretty good but, please, do not expect that they are complete as the -% Latin Modern compatible ones; the latter were built in order to satisfy -% the most stringent requirements of the Hellenists; while the former were -% designed to satisfy the every day needs of Greek typesetting. +% Society are pretty good but, please, do not expect that they are complete +% as the Latin Modern compatible ones; the latter were built in order to +% satisfy the most stringent requirements of the Hellenists; while the +% former were designed to satisfy the every day needs of Greek typesetting. % I don't claim that the default fonts are better than the ones -% provided by other groups; it is just a caveat that with some fonts certain -% glyphs are available which are not available with other fonts. +% provided by other groups; it is just a caveat that with some fonts +% certain glyphs are available which are not available with other fonts. % % \section{Incomplete fonts and different encoding} -% I would like to stress even more the necessity of reading the documentation -% relative to each Greek font collection you want to use in your document. Some -% fonts, such as Epigrafica, have been designed just for the monotonic -% Greek spelling (unfortunately the Epigrafica documentation is not so clear -% about this point); but these fonts have their |.fd| files with the family -% name |epigrafica|; everything appears normal, but as soon you typeset -% even the shortest text with the polytonic spelling, you -% find out that most diacritics are missing; the |.log| file reports missing -% glyphs, but the warning is not so easy to decipher; this is due to the way -% \LaTeX\ writes out messages to the |.log| file. +% I would like to stress even more the necessity of reading the +% documentation relative to each Greek font collection you want to use +% in your document. Some fonts, such as Epigrafica, have been designed +% just for the monotonic Greek spelling; the Epigrafica documentation +% is explicit about this point, and says that there is work in progress +% to extend the functionality to the polytonic Greek version; dated 2006, +% but apparently this work has not been completed. % % Other non LGR encoded fonts may be used to typeset Greek text, -% for example Ibycus, Yannis Harambous' Greek fonts, Sylvio Levi's -% fonts; they may be used with Plain \TeX\ and therefore don't use |.fd| files; -% or they have their own package, for example |ibycus.sty|, to make the fonts -% accessible to \LaTeX\ users. Therefore don't use this extension module -% |begingreek| with these fonts; if you do and specify the names of these fonts -% as if they were their font family names, you get a warning message and the -% Greek text gets typeset with the default fonts (see the next paragraph). +% for example the Ibycus fonts, the Yannis Harambous' Greek fonts, +% the Sylvio Levi's fonts; they may be used with Plain \TeX\ and +% therefore don't use |.fd| files; or they have their own package, +% for example |ibycus.sty|, to make the fonts accessible to \LaTeX\ +% users. Therefore don't use this extension module |begingreek| with +% these fonts; if you do and specify the names of these fonts as if +% they were their font family names, you get a warning message and +% the Greek text gets typeset with the default fonts (see the next +% paragraph). % -% \section{Default font control} +% \section{Font controls} +%{\color{red}% % It may happen to misspell the Greek font family name to be specified as -% an option to the module loading statement. This specified -% name is used to create the corresponding |.fd| file name and it is checked +% an option to the module loading statement. This specified name is used +% to create the corresponding |.fd| file name and it is checked % if this |.fd| actually exists. If it does not exist, a warning message % is output and the default Greek font is used in its place. % % The |.fd| might be missing also if a basic incomplete \TeX\ system % distribution is installed; in this case the user should provide to % complete the installation or refrain from using a Greek font family -% that is not available or that misses the companion |.fd| file. +% that is not available or that misses the companion |.fd| file.} % % \section{The new \texttt{greek} environment} % With this package loaded, the user has a new environment available; this @@ -224,24 +224,25 @@ etc. % as several paragraphs. % % This Greek text may be input in three different ways: in order to get -% \greektxt{αὐτῇ}, it is possible to write the source file as \verb+a>ut~h|+, -% or \verb+a\>t\~h|+, or |αὐτῇ|. The third way looks much better to a -% Hellenist, but it may be difficult to type-in without a suitable +% \greektxt{αὐτῇ}, it is possible to write the source file as +% |αὐτῇ| or \verb+a>ut~h|+, or \verb+a\>t\~h|+. The first way looks much +% better to a Hellenist, but it may be difficult to type without a suitable % keyboard and/or operating system; it also requires loading the -% \pack{textalpha} package. Notice that the first form, characteristic -% of the LGR encoded Greek fonts, relies on the font ligature functionality, -% but in certain cases it lets some kerning failures become visible; -% the second form relies on the internal LICR definitions (LICR: -% LaTeX Internal Character Representation) and no kerning failures +% \pack{textalpha} package. Notice that the second form, characteristic +% of the LGR encoded Greek fonts, relies on the font ligature +% functionality, but in certain cases it lets some kerning failures +% become visible; the third form relies on the internal LICR definitions +% (LICR: LaTeX Internal Character Representation) and no kerning failures % take place; the direct Greek input relies on a special extended LICR % when used with |pdfLaTeX|. The LICR definitions have been part of any % modern \TeX\ Live distribution since December~2013. % % The optional argument \meta{other Greek font family} is just another -% family; the less you have to type, the less error-prone is your source code. -% Nevertheless the family name that is being specified is tested for -% the existence of its corresponding font |.fd| file, and if this file -% does not exist or the family name is misspelt, the default Greek font is used. +% family; the less you have to type, the less error-prone is your source +% code. \textcolor{red}{Nevertheless the family name that is being +% specified is tested for the existence of its corresponding font |.fd| +% file, and if this file does not exist or the family name is misspelt, +% the default Greek font is used}. % % \section{The command \texttt{\char92greektxt}} % For very short Greek texts an even simpler approach may be defined. @@ -257,31 +258,33 @@ etc. % a paragraph terminator (command |\par| or a blank line) an error flag is % raised. % -% % \section{Font shapes and series} % For both the environment |greek| and the command |\greektxt| the font % shape and/or series are specified with the usual shape and/or font % declarations such as |\bfseries|, |\itshape|, and so on. Some families % have non standard shapes; the default Latin Modern % compatible Greek fonts extra shapes are already defined in their -% specific |.fd| font file; the same is true with other families; in +% specific |.fd| font files; the same is true with other families; in % general the medium and bold extended series and the upright and % italic/slanted shapes are always available; although -% table~\ref{tab:greek-fonts} displays some families where the \emph{normal} -% shape is already oblique, those families miss another italic or slanted -% shape. +% table~\ref{tab:greek-fonts} displays some families where the +% \emph{normal} shape is already oblique, those families miss another +% italic or slanted shape. % -% The user therefore should control the documentation of the extension module -% relative to each family; should this documentation be missing, the user -% should fetch the font |.fd| file, open it with a text editor, and read -% inside the file which shapes are available; this does not necessarily -% imply that the specific font extension module has a special command to choose -% that shape, but the user can define himself one. This is not unusual: -% even the standard Computer Modern (CM) Latin fonts have available the -% {\fontshape{ui}\selectfont upright italic shape,} but the \LaTeX\ kernel -% and all standard classes miss the |\uishape| declaration and the |\textui| -% command, in spite that the |ui| internal shape code is defined and the -% font is available. +% The user therefore should control the documentation of the extension +% module relative to each family; should this documentation be missing, +% the user should fetch the font |.fd| file, open it with a text editor, +% and read inside the file which shapes are available; this does not +% necessarily imply that the specific font extension module has a special +% command to choose that shape, but the user can define himself one. This +% is not unusual: even the standard Computer Modern (CM) Latin fonts have +% available the {\fontshape{ui}\selectfont upright italic shape,} but the +% \LaTeX\ kernel and all standard classes miss the |\uishape| declaration +% and the |\textui| command, in spite that the |ui| internal shape code is +% defined and the font is available. With the 2021 release of \TeX~Live +% the list of available standard font series and shapes codes has been +% extended, and this glitch apparently is eliminated, at least with the +% various fonts available with the standard \TeX~Live installation. % % % \section{Examples} @@ -300,7 +303,8 @@ etc. % \multicolumn1c{Command} & \multicolumn1c{Result} \\ % \cs{greektxt}\Arg{\cs{alphabet}} & \greektxt{\alfabeto} \\ % \cs{greektxt}\Arg{\cs{bfseries}\cs{alphabet}} & \greektxt{\bfseries\alfabeto}\\ -% \cs{greektxt}\Arg{\cs{lishape}\cs{alphabet}}& \greektxt{\fontshape{li}\selectfont\alfabeto}\\[2ex] +% \cs{greektxt}\Arg{\cs{lishape}\cs{alphabet}}& \greektxt{\fontshape{li}\selectfont\alfabeto}\\ +%\cs{greektxt}\Arg{\cs{itshape}\cs{alphabet}}& \greektxt{\itshape\alfabeto}\\[2ex] %\multicolumn2c{Bodoni}\\\midrule % \multicolumn1c{Command} & \multicolumn1c{Result} \\ % \cs{greektxt[bodoni]}\Arg{\cs{alphabet}} &\greektxt[bodoni]{\alfabeto}\\ @@ -311,13 +315,24 @@ etc. % \caption{Some examples of family, series and shape selection} % \label{tab:examples} % \end{table} +% +% Please notice in table~\ref{tab:examples} the difference between the +% lipsian |li| and the italic |it| shapes; the former is more compact +% and uses a “curly” epsilon, while the latter, besides being slightly +% larger, uses an “arched” epsilon. Notice also that the GFS fonts, such +% as the Bodoni one used in table~\ref{tab:examples}, do not have two +% different oblique shapes as the Latin Modern ones do. The italic shape +% of the Latin Modern fonts imitates the GFS Olga font, while the its +% lipsian shape imitates the fonts used by some printers in Lipsia +% (Germany). % % \section{Acknowledgements} % I should acknowledge the collaboration of a person, whose name I can't -% remember, whom a couple of years ago I developed the first embryo of -% this module with; the project was abandoned, I don't remember why. I must -% thank also Mauro Sacchetto whose questions posted in the forum of the -% Italian TUG forced me to resume the project; he also tested the +% remember, with whom some of years ago I developed the first embryo of +% this module; the project was eventually abandoned, I don't remember why. +% +% I must thank also Mauro Sacchetto whose questions posted in the forum +% of the Italian TUG forced me to resume the project; he also tested the % environment and the command, and gave me a very important feedback. % %\StopEventually{} @@ -327,8 +342,8 @@ etc. % here we describe the real code. % % First we load the module \pack{iftex} in order to test if the typesetting -% engine is |pdfTeX|; if it is not, we provide an error message and force the -% user to quit the job. +% engine is |pdfTeX|; if it is not, we provide an error message and force +% the user to quit the job, besides aborting this package loading. %\iffalse %<package*> %\fi @@ -345,28 +360,31 @@ Type X to quit}{\@ehd} % \end{macrocode} % At this point we know we are typesetting with the |pdfTeX| engine; now % we test if the |greek| language has been specified to \babel. It does -% not matter which attributes or modifiers of the language have been specified, -% but any Greek variant is valid. We use the $\varepsilon$-\TeX\ command -% |\ifcsname| so that we do not produce any trace in memory and in particular -% we do not need to test the macro with |\ifx| against |\relax|. -% If the language |greek| has not been specified to \babel\ or if this -% module has been loaded before \babel\ itself, an error flag is raised and the -% user is forced to quit the job. +% not matter which attributes or modifiers of the language have been +% specified, but any Greek variant is valid. We use the +% $\varepsilon$-\TeX\ command |\ifcsname| so that we do not leave any +% trace in memory and in particular we do not need to test the macro +% with |\ifx| against |\relax|. If the language |greek| has not been +% specified to \babel\ or if this module has been loaded before +% \babel\ itself, an error flag is raised and the user is forced to quit +% the job. % \begin{macrocode} \unless\ifcsname captionsgreek\endcsname -\PackageError{begingreek}{\MessageBreak -Package `begingreek' may be used only\MessageBreak -if language `greek' is already defined\MessageBreak -Check that `begingreek' is loaded after\MessageBreak -`babel' and that the language `greek'\MessageBreak -has been specified\MessageBreak\MessageBreak +\PackageError{begingreek}{% +****************************************\MessageBreak +Package `begingreek' may be used only \MessageBreak +if language `greek' is already defined. \MessageBreak +Check that `begingreek' is loaded after \MessageBreak +`babel' and that the language `greek' \MessageBreak +has been specified \MessageBreak +****************************************\MessageBreak Type X to quit}{\@ehd} \expandafter\endinput \fi % \end{macrocode} % Now we can define the package option with the standard facilities -% provided by the \LaTeX\ kernel. First we set some the default Greek -% font family to the |lmr| one (Latin Modern compliant ``serifed'' +% provided by the \LaTeX\ kernel. First we set the default Greek +% font family to the |lmr| one (Latin Modern compliant “serifed” % Greek fonts). Then we define a generic option that uses the % |\CurrentOption| macro for setting another default Greek font family. % Of course it is necessary to test if the generic option passed as an @@ -381,34 +399,39 @@ Type X to quit}{\@ehd} % \begin{macrocode} \def\greekfontfamily{lmr} -\DeclareOption*{\IfFileExists{lgr\CurrentOption.fd}{% -\edef\greekfontfamily{\CurrentOption}}{% -\PackageWarning{begingreek}{% -The file lgr\CurrentOption.fd does not exist\MessageBreak -Either provide such a file, or specify a\MessageBreak -valid Greek font family to the\MessageBreak -\string\begin\string{greek\string} package\MessageBreak -I continue with the default font family\MessageBreak}}} +\DeclareOption*{% + \IfFileExists{lgr\CurrentOption.fd}% + {\edef\greekfontfamily{\CurrentOption}}% + {\PackageWarning{begingreek}{% + The file lgr\CurrentOption.fd does not exist\MessageBreak + Either provide such a file, or specify a \MessageBreak + valid Greek font family to the \MessageBreak + \string\begin\string{greek\string} package \MessageBreak + I continue with the default font family \MessageBreak}% + }% +} \ProcessOptions\relax % \end{macrocode} % -% Now we can define the new environment |greek|. Notice that we use -% the default Greek font family to specify the environment optional argument, -% but we have to test the validity of the font family name; we cannot -% use the same name |\greekfontfamily| in the internal definitions -% otherwise we'd produce an infinite loop; so we have to change the name -% of the macro that holds the specified family name; if it is an -% invalid name, either misspelt or inexistent, we reset it to the default, -% either the overall default or the package defined default (saved -% in |\greekfontfamily|) so we can proceed without further problems. +% Now we can define the new environment |greek|. +% Notice that we use the default Greek font family to specify the +% environment optional argument, but we have to test the validity +% of the font family name; we cannot use the same name |\greekfontfamily| +% in the internal definitions otherwise we'd produce an infinite loop; +% so we have to change the name of the macro that holds the specified +% family name; if it is an invalid name, either misspelt or inexistent, +% we reset it to the default, either the overall default or the package +% defined default (saved in |\greekfontfamily|) so we can proceed without +% further problems. % \begin{macrocode} \newenvironment{greek}[1][\greekfontfamily]{\begin{otherlanguage}{greek}% \edef\Greekfontfamily{#1}% \IfFileExists{lgr\Greekfontfamily.fd}{}% -{\PackageWarning{begingreek}{% -Font family lgr\Greekfontfamily.fd does not exist\MessageBreak -Default fonts used}\def\Greekfontfamily{\greekfontfamily}}% + {\PackageWarning{begingreek}{\MessageBreak + Font family lgr\Greekfontfamily.fd does not exist\MessageBreak + Default fonts used\MessageBreak}% +\def\Greekfontfamily{\greekfontfamily}}% \fontfamily{\Greekfontfamily}\selectfont }{\end{otherlanguage}} @@ -419,12 +442,13 @@ Default fonts used}\def\Greekfontfamily{\greekfontfamily}}% % \begin{macrocode} \newcommand*\greektxt[2][\greekfontfamily]{% \edef\Greekfontfamily{#1}% -\foreignlanguage{greek}{% \IfFileExists{lgr\Greekfontfamily.fd}{}% -{\PackageWarning{begingreek}{% -Font family lgr\Greekfontfamily.fd does not exist\MessageBreak -Default fonts used}\def\Greekfontfamily{\greekfontfamily}}% -\fontfamily{\Greekfontfamily}\selectfont#2}} + {\PackageWarning{begingreek}{\MessageBreak + Font family lgr\Greekfontfamily.fd does not exist\MessageBreak + Default fonts used\MessageBreak}% +\def\Greekfontfamily{\greekfontfamily}}% +\fontfamily{\Greekfontfamily}\selectfont +\foreignlanguage{greek}{#2}} % \end{macrocode} % diff --git a/macros/latex/contrib/begingreek/begingreek.pdf b/macros/latex/contrib/begingreek/begingreek.pdf Binary files differindex f64dc21981..c7295a786d 100644 --- a/macros/latex/contrib/begingreek/begingreek.pdf +++ b/macros/latex/contrib/begingreek/begingreek.pdf diff --git a/macros/latex/contrib/begingreek/manifest.txt b/macros/latex/contrib/begingreek/manifest.txt deleted file mode 100644 index b7dfd66f44..0000000000 --- a/macros/latex/contrib/begingreek/manifest.txt +++ /dev/null @@ -1,30 +0,0 @@ -manifest.txt (begingreek version 1.5) -Copyright 2015 Claudio Beccari - -This work may be distributed and/or modified under the conditions of -the LaTeX Project Public License, either version 1.3 of this license or -(at your option) any later version. The latest version of this license -is in http://www.latex-project.org/lppl.txt and version 1.3 or later is -part of all distributions of LaTeX version 2003/12/01 or later. - -This work itself and every derived work are subject to the above -licence. - -This work has the LPPL maintenance status "author-maintained". - -This work consists of the files listed in manifest.txt - -This work consists of the following files - manifest.txt - begingreek.dtx - -The files derived from the work are the following: - - begingreek.sty - begingreek.pdf - -The begingreek.dtx file is self extracting and self documenting; if you run -pdflatex on it you get at the same time the style file besides and the -English documented file. - -Maintainer: Claudio Beccari: claudio dot beccari at gmail dot com diff --git a/macros/latex/contrib/chinesechess/chinesechess.pdf b/macros/latex/contrib/chinesechess/chinesechess.pdf Binary files differindex 22951bd3db..a965c4fe30 100644 --- a/macros/latex/contrib/chinesechess/chinesechess.pdf +++ b/macros/latex/contrib/chinesechess/chinesechess.pdf diff --git a/macros/latex/contrib/chinesechess/chinesechess.sty b/macros/latex/contrib/chinesechess/chinesechess.sty index 6ddb58b836..2a2db971ed 100644 --- a/macros/latex/contrib/chinesechess/chinesechess.sty +++ b/macros/latex/contrib/chinesechess/chinesechess.sty @@ -19,21 +19,18 @@ %% \NeedsTeXFormat{LaTeX2e}[2020/10/01] \RequirePackage{expl3} -\ProvidesExplPackage{chinesechess}{2022-04-29}{v1.0.0} +\ProvidesExplPackage{chinesechess}{2022-05-06}{v1.1.0} {Typeset Chinese chess with l3draw} \RequirePackage { l3keys2e, l3draw, xparse } -% 保证TeXLive的向下兼容 +% 测量盒子总高度(保证TeXLive的向下兼容) \cs_if_free:NT \box_ht_plus_dp:N { \cs_new_protected:Npn \box_ht_plus_dp:N #1 { \tex_dimexpr:D \box_ht:N #1 + \box_dp:N #1 \scan_stop: } } -% 可以使用>{\SplitArgument{1}{~}}分割参数,如: -% \NewDocumentCommand{\cchessboard}{ s >{\SplitArgument{1}{,}}O{10mm,10mm} } -% % 棋盘排版命令用户接口 % #1 星号命令,是否输出棋子 % #2 棋盘类型、棋子类型等外观选项 @@ -56,10 +53,10 @@ % 棋谱排版命令用户接口 % #1 棋盘类型、棋子类型等外观选项 % #2 棋子位置列表 -% 棋子字母汉字对照表(取xq.sty中的定义) -% K=帅,A=仕,E=相,R=车,C=砲,H=马,P=兵, k=将,a=士,e=象,r=車,c=炮,h=馬,p=卒 -% 水平定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8) -% 垂直定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8),j(9) +% 红棋:K=帅,A=仕,E/B=相,R=车,C=砲,N/H=马,P=兵, +% 黑棋:k=将,a=士,e/b=象,r=車,c=炮,n/h=馬,p=卒 +% 横向定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8) +% 纵向定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8),j(9) \NewDocumentCommand{\cchessman}{ O{} m } { \group_begin: @@ -75,29 +72,43 @@ % 定义棋子字符常量 \clist_map_inline:nn { - { K } {\__cchess_symbol:n {"5E25} }, % 帥 - { A } {\__cchess_symbol:n {"4ED5} }, % 仕 - { E } {\__cchess_symbol:n {"76F8} }, % 相 - { H } {\__cchess_symbol:n {"9A6C} }, % 马 - { R } {\__cchess_symbol:n {"8F66} }, % 车 - { C } {\__cchess_symbol:n {"7832} }, % 砲 - { P } {\__cchess_symbol:n {"5175} }, % 兵 - { k } {\__cchess_symbol:n {"5C07} }, % 將 - { a } {\__cchess_symbol:n {"58EB} }, % 士 - { e } {\__cchess_symbol:n {"8C61} }, % 象 - { h } {\__cchess_symbol:n {"99AC} }, % 馬 - { r } {\__cchess_symbol:n {"8ECA} }, % 車 - { c } {\__cchess_symbol:n {"70AE} }, % 炮 - { p } {\__cchess_symbol:n {"5352} }, % 卒 + { K } { 帥 }, % 帥\__cchess_symbol:n {"5E25} + { A } { 仕 }, % 仕\__cchess_symbol:n {"4ED5} + { E } { 相 }, % 相\__cchess_symbol:n {"76F8} + { B } { 相 }, % 相\__cchess_symbol:n {"76F8} + { H } { 马 }, % 马\__cchess_symbol:n {"9A6C} + { N } { 马 }, % 马\__cchess_symbol:n {"9A6C} + { R } { 车 }, % 车\__cchess_symbol:n {"8F66} + { C } { 砲 }, % 砲\__cchess_symbol:n {"7832} + { P } { 兵 }, % 兵\__cchess_symbol:n {"5175} + { k } { 將 }, % 將\__cchess_symbol:n {"5C07} + { a } { 士 }, % 士\__cchess_symbol:n {"58EB} + { e } { 象 }, % 象\__cchess_symbol:n {"8C61} + { b } { 象 }, % 象\__cchess_symbol:n {"8C61} + { h } { 馬 }, % 馬\__cchess_symbol:n {"99AC} + { n } { 馬 }, % 馬\__cchess_symbol:n {"99AC} + { r } { 車 }, % 車\__cchess_symbol:n {"8ECA} + { c } { 炮 }, % 炮\__cchess_symbol:n {"70AE} + { p } { 卒 }, % 卒\__cchess_symbol:n {"5352} } { \__cchess_piece_char_setup:nn ##1 } } + +% 棋子字符设置命令 +% #1 棋子编号及字符 +% K=帅,A=仕,B/E=相,R=车,C=砲,N/H=马,P=兵 +% k=将,a=士,b/e=象,r=車,c=炮,n/h=馬,p=卒 +\NewDocumentCommand{\piecechar}{ m m } + { + \__cchess_piece_char_setup:nn { #1 } { #2 } + } + % 打谱环境初始化(仅用于setcchessman环境中) % #1 棋子位置列表 -% 棋子字母汉字对照表(取xq.sty中的定义) -% K=帅,A=仕,E=相,R=车,C=砲,H=马,P=兵, k=将,a=士,e=象,r=車,c=炮,h=馬,p=卒 -% 水平定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8) -% 垂直定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8),j(9) +% 红棋:K=帅,A=仕,E/B=相,R=车,C=砲,N/H=马,P=兵, +% 黑棋:k=将,a=士,e/b=象,r=車,c=炮,n/h=馬,p=卒 +% 横向定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8) +% 纵向定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8),j(9) \NewDocumentCommand{\init}{ m } { % 临时clist @@ -110,20 +121,20 @@ % 打谱环境中的棋子布置命令(仅用于setcchessman环境中) % #1 棋子位置 -% #2 棋子名称(单个英文字母) -% 棋子字母汉字对照表(取xq.sty中的定义) -% K=帅,A=仕,E=相,R=车,C=砲,H=马,P=兵, k=将,a=士,e=象,r=車,c=炮,h=馬,p=卒 -% 水平定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8) -% 垂直定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8),j(9) +% #2 棋子位置列表 +% 红棋:K=帅,A=仕,E/B=相,R=车,C=砲,N/H=马,P=兵, +% 黑棋:k=将,a=士,e/b=象,r=車,c=炮,n/h=馬,p=卒 +% 横向定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8) +% 纵向定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8),j(9) \NewDocumentCommand{\set}{ m m } { \__cchess_piece_replace_handle:nn { #1 } { #2 } } % 删除打谱环境中的棋子(仅用于setcchessman环境中) -% #1 棋子位置 -% 水平定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8) -% 垂直定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8),j(9) +% #1 棋子位置列表 +% 横向定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8) +% 纵向定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8),j(9) \NewDocumentCommand{\del}{ m } { \__cchess_piece_remove_handle:n { #1 } @@ -133,9 +144,10 @@ % #1 棋子名称(单个英文字母) % #2 棋子当前位置 % #3 棋子目的位置 -% K=帅,A=仕,E=相,R=车,C=砲,H=马,P=兵, k=将,a=士,e=象,r=車,c=炮,h=馬,p=卒 -% 水平定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8) -% 垂直定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8),j(9) +% 红棋:K=帅,A=仕,E/B=相,R=车,C=砲,N/H=马,P=兵, +% 黑棋:k=将,a=士,e/b=象,r=車,c=炮,n/h=馬,p=卒 +% 横向定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8) +% 纵向定位: a(0),b(1),c(2),d(3),e(4),f(5),g(6),h(7),i(8),j(9) \NewDocumentCommand{\mov}{ m m m } { \__cchess_piece_move_handle:nnn { #1 } { #2 } { #3 } @@ -167,13 +179,37 @@ \group_end: } +% 打谱棋谱输出用户接口 +% #1 每行输出步数 +% #2 棋谱交叉引用label +% 参考雾月的回复:https://ask.latexstudio.net/ask/question/7430.html +\NewDocumentCommand{\printman}{ O{} >{\TrimSpaces} m } % 去掉两侧空格 + { + \group_begin: + \keys_set:nn { cchess } { #1 } + \__cchess_setman_print:n { #2 } + \group_end: + } + +% 棋子输出用户接口 +% #1 棋子字体字号 +% #2 棋子编码 +% 红棋:K=帅,A=仕,E/B=相,R=车,C=砲,N/H=马,P=兵, +% 黑棋:k=将,a=士,e/b=象,r=車,c=炮,n/h=馬,p=卒 +\NewDocumentCommand{\getpiece}{ O{\normalsize} m } + { + \group_begin: + \__cchess_getpiece_handle:nn {#1} { #2 } + \group_end: + } -% ==========棋子字符定义===================== +% ==========棋子字符常量定义===================== % 读取符号 \cs_new:Npn \__cchess_symbol:n #1 { - \tex_char:D #1 - \scan_stop: + #1 + % \tex_char:D #1 + % \scan_stop: } % 棋子符号定义 @@ -233,30 +269,39 @@ % 出于对国际象棋棋手意识习惯的兼容性设计 % 相 B ,也可兼容使用 E, % 马N, 也可兼容使用 H 代替 +% 在此,为兼容性考虑使用B/E同时表示相,使用H/N同时表示马 +% 在使用时,可以任意选择习惯的名称 + % 判断红黑棋子英文单字母名称的正则表达式 \regex_new:N \l__capital_regex -\regex_set:Nn \l__capital_regex { [KAERCHP] } -% 判断棋子英文单字母名称的正则表达式 -\clist_const:Nn \c__cchess_pieces_name_clist { K,A,E,R,C,H,P,k,a,e,r,c,h,p } +\regex_set:Nn \l__capital_regex { [KAEBRCHNP] } + +% 棋子英文单字母名称列表 +\clist_const:Nn \c__cchess_pieces_name_clist { K,A,E,B,R,C,H,N,P,k,a,e,b,r,c,h,n,p } \msg_new:nnn { cchess } { piecename-exists } { The~ piece~ name~ `#1~ not~ exists. } % 定义棋子字符常量 +% 注意相和马分别用两个符号以适配不同习惯 \clist_map_inline:nn { - { K } { "5E25 }, % 帥 - { A } { "4ED5 }, % 仕 - { E } { "76F8 }, % 相 - { H } { "9A6C }, % 马 - { R } { "8F66 }, % 车 - { C } { "7832 }, % 砲 - { P } { "5175 }, % 兵 - { k } { "5C07 }, % 將 - { a } { "58EB }, % 士 - { e } { "8C61 }, % 象 - { h } { "99AC }, % 馬 - { r } { "8ECA }, % 車 - { c } { "70AE }, % 炮 - { p } { "5352 }, % 卒 + { K } { 帥 }, % 帥"5E25 + { A } { 仕 }, % 仕"4ED5 + { E } { 相 }, % 相"76F8 + { B } { 相 }, % 相"76F8 + { H } { 马 }, % 马"9A6C + { N } { 马 }, % 马"9A6C + { R } { 车 }, % 车"8F66 + { C } { 砲 }, % 砲"7832 + { P } { 兵 }, % 兵"5175 + { k } { 將 }, % 將"5C07 + { a } { 士 }, % 士"58EB + { e } { 象 }, % 象"8C61 + { b } { 象 }, % 象"8C61 + { h } { 馬 }, % 馬"99AC + { n } { 馬 }, % 馬"99AC + { r } { 車 }, % 車"8ECA + { c } { 炮 }, % 炮"70AE + { p } { 卒 }, % 卒"5352 } { \__cchess_piece_define:nn #1 } @@ -268,8 +313,8 @@ { #1 } { \use:c { c__cchess_ #1 _tl } } } -% 在棋子编码列表中添加n表示空(null)棋子 -\clist_push:Nn \c__cchess_pieces_name_clist { n } +% 在棋子编码列表中添加z表示空棋子 +\clist_push:Nn \c__cchess_pieces_name_clist { z } % 定义棋子盒子容器 \clist_map_inline:Nn \c__cchess_pieces_name_clist @@ -277,7 +322,7 @@ \coffin_new:c { l__cchess_piece_ #1 _coffin } } % 将空棋子盒子容器置空 -\hcoffin_gset:Nn \l__cchess_piece_n_coffin { \phantom{空} } +\hcoffin_gset:Nn \l__cchess_piece_z_coffin { \phantom{a} } % 棋盘盒子容器 \coffin_new:N \l__cchess_board_coffin @@ -311,11 +356,11 @@ 5 = f, 6 = g, 7 = h, 8 = i, 9 = j } -% 判断是水平方向位置合法性的正则表达式 +% 判断是横向位置合法性的列表 \clist_const:Nn \c__cchess_pos_x_index_clist { a,b,c,d,e,f,g,h,i,0,1,2,3,4,5,6,7,8 } \msg_new:nnn { cchess } { posx-exists } { The~ x~ index~ `#1~ not~ exists. } -% 判断是垂直方向位置合法性的正则表达式 +% 判断是纵向位置合法性的列表 \clist_const:Nn \c__cchess_pos_y_index_clist { a,b,c,d,e,f,g,h,i,j,0,1,2,3,4,5,6,7,8,9 } \msg_new:nnn { cchess } { posy-exists } { The~ y~ index~ `#1~ not~ exists. } @@ -331,20 +376,20 @@ { \coffin_new:c { l__cchess_board_piece_ #1 _ ##1 _coffin } \hcoffin_gset:cn { l__cchess_board_piece_ #1 _ ##1 _coffin } - { \phantom{空} } + { \phantom{a} } } } -\coffin_new:N \l__cchess_board_piece_n_coffin -\hcoffin_gset:Nn \l__cchess_board_piece_n_coffin { \phantom{空} } +\coffin_new:N \l__cchess_board_piece_z_coffin +\hcoffin_gset:Nn \l__cchess_board_piece_z_coffin { \phantom{a} } -% 红方棋盘坐标字母与竖线标位对应关系 +% 红方棋盘坐标字母与红棋竖线标位对应关系 \prop_const_from_keyval:Nn \c__cchess_board_red_x_idx_prop { a = 九, b = 八, c = 七 , d = 六, e = 五, f = 四, g = 三, h = 二, i = 一 } -% 黑方棋盘坐标字母与竖线标位对应关系 +% 黑方棋盘坐标字母与黑棋竖线标位对应关系 \prop_const_from_keyval:Nn \c__cchess_board_black_x_idx_prop { a = 1, b = 2, c = 3 , d = 4, e = 5, @@ -358,7 +403,7 @@ 5 = 五, 6 = 六, 7 = 七, 8 = 八, 9 = 九 } -% 棋谱文字说明列表(如车一进二等) +% 棋谱记录列表(如车一进二等) \clist_new:N \l__cchess_manual_clist % 棋子外框盒子容器 @@ -393,16 +438,21 @@ % 棋子缩放比例 \tl_new:N \l__cchess_piece_scale_tl % 待处理棋子字符 -\tl_new:N \l__cchess_pieces_tl +\tl_new:N \l__cchess_pieces_tl % 棋子字符格式 -\tl_new:N \l__cchess_piece_char_format_tl +\tl_new:N \l__cchess_piece_char_format_tl % 棋盘背景图片名称 -\tl_new:N \l__cchess_board_background_tl +\tl_new:N \l__cchess_board_background_tl % 棋子字符字形类型(实线、虚线等) -\int_new:N \l__cchess_charstroke_type_int +\int_new:N \l__cchess_charstroke_type_int + +% 打谱环境棋谱标签 +\tl_new:N \l__cchess_setman_label_tl +% 打谱结果每行棋谱步数 +\int_new:N \l__cchess_mans_per_line_int % 打谱环境用计数器 -% \int_new:N \c@cchessman +\newcounter{setman} % 增加两个临时int变量 \int_new:N \l_tmpc_int @@ -415,7 +465,8 @@ % 棋子盒子由l3draw实现, -% 棋子外围盒子及缩放设计思路来自zitie宏包(\url{https://www.ctan.org/pkg/zitie})。 +% 棋子外围盒子及缩放设计思路来自zitie宏包 +% (\url{https://www.ctan.org/pkg/zitie})。 % =============颜色处理函数============= % 填充色辅助函数 @@ -448,11 +499,11 @@ \coffin_ht:N #1 + \coffin_dp:N #1 } -% 计算基字符外框大小(外接正方形边长和外接圆半径) +% 计算外框大小(外接正方形边长和外接圆半径) \cs_new:Npn \__cchess_calc_piece_box_size: { - % 设置基字符格式的基字符盒子 - \hbox_set:Nn \l_tmpa_box { 将 } + % 设置计算基础盒子 + \hbox_set:Nn \l_tmpa_box { xx } % 盒子宽度 \dim_set:Nn \l_tmpa_dim @@ -491,31 +542,16 @@ % =============构造棋子函数============= % 字符盒子构造类型函数名称生成函数 -% 名称中6个参数分别表示: -% #1 左下角x坐标 -% #2 左下角y坐标 -% #3 右上角x坐标 -% #4 右上角y坐标 -% #5 x方向缩放比例(扩展保留参数) -% #6 y方向缩放比例(扩展保留参数) +% #1 缩放比例 \cs_new_nopar:Npn \__cchess_piece_box_type:n #1 { __cchess_piece_box_construct_type_ #1 :n } % 字符盒子构造类型函数名称命令生成函数 -% 名称命令中6个参数分别表示: -% #1 左下角x坐标 -% #2 左下角y坐标 -% #3 右上角x坐标 -% #4 右上角y坐标 -% #5 x方向缩放比例(扩展保留参数) -% #6 y方向缩放比例(扩展保留参数) +% #1 缩放比例 \cs_new_nopar:Npn \__cchess_piece_box_type_c:n #1 { - \use:c - { - __cchess_piece_box_construct_type_ #1 :n - } + \use:c { __cchess_piece_box_construct_type_ #1 :n } } % 字符盒子构造类型函数内部生成器函数 @@ -647,25 +683,21 @@ % =============构造棋盘函数============= % 棋盘部件构造函数函数名称生成函数 % 名称中2个参数分别表示: -% #1 x方向缩放比例(暂未使用保留参数) -% #2 y方向缩放比例(暂未使用保留参数) +% #1 x方向缩放比例(暂未使用, 保留参数) +% #2 y方向缩放比例(暂未使用, 保留参数) \cs_new_nopar:Npn \__cchess_board_type:n #1 { __cchess_board_construct_type_ #1 :nn } -% 字符盒子构造类型函数名称命令生成函数 % 名称命令中2个参数分别表示: -% #1 x方向缩放比例(暂未使用保留参数) -% #2 y方向缩放比例(暂未使用保留参数) +% #1 x方向缩放比例(暂未使用, 保留参数) +% #2 y方向缩放比例(暂未使用, 保留参数) \cs_new_nopar:Npn \__cchess_board_type_c:n #1 { - \use:c - { - __cchess_board_construct_type_ #1 :nn - } + \use:c { __cchess_board_construct_type_ #1 :nn } } -% 字符盒子构造类型函数生成器内部函数 +% 棋盘类型函数生成器内部函数 % #1 类型名称 \cs_new:Npn \__cchess_new_board_private_construct:nn #1 { @@ -675,7 +707,7 @@ \cs_generate_variant:Nn \__cchess_new_board_private_construct:nn { V } \cs_generate_variant:Nn \__cchess_new_board_private_construct:nn { x } -% 字符盒子构造类型函数生成器函数 +% 棋盘类型函数生成器函数 % #1 类型名称 \cs_new:Npn \__cchess_new_board_construct:nn #1 { @@ -687,10 +719,10 @@ \cs_generate_variant:Nn \__cchess_new_board_construct:nn { V } \cs_generate_variant:Nn \__cchess_new_board_construct:nn { x } -% 无棋盘 +% 空棋盘 \__cchess_new_board_construct:nn { none } { } -% 半部棋盘 +% 仅格子线半部棋盘 \__cchess_new_board_private_construct:nn { __semiboard } { \draw_scope_begin: @@ -787,7 +819,7 @@ \draw_scope_end: } -% 兵、炮标志 +% 兵、炮标志(半棋盘) \__cchess_new_board_private_construct:nn { __semipos } { \hcoffin_set:Nn \l_tmpa_coffin @@ -867,7 +899,7 @@ \draw_scope_end: } -% 象位线 +% 象位虚线 \__cchess_new_board_private_construct:nn { __elephantcross } { \draw_scope_begin: @@ -910,8 +942,8 @@ \color_select:n { cchessboardlinecolor } - \hcoffin_set:Nn \l_char_tmpa_coffin { 河 } - \hcoffin_set:Nn \l_char_tmpb_coffin { 楚 } + \hcoffin_set:Nn \l_char_tmpa_coffin { 楚 } + \hcoffin_set:Nn \l_char_tmpb_coffin { 河 } \hcoffin_set:Nn \l_char_tmpc_coffin { 漢 } \hcoffin_set:Nn \l_char_tmpd_coffin { 界 } @@ -924,7 +956,7 @@ \coffin_rotate:cn { l_char_tmp ##1 _coffin } { 90 } } - % 测量盒子容器总高度(用内切圆则不需要) + % 测量盒子容器总高度 \dim_set:Nn \l_tmpa_dim { \__cchess_coffin_ht_plus_dp:N \l_char_tmpa_coffin } @@ -933,7 +965,8 @@ \fp_to_dim:n { \fp_eval:n { \gridsize * 0.45 } } } - \clist_map_inline:Nn \l_tmpa_clist + % 缩放盒子容器 + \clist_map_inline:nn { a, b, c, d } { \coffin_scale:cnn { l_char_tmp ##1 _coffin } { @@ -945,17 +978,26 @@ % 排版文字 \draw_scope_begin: - \int_set:Nn \l_tmpa_int { 1 } - \clist_map_inline:Nn \l_tmpa_clist - { - \draw_path_scope_begin: - \draw_transform_shift:n - { \gridsize * \l_tmpa_int, \gridsize * 4.5 } - \draw_coffin_use:cnn { l_char_tmp ##1 _coffin } { hc } { vc } - \draw_path_scope_end: - \int_incr:N \l_tmpa_int - \int_incr:N \l_tmpa_int - } + \draw_path_scope_begin: + \draw_transform_shift:n { \gridsize * 2, \gridsize * 4.5 } + \draw_transform_shift:n { -\gridsize / 2, 0pt } + \draw_coffin_use:cnn { l_char_tmpb_coffin } { hc } { vc } + \draw_path_scope_end: + \draw_path_scope_begin: + \draw_transform_shift:n { \gridsize * 2, \gridsize * 4.5 } + \draw_transform_shift:n { \gridsize / 2, 0pt } + \draw_coffin_use:cnn { l_char_tmpa_coffin } { hc } { vc } + \draw_path_scope_end: + \draw_path_scope_begin: + \draw_transform_shift:n { \gridsize * 6, \gridsize * 4.5 } + \draw_transform_shift:n { -\gridsize / 2, 0pt } + \draw_coffin_use:cnn { l_char_tmpc_coffin } { hc } { vc } + \draw_path_scope_end: + \draw_path_scope_begin: + \draw_transform_shift:n { \gridsize * 6, \gridsize * 4.5 } + \draw_transform_shift:n { \gridsize / 2, 0pt } + \draw_coffin_use:cnn { l_char_tmpd_coffin } { hc } { vc } + \draw_path_scope_end: \draw_scope_end: } @@ -1255,13 +1297,18 @@ % =============棋子文字设置函数============= % 设置棋子的文字 % 红棋编码用大写字母,默认: -% K=帅,A=仕,E=相,R=车,C=砲,H=马,P=兵 +% K=帅,A=仕,E/B=相,R=车,C=砲,H/N=马,P=兵 % 黑棋编码用小字字母,默认: -% k=将,a=士,e=象,r=車,c=炮,h=馬,p=卒 +% k=将,a=士,e/b=象,r=車,c=炮,h/n=馬,p=卒 % #1 棋子编码 % #2 棋子字符 \cs_new_nopar:Npn \__cchess_piece_char_setup:nn #1#2 { + \clist_if_in:NnF \c__cchess_pieces_name_clist { #1 } + { + \msg_error:nnx { cchess } { piecename-exists } { #1 } + } + \prop_gput:Nnn \c__cchess_board_pieces_alph_name_prop { #1 } { #2 } } @@ -1310,21 +1357,10 @@ boardlinecolor .initial:n = black , boardlinecolor* .code:n = { \__cchess_color_select:nnn { cchessboardlinecolor } #1 } , - % 设置棋子字符 - piecechar .code:n = { \__cchess_piece_char_setup:nn #1 }, - piecechar .initial:n = {K}{\c__cchess_K_tl} , - - % 字符格式 - piecefont .code:n = { \tl_set:Nn \l__cchess_piece_char_format_tl {#1} - \__cchess_calc_piece_box_size: - }, + % 棋盘背景图片 + boardbg .tl_set:N = \l__cchess_board_background_tl , + boardbg .initial:n = {} , - % 边框类型 - piecetype .code:n = { \exp_args:NNx \clist_if_in:NnTF - \g__cchess_piece_box_list_clist {#1} - { \tl_set:Nx \l__cchess_piece_box_type_tl {#1} } - { \msg_error:nnx { cchess } { box-exists } {#1} } - }, % 缩放方式 resize .code:n = { \exp_args:NNx \clist_if_in:NnTF \g__cchess_resize_method_clist {#1} @@ -1340,6 +1376,22 @@ width .dim_set:N = \l__cchess_manual_width_dim , height .dim_set:N = \l__cchess_manual_height_dim , + % 设置棋子字符 + piecechar .code:n = { \__cchess_piece_char_setup:nn #1 }, + piecechar .initial:n = {K}{\c__cchess_K_tl} , + + % 字符格式 + piecefont .code:n = { \tl_set:Nn \l__cchess_piece_char_format_tl {#1} + \__cchess_calc_piece_box_size: + }, + + % 边框类型 + piecetype .code:n = { \exp_args:NNx \clist_if_in:NnTF + \g__cchess_piece_box_list_clist {#1} + { \tl_set:Nx \l__cchess_piece_box_type_tl {#1} } + { \msg_error:nnx { cchess } { box-exists } {#1} } + }, + % 字符边框线宽 boxlinewd .dim_set:N = \l__cchess_box_linewidth_dim , boxlinewd .initial:n = 0.4pt , @@ -1434,9 +1486,13 @@ { \int_set_eq:NN \l__cchess_charstroke_type_int \l_keys_choice_int }, charstroke .initial:n = bold, - % 棋盘背景图片 - boardbg .tl_set:N = \l__cchess_board_background_tl , - boardbg .initial:n = {} , + % 打谱环境交叉引用标签 + label .tl_gset:N = \l__cchess_setman_label_tl , + label .initial:n = {} , + + % 每行棋谱步数 + mansperline .tl_gset:N = \l__cchess_mans_per_line_int , + mansperline .initial:n = 2 , unknown .code:n = { \msg_error:nn { cchess } { unknown-option } } } @@ -1448,7 +1504,7 @@ piecefont = \kaishu, piecetype = ooo, boardtype = x+tn, - resize = none, + resize = none, } % 选项设置用户接口 @@ -1491,7 +1547,7 @@ % 缩放棋子盒子容器 \coffin_resize:Nnn \l__cchess_piece_coffin { \piecesize }{ \piecesize } - % 复制结果以备后续使用 + % 保存结果 \coffin_gset_eq:cN { l__cchess_piece_ ##1 _coffin } \l__cchess_piece_coffin } @@ -1531,17 +1587,17 @@ } % =============创建棋子占位coffins============= - % 缩放空白棋子(n---null) -\cs_new:Nn \__cchess_board_piece_n_resize: + % 缩放空白棋子 +\cs_new:Nn \__cchess_board_piece_z_resize: { - \coffin_resize:Nnn \l__cchess_piece_n_coffin { \piecesize } { \piecesize } + \coffin_resize:Nnn \l__cchess_piece_z_coffin { \piecesize } { \piecesize } } -% 执行缩放 -\__cchess_board_piece_n_resize: +% 缩放空白棋子 +\__cchess_board_piece_z_resize: % 将棋子盒子容器布置到棋盘指定位置(用于棋谱和棋盘排版) % #1 棋子参数 -% 棋子参数的形式为{0,0}{k},{0,1}{K},注意需要包含大括号, +% 棋子参数的形式为{{0,0}{k},{0,1}{K}},注意需要包含大括号, % 不同棋子之间用英文逗号分隔 \cs_new:Npn \__cchess_board_piece_pos_construct:n #1 { @@ -1550,7 +1606,7 @@ \draw_begin: % 在四个角布置空白棋子实现占位(用于撑满棋子画布) \clist_set:Nn \l_tmpa_clist - { {0, 0}{n}, {8, 0}{n}, {0, 9}{n}, {8, 9}{n}} + { {0, 0}{z}, {8, 0}{z}, {0, 9}{z}, {8, 9}{z}} \clist_map_inline:Nn \l_tmpa_clist { \__cchess_piece_set_handle:nn ##1 @@ -1575,7 +1631,7 @@ % 如果文件名不为空则载入图片,否则创建一个空盒子容器 \tl_if_empty:NTF \l__cchess_board_background_tl { - \phantom{将} + \phantom{a} }{ \includegraphics{\l__cchess_board_background_tl} } @@ -1670,6 +1726,43 @@ } } +% 在正文中排版棋子 +\cs_new:Npn \__cchess_getpiece_handle:nn #1#2 + { + % 构建红黑各7个棋子 + \__cchess_pieces_construct: + + % 设置指定格式的基字符盒子 + \hbox_set:Nn \l_tmpa_box { #1 将 } + + % 盒子高度 + \dim_set:Nn \l_tmpa_dim + { + \box_ht_plus_dp:N \l_tmpa_box + } + + % 棋子高度 + \dim_set:Nn \l_tmpb_dim + { + \__cchess_coffin_ht_plus_dp:N \l__cchess_piece_K_coffin + } + + % 缩放棋子 + \coffin_scale:cnn { l__cchess_piece_ #2 _coffin } + { + \dim_ratio:nn { \l_tmpa_dim } { \l_tmpb_dim } + }{ + \dim_ratio:nn { \l_tmpa_dim } { \l_tmpb_dim } + } + + % 盒子深度 + \dim_set:Nn \l_tmpb_dim { \box_dp:N \l_tmpa_box } + + % 输出盒子(下沉深度距离) + \coffin_typeset:cnnnn { l__cchess_piece_ #2 _coffin } + { l } { b } { 0pt } { -\l_tmpb_dim } + } + % =============排版棋谱============= % 棋谱排版 \cs_new:Npn \__cchess_manual_output:n #1 @@ -1820,12 +1913,14 @@ } \cs_generate_variant:Nn \__cchess_piece_set:nnn {VV} +% ====================================================== % ===采用棋子替换方式创建棋子画布coffin(用于打谱排版)=== -% 缩放棋子盒子容器 +% ====================================================== +% 缩放占棋子盒子容器 \cs_new:Nn \__cchess_board_pieces_resize: { % 空白棋子 - \coffin_resize:Nnn \l__cchess_board_piece_n_coffin + \coffin_resize:Nnn \l__cchess_board_piece_z_coffin { \piecesize } { \piecesize } % 其它棋子,按行(a-i)列(a-j)编号命名。 @@ -1912,8 +2007,8 @@ } % 棋子占位替换函数 -% #1 x方向数字型坐标值(a-i) -% #2 y方向数字型坐标值(a-j) +% #1 横向字符型坐标值(a-i) +% #2 纵向字符型坐标值(a-j) % #3 棋子名称(单英文字母) \cs_new:Npn \__cchess_piece_replace:nnn #1#2#3 { @@ -1958,14 +2053,14 @@ } % 棋子删除函数 -% #1 x方向数字型坐标值(a-i) -% #2 y方向数字型坐标值(a-j) +% #1 横向字符型坐标值(a-i) +% #2 纵方向字符型坐标值(a-j) % #3 棋子名称(单英文字母) \cs_new:Npn \__cchess_piece_remove:nn #1#2 { \coffin_gset_eq:cN { l__cchess_board_piece_ #1 _ #2 _coffin } - \l__cchess_board_piece_n_coffin + \l__cchess_board_piece_z_coffin } \cs_generate_variant:Nn \__cchess_piece_remove:nn {VV} @@ -2028,10 +2123,10 @@ } % 棋子移动函数 -% #1 原位置x方向数字型坐标值(a-i) -% #2 原位置y方向数字型坐标值(a-j) -% #3 新位置x方向数字型坐标值(a-i) -% #4 新位置y方向数字型坐标值(a-j) +% #1 原位置横向字符型坐标值(a-i) +% #2 原位置纵向字符型坐标值(a-j) +% #3 新位置横向字符型坐标值(a-i) +% #4 新位置纵向字符型坐标值(a-j) % #5 棋子名称(单英文字母) \cs_new:Npn \__cchess_piece_move:nnnnn #1#2#3#4#5 { @@ -2050,14 +2145,14 @@ % 生成打谱棋谱记录 % TODO:暂未实现纵向同类棋子前后判断 -% #1 原位置x方向数字型坐标值(a-i) -% #2 原位置y方向数字型坐标值(a-j) -% #3 新位置x方向数字型坐标值(a-i) -% #4 新位置y方向数字型坐标值(a-j) +% #1 原位置横向字符型坐标值(a-i) +% #2 原位置纵向字符型坐标值(a-j) +% #3 新位置横向字符型坐标值(a-i) +% #4 新位置纵向字符型坐标值(a-j) % #5 棋子名称(单英文字母) \cs_new:Npn \__cchess_piece_manual_str_construct:nnnnn #1#2#3#4#5 { - % 将字母坐标数据转换为整数坐标 + % 将字符坐标数据转换为整数坐标 \prop_get:NnN \c__cchess_board_pos_alph_num_prop { #1 } \l_tmpa_tl \prop_get:NnN \c__cchess_board_pos_alph_num_prop { #2 } \l_tmpb_tl \prop_get:NnN \c__cchess_board_pos_alph_num_prop { #3 } \l_tmpc_tl @@ -2226,6 +2321,11 @@ \tl_use:N \l_tmpa_tl } +% 定义\label命令的变体函数 +%\label { #1 } +\cs_set_eq:NN \__cchess_setman_label:n \label +\cs_generate_variant:Nn \__cchess_setman_label:n { x } + % 打谱环境后处理函数 \cs_new:Nn \__cchess_setcchessman_post_setup: { @@ -2257,36 +2357,27 @@ % 星号环境需要输出打谱记录 \bool_if:NT \l__cchess_with_setman_bool { - % 测量打谱记录盒子水平尺寸 - \hcoffin_set:Nn \l_tmpa_coffin { 车九平八\quad 车九平八} - \dim_set:Nn \l_tmpa_dim { \coffin_wd:N \l_tmpa_coffin } + % 递增计数器 + \refstepcounter{setman} + % 设置label标签 + \__cchess_setman_label:x { \l__cchess_setman_label_tl } - % 构建打谱记录垂直盒子容器 - \vcoffin_set:Nnn \l_tmpa_coffin { \l_tmpa_dim } + % 构造临时文件 + \iow_open:Nn \g_tmpa_iow { - % 遍历打谱记录列表,输出打谱记录 - \bool_until_do:nn { \clist_if_empty_p:N \l__cchess_manual_clist } - { - % 取消首行缩进 - \noindent - \clist_pop:NN \l__cchess_manual_clist \l_tmpa_tl + \c_sys_jobname_str\l__cchess_setman_label_tl\thesetman .man + } - \clist_if_empty:NTF \l__cchess_manual_clist - { - \l_tmpa_tl - }{ - \clist_pop:NN \l__cchess_manual_clist \l_tmpb_tl - \l_tmpa_tl - \quad - \l_tmpb_tl - \par - } - } + % 遍历打谱记录列表,输出打谱记录到临时文件 + \bool_until_do:nn { \clist_if_empty_p:N \l__cchess_manual_clist } + { + \clist_pop:NN \l__cchess_manual_clist \l_tmpa_tl + \tl_set:Nx \l_tmpb_tl {\l_tmpa_tl} + \iow_now:Nx \g_tmpa_iow { \l_tmpb_tl } } - % 拼装打谱记录盒子容器到结果容器 - \coffin_join:NnnNnnnn \l__cchess_manual_coffin - { l } { t } \l_tmpa_coffin { r } { t } { -10pt } { -\piecesize } + % 关闭文件 + \iow_close:N \g_tmpa_iow } % 输出结果盒子容器 @@ -2294,4 +2385,60 @@ { l }{ b } { 0pt } { 0pt } } +% 参考雾月的回复:https://ask.latexstudio.net/ask/question/7430.html +% LaTeX3 并未定义 \use_i:nnnnn +\cs_set:Npn \use_i:nnnnn #1#2#3#4#5 {#1} + +% 打谱棋谱排版描述处理 +\cs_new:Npn \__cchess_setman_print:n #1 + { + % 根据棋谱label构建文件名 + \cs_if_exist:cTF { r@#1 } + { + % 这一步是得到 ref,它保存在 \r@#1 中。 + % \r@#1 有两项,当使用 hyperref 时, + % \r@#1 有 5 项,这里使用 \empty 统一解决 + \tl_set:Nx \l_tmpa_tl + { + \c_sys_jobname_str + #1 \exp_args:NNc \exp_after:wN \use_i:nnnnn { r@ #1 } + \c_empty_tl \c_empty_tl \c_empty_tl .man + } + + % 打开文件读取数据并输出结果 + \ior_open:NnTF \g_tmpb_ior { \l_tmpa_tl } + { + % 循环计数 + \int_set:Nn \l_tmpa_int { 1 } + % 循环读取一行棋谱 + \ior_str_map_variable:NNn \g_tmpb_ior \l_tmpb_str + { + % 转换为token + \tl_set_rescan:Nno \l_tmpb_tl + { + \char_set_catcode_letter:N \_ + \char_set_catcode_letter:N : + }{ \l_tmpb_str } + + % 输出结果 + \tl_use:N \l_tmpb_tl + + % 根据每行步数确定输出\quad或是\par + \int_set:Nn \l_tmpb_int + { + \int_mod:nn { \l_tmpa_int } { \l__cchess_mans_per_line_int } + } + \int_compare:nNnTF { \l_tmpb_int } = { 0 } + { \par } { \quad } + + \int_incr:N \l_tmpa_int + } + } + { \msg_error:nnx { cchess } { file-not-found } { \l_tmpa_tl } } + + % 关闭文件 + \iow_close:N \g_tmpa_ior + }{ \G@refundefinedtrue }% 引用未定义 + } + \endinput diff --git a/macros/latex/contrib/chinesechess/chinesechess.tex b/macros/latex/contrib/chinesechess/chinesechess.tex index 9220174cc8..60404db623 100644 --- a/macros/latex/contrib/chinesechess/chinesechess.tex +++ b/macros/latex/contrib/chinesechess/chinesechess.tex @@ -123,7 +123,7 @@ { \__codedoc_cmd:no {#1} { #2 } } \ExplSyntaxOff -\def\vers{\texttt{v1.0.0} } +\def\vers{\texttt{v1.1.0} } \begin{document} \title{ @@ -150,15 +150,14 @@ \section{引言} -\pkg{chinesechess}是一个基于\pkg{l3draw}用\pkg{Expl3}开发的 -中国象棋排版宏包。它提供了\tn{cchessboard} 全棋盘、 -\tn{cchessbord*}空白棋盘和\tn{cchessman}棋谱排版命令。同时, +\pkg{chinesechess}是一个基于\pkg{l3draw}绘图宏包,用\pkg{Expl3}% +开发的中国象棋排版宏包。它提供了\tn{cchessboard}(全棋盘)、% +\tn{cchessbord*}(空棋盘)和\tn{cchessman}(棋谱)排版命令。同时, 该宏包还提供了用于打谱的排版环境\env{setcchessman},在该环境 -中,可以通过环境专用命令\tn{init}初始化棋谱状态,\tn{set}在 -指定位置布置棋子,\tn{del}删除指定位置的棋子,\tn{mov}实现 -棋子的移动,从而实现打谱操作,并在环境结束后以最终状态排版棋谱。 -另外,也可以通过星号环境\env{setcchessman*}实现棋谱的文本描述 -输出。 +中,可以通过环境专用命令\tn{init}(初始化棋谱状态),\tn{set}(在 +指定位置布置棋子),\tn{del}(删除指定位置的棋子),\tn{mov}(实现 +棋子的移动),从而实现打谱操作,并在环境结束后以最终状态排版棋谱。 +另外,也可以通过星号环境\env{setcchessman*}实现棋谱文本输出。 棋子、棋盘、背景等外观可以通过命令、环境选项或\tn{cchessset}% 命令进行设置。 @@ -226,8 +225,8 @@ 编码 & 红棋 & 编码 & 黑棋\\\hline K & 帥 & k & 將 \\ A & 仕 & a & 士 \\ - E & 相 & e & 象 \\ - H & 马 & h & 馬 \\ + B(E) & 相 & b(e) & 象 \\ + N(H) & 马 & n(h) & 馬 \\ R & 车 & r & 車 \\ C & 炮 & c & 炮 \\ P & 兵 & p & 卒 \\\hline @@ -274,7 +273,9 @@ 指定位置的棋子,\tn{mov}实现棋子的移动,从而实现打谱操作。 在环境结束后以最终打谱状态排版棋谱。 - 星号环境\env{setcchessman*}会同时排版棋谱的文本描述(如:车一进二等)。 + 星号环境\env{setcchessman*}用于记录排版棋谱的文本描述(如:车一进二等)。 + 可在在\env{setcchessman*}环境中用label选项进行标记,然后用\tn{printman}% + 输出该棋谱。 在\oarg{外观选项}中可以通过key-value的方式设置棋子、棋盘的颜色、 字体、字号、线宽等外观。 @@ -302,27 +303,6 @@ \end{setcchessman} \end{SideBySideExample} -\begin{SideBySideExample}[frame=single,numbers=left, - xrightmargin=.45\linewidth,gobble=2] - \centering - % 为便排版,进行缩放 - \cchessset{resize=real, - width=.30\linewidth} - \begin{setcchessman*} - % 残局初始化 - \init{ {{4,0}{K}}, {{2,2}{p}}, - {{1,7}{C}}, {{4,9}{k}} } - % 添加棋子 - \set{e,d}{P} \set{8,g}{h} - % 删除棋子 - \del{4,3} - % 移动棋子 - \mov{C}{b,h}{b,b} \mov{p}{2,2}{3,2} - \mov{K}{4,0}{4,1} \mov{h}{8,6}{6,7} - \mov{K}{4,1}{3,1} \mov{h}{6,7}{5,5} - \end{setcchessman*} -\end{SideBySideExample} - \subsection{打谱专用命令} \subsubsection{\tn{init}棋谱初始化命令} @@ -386,6 +366,52 @@ \textbf{\textsf{注意: }}该命令只能用于\env{setcchessman}环境中。 +\subsection{\tn{printman}输出打谱结果命令} + +\begin{function}{\printman} + \begin{syntax} + \cs{printman} \marg{\env{setcchessman*}环境的label标签} + \end{syntax} +\end{function} + + 输出由label标签指定的\env{setcchessman*}打谱环境生成的棋谱。 + +\subsection{\tn{getpiece}输出棋子命令} + +\begin{function}{\getpiece} + \begin{syntax} + \cs{getpiece} \oarg{棋子字号} \marg{棋子编码} + \end{syntax} +\end{function} + + 按\oarg{棋子字号}指定的字号将用\marg{棋子编码}指定的棋子在当前位置输出。 + + \marg{棋子编码}中的编码详见表表\ref{tab-piececode}。 + +\begin{SideBySideExample}[frame=single,numbers=left, + xrightmargin=.28\linewidth,gobble=2] + \centering + \getpiece{K}\getpiece{A}\getpiece{B}\getpiece{R}% + \getpiece{N}\getpiece{C}\getpiece{P} + + \getpiece{k}\getpiece{a}\getpiece{b}\getpiece{r}% + \getpiece{n}\getpiece{c}\getpiece{p} +\end{SideBySideExample} + +\subsection{\tn{piecechar}棋子字符设置命令} + +\begin{function}{\piecechar} + \begin{syntax} + \cs{piecechar} \marg{棋子编码} \marg{棋子字符} + \end{syntax} +\end{function} + + 用于将\marg{棋子编码}指定的棋子字符设置为指定的\marg{棋子字符}。 + + \marg{棋子编码}中的编码详见表表\ref{tab-piececode}。 + + \textbf{\textsf{说明: }}该功能也可以通过|piecechar|外观选项实现。 + \subsection{\tn{resetpiece}棋子字符复位命令} \begin{function}{\resetpiece} @@ -624,14 +650,14 @@ piecechar={E}{\faChessBishop}, piecechar={H}{\faChessKnight}, piecechar={R}{\faChessRook}, - piecechar={C}{\faBomb}, + piecechar={C}{\faMeteor}, piecechar={P}{\faChessPawn}, piecechar={k}{\faChessQueen}, piecechar={a}{\faShield*}, piecechar={e}{\faChessBishop}, piecechar={h}{\faChessKnight}, piecechar={r}{\faChessRook}, - piecechar={c}{\faBomb}, + piecechar={c}{\faMeteor}, piecechar={p}{\faChessPawn}, boardlinecolor=red] \end{SideBySideExample} @@ -862,6 +888,47 @@ redupper=red,blkupper=black] \end{SideBySideExample} +\bigskip + +\subsection{打谱} + +\subsubsection{label标签} + +\begin{option}{ opt = label, desc = {= \meta{棋谱标签}}, init=init-none } + 设置\env{setcchessman*}打谱环境交叉引用标签。 +\end{option} + +\subsubsection{每行棋谱步数} + +\begin{option}{ opt = mansperline, desc = {= \meta{每行棋谱步数}}, init=2 } + 设置\tn{printman}输出棋谱时,每行输出棋谱的步数。 +\end{option} + +\begin{SideBySideExample}[frame=single,numbers=left, + xrightmargin=.45\linewidth,gobble=2] + \centering + \printman{test} + + \bigskip + + % 为便排版,进行缩放 + \cchessset{resize=real, + width=0.90\linewidth} + \begin{setcchessman*}[label=test] + % 残局初始化 + \init{ {{4,0}{K}}, {{2,2}{p}}, + {{1,7}{C}}, {{4,9}{k}} } + % 添加棋子 + \set{e,d}{P} \set{8,g}{h} + % 删除棋子 + \del{4,3} + % 移动棋子 + \mov{C}{b,h}{b,b} \mov{p}{2,2}{3,2} + \mov{K}{4,0}{4,1} \mov{h}{8,6}{6,7} + \mov{K}{4,1}{3,1} \mov{h}{6,7}{5,5} + \end{setcchessman*} +\end{SideBySideExample} + % \bigskip % \title{ diff --git a/macros/latex/contrib/mathsemantics/Contributing.md b/macros/latex/contrib/mathsemantics/Contributing.md new file mode 100644 index 0000000000..564cd29547 --- /dev/null +++ b/macros/latex/contrib/mathsemantics/Contributing.md @@ -0,0 +1,51 @@ +# Contributing to `MathSemantics.sty` + +First, thanks for taking the time to contribute. +Any contribution is appreciated and welcome. + +The following is a set of guidelines to [`MathSemantics.sty`](https://github.com/kellertuer/MathSemantics.sty). + +- [Contributing to `MathSemantics.sty`](#contributing-to-mathsemanticssty) + - [I just have a question](#i-just-have-a-question) + - [How can I file an issue?](#how-can-i-file-an-issue) + - [How can I contribute?](#how-can-i-contribute) + - [Add a missing command](#add-a-missing-command) + - [Provide a new abbreviation or a name](#provide-a-new-abbreviation-or-a-name) + - [Provide a new command](#provide-a-new-command) + - [Code style](#code-style) + +## I just have a question + +The developers can most easily be reached in the GitHub Discussions at <https://github.com/kellertuer/MathSemantics.sty/discussions> + +## How can I file an issue? + +If you found a bug or want to propose a feature, we track our issues within the [GitHub repository](https://github.com/kellertuer/MathSemantics.sty/issues). + +## How can I contribute? + +### Add a missing command + +If you have a semantic command, and abbreviation or a syntactic sugar that fits this package, feel free to add it. contribution. + +### Provide a new abbreviation or a name + +Abbreviations are all defined in `mathsemantics-abbreviations.sty`. +They are stored grouped by language and ordered alphabetically by command. Remember to also add a line in the Abbreviations section in the `mathsemantics-documentation.tex` + +### Provide a new command + +Since commands might be a little complex from time to time, we often use `\NewDocumentCommand` to define them. Please remember to add a documentation in the source code above the command. + +Usually within a file (like `mathsemantics-semantic.sty` or `mathsemantics-manifold.sty`) first commands are defined, then math operators and symbols. + +If you define a command that uses a symbol, provide that as a command as well, so it can easily be changed without redefining the whole (maybe complicated) command. One example is the command `\geodesic` and the `\geodesicSymbol`. + +Remember to add an entry in the corresponding section in the documentation as well. Such an entry should explain all possible parameters, also the optional one. It should also provide an example usage of every parameter/setting that can be used. There is both a `\codeExample` as well as a `\mathCodeExample` example command that take one argument, which is both rendered as code and its resulting look. + +### Code style + +- the first optional parameter `[]` should usually be used to scale brackets appearing in a command and maybe also internal elements, like the `\mid` in `\setDef`. +- Commands are written in `CamelCase`, where the first letter might or might not be capitalised depending on the context +- The syntax helpers (Section 4.2 in the documentation) might be useful when parts should be enclosed in parenthesis or other delimiters +- For every command, the goal should be that the resulting mathematics is easier readable afterwards. diff --git a/macros/latex/contrib/mathsemantics/LICENSE b/macros/latex/contrib/mathsemantics/LICENSE new file mode 100644 index 0000000000..17885e398a --- /dev/null +++ b/macros/latex/contrib/mathsemantics/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Ronny Bergmann, Roland Herzog + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/macros/latex/contrib/mathsemantics/README.md b/macros/latex/contrib/mathsemantics/README.md new file mode 100644 index 0000000000..bcec0369da --- /dev/null +++ b/macros/latex/contrib/mathsemantics/README.md @@ -0,0 +1,38 @@ +# MathSemantics.sty + +[![documentation](https://badgen.net/badge/documentation/pdf/green)](https://ronnybergmann.net/MathSemantics.sty/mathsemantics-documentation.pdf) +![LaTeX](https://badgen.net/badge/language/LaTeX/blue) +[![GitHub license](https://badgen.net/github/license/kellertuer/MathSemantics.sty)](https://github.com/kellertuer/MathSemantics.sty/blob/master/LICENSE) + + +This LaTeX package `mathsemantics.sty` provides both syntactic and semantic helpers to typeset math in LaTeX. The syntactic layer eases typesetting of formular in general, while the semantic layer provides commands like `\inner{x}{y}` to unify + typesetting of inner products. These not only unify typesetting of math formulae but also allow to easily adapt Notation if a user prefers to. +The semantic layer is split into topics. + +## Example + +Instead of always writing + +```latex +\lVert x \rVert +``` + +for the norm and maybe having to manually increase _both_ delimiters for example in + +```latex +\Bigr\lVert \frac{x}{2} \Bigr\rVert +``` + +with the commands from this package this simplifies to + +```latex +\norm{x} +``` + +and + +```latex +\norm[Big]{\frac{1}{2}} +``` + +For a comprehensive overview over all commands, see the [mathsemantics-documentation.pdf](https://ronnybergmann.net/MathSemantics.sty/mathsemantics-documentation.pdf). diff --git a/macros/latex/contrib/mathsemantics/mathsemantics-abbreviations.sty b/macros/latex/contrib/mathsemantics/mathsemantics-abbreviations.sty new file mode 100644 index 0000000000..e156608aad --- /dev/null +++ b/macros/latex/contrib/mathsemantics/mathsemantics-abbreviations.sty @@ -0,0 +1,53 @@ +\ProvidesPackage{mathsemantics-abbreviations}[2022/05/06] + +% Resolve the dependencies of this package +\RequirePackage{mathsemantics-commons} + +% Define some English abbreviations +\let\aa\undefined \newcommand{\aa}{a.a.\xspace} +\newcommand{\ale}{a.e.\xspace} +\let\cf\undefined \newcommand{\cf}{cf.\xspace} +\newcommand{\eg}{e.\,g.\xspace} +\newcommand{\Eg}{E.\,g.\xspace} +\let\ie\undefined \newcommand{\ie}{i.\,e.\xspace} +\newcommand{\Ie}{I.\,e.\xspace} +\newcommand{\iid}{i.\,i.\,d.\xspace} +\let\st\undefined \newcommand{\st}{s.\,t.\xspace} % WileyNJD-v2.cls (loads soul.sty) +\newcommand{\wolog}{w.l.o.g.\xspace} % \wlog is a LaTeX core command which writes to the .log file +\newcommand{\wrt}{w.r.t.\xspace} + +% Define some German abbreviations +\newcommand{\bspw}{bspw.\xspace} +\newcommand{\bzgl}{bzgl.\xspace} +\newcommand{\bzw}{bzw.\xspace} +\newcommand{\dah}{d.\,h.\xspace} +\newcommand{\Dah}{D.\,h.\xspace} +\newcommand{\etc}{etc.\xspace} +\newcommand{\evtl}{evtl.\xspace} +\newcommand{\Evtl}{Evtl.\xspace} +\newcommand{\fue}{f.\,ü.\xspace} +\newcommand{\fs}{f.\,s.\xspace} +\newcommand{\iA}{i.\,A.\xspace} +\newcommand{\IA}{I.\,A.\xspace} +\newcommand{\idR}{i.\,d.\,R.\xspace} +\newcommand{\IdR}{I.\,d.\,R.\xspace} +\newcommand{\iW}{i.\,W.\xspace} +\newcommand{\IW}{I.\,W.\xspace} +\newcommand{\mE}{m.\,E.\xspace} +\newcommand{\oBdA}{o.\,B.\,d.\,A.\xspace} +\newcommand{\OBdA}{O.\,B.\,d.\,A.\xspace} +\let\og\undefined \newcommand{\og}{o.\,g.\xspace} % cedram.cls +\newcommand{\oae}{o.\,ä.\xspace} +\newcommand{\pa}{p.\,a.\xspace} +\newcommand{\spd}{s.\,p.\,d.\xspace} +\let\so\undefined \newcommand{\so}{s.\,t.\xspace} % WileyNJD-v2.cls (loads soul.sty) +\newcommand{\ua}{u.\,a.\xspace} +\newcommand{\ug}{u.\,g.\xspace} +\newcommand{\usw}{usw.\xspace} +\newcommand{\Ua}{U.\,a.\xspace} +\newcommand{\uU}{u.\,U.\xspace} +\newcommand{\UnU}{U.\,U.\xspace} +\newcommand{\vgl}{vgl.\xspace} +\newcommand{\zB}{z.\,B.\xspace} +\newcommand{\ZB}{Z.\,B.\xspace} +\newcommand{\zHd}{z.\,Hd.\xspace}
\ No newline at end of file diff --git a/macros/latex/contrib/mathsemantics/mathsemantics-commons.sty b/macros/latex/contrib/mathsemantics/mathsemantics-commons.sty new file mode 100644 index 0000000000..7f32621c53 --- /dev/null +++ b/macros/latex/contrib/mathsemantics/mathsemantics-commons.sty @@ -0,0 +1,13 @@ +\ProvidesPackage{mathsemantics-commons}[2022/05/06] + +% Packages which allow control flow +\RequirePackage{ifthen} +\RequirePackage{xifthen} +\RequirePackage{ifxetex} + +\RequirePackage{xparse} +\RequirePackage{xspace} +\let\Bbbk\relax +\RequirePackage{amssymb} % load diableable by an option? +\RequirePackage{mathtools} +\RequirePackage{calc}
\ No newline at end of file diff --git a/macros/latex/contrib/mathsemantics/mathsemantics-documentation-local.sty b/macros/latex/contrib/mathsemantics/mathsemantics-documentation-local.sty new file mode 100644 index 0000000000..87ff66da0b --- /dev/null +++ b/macros/latex/contrib/mathsemantics/mathsemantics-documentation-local.sty @@ -0,0 +1,106 @@ +% commands used in the docs. +\ProvidesPackage{mathsemantics-documentation-local} +\RequirePackage{fontawesome5} +% Load the metalogo package (which provides the \XeTeX command) +\RequirePackage{metalogo} + +\RequirePackage{xcolor} +\RequirePackage{lineno} +\RequirePackage{scrdate} +\RequirePackage{lastpage} +\RequirePackage{scrlayer-scrpage} +\RequirePackage{stmaryrd} +\RequirePackage{enumitem} +\RequirePackage{ccicons} +\usepackage[useregional]{datetime2} +\RequirePackage{minted} +\usemintedstyle{vs} +% load fonts +\RequirePackage{microtype} +\RequirePackage[proportional]{libertine} +\RequirePackage[libertine,liby]{newtxmath} +\RequirePackage[scaled=0.95,varqu,varl]{inconsolata} + +\RequirePackage{hyperref} +\RequirePackage[nameinlink,capitalize,noabbrev]{cleveref} +% Load Package - after minted +\RequirePackage[shortbb]{mathsemantics} + +\definecolor{TolMutedBlue}{HTML}{332288} +\definecolor{TolMutedGreen}{HTML}{117733} +\definecolor{TolMutedWine}{HTML}{882255} + +\crefformat{footnote}{#2\footnotemark[#1]#3} +\hypersetup{ + pdfpagemode=UseOutlines, + colorlinks=true, + linkcolor=TolMutedBlue, + filecolor=TolMutedWine, + urlcolor=TolMutedWine, + citecolor=TolMutedGreen, + plainpages=false, + hypertexnames=false +} + + +% Set up the appearance of author, date, title, and section headings etc. +\renewcommand*{\sectfont}{\color{TolMutedBlue}\sffamily} +\setkomafont{author}{\large\normalfont\sffamily} +\setkomafont{date}{\large\normalfont\sffamily} +\setkomafont{title}{\color{TolMutedBlue}\normalfont\sffamily\scshape} +\addtokomafont{pageheadfoot}{\normalfont\sffamily\footnotesize} +\addtokomafont{section}{\scshape} +\addtokomafont{subsection}{\scshape} +\addtokomafont{subsubsection}{\scshape\itshape} +\pagestyle{scrheadings} +\KOMAoptions{headsepline=true} +\KOMAoptions{footsepline=true} +\KOMAoptions{plainfootsepline=true} + +\rohead[]{mathsemantics.sty} +\lehead[]{R. Bergmann} +\refoot[]{\ISOToday} +\cofoot[]{\ccbysa} +\ofoot[page~\thepage~of~\pageref*{LastPage}]{page~\thepage~of~\pageref*{LastPage}} +\useosf + +% Define a command which displays a command inline +\NewDocumentCommand\codeCommand{v}{\mintinline{LaTeX}|#1|} + +% Define a command which displays code and renders its results +\NewDocumentCommand\codeExample{v}{% + \faIcon{code}\hspace{.25cm}% + \mintinline{LaTeX}{#1} + \hspace{.5cm}\faEye[regular]\hspace{.25cm}% + \scantokens{#1\noexpand}% +} + +% Define a command which just renders the result but does not display the code +\NewDocumentCommand\justCodeExample{v}{% + \faEye[regular]\hspace{.25cm}% + \scantokens{#1\noexpand}% +} + +% Define a command which displays code and renders its results in math mode +\NewDocumentCommand\mathCodeExample{v}{% + \faIcon{code}$_{\hspace{-.5ex}\text{\color{TolMutedGreen}\faIcon{dollar-sign}}}$\hspace{.125cm}% + \mintinline{LaTeX}{#1} + \hspace{.5cm} + \faEye[regular]\hspace{.125cm}\scantokens{$\displaystyle #1\noexpand$}% +} + +\newcommand{\mathsemanticsWarning}{{ \color{TolVibrantOrange}\faIcon{exclamation-triangle}\ }} +\newcommand{\file}[1]{\nolinkurl{#1}} + +% Define a command which displays colors +\NewDocumentCommand\colorExample{v}{% + \faIcon{tint}% + \hspace{.25cm} + \makebox[.3\textwidth][l]{\textcolor{#1}{#1}}% + \hspace{.5cm}% + \colorbox{#1}{\textcolor{white}{\faIcon{fill}}\hspace{.25cm}#1\hspace{.25cm}}% +} + +% Define a new description type list +\newenvironment{commandlist}{\begin{description}[style=multiline,leftmargin=.25\textwidth,font=\texttt]}{\end{description}} +\newenvironment{dictionarylist}{\begin{description}[style=multiline,leftmargin=.5\textwidth,font=\textbf, topsep=0pt,itemsep=-1.1ex,partopsep=1ex,parsep=1ex]}{\end{description}} diff --git a/macros/latex/contrib/mathsemantics/mathsemantics-documentation.pdf b/macros/latex/contrib/mathsemantics/mathsemantics-documentation.pdf Binary files differnew file mode 100644 index 0000000000..eb438346c6 --- /dev/null +++ b/macros/latex/contrib/mathsemantics/mathsemantics-documentation.pdf diff --git a/macros/latex/contrib/mathsemantics/mathsemantics-documentation.tex b/macros/latex/contrib/mathsemantics/mathsemantics-documentation.tex new file mode 100644 index 0000000000..875f0a0b55 --- /dev/null +++ b/macros/latex/contrib/mathsemantics/mathsemantics-documentation.tex @@ -0,0 +1,710 @@ +\documentclass[english,a4paper,DIV=12,parskip=full,oneside]{scrartcl} +\usepackage{mathsemantics-documentation-local} +\date{\today, v\,1.0.0} +\author{% + Ronny Bergmann\\[.25\baselineskip]% + \small\href{mailto:ronny.bergmann@ntnu.no}{ronny.bergmann@ntnu.no}\\[.125\baselineskip] + \small Department of Mathematical Sciences\\% + \small NTNU, Trondheim, Norway.% + \and + Roland Herzog\\[.25\baselineskip]% + \small\href{mailto:roland.herzog@iwr.uni-heidelberg.de}{roland.herzog@iwr.uni-heidelberg.de}\\[.125\baselineskip] + \small Interdisciplinary Center for Scientific Computing\\% + \small Heidelberg University, Germany.% + } +% Roland Herzog, Interdisciplinary Center for Scientific Computing, Heidelberg University, Germany +% Ronnny Bergmann, Department of Mathematical Sciences, NTNU, Trondheim, Norway +\title{MathSemantics.sty – Semantic Math Commands} +\begin{document} + \maketitle + \tableofcontents + \section{Introduction} + This package aims to provide semantic commands for ease of use in mathematics + to see better \emph{what} you semantically mean which should be distinct/split + from \emph{how} it is realised in \LaTeX. + + The package is a spin-off and developed in the suite of packages from the former numapde-group in Chemnitz, + see the original repository at \url{https://gitlab.hrz.tu-chemnitz.de/numapde-public/numapde-latex}. + + Throughout this documentation most commands are directly illustrated by examples, which are + both displayed as code (\faIcon{code} or \faIcon{code}$_{\hspace{-.5ex}\text{\color{TolMutedGreen}\faIcon{dollar-sign}}}$ for math examples) and its rendered result in \LaTeX\ (\faEye[regular]). + Two examples are\\ + \mathCodeExample{\bbR}\\ + and\\ + \codeExample{\eg} + + The aim is to first ease the use of some often used letters and low-level formats like + bold face letters \mathCodeExample{\bbR}, but also to provide high level commands that + make typing mathematics easier, for example using \mathCodeExample{\abs{\frac{1}{2}}} and \mathCodeExample{\abs[Big]{\frac{1}{2}}} + This is the main goal in \cref{sec:syntax} about syntactical commands for mathematics. + A next more support/helping section about abbreviations and names is \cref{sec:abbreviations}. + + The first main part on general semantic commands is \cref{sec:semantic}. + + While all these are loaded by default. The next part, \cref{sec:semantics-by-topic}, + introduces semantic commands for specific topics. + These are given in separate sub-packages and can be loaded if you work in this area and want to use the commands. + + The package should be loaded late, since it might overwrite a few commands, + currently most prominently \codeCommand{\d} which is overwritten by \mintinline{LaTeX}|cleveref| in case \mintinline{LaTeX}|minted| is loaded. + So for more flexibility, there is the alternative command \codeCommand{\dInt}. + + + + \section{Package Options} + \label{sec:package-options} + \begin{commandlist} + \item[shortbb] use shorter notations for the blackboard-bold math letters \codeCommand{\C, \K, \N, \Q, \R, \Z} + \end{commandlist} + + \section{Required Packages} + \label{sec:required-packages} + \begin{description} + \item[amssymb.sty] defines mathematical symbol fonts + \item[ifthen.sty] facilitates the definition of conditional commands + \item[ifxetex.sty] provides a way to check if a document is being processed by \XeTeX{} and company + \item[mathtools.sty] provides lots of improvements for math typesetting (includes \file{amsmath.sty}) + \item[xifthen.sty] extends \file{ifthen.sty} by adding new boolean conditions + \item[xparse.sty] provides a high-level interface to define new commands + \item[xspace.sty] adds space depending on context + \end{description} + + + \section{Syntax} + \label{sec:syntax} + + The \file{mathsemantics-syntax.sty} package provides mainly symbols and short commands, which can be used in semantic definitions for ease of notation. + They usually are rather simple commands without too many parameters. + + + \subsection{Letters} + \label{subsec:letters} + + \begin{commandlist} + \item[ba\ldots bz] lower-case \textbf{b}old-face letters \mathCodeExample{\br, \bf} + \item[bA\ldots bZ] upper-case \textbf{b}old-face letters \mathCodeExample{\bR, \bF} + \item[balpha\ldots bomega] lower-case \textbf{b}old-face Greek letters \mathCodeExample{\balpha,\boldeta} (the latter being an exception) + \item[bAlpha\ldots bOmega] upper-case \textbf{b}old-face Greek letters \mathCodeExample{\bGamma,\bDelta} + \item[bnull] \textbf{b}old-face zero \mathCodeExample{\bnull} + \item[bone] \textbf{b}old-face one \mathCodeExample{\bone} + \item[cA\ldots cZ] upper-case \textbf{c}alligraphic letters \mathCodeExample{\cM, \cN}\\ + \item[fA\ldots fZ] upper-case \textbf{f}raktur letters \mathCodeExample{\fM, \fN, \fX}\\ + \item[sA\ldots sZ] upper-case \textbf{s}cript letters \mathCodeExample{\sM, \sN, \sX}\\ + \item[va\ldots vz] lower-case letters with a \textbf{v}ector accent \mathCodeExample{\va,\vb} + \item[vA\ldots vZ] upper-case letters with a \textbf{v}ector accent \mathCodeExample{\vA,\vB} + \item[valpha\ldots vomega] lower-case Greek letters with a \textbf{v}ector accent \mathCodeExample{\valpha,\vbeta} + \item[vAlpha\ldots vOmega] upper-case Greek letters with a \textbf{v}ector accent \mathCodeExample{\vGamma,\vDelta} + \item[vnull] vector zero \mathCodeExample{\vnull} + \item[vone] vector one \mathCodeExample{\vone} + \item[bbA,...,bbZ] blackboard-bold uppercase letters\par\mathCodeExample{\bbC,\bbK,\bbN,\bbQ,\bbR,\bbS,\bbZ} + \\[.5\baselineskip] use the package option \codeCommand{shortbb} to introduce\\ + \mathCodeExample{\C,\K,\N,\Q,\R,\Z} if not already defined elsewhere (\ie they are not redefined, only \emph{provided}. + \end{commandlist} + + \subsection{Syntax Helpers}\label{subsec:syntax_helpers} + + \begin{commandlist} + \item[enclspacing] provides spacing after the opening and before the closing delimiters for \codeCommand{\enclose}. + This is by default set to be empty. + \item[enclose] is a command which encloses some content in scaled delimiters. + It is meant as a helper to facilitate the definition of other commands. + Its syntax is \codeCommand{\enclose[#1]{#2}{#3}{#4}}. + The first (optional) argument is used to scale the delimiters to the standard amsmath sizes.% + \footnote{\mintinline{LaTeX}|big|, \mintinline{LaTeX}|Big|, \mintinline{LaTeX}|bigg|, \mintinline{LaTeX}|Bigg| or \mintinline{LaTeX}|auto|, which uses \mintinline{LaTeX}|left| and \mintinline{LaTeX}|right| as well as \mintinline{LaTeX}|none| to easily deactivate brackets.\label{footnote:amsmath_sizes}} + The second and fourth arguments specify the opening and closing delimiters, respectively. + The third argument is the content to be enclosed. + \par\mathCodeExample{\enclose{[}{\dfrac{1}{2}}{]}} % chktex 9 + \par\mathCodeExample{\enclose[Big][{\dfrac{1}{2}}]} % chktex 9 + \par\mathCodeExample{\enclose[auto]{[}{\dfrac{1}{2}}{]}} % chktex 9 + \par\mathCodeExample{\enclose[none]{[}{\dfrac{1}{2}}{]}} % chktex 9 + + \textbf{Note 1.} \mintinline{LaTeX}|none| is merely meant for testing when having arguments + in brackets whether it is useful to omit them. You can also deactivate the absolute value + vertical lines this way, so \emph{use this option with care}. + + \textbf{Note 2.} This command should normally be used only in the definition of other commands. + For instance, \codeCommand{\abs} is using it internally. See \codeCommand{\paren} for the nicer command to use + \item[enclspacingSet] provides spacing before and after the center delimiter \codeCommand{\encloseSet}. + This is by default set to \codeCommand{\,}. + \item[encloseSet] is a command which encloses some content in scaled delimiters. + It is meant as a helper to facilitate the definition of other commands. + Its syntax is \codeCommand{\encloseSet#1]{#2}{#3}{#4}{#5}{#6}}. + The first (optional) argument is used to scale the delimiters including the center one to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second and sixth arguments specify the opening and closing delimiters, respectively. + The fourth argument specifies the center delimiter and + The third and fifth argument are the content to be enclosed. + \par\mathCodeExample{\encloseSet[big]{\{}{x\in\bbR}{|}{x>5}{\}}} % chktex 9 + \par\mathCodeExample{\encloseSet[auto]{\{}{x\in\bbR}{|}{x>\dfrac{1}{2}}{\}}} % chktex 9 + \\ + \textbf{Note.} This command should normally be used only in the definition of other commands. + For instance, \codeCommand{\setDef} is using it internally. + \item[paren] is an alternative to \codeCommand{\enclose}, with a different ordering of arguments. + Its syntax is \codeCommand{\paren[#1]{#2}{#3}{#4}}, which is simply mapped to \codeCommand{\enclose[#1]{#2}{#4}{#3}}. + \par\mathCodeExample{\paren[Big]{[}{]}{\dfrac{1}{2}}} + \par\mathCodeExample{\paren[Big][]{\dfrac{1}{2}}} + \par\mathCodeExample{\paren[auto]{[}{]}{\dfrac{1}{2}}} + \end{commandlist} + + \subsection{Spacing Helpers}\label{subsec:spacing_helpers} + + \begin{commandlist} + \item[clap] complements the standard \LaTeX\ commands \codeCommand{\llap} and \codeCommand{\rlap}. + These commands horizontally smash their arguments. + \par\codeExample{Let us \llap{smash} something.} + \par\codeExample{Let us \clap{smash} something.} + \par\codeExample{Let us \rlap{smash} something.} + \item[mathllap] corresponds to \codeCommand{\llap} in math mode. + \par\mathCodeExample{\sum_{\mathllap{1\le i\le j\le n}} X_{ij}} + \item[mathclap] corresponds to \codeCommand{\clap} in math mode. + \par\mathCodeExample{\sum_{\mathclap{1\le i\le j\le n}} X_{ij}} + \item[mathrlap] corresponds to \codeCommand{\rlap} in math mode. + \par\mathCodeExample{\sum_{\mathrlap{1\le i\le j\le n}} X_{ij}} + \item[mrep] stands for \emph{math replace} and it typesets an argument while reserving the space for another. + Its syntax is \codeCommand{\mrep[#1]{#2}{#3}} + The first (optional) argument is one of \codeCommand{{l,c,r}} and it is used to define the alignment. + \codeCommand{c} is the default. + \par\mathCodeExample{\mrep[l]{1}{-1}-1} + \par\mathCodeExample{\mrep[c]{1}{-1}-1} + \par\mathCodeExample{\mrep[r]{1}{-1}-1} + \end{commandlist} + + \section{Abbreviations} + \label{sec:abbreviations} + \subsection{English} + \begin{commandlist} + \item[aa] almost all \codeExample{\aa} + \item[ale] almost everywhere \codeExample{\ale} + \item[eg] exempli gratia (for example) \codeExample{\eg} + \item[etc] et cetera (and so on) \codeExample{\etc} + \item[ie] id est (id est) \codeExample{\ie} + \item[iid] independent and identically distributed \codeExample{\iid} + \item[spd] symmetric positive definite \codeExample{\spd} + \item[st] such that or subject to \codeExample{\st} + \item[wrt] with respect to \codeExample{\wrt} + \end{commandlist} + \subsection{German} + \begin{commandlist} + \item[bspw] beispielsweise (for example) \codeExample{\bspw} + \item[bzgl] bezüglich (with regard to) \codeExample{\bzgl} + \item[bzw] beziehungsweise (respectively) \codeExample{\bzw} + \item[Dah] Das heißt (That is, beginning of phrase) \codeExample{\Dah} + \item[dah] das heißt (that is) \codeExample{\dah} + \item[evtl] eventuell (possibly) \codeExample{\evtl} + \item[fs] fast sicher \codeExample{\fs} + \item[fue] fast überall \codeExample{\fue} + \item[IA] Im Allgemeinen (beginning of phrase) \codeExample{\IA} + \item[iA] im Allgemeinen \codeExample{\iA} + \item[idR] in der Regel \codeExample{\idR} + \item[IdR] In der Regel (beginning of phrase) \codeExample{\IdR} + \item[iW] im Wesentlichen \codeExample{\iW} + \item[IW] Im Wesentlichen (beginning of phrase) \codeExample{\IW} + \item[mE] meines Erachtens \codeExample{\mE} + \item[oBdA] ohne Beschränkung der Allgemeinheit \codeExample{\oBdA} + \item[OBdA] ohne Beschränkung der Allgemeinheit (beginning of phrase) \par\codeExample{\OBdA} + \item[og] oben genannt \codeExample{\og} + \item[oae] oder ähnliche \codeExample{\oae} + \item[so] siehe oben \codeExample{\so} + \item[ua] unter anderem \codeExample{\ua} + \item[Ua] Unter anderem (beginning of phrase) \codeExample{\Ua} + \item[ug] unten genannt \codeExample{\ug} + \item[usw] und so weiter (and so on) \justCodeExample{\usw} + \item[uU] unter Umständen \codeExample{\uU} + \item[UnU] Unter Umständen (beginning of phrase) \codeExample{\UnU} + \item[vgl] vergleiche (compare) \codeExample{\vgl} + \item[zB] zum Beisiel \codeExample{\zB} + \item[ZB] Zum Beispiel (beginning of phrase) \codeExample{\ZB} + \item[zHd] zu Händen \codeExample{\zHd} + \end{commandlist} + + \section{Names} + \begin{commandlist} + \item[adimat] \justCodeExample{\adimat} + \item[ampl] \justCodeExample{\ampl} + \item[BibTeX] \justCodeExample{\BibTeX} + \item[BibLaTeX] \justCodeExample{\BibLaTeX} + \item[cg] \justCodeExample{\cg} + \item[cpp] \justCodeExample{\cpp} + \item[cppmat] \justCodeExample{\cppmat} + \item[dolfin] \justCodeExample{\dolfin} + \item[dolfinplot] \justCodeExample{\dolfinplot} + \item[dolfinadjoint] \justCodeExample{\dolfinadjoint} + \item[doxygen] \justCodeExample{\doxygen} + \item[femorph] \justCodeExample{\femorph} + \item[fenics] \justCodeExample{\fenics} + \item[ffc] \justCodeExample{\ffc} + \item[fmg] \justCodeExample{\fmg} + \item[fortran] \justCodeExample{\fortran} + \item[gitlab] \justCodeExample{\gitlab} + \item[gmres] \justCodeExample{\gmres} + \item[gmsh] \justCodeExample{\gmsh} + \item[ipopt] \justCodeExample{\ipopt} + \item[libsvm] \justCodeExample{\libsvm} + \item[liblinear] \justCodeExample{\liblinear} + \item[macmpec] \justCodeExample{\macmpec} + \item[manifoldsjl] \justCodeExample{\manifoldsjl} + \item[manopt] \justCodeExample{\manopt} + \item[manoptjl] \justCodeExample{\manoptjl} + \item[mathematica] \justCodeExample{\mathematica} + \item[matlab] \justCodeExample{\matlab} + \item[maple] \justCodeExample{\maple} + \item[maxima] \justCodeExample{\maxima} + \item[metis] \justCodeExample{\metis} + \item[minres] \justCodeExample{\minres} + \item[mshr] \justCodeExample{\mshr} + \item[mvirt] \justCodeExample{\mvirt} + \item[numpy] \justCodeExample{\numpy} + \item[paraview] \justCodeExample{\paraview} + \item[pdflatex] \justCodeExample{\pdflatex} + \item[perl] \justCodeExample{\perl} + \item[petsc] \justCodeExample{\petsc} + \item[pymat] \justCodeExample{\pymat} + \item[python] \justCodeExample{\python} + \item[scikit] \justCodeExample{\scikit} + \item[scikitlearn] \justCodeExample{\scikitlearn} + \item[scipy] \justCodeExample{\scipy} + \item[sphinx] \justCodeExample{\sphinx} + \item[subgmres] \justCodeExample{\subgmres} + \item[subminres] \justCodeExample{\subminres} + \item[superlu] \justCodeExample{\superlu} + \item[svmlight] \justCodeExample{\svmlight} + \item[tritetmesh] \justCodeExample{\tritetmesh} + \item[ufl] \justCodeExample{\ufl} + \item[uqlab] \justCodeExample{\uqlab} + \item[viper] \justCodeExample{\viper} + \item[xml] \justCodeExample{\xml} + \end{commandlist} + + \section{Semantic Commands} + \label{sec:semantic} + Build upon Syntax from \cref{sec:syntax} this part provides semantic mathematical commands. + + \begin{commandlist} + \item[abs] absolute value. + Its syntax is \codeCommand{\abs[#1]{#2}}. + The first (optional) argument is used to scale the delimiters enclosing the arguments to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the argument. + \par\mathCodeExample{\abs{a}} + \par\mathCodeExample{\abs[Big]{\dfrac{1}{2}}} + \par\mathCodeExample{\abs[auto]{\dfrac{1}{2}}} + \item[aff] affine hull \mathCodeExample{\aff} + \item[arcosh] area hyperbolic cosine \mathCodeExample{\arcosh} + \item[arcoth] area hyperbolic cotangens \mathCodeExample{\arcoth} + \item[argmax] maximizer of a function + \mathCodeExample{\argmax_{x \in \bbR} f(x)} % chktex 6 + \item[Argmax] set of maximizers of a function + \mathCodeExample{\Argmax_{x \in \bbR} f(x)} % chktex 6 + \item[argmin] minimizer of a function + \mathCodeExample{\argmin_{x \in \bbR} f(x)} % chktex 6 + \item[Argmin] set of minimizers of a function + \mathCodeExample{\Argmin_{x \in \bbR} f(x)} % chktex 6 + \item[arsinh] area hyperbolic cotangens \mathCodeExample{\arsinh} + \item[artanh] area hyperbolic tangens \mathCodeExample{\artanh} + \item[bdiv] bold (meaning: vector) divergence of a matrix-valued function \mathCodeExample{\bdiv} + \item[ceil] integer larger or equal to input. + Its syntax is \codeCommand{\ceil[#1]{#2}}. + The first (optional) argument is used to scale the delimiters enclosing the arguments to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the argument. + \par\mathCodeExample{\ceil{a}} + \par\mathCodeExample{\ceil[Big]{\dfrac{1}{2}}} + \item[clconv] closure of the convex hull of a set \mathCodeExample{\clconv M} + \item[closure] closure of a set \mathCodeExample{\closure M} + \item[cofac] cofactor matrix \mathCodeExample{\cofac(A)} + \item[compactly] compact embedding of topological spaces \mathCodeExample{\compactly} + \item[cone] conic hull \mathCodeExample{\cone} + \item[conv] convex hull of a set \mathCodeExample{\conv M} + \item[corresponds] binary operator for correspondence \mathCodeExample{A\corresponds B} + \item[cov] covariance \mathCodeExample{\cov} + \item[curl] the curl operator \mathCodeExample{\curl} + \item[d, dInt] integral symbol with prepended space, as in + \par\mathCodeExample{\int_\bbR \exp(-x^2) \d x} + \\Since \codeCommand{\d} is often overridden, \codeCommand{\dInt} is the safe alternative + \item[dev] deviator of a matrix \mathCodeExample{\dev A} + \item[diag] diagonal matrix composed of entries in a vector, or diagonal of a matrix + \par\mathCodeExample{\diag(a)} + \par\mathCodeExample{\diag(A)} + \item[diam] diameter \mathCodeExample{\diam(M)} + \item[distOp] the mathematical operator denoting the distance + \par\mathCodeExample{\distOp} + \item[dist] distance from a point to a set. + Its syntax is \codeCommand{\dist[#1]{#2}{#3}} or \codeCommand{\dist[#1]{#2}}. + The first (optional) argument is used to scale the parentheses enclosing the argument to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the set. + The third argument denotes the point; it can be omitted. + The command \codeCommand{\distOp} is used to typeset the operator. + \par\mathCodeExample{\dist[Big]{\cC}{\dfrac{x}{2}}} + \par\mathCodeExample{\dist{\cC}} + \par\mathCodeExample{\dist} + \item[div] divergence \mathCodeExample{\div} + \item[Div] (row-wise) divergence \mathCodeExample{\Div} + \item[dom] domain \mathCodeExample{\dom} + \item[dotcup] distinct union \mathCodeExample{\dotcup} + \item[dprod] double contraction of matrices $A \dprod B = \sum_{i,j} A_{ij} B_{ij} = \trace(A^\transp B)$ + \par\mathCodeExample{A \dprod B} + \item[dual] duality pairing. + Its syntax is \codeCommand{\dual[#1]{#2}{#3}}. + The first (optional) argument is used to scale the delimiters enclosing the arguments to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the first factor. + The third argument denotes the second factor. + \par\mathCodeExample{\dual{x^*}{x}} + \par\mathCodeExample{\dual[Big]{x^*}{\dfrac{1}{2}}} + \item[e] Euler's number \mathCodeExample{\e} + \item[embed] embedding of topological spaces \mathCodeExample{\embed} + \item[embeds] synonym of \codeCommand{\embed} \mathCodeExample{\embeds} + \item[epi] epigraph \mathCodeExample{\epi} + \item[eR] extended real line \mathCodeExample{\eR = \bbR \cup \{\pm \infty\}} + \item[essinf] essential infimum \par \mathCodeExample{\displaystyle\essinf_{x \in \bbR} f(x)} % chktex 1 chktex 6 + \item[esssup] essential supremum \par \mathCodeExample{\displaystyle\esssup_{x \in \bbR} f(x)} % chktex1 chktex 6 + \item[file] typesets a file name (using \codeCommand{nolinkurl}) + \par\codeExample{\file{test.txt}} + \item[floor] integer less or equal to input. + Its syntax is \codeCommand{\floor[#1]{#2}}. + The first (optional) argument is used to scale the delimiters enclosing the arguments to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the argument. + \par\mathCodeExample{\floor{a}} + \par\mathCodeExample{\floor[Big]{\dfrac{1}{2}}} + \item[grad] gradient (of a function) \mathCodeExample{\grad F} %chktex 1 + \item[Graph] graph of a function \mathCodeExample{\Graph} + \item[id] identity operator \mathCodeExample{\id} + \item[image] image of a function \mathCodeExample{\image} + \item[inj] injectivity (radius) \mathCodeExample{\inj} + \item[inner] inner product. + Its syntax is \codeCommand{\inner[#1]{#2}{#3}}. + The first (optional) argument is used to scale the parentheses enclosing the arguments to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the first factor. + The third argument denotes the second factor. + \par\mathCodeExample{\inner{a}{b}} + \par\mathCodeExample{\inner[Big]{a}{\dfrac{b}{2}}} + \item[interior] \mathCodeExample{\interior} + \item[jump] jump of a quantity, \eg, across a finite element facet. + Its syntax is \codeCommand{\jump[#1]{#2}}. + The first (optional) argument is used to scale the delimiters enclosing the arguments to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the argument. + \par\mathCodeExample{\jump{a}} + \par\mathCodeExample{\jump[Big]{\dfrac{1}{2}}} + \item[laplace] the Laplace operator \mathCodeExample{\laplace u} %chktex 1 + \item[lin] linear hull of a set of vectors \mathCodeExample{\lin\{v_1,v_2\}} + \item[norm] norm of a vector. + Its syntax is \codeCommand{\norm[#1]{#2}}. + The first (optional) argument is used to scale the delimiters enclosing the arguments to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the argument. + \par\mathCodeExample{\norm{a}} + \par\mathCodeExample{\norm[Big]{\dfrac{c}{2}}} + \par\mathCodeExample{\norm[auto]{\dfrac{c}{2}}} + % + \item[projOp] the mathematical operator denoting the projection \mathCodeExample{\projOp} + \par\mathCodeExample{\projOp} + \item[proj] projection onto a set. + Its syntax is \codeCommand{\proj[#1]{#2}(#3)} or \codeCommand{\proj[#1]{#2}}. + The first (optional) argument is used to scale the parentheses enclosing the argument to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the set and can also be left out. + The third argument denotes the point; it can be omitted. + The command \codeCommand{\projOp} is used to typeset the operator. + \par\mathCodeExample{\proj} + \par\mathCodeExample{\proj(x)} + \par\mathCodeExample{\proj{\cC}} + \par\mathCodeExample{\proj{\cC}(x)} + \par\mathCodeExample{\proj[Big](\dfrac{x}{2})} + \par\mathCodeExample{\proj[Big]{\cC}(\dfrac{x}{2})} + \item[proxOp] the mathematical operator denoting the proximal map + \par\mathCodeExample{\proxOp} + \item[prox] the proximal operator of a function. + Its syntax is \codeCommand{\prox[#1]{#2}(#3)} or \codeCommand{\prox[#1]{#2}}. + The first (optional) argument is used to scale the parentheses enclosing the argument to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the set. + The third argument denotes the point; it can be omitted. + The command \codeCommand{\proxOp} is used to typeset the operator. + \par\mathCodeExample{\prox} + \par\mathCodeExample{\prox{\lambda F}} % chktex 1 + \par\mathCodeExample{\prox{\lambda F}(x)} % chktex 1 + \par\mathCodeExample{\prox[auto]{\lambda F}(\dfrac{x}{2})} %chktex 1 + \item[rank] rank (of a matrix) \mathCodeExample{\rank} + \item[range] range of some operator \mathCodeExample{\range} + \item[restr] restriction/evaluation. + Its syntax is \codeCommand{\restr[#1]{#2}{#3}}. + The first (optional) argument is used to scale the deliminters enclosing the arguments to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the argument to be restricted/evaluated. + The third argument denotes the restriction set/evaluation point. + \par\mathCodeExample{\restr[auto]{\frac{\d}{\d t}(f \circ \gamma)(t)}{t=0}} + \item[ri] relative interior \mathCodeExample{\ri} + + + \item[setDef] define a set, where \codeCommand{\setMid} serves as the center divider. + Its syntax is \codeCommand{\setDef[#1]{#2}{#3}}. + The first (optional) argument is used to scale the parentheses enclosing the argument and the center divider to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the left part of the definition, naming the potential elements of the set being defined. + The third argument denotes the condition to include the elements in the set. + \par\mathCodeExample{\setDef{x\in\bbR}{x>5}}\\ + \par\mathCodeExample{\setDef[Big]{x\in\bbR}{x>\dfrac{1}{2}}} + \item[setMid] divider within \codeCommand{\setDef} (set definitions). + \\This defaults to \mathCodeExample{\setMid}. + \item[sgn] sign \mathCodeExample{\sgn} + \item[Sgn] sign (set valued) \mathCodeExample{\Sgn} + \item[supp] support (of a function) \mathCodeExample{\supp F} % chktex 1 + \item[sym] symmetric part (of a matrix) \mathCodeExample{\sym A} % chktex 1 + \item[trace] trace (of a matrix) \mathCodeExample{\trace A} % chktex 1 + \item[transp] transpose of a vector or matrix. + \par\mathCodeExample{A^\transp} + \item[transposeSymbol] symbol to use for the transpose + \par\mathCodeExample{\transposeSymbol} + \item[var] variance \mathCodeExample{\var} + \item[weakly] weak convergence of a sequence \mathCodeExample{\weakly} + \item[weaklystar] weak star convergence of a sequence \mathCodeExample{\weaklystar} + \end{commandlist} + + \section{Additional Semantics by Topic}\label{sec:semantics-by-topic} + +While semantic commands might be suitable for all mathematical topics, the following subsections collect commands which are most useful in one particular mathematical area and hence might clutter the general semantic file. +Any semantic topic files should always build on \file{mathsemantics-semantic.sty}. + + +\subsection{Manifolds: \texorpdfstring{\file{mathsemantics-manifolds.sty}}{mathsemantics-manifolds.sty}}\label{subsec:manifolds} + +The semantic file \file{mathsemantics-manifolds.sty} collects definitions and notations for Riemannian manifolds. +\begin{commandlist} + \item[bitangentSpace] the bi tangent space. + Its syntax is \codeCommand{\bitangent{#1}[#2]}. + The first argument denotes the base point. + The second (optional) argument denotes the manifold, which defaults to $\cM$. + \par\mathCodeExample{\bitangentSpace{p}} + \par\mathCodeExample{\bitangentSpace{q}[\cN]} + \item[bitangentSpaceSymbol] the symbol used within \codeCommand{\bitangentSpace}. + \par\mathCodeExample{\bitangentSpaceSymbol} + \item[cotangentSpace] the cotangent space. + Its syntax is \codeCommand{\cotangentSpace{#1}[#2]}. + The first argument denotes the base point. + The second (optional) argument denotes the manifold, which defaults to $\cM$. + \par\mathCodeExample{\cotangentSpace{p}} + \par\mathCodeExample{\cotangentSpace{q}[\cN]} + \item[cotangentBundle] the cotangent bundle. + Its syntax is \codeCommand{\cotangentBundle[#1]}. + The (optional) argument denotes the manifold, which defaults to $\cM$. + \par\mathCodeExample{\cotangentBundle} + \par\mathCodeExample{\cotangentBundle[\cN]} + \item[cotangentSpaceSymbol] the symbol used within \codeCommand{\cotangent}. + \par\mathCodeExample{\cotangentSpaceSymbol} + \item[covariantDerivative] is the covariant derivative. + Its syntax is \codeCommand{\covariantDerivative{#1}[#2]}. + The first argument is the vector (or vector field) determining the direction of differentiation. + The second (optional) argument denotes the tensor field being differentiated. + \par\mathCodeExample{\covariantDerivative{X}{Y}} + \item[covariantDerivativeSymbol]\hspace{4em}the symbol used for the covariant derivative \codeCommand{\covariantDerivative}. + \par\mathCodeExample{\covariantDerivativeSymbol} + \item[exponential] the exponential map. + Its syntax is \codeCommand{\exponential[#1]{#2}(#3)}. + The first argument can be used to scale the third. + The second argument denotes the base point and is mandatory. + The third argument denotes the tangent vector, which is optional, but if provided, the argument is put in brackets. + The first following example illustrates the case, where no brackets are put. + Note that the space is mandatory. + \par\mathCodeExample{\exponential{p}X} + \par\mathCodeExample{\exponential{p}(X)} + \par\mathCodeExample{\exponential[Big]{p}(\frac{X}{2})} + \item[expOp] the symbol used within the \codeCommand{\exponential}. + \par\mathCodeExample{\expOp} + \item[geodesic] a geodesic. + Its syntax is \codeCommand{\geodesic|#1|<#2>[#3]{#4}{#5}(#6)}.% chktex 6 + The first argument can be used to use a different symbol (locally) for the geodesic + The second (optional) argument is used to modify the style of the geodesic (\codeCommand{s}ymbol, \codeCommand{l}ong, \codeCommand{a}rc or \codeCommand{p}lain, where the last is the default) + The third (optional) argument is used to scale the parentheses enclosing the argument to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + It is ignored when the sixth argument is not given. + The fourth argument denotes the initial point (at $t = 0$). + The fifth argument denotes either the final point (at $t = 1$) for types~\codeCommand{l} and \codeCommand{a}, or the initial tangent vector for type~\codeCommand{p}. + The sixth (optional) argument denotes the evaluation point. + The command \codeCommand{\geodesicSymbol} is used to typeset the geodesic symbol default (i.e. globally) + % \begin{itemize} + % \item a style might be given in \lstinline!<>! as first, optional argument + % \item the second argument in \lstinline![]! is again scaling of the argument (ignored for \lstinline!s! or if the last is not given) + % \item the third and fourth in usual curly braces are also optional and refer to either start and end point or start point and tangent, + % \item the argument of the geodesic is given in \lstinline!()! as fifth argument + % \end{itemize} + % Note that omitting the third and fourth might lead to undesired print, especially for \lstinline!l!ong. + \par\mathCodeExample{\geodesic<s>} + \par\mathCodeExample{\geodesic<s>(t)} %chktex 36 + \par\mathCodeExample{\geodesic<l>{p}{q}} + \par\mathCodeExample{\geodesic<l>{p}{q}(t)} %chktex 36 + \par\mathCodeExample{\geodesic<a>{p}{q}} + \par\mathCodeExample{\geodesic<a>[Big]{p}{q}(\dfrac{t}{2})} %chktex 36 + \par\mathCodeExample{\geodesic<p>{p}{X}} + \par\mathCodeExample{\geodesic<p>{p}{X}(t)} %chktex 36 + \par\mathCodeExample{\geodesic<p>[Big]{p}{X}(\dfrac{t}{2})} %chktex 36 + \par\mathCodeExample{\geodesic[big]{p}{X}((1-t)t)} %chktex 36 + \par\mathCodeExample{\geodesic|\dot\gamma|{p}{X}(t)} %chktex 36 + \item[geodesicSymbol] symbol to use for the geodesic in \codeCommand{\geodesic} + \par\mathCodeExample{\geodesicSymbol} + \item[inverseRetract] use an inverse retraction, the arguments are similar to \codeCommand{\logarithm} but use the \codeCommand{\retractionSymbol} + \par\mathCodeExample{\inverseRetract{p}q} + \par\mathCodeExample{\inverseRetract{p}(q)} + \par\mathCodeExample{\inverseRetract[Big]{p}(q)} + \item[logarithm] the logarithmic map. + Its syntax is \codeCommand{\logarithm[#1]{#2}(#3)}. + The first argument can be used to scale the third. + The second argument denotes the base point and is mandatory. + The third argument denotes another point, which is optional, but + if provided, the argument is put in brackets. The first following example + illustrates the case, where no brackets are put. Note that the space is + mandatory. + \par\mathCodeExample{\logarithm{p}q} + \par\mathCodeExample{\logarithm{p}(q)} + \par\mathCodeExample{\logarithm[Big]{p}(q)} + \item[logOp] the symbol used within the \codeCommand{\logarithm}. + \par\mathCodeExample{\logOp} + \item[parallelTransport] the parallel transport.\\ + Its syntax is \codeCommand{\parallelTransport[#1]{#2}{#3}(#4){5}}. + The first (optional) argument is used to scale the parentheses enclosing the argument \#4.\cref{footnote:amsmath_sizes} + The second argument is the start point of parallel transport on a manifold. + The third argument is the end point of parallel transport on a manifold. + The fourth (optional) argument is the tangent vector that is transported. + Putting it in brackets enables the scaling by the first argument. + The fifth (optional) argument specifies an exponent, for example to parallel transport along a curve $c$ + \par\mathCodeExample{\parallelTransport{p}{q}X} + \par\mathCodeExample{\parallelTransport{p}{q}(X)} + \par\mathCodeExample{\parallelTransport[big]{p}{q}(X)} + \par\mathCodeExample{\parallelTransport{p}{q}(X)[c]} + \par\mathCodeExample{\parallelTransport{p}{q}[c]} + \item[parallelTransportDir] similar to \codeCommand{\parallelTransport}, but the third + argument is a direction to transport into. This can be rewritten to the classical notation + applying an exponential map from the base point (\#2) to th direction (\#3). + The fifth (optional) argument specifies an exponent, for example to parallel transport along a curve $c$ + \par\mathCodeExample{\parallelTransportDir{p}{Y}X} + \par\mathCodeExample{\parallelTransportDir{p}{Y}(X)} + \par\mathCodeExample{\parallelTransportDir[big]{p}{Y}(X)} + \par\mathCodeExample{\parallelTransportDir{p}{Y}(X)[c]} + \par\mathCodeExample{\parallelTransportDir{p}{Y}[c]} + \item[parallelTransportSymbol]\hspace*{2em}the symbol to use within \codeCommand{\parallelTransport} and \codeCommand{\parallelTransportDir} + \par\mathCodeExample{\parallelTransportSymbol} + \item[retract] a retraction.\\ + Its syntax is \codeCommand{\retract[#1]{#2}{#3}}. + The first argument can be used to scale the third. + The second argument denotes the base point. + The third argument denotes the tangent vector, which is optional, but + if provided, the argument is put in brackets. The first following example + illustrates the case, where no brackets are put. Note that the space is + mandatory. + \par\mathCodeExample{\retract{p}X} + \par\mathCodeExample{\retract{p}(X)} + \par\mathCodeExample{\retract[Big]{p}(\frac{X}{2})} + \item[retractionSymbol] symbol to use for a retraction and an inverse retraction, + see \codeCommand{\retract} and \codeCommand{\inverseRetract}. + \par\mathCodeExample{\retractionSymbol} + \item[riemannian] the Riemannian metric (family of inner products on the tangent spaces). + Its syntax is \codeCommand{\riemannian[#1]{#2}{#3}[#4]}. + The first (optional) argument is used to scale the parentheses enclosing the argument to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the first factor. + The third argument denotes the second factor. + The fourth (optional) argument denotes the base point of the tangent space. + \par\mathCodeExample{\riemannian{X_1}{X_2}} + \par\mathCodeExample{\riemannian{Y_1}{Y_2}[q]} + \par\mathCodeExample{\riemannian[Big]{\dfrac{1}{2}X_1}{X_2}[p]} + \item[riemanniannorm] the norm induced by the Riemannian metric.\\ + Its syntax is \codeCommand{\riemanniannorm[#1]{#2}[#3]}. + The first (optional) argument is used to scale the parentheses enclosing the argument to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the argument. + The third (optional) argument denotes the base point of the tangent space. + \par\mathCodeExample{\riemanniannorm{X}} + \par\mathCodeExample{\riemanniannorm{Y}[p]} + \par\mathCodeExample{\riemanniannorm[Big]{\dfrac{1}{2}X}[p]} + \item[secondCovariantDerivative]\hspace*{3em}is the second-order covariant derivative.\\ + Its syntax is \codeCommand{\secondCovariantDerivative{#1}{#2}[#3]}. + The first argument is the vector (or vector field) determining the first direction of differentiation. + The second argument is the vector (or vector field) determining the second direction of differentiation. + The third (optional) argument denotes the tensor field being differentiated. + \par\mathCodeExample{\secondCovariantDerivative{X}{Y}{T}} + \item[secondCovariantDerivativeSymbol]\hspace*{6em} the symbol used for the second covariant derivative.\\ + This is used within \codeCommand{\secondCovariantDerivative}. + \par\mathCodeExample{\secondCovariantDerivativeSymbol} + \item[tangentSpace] the tangent space. + Its syntax is \codeCommand{\tangentSpace{#1}[#2]}. + The first argument denotes the base point. + The second (optional) argument denotes the manifold, which defaults to $\cM$. + \par\mathCodeExample{\tangentSpace{p}} + \par\mathCodeExample{\tangentSpace{q}[\cN]} + \item[tangentBundle] the tangent bundle. + Its syntax is \codeCommand{\tangentBundle[#1]}. + The (optional) argument denotes the manifold, which defaults to $\cM$. + \par\mathCodeExample{\tangentBundle} + \par\mathCodeExample{\tangentBundle[\cN]} + \item[tangentSpaceSymbol] the symbol used within \codeCommand{\tangent}. + \par\mathCodeExample{\tangentSpaceSymbol} + \item[tensorBundle] the tensor bundle. + Its syntax is \codeCommand{\tensorBundle{#1}{#2}[#3]}. + The first argument denotes the number $r$ of elements of the cotangent space the tensors accept. + The second argument denotes the number $s$ of elements of the tangent space the tensors accept. + The third (optional) argument denotes the manifold, which defaults to $\cM$. + \par\mathCodeExample{\tensorBundle{r}{s}} + \par\mathCodeExample{\tensorBundle{r}{s}[\cN]} + \item[tensorSpace] a tensor space over a vector space~$V$. + Its syntax is \codeCommand{\tensorSpace{#1}{#2}[#3]}. + The first argument denotes the number $r$ of elements of the dual space~$V^*$ the tensors accept. + The second argument denotes the number $s$ of elements of the space~$V$ the tensors accept. + The third (optional) argument denotes the vector space, which defaults to empty. + \par\mathCodeExample{\tensorSpace{r}{s}} + \par\mathCodeExample{\tensorSpace{r}{s}[V]} + \item[tensorSpaceSymbol] the symbol used within \codeCommand{\tensorSpace} and \codeCommand{\tensorBundle}. + \par\mathCodeExample{\tensorSpaceSymbol} + \item[vectorTransport] a vector transport.\\ + Its syntax is \codeCommand{\vectorTransport[#1]{#2}{#3}(#4)[#5]}. + The first (optional) argument is used to scale the parentheses enclosing the argument \#4.\cref{footnote:amsmath_sizes} + The second argument is the start point of vector transport on a manifold. + The third argument is the end point of vector transport on a manifold. + The fourth (optional) argument is the tangent vector that is transported. + Putting it in brackets enables the scaling by the first argument. + Finally a retraction symbol can be added in the exponent to distinguish vector transports as \#5. + \par\mathCodeExample{\vectorTransport{p}{q}X} + \par\mathCodeExample{\vectorTransport{p}{q}(X)} + \par\mathCodeExample{\vectorTransport[big]{p}{q}(X)} + \par\mathCodeExample{\vectorTransport{p}{q}(X)[\retractionSymbol]} + \item[vectorTransportDir] similar to \codeCommand{\vectorTransport}, but the third + argument is a direction to transport into. This can be rewritten to the classical notation + applying an retraction from the base point (\#2) to th direction (\#3). + \par\mathCodeExample{\vectorTransportDir{p}{Y}X} + \par\mathCodeExample{\vectorTransportDir{p}{Y}(X)} + \par\mathCodeExample{\vectorTransportDir[big]{p}{Y}(X)} + \par\mathCodeExample{\vectorTransportDir{p}{Y}(X)[\retractionSymbol]} + \item[vectorTransportSymbol]\hspace*{2em}the symbol to use within \codeCommand{\vectorTransport} and \codeCommand{\vectorTransportDir} + \par\mathCodeExample{\vectorTransportSymbol} +\end{commandlist} + + +\subsection{Optimization: \texorpdfstring{\file{mathsemantics-optimization.sty}}{mathsemantics-optimization.sty}}\label{subsec:optimization} + +The semantic file \file{mathsemantics-optimization.sty} collects definitions and notations related to optimization. +\begin{commandlist} + \item[linearizingcone] the linearizing cone. + Its syntax is \codeCommand{\linearizingcone[#1]{#2}{#3}}. + The first (optional) argument is used to scale the parentheses enclosing the argument to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the set. + The third argument denotes the base point. + \par\mathCodeExample{\linearizingcone{A}{x}} + \par\mathCodeExample{\linearizingcone{A}{x^2}} + \par\mathCodeExample{\linearizingcone[big]{A}{x^2}} + + \item[normalcone] the normal cone. + Its syntax is \codeCommand{\normalcone[#1]{#2}{#3}}. + The first (optional) argument is used to scale the parentheses enclosing the argument to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the set. + The third argument denotes the base point. + \par\mathCodeExample{\normalcone{A}{x}} + \par\mathCodeExample{\normalcone{A}{x^2}} + \par\mathCodeExample{\normalcone[big]{A}{x^2}} + + \item[polarcone] the polar cone of a set \mathCodeExample{\polarcone{A}} + + \item[radialcone] the radial cone. + Its syntax is \codeCommand{\radialcone[#1]{#2}{#3}}. + The first (optional) argument is used to scale the parentheses enclosing the argument to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the set. + The third argument denotes the base point. + \par\mathCodeExample{\radialcone{A}{x}} + \par\mathCodeExample{\radialcone{A}{x^2}} + \par\mathCodeExample{\radialcone[big]{A}{x^2}} + + \item[tangentcone] the tangent cone. + Its syntax is \codeCommand{\tangentcone[#1]{#2}{#3}}. + The first (optional) argument is used to scale the parentheses enclosing the argument to the standard amsmath sizes.\cref{footnote:amsmath_sizes} + The second argument denotes the set. + The third argument denotes the base point. + \par\mathCodeExample{\tangentcone{A}{x}} + \par\mathCodeExample{\tangentcone{A}{x^2}} + \par\mathCodeExample{\tangentcone[big]{A}{x^2}} +\end{commandlist} +\end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/mathsemantics/mathsemantics-manifolds.sty b/macros/latex/contrib/mathsemantics/mathsemantics-manifolds.sty new file mode 100644 index 0000000000..7c3c80d493 --- /dev/null +++ b/macros/latex/contrib/mathsemantics/mathsemantics-manifolds.sty @@ -0,0 +1,197 @@ +% This LaTeX package provides numerous commands relevant to typesetting +% material related to manifolds and differential geometry. +\ProvidesPackage{mathsemantics-manifolds}[2022/05/06] + +% Resolve the dependencies of this package +\RequirePackage{mathsemantics-semantic} + +% Define some symbols +\newcommand{\bitangentSpaceSymbol}{\cT^{**}} +\newcommand{\cotangentSpaceSymbol}{\cT^*} +\newcommand{\covariantDerivativeSymbol}{\textup{D}} +\newcommand{\secondCovariantDerivativeSymbol}{\covariantDerivativeSymbol^2} +\newcommand{\geodesicSymbol}{\gamma} +\@ifundefined{widearc}{% + \DeclareSymbolFont{yhlargesymbols}{OMX}{yhex}{m}{n} + \DeclareMathAccent{\wideparen}{\mathord}{yhlargesymbols}{"F3} + \newcommand{\geodesicArcSymbol}{\wideparen} + }{% + \newcommand{\geodesicArcSymbol}{\widearc} +} +\newcommand{\parallelTransportSymbol}{\textup{P}} +\newcommand{\retractionSymbol}{\textup{retr}} +\newcommand{\tangentSpaceSymbol}{\cT} +\newcommand{\tensorSpaceSymbol}{\cT} +\newcommand{\vectorTransportSymbol}{\textup{T}} + +% Define a command for the bitangent space +% Argument {#1} is the base point +% The optional argument [#2] (default \cM) is the manifold +\NewDocumentCommand{\bitangentSpace}{ m O{\cM} }{\bitangentSpaceSymbol_{#1}#2} + +% Define a command for the cotangent space +% Argument {#1} is the base point +% The optional argument [#2] (default \cM) is the manifold +\NewDocumentCommand{\cotangentSpace}{ m O{\cM} }{\cotangentSpaceSymbol_{#1}\!#2} + +% Define a command for the cotangent bundle +% The optional argument [#1] (default \cM) is the manifold +\NewDocumentCommand{\cotangentBundle}{ O{\cM} }{\cotangentSpaceSymbol\!#1} + +% Define a command for the covariant derivative (connection) +% Argument {#1} is the vector (field) which determines the direction of differentiation +% The optional argument [#2] denotes the tensor field being differentiated +\NewDocumentCommand{\covariantDerivative}{ m O{} }{\covariantDerivativeSymbol_{#1}#2} + +\DeclareMathOperator{\expOp}{exp} +% Define a command for the exponential map +% Argument {#1} is used to scale the brackets around #3 +% Argument {#2} is the source base point +% Argument {#3} is a corresponding tangent vector +\NewDocumentCommand{\exponential}{ O{} m d() }{% + \expOp_{#2}\IfNoValueF{#3}{\enclose[#1]{(}{#3}{)}}% +} + +% Define a command for various versions of geodesic curves +% * The optional argument (#1) can be used to locally set the geodesic symbol. +% note that globally setting it, you can also redefine `\geodesicSymbol' +% * The optional argument <#2> defines the type: [s]symbol, [l]ong, [a]rc, or [p]lain (the default) +% * The optional argument [#2] scales the delimiters +% * Argument {#4} is the initial point (t = 0) of the geodesic +% * Argument {#5} is the final point (t = 1) of the geodesic (for types l and a) +% * Argument {#5} is the initial tangent direction of the geodesic (for type p) +% * The optional argument (#6) denotes the evaluation point +\NewDocumentCommand{\geodesic}{ D||{\geodesicSymbol} D<>{plain} o G{} G{} d() }{% + \ifthenelse{\equal{#2}{s}}{% + {#1}% format: just the symbol + \IfNoValueF{#6}{\enclose[#3]{(}{#6}{)}}% if arg given + }{% not s + \ifthenelse{\equal{#2}{l}}{% long form + {#1}% format: arg; p1, p2 + \enclose[#3]{(}{% + \IfNoValueTF{#6}{\cdot}{#6};#4\,,\,#5% + }{)}%print \cdot if not param given + }{% neither s nor l + \ifthenelse{\equal{#2}{a}}{% + {#1}_{\geodesicArcSymbol{#4,#5}}% + \IfNoValueF{#6}{\enclose[#3]{(}{#6}{)}}% if arg given -> print + }{% neither s nor l nor a -> plain + {#1}_{#4,#5}% + \IfNoValueF{#6}{\enclose[#3]{(}{#6}{)}}% if arg given -> print + }% + }% + }% +} + +\DeclareMathOperator{\logOp}{log} +% Define a command for the logarithmic map +% Argument {#1} is used to scale the brackets around #3 +% Argument {#2} is the source base point +% Argument {#3} is a second point +\NewDocumentCommand{\logarithm}{ O{} m d() }{% + \logOp_{#2}\IfNoValueF{#3}{\enclose[#1]{(}{#3}{)}}% +} + +% Define a command for the logarithmic map +% Argument {#1} is used to scale the brackets around #3 +% Argument {#2} is the source base point +% Argument {#3} is a second point +\NewDocumentCommand{\inverseRetract}{ O{} m d() }{% + \retractionSymbol^{-1}_{#2}\IfNoValueF{#3}{\enclose[#1]{(}{#3}{)}}% +} + +% Define a command for the Lie bracket (of two vector fields) +% The optional argument [#1] scales the delimiters +% Argument {#2} is the first vector field +% Argument {#3} is the second vector field +\NewDocumentCommand{\lie}{ O{} m m }{\enclose[#1]{[}{#2,#3}{]}} + +% Define a command for the parallel transport, where +% Argument {#1} (optional) is used to scale the brackets around #4 +% Argument {#2} is the source base point +% Argument {#3} is the destination base point +% Argument {#4} is a tangent vector from the source base points tangent space (in round brackets) +% Argument {#5} (optional) can be used to specify that this parallel transport is along a curve +\NewDocumentCommand{\parallelTransport}{ O{} m m d() O{}}{% + \parallelTransportSymbol^{#5}_{#3\leftarrow#2}% + \IfNoValueF{#4}{\enclose[#1]{(}{#4}{)}}% +} + +% Define a command for the parallel transport with direction, where +% Argument {#1} (optional) is used to scale the brackets around #4 +% Argument {#2} is the source base point +% Argument {#3} is the direction to transport into +% Argument {#4} is a tangent vector from the source base points tangent space (in round brackets) +% Argument {#5} (optional) can be used to specify that this parallel transport is along a curve +\NewDocumentCommand{\parallelTransportDir}{ O{} m m d() O{}}{% + \parallelTransportSymbol^{#5}_{#2,#3}% + \IfNoValueF{#4}{\enclose[#1]{(}{#4}{)}}% +} + +% Define a command for a retraction map +% Argument {#1} is used to scale the brackets around #3 +% Argument {#2} is the source base point +% Argument {#3} is a corresponding tangent vector +\NewDocumentCommand{\retract}{ O{} m d() }{% + \retractionSymbol_{#2}\IfNoValueF{#3}{\enclose[#1]{(}{#3}{)}}% +} + +% Define a command for the Riemannian metric (inner product in the tangent space) +% The optional argument [#1] scales the delimiters +% Argument {#2} is the first tangent vector +% Argument {#3} is the second tangent vector +% The optional argument [#4] can be used to denote the base point or to specify the metric +\NewDocumentCommand{\riemannian}{ O{} m m O{} }{\enclose[#1]{(}{#2\,,\,#3}{)}_{#4}} + +% Define a command for the norm induced by the Riemannian metric (inner product in the tangent space) +% The optional argument [#1] scales the delimiters +% Argument {#2} is the tangent vector +% The optional argument [#3] can be used to denote the base point or to specify the metric +\NewDocumentCommand{\riemanniannorm}{ O{} m O{} }{\norm[#1]{#2}_{#3}} + +% Define a command for the second covariant derivative +% Argument {#1} is the vector (field) which determines the first direction of differentiation +% Argument {#2} is the vector (field) which determines the second direction of differentiation +% The optimal argument (#3) denotes the tensor field being differentiated +\NewDocumentCommand{\secondCovariantDerivative}{ m m O{} }{\secondCovariantDerivativeSymbol_{#1,#2}#3} + +% Define a command for the tangent space +% Argument {#1} is the base point +% The optional argument [#2] (default \cM) is the manifold +\NewDocumentCommand{\tangentSpace}{ m O{\cM} }{\tangentSpaceSymbol_{#1}#2} + +% Define a command for the tangent bundle +% The optional argument [#1] (default \cM) is the manifold +\NewDocumentCommand{\tangentBundle}{ O{\cM} }{\tangentSpaceSymbol{}#1} + +% Define a command for the (r,s)-tensor bundle +% Argument {#1} is the number r of elements of the cotangent space the tensors accept. +% Argument {#2} is the number s of elements of the tangent space the tensors accept. +% The optimal argument [#3] (default \cM) is the manifold +\NewDocumentCommand{\tensorBundle}{ m m O{\cM} }{\tensorSpaceSymbol^{(#1,#2)}#3} + +% Define a command for the space of (r,s)-tensors over a vector space V +% Argument {#1} is the number r of elements of the dual space V^* the tensors accept. +% Argument {#2} is the number s of elements of the space V the tensors accept. +% The optimal argument [#3] (default empty) denotes the vector space V. +\NewDocumentCommand{\tensorSpace}{ m m O{} }{\tensorSpaceSymbol^{(#1,#2)}\IfNoValueF{#3}{(#3)}} + +% Define a command for the general vector transport, where +% Argument {#1} (optional) is used to scale the brackets around #4 +% Argument {#2} is the source base point +% Argument {#3} is the destination base point +% Argument {#4} (optional) is a tangent vector from the source base point's tangent space +% Argument {#5} (optional) can be used to specify that this vector transport is from a retraction or symmetric +\NewDocumentCommand{\vectorTransport}{ O{} m m d() O{}}{% + \vectorTransportSymbol_{#3\leftarrow#2}^{#5}\IfNoValueF{#4}{\enclose[#1]{(}{#4}{)}}% +} + +% Define a command for the general vector transport with direction, where +% Argument {#1} (optional) is used to scale the brackets around #4 +% Argument {#2} is the source base point +% Argument {#3} is the dirction to transport to (using the retraction in #5) +% Argument {#4} (optional) is a tangent vector from the source base point's tangent space +% Argument {#5} (optional) can be used to specify that this vector transport is from a retraction or symmetric +\NewDocumentCommand{\vectorTransportDir}{ O{} m m d() O{}}{% + \vectorTransportSymbol_{#2,#3}^{#5}\IfNoValueF{#4}{\enclose[#1]{(}{#4}{)}}% +} diff --git a/macros/latex/contrib/mathsemantics/mathsemantics-names.sty b/macros/latex/contrib/mathsemantics/mathsemantics-names.sty new file mode 100644 index 0000000000..360e889eca --- /dev/null +++ b/macros/latex/contrib/mathsemantics/mathsemantics-names.sty @@ -0,0 +1,65 @@ +\ProvidesPackage{mathsemantics-names}[2022/05/06] + +% Resolve the dependencies of this package +\RequirePackage{mathsemantics-commons} + +% Define a default markdown for named (mostly software related) +% packages, and some commands for often-used packages as well +\newcommand{\namemd}[1]{\textsc{#1}\xspace} +\newcommand{\adimat}{\namemd{ADiMat}} +\newcommand{\ampl}{\namemd{AMPL}} +\newcommand{\BibTeX}{\namemd{Bib\TeX}} +\newcommand{\BibLaTeX}{\namemd{Bib\LaTeX}} +\newcommand{\cg}{\namemd{CG}} +\newcommand{\cpp}{\namemd{C++}} +\newcommand{\cppmat}{\namemd{cppmat}} +\newcommand{\dolfin}{\namemd{Dolfin}} +\newcommand{\dolfinplot}{\namemd{Dolfin-Plot}} +\newcommand{\dolfinadjoint}{\namemd{Dolfin-Adjoint}} +\newcommand{\doxygen}{\namemd{Doxygen}} +\newcommand{\femorph}{\namemd{FEMorph}} +\newcommand{\fenics}{\namemd{FEniCS}} +\newcommand{\ffc}{\namemd{FFC}} +\newcommand{\fmg}{\namemd{FMG}} +\newcommand{\fortran}{\namemd{Fortran}} +\newcommand{\gitlab}{\namemd{GitLab}} +\newcommand{\gmres}{\namemd{Gmres}} +\newcommand{\gmsh}{\namemd{Gmsh}} +\newcommand{\ipopt}{\namemd{Ipopt}} +\newcommand{\libsvm}{\namemd{LIBSVM}} +\newcommand{\liblinear}{\namemd{LIBLINEAR}} +\newcommand{\macmpec}{\namemd{MacMPEC}} +\newcommand{\manifoldsjl}{\namemd{Manifolds.jl}} +\newcommand{\manopt}{\namemd{Manopt}} +\newcommand{\manoptjl}{\namemd{Manopt.jl}} +\newcommand{\mathematica}{\namemd{Mathematica}} +\newcommand{\matlab}{\namemd{Matlab}} +\newcommand{\maple}{\namemd{Maple}} +\newcommand{\maxima}{\namemd{Maxima}} +\newcommand{\meshio}{\namemd{meshio}} +\newcommand{\metis}{\namemd{Metis}} +\newcommand{\minres}{\namemd{Minres}} +\newcommand{\mshr}{\namemd{mshr}} +\newcommand{\mvirt}{\namemd{MVIRT}} +\newcommand{\numapde}{\namemd{numapde}} +\newcommand{\numpy}{\namemd{NumPy}} +\newcommand{\paraview}{\namemd{Paraview}} +\newcommand{\pdflatex}{\namemd{PDF\LaTeX}} +\newcommand{\perl}{\namemd{Perl}} +\newcommand{\petsc}{\namemd{PETSc}} +\newcommand{\pymat}{\namemd{pymat}} +\newcommand{\python}{\namemd{Python}} +\newcommand{\scikit}{\namemd{SciKit}} +\newcommand{\scikitlearn}{\namemd{SciKit-learn}} +\newcommand{\scipy}{\namemd{SciPy}} +\newcommand{\sphinx}{\namemd{Sphinx}} +\newcommand{\subgmres}{\namemd{SubGmres}} +\newcommand{\subminres}{\namemd{SubMinres}} +\newcommand{\superlu}{\namemd{SuperLU}} +\newcommand{\svmlight}{\namemd{SVM${}^\text{light}$}} +\newcommand{\TikZ}{Ti\textit{k}Z\xspace} +\newcommand{\tritetmesh}{\namemd{TriTetMesh}} +\newcommand{\ufl}{\namemd{UFL}} +\newcommand{\uqlab}{\namemd{UQLab}} +\newcommand{\viper}{\namemd{Viper}} +\newcommand{\xml}{\namemd{XML}}
\ No newline at end of file diff --git a/macros/latex/contrib/mathsemantics/mathsemantics-optimization.sty b/macros/latex/contrib/mathsemantics/mathsemantics-optimization.sty new file mode 100644 index 0000000000..fecbf027d7 --- /dev/null +++ b/macros/latex/contrib/mathsemantics/mathsemantics-optimization.sty @@ -0,0 +1,40 @@ +% This LaTeX package provides numerous commands relevant to typesetting +% material related to manifolds and differential geometry. +\ProvidesPackage{mathsemantics-optimization}[2022/05/06] + +% Resolve the dependencies of this package +\RequirePackage{mathsemantics-semantic} + +% Define some symbols +\newcommand{\normalCone}{\cN} +\newcommand{\radialCone}{\cK} +\newcommand{\tangentCone}{\cT} +\newcommand{\linearizingCone}{\cT^{\textup{lin}}} + +% Define a command for the radial cone +% The optional argument [#1] scales the delimiters +% Argument {#2} is the set +% Argument {#3} is the base point +\NewDocumentCommand{\radialcone}{ O{} m m }{\radialCone_{#2}\enclose[#1]{(}{#3}{)}} + +% Define a command for the tangent cone +% The optional argument [#1] scales the delimiters +% Argument {#2} is the set +% Argument {#3} is the base point +\NewDocumentCommand{\tangentcone}{ O{} m m }{\tangentCone_{#2}\enclose[#1]{(}{#3}{)}} + +% Define a command for the linearizing cone +% The optional argument [#1] scales the delimiters +% Argument {#2} is the set +% Argument {#3} is the base point +\NewDocumentCommand{\linearizingcone}{ O{} m m }{\linearizingCone_{#2}\enclose[#1]{(}{#3}{)}} + +% Define a command for the normal cone +% The optional argument [#1] scales the delimiters +% Argument {#2} is the set +% Argument {#3} is the base point +\NewDocumentCommand{\normalcone}{ O{} m m }{\normalCone_{#2}\enclose[#1]{(}{#3}{)}} + +% Define a command for the polar cone +% Argument {#1} is the set +\NewDocumentCommand{\polarcone}{ m }{#1^\circ} diff --git a/macros/latex/contrib/mathsemantics/mathsemantics-semantic.sty b/macros/latex/contrib/mathsemantics/mathsemantics-semantic.sty new file mode 100644 index 0000000000..6ccb0f7b62 --- /dev/null +++ b/macros/latex/contrib/mathsemantics/mathsemantics-semantic.sty @@ -0,0 +1,112 @@ +\ProvidesPackage{mathsemantics-semantic}[2022/05/06] + +% Resolve the dependencies of this package +\RequirePackage{mathsemantics-commons} +\RequirePackage{mathsemantics-syntax} + +\newcommand{\abs}[2][]{\enclose[#1]{\lvert}{#2}{\rvert}} +\newcommand{\ceil}[2][]{\enclose[#1]{\lceil}{#2}{\rceil}} +\newcommand{\dual}[3][]{\enclose[#1]{\langle}{#2\,,#3}{\rangle}} +\newcommand{\floor}[2][]{\enclose[#1]{\lfloor}{#2}{\rfloor}} +\newcommand{\avg}[2][]{\enclose[#1]{\lbrace}{#2}{\rbrace}} +\newcommand{\inner}[3][]{\enclose[#1]{(}{#2\,,\,#3}{)}} +\newcommand{\jump}[2][]{\enclose[#1]{\llbracket}{#2}{\rrbracket}} +\newcommand{\norm}[2][]{\enclose[#1]{\lVert}{#2}{\rVert}} +\newcommand{\restr}[3][]{\enclose[#1]{.}{#2}{\rvert}_{#3}} +\newcommand{\setMid}{|} +\newcommand{\setDef}[3][]{\encloseSet[#1]{\{}{#2}{\setMid}{#3}{\}}} +% Define the distance to a set operator +% The optional argument #1 scales the delimiters +% Argument #2 is the set +% Argument #3 is the quantity +\DeclareMathOperator{\distOp}{dist} +\NewDocumentCommand{\dist}{ O{} g g }{\IfNoValueTF{#3}{\IfNoValueTF{#2}{\distOp}{\distOp_{#2}}}{\distOp_{#2}\enclose[#1]{(}{#3}{)}}} + +% Define the projection operator +% The optional argument #1 scales the delimiters +% Argument #2 is the set to be projected onto +% Argument #3 is the quantity to be projected +\DeclareMathOperator{\projOp}{proj} +\NewDocumentCommand{\proj}{ O{} g d() }{% + \IfNoValueTF{#2}{\projOp}{\projOp_{#2}}\IfNoValueF{#3}{\enclose[#1]{(}{#3}{)}}% +} + +% Define the prox operator +% The optional argument #1 scales the delimiters +% Argument #2 is the function whose prox map we are taking +% Argument #3 is the argument of the prox map +\DeclareMathOperator{\proxOp}{prox} +\NewDocumentCommand{\prox}{ O{} g d() }{% + \IfNoValueTF{#2}{\proxOp}{\proxOp_{#2}}\IfNoValueF{#3}{\enclose[#1]{(}{#3}{)}}% +} + +% Define some mathematical and other operators +\DeclareMathOperator{\aff}{aff} +\DeclareMathOperator{\arcosh}{arcosh} +\DeclareMathOperator{\arcoth}{arcoth} +\DeclareMathOperator{\arsinh}{arsinh} +\DeclareMathOperator{\artanh}{artanh} +\DeclareMathOperator*{\argmax}{arg\,max} +\DeclareMathOperator*{\Argmax}{Arg\,max} +\DeclareMathOperator*{\argmin}{arg\,min} +\DeclareMathOperator*{\Argmin}{Arg\,min} +\DeclareMathOperator{\bdiv}{\textup{\textbf{div}}} +\DeclareMathOperator{\card}{card} +\DeclareMathOperator{\clconv}{\overline{\conv}} +\let\closure\undefined \DeclareMathOperator{\closure}{cl} % WileyNJD-v2.cls (loads stix.sty) +\DeclareMathOperator{\cofac}{cof} +\newcommand{\compactly}{\hookrightarrow\hookrightarrow} +\DeclareMathOperator{\cone}{cone} +\DeclareMathOperator{\conv}{conv} +\newcommand{\corresponds}{\mathrel{\widehat{=}}} +\DeclareMathOperator{\cov}{Cov} +\DeclareMathOperator{\curl}{curl} +\DeclareMathOperator{\dev}{dev} +\let\div\undefined \DeclareMathOperator{\div}{div} +\DeclareMathOperator{\Div}{Div} +% https://tex.stackexchange.com/questions/140642/conditionally-remove-the-space-before-a-one-letter-operator +\newcommand{\dInt}{\mathop{}\!\textup{d}} +\let\d\undefined\newcommand{\d}{\dInt} +\let\diag\undefined \DeclareMathOperator{\diag}{diag} % etna.cls +\DeclareMathOperator{\diam}{diam} +\DeclareMathOperator{\dom}{dom} +\newcommand{\dotcup}{\ensuremath{\mathaccent\cdot\cup}} +\DeclareMathSymbol{\dprod}{\mathbin}{operators}{"3A} +\let\e\undefined \newcommand{\e}{\mathrm{e}} % ifacconf.cls +\newcommand{\embed}{\hookrightarrow} +\newcommand{\embeds}{\embed} +\DeclareMathOperator{\epi}{epi} +\newcommand{\eR}{\overline{\bbR}} +\DeclareMathOperator*{\esssup}{ess\,sup} +\DeclareMathOperator*{\essinf}{ess\,inf} +\let\grad\undefined \DeclareMathOperator{\grad}{grad} % etna.cls +\DeclareMathOperator{\Graph}{Graph} +\newcommand{\id}{\textup{id}} +\DeclareMathOperator{\image}{image} +\DeclareMathOperator{\interior}{int} +\DeclareMathOperator{\inj}{inj} +\newcommand{\laplace}{\Delta} +\DeclareMathOperator*{\limessinf}{lim\,ess\,inf} +\DeclareMathOperator*{\limesssup}{lim\,ess\,sup} +\DeclareMathOperator{\lin}{lin} +\let\rank\undefined \DeclareMathOperator{\rank}{rank} % etna.cls +\DeclareMathOperator{\range}{range} +\DeclareMathOperator{\ri}{ri} +\DeclareMathOperator{\sgn}{sgn} +\DeclareMathOperator{\Sgn}{Sgn} +\DeclareMathOperator{\Span}{span} +\let\supp\undefined \DeclareMathOperator{\supp}{supp} % etna.cls +\DeclareMathOperator{\sym}{sym} +\DeclareMathOperator{\trace}{trace} +\newcommand{\transposeSymbol}{\mkern-1.5mu\textup{T}} +\AtBeginDocument{\providecommand*{\transp}{{\transposeSymbol}}} % postpone it since newtxmath.sty has its own \transp +\DeclareMathOperator{\var}{Var} +\newcommand{\weakly}{\rightharpoonup} +\newcommand{\weaklystar}{\stackrel\star\rightharpoonup} + +\@ifpackageloaded{academicon}{% + \definecolor{orcidlogocolor}{HTML}{A6CE39} + \providecommand*{\orcid}[1]{\href{https://orcid.org/#1}{\textcolor{orcidlogocolor}{\aiOrcid}~\detokenize{#1}}} +}{% + \providecommand*{\orcid}[1]{\href{https://orcid.org/#1}{ORCID~\detokenize{#1}}} +} diff --git a/macros/latex/contrib/mathsemantics/mathsemantics-syntax.sty b/macros/latex/contrib/mathsemantics/mathsemantics-syntax.sty new file mode 100644 index 0000000000..d11cd62405 --- /dev/null +++ b/macros/latex/contrib/mathsemantics/mathsemantics-syntax.sty @@ -0,0 +1,428 @@ +\ProvidesPackage{mathsemantics-syntax}[2022/05/06] +\provideboolean{mathsemantics@syntax@shortbb} +\setboolean{mathsemantics@syntax@shortbb}{false}% default: false +\DeclareOption{shortbb}{% + \setboolean{mathsemantics@syntax@shortbb}{true}% Some Code +} +\ProcessOptions\relax +\RequirePackage{mathsemantics-commons} + +% Define commands for bold upper-case letters in math mode +\newcommand{\bA}{{\boldsymbol{A}}} +\newcommand{\bB}{{\boldsymbol{B}}} +\newcommand{\bC}{{\boldsymbol{C}}} +\newcommand{\bD}{{\boldsymbol{D}}} +\newcommand{\bE}{{\boldsymbol{E}}} +\newcommand{\bF}{{\boldsymbol{F}}} +\newcommand{\bG}{{\boldsymbol{G}}} +\newcommand{\bH}{{\boldsymbol{H}}} +\newcommand{\bI}{{\boldsymbol{I}}} +\newcommand{\bJ}{{\boldsymbol{J}}} +\newcommand{\bK}{{\boldsymbol{K}}} +\newcommand{\bL}{{\boldsymbol{L}}} +\newcommand{\bM}{{\boldsymbol{M}}} +\newcommand{\bN}{{\boldsymbol{N}}} +\newcommand{\bO}{{\boldsymbol{O}}} +\newcommand{\bP}{{\boldsymbol{P}}} +\newcommand{\bQ}{{\boldsymbol{Q}}} +\newcommand{\bR}{{\boldsymbol{R}}} +\newcommand{\bS}{{\boldsymbol{S}}} +\newcommand{\bT}{{\boldsymbol{T}}} +\newcommand{\bU}{{\boldsymbol{U}}} +\newcommand{\bV}{{\boldsymbol{V}}} +\newcommand{\bW}{{\boldsymbol{W}}} +\newcommand{\bX}{{\boldsymbol{X}}} +\newcommand{\bY}{{\boldsymbol{Y}}} +\newcommand{\bZ}{{\boldsymbol{Z}}} + +% Define commands for bold lower-case letters in math mode +\newcommand{\ba}{{\boldsymbol{a}}} +\newcommand{\bb}{{\boldsymbol{b}}} +\newcommand{\bc}{{\boldsymbol{c}}} +\newcommand{\bd}{{\boldsymbol{d}}} +\newcommand{\be}{{\boldsymbol{e}}} +\let\bf\undefined \newcommand{\bf}{{\boldsymbol{f}}} +\newcommand{\bg}{{\boldsymbol{g}}} +\newcommand{\bh}{{\boldsymbol{h}}} +\let\bi\undefined \newcommand{\bi}{{\boldsymbol{i}}} % Taylor and Francis +\newcommand{\bj}{{\boldsymbol{j}}} +\newcommand{\bk}{{\boldsymbol{k}}} +\newcommand{\bl}{{\boldsymbol{l}}} +\let\bm\undefined \newcommand{\bm}{{\boldsymbol{m}}} % Taylor and Francis +\newcommand{\bn}{{\boldsymbol{n}}} +\newcommand{\bo}{{\boldsymbol{o}}} +\newcommand{\bp}{{\boldsymbol{p}}} +\newcommand{\bq}{{\boldsymbol{q}}} +\newcommand{\br}{{\boldsymbol{r}}} +\newcommand{\bs}{{\boldsymbol{s}}} +\newcommand{\bt}{{\boldsymbol{t}}} +\newcommand{\bu}{{\boldsymbol{u}}} +\newcommand{\bv}{{\boldsymbol{v}}} +\newcommand{\bw}{{\boldsymbol{w}}} +\newcommand{\bx}{{\boldsymbol{x}}} +\newcommand{\by}{{\boldsymbol{y}}} +\newcommand{\bz}{{\boldsymbol{z}}} + +% Define commands for bold numbers 0, 1 in math mode +\newcommand{\bnull}{{\boldsymbol{0}}} +\newcommand{\bone}{{\boldsymbol{1}}} + +% Define commands for bold lower-case Greek letters in math mode +\newcommand{\balpha}{{\boldsymbol{\alpha}}} +\newcommand{\bbeta}{{\boldsymbol{\beta}}} +\newcommand{\bgamma}{{\boldsymbol{\gamma}}} +\newcommand{\bdelta}{{\boldsymbol{\delta}}} +\newcommand{\bepsilon}{{\boldsymbol{\epsilon}}} +\newcommand{\bvarepsilon}{{\boldsymbol{\varepsilon}}} +\newcommand{\bzeta}{{\boldsymbol{\zeta}}} +\newcommand{\boldeta}{{\boldsymbol{\eta}}} % exception: \boldeta instead of \beta +\newcommand{\btheta}{{\boldsymbol{\theta}}} +\newcommand{\bvartheta}{{\boldsymbol{\vartheta}}} +\newcommand{\biota}{{\boldsymbol{\iota}}} +\newcommand{\bkappa}{{\boldsymbol{\kappa}}} +\newcommand{\bvarkappa}{{\boldsymbol{\varkappa}}} +\newcommand{\blambda}{{\boldsymbol{\lambda}}} +\newcommand{\bmu}{{\boldsymbol{\mu}}} +\newcommand{\bnu}{{\boldsymbol{\nu}}} +\newcommand{\bomicron}{\boldsymbol{o}} +\newcommand{\bxi}{{\boldsymbol{\xi}}} +\newcommand{\bpi}{{\boldsymbol{\pi}}} +\newcommand{\bvarpi}{{\boldsymbol{\varpi}}} +\newcommand{\brho}{{\boldsymbol{\rho}}} +\newcommand{\bvarrho}{{\boldsymbol{\varrho}}} +\newcommand{\bsigma}{{\boldsymbol{\sigma}}} +\newcommand{\bvarsigma}{{\boldsymbol{\varsigma}}} +\newcommand{\btau}{{\boldsymbol{\tau}}} +\newcommand{\bupsilon}{{\boldsymbol{\upsilon}}} +\newcommand{\bphi}{{\boldsymbol{\phi}}} +\newcommand{\bvarphi}{{\boldsymbol{\varphi}}} +\newcommand{\bchi}{{\boldsymbol{\chi}}} +\newcommand{\bpsi}{{\boldsymbol{\psi}}} +\newcommand{\bomega}{{\boldsymbol{\omega}}} + +% Define commands for bold upper-case Greek letters in math mode +\newcommand{\bAlpha}{{\boldsymbol{A}}} +\newcommand{\bBeta}{{\boldsymbol{B}}} +\newcommand{\bGamma}{{\boldsymbol{\Gamma}}} +\newcommand{\bDelta}{{\boldsymbol{\Delta}}} +\newcommand{\bEpsilon}{{\boldsymbol{E}}} +\newcommand{\bZeta}{{\boldsymbol{Z}}} +\newcommand{\bEta}{{\boldsymbol{H}}} +\newcommand{\bTheta}{{\boldsymbol{\Theta}}} +\newcommand{\bIota}{{\boldsymbol{I}}} +\newcommand{\bKappa}{{\boldsymbol{K}}} +\newcommand{\bLambda}{{\boldsymbol{\Lambda}}} +\newcommand{\bMu}{{\boldsymbol{M}}} +\newcommand{\bNu}{{\boldsymbol{N}}} +\newcommand{\bXi}{{\boldsymbol{\Xi}}} +\newcommand{\bOmicron}{{\boldsymbol{O}}} +\newcommand{\bPi}{{\boldsymbol{\Pi}}} +\newcommand{\bRho}{{\boldsymbol{P}}} +\newcommand{\bSigma}{{\boldsymbol{\Sigma}}} +\newcommand{\bTau}{{\boldsymbol{T}}} +\newcommand{\bUpsilon}{{\boldsymbol{\Upsilon}}} +\newcommand{\bPhi}{{\boldsymbol{\Phi}}} +\newcommand{\bChi}{{\boldsymbol{X}}} +\newcommand{\bPsi}{{\boldsymbol{\Psi}}} +\newcommand{\bOmega}{{\boldsymbol{\Omega}}} + +% Define commands for calligraphic upper-case letters in math mode +\newcommand{\cA}{\mathcal{A}} +\newcommand{\cB}{\mathcal{B}} +\newcommand{\cC}{\mathcal{C}} +\newcommand{\cD}{\mathcal{D}} +\newcommand{\cE}{\mathcal{E}} +\newcommand{\cF}{\mathcal{F}} +\newcommand{\cG}{\mathcal{G}} +\newcommand{\cH}{\mathcal{H}} +\newcommand{\cI}{\mathcal{I}} +\newcommand{\cJ}{\mathcal{J}} +\newcommand{\cK}{\mathcal{K}} +\newcommand{\cL}{\mathcal{L}} +\newcommand{\cM}{\mathcal{M}} +\newcommand{\cN}{\mathcal{N}} +\newcommand{\cO}{\mathcal{O}} +\newcommand{\cP}{\mathcal{P}} +\newcommand{\cQ}{\mathcal{Q}} +\newcommand{\cR}{\mathcal{R}} +\newcommand{\cS}{\mathcal{S}} +\newcommand{\cT}{\mathcal{T}} +\newcommand{\cU}{\mathcal{U}} +\newcommand{\cV}{\mathcal{V}} +\newcommand{\cW}{\mathcal{W}} +\newcommand{\cX}{\mathcal{X}} +\newcommand{\cY}{\mathcal{Y}} +\newcommand{\cZ}{\mathcal{Z}} + +% Define commands for fraktur upper-case letters in math mode +\newcommand{\fA}{\mathfrak{A}} +\newcommand{\fB}{\mathfrak{B}} +\newcommand{\fC}{\mathfrak{C}} +\newcommand{\fD}{\mathfrak{D}} +\newcommand{\fE}{\mathfrak{E}} +\newcommand{\fF}{\mathfrak{F}} +\newcommand{\fG}{\mathfrak{G}} +\newcommand{\fH}{\mathfrak{H}} +\newcommand{\fI}{\mathfrak{I}} +\newcommand{\fJ}{\mathfrak{J}} +\newcommand{\fK}{\mathfrak{K}} +\newcommand{\fL}{\mathfrak{L}} +\newcommand{\fM}{\mathfrak{M}} +\newcommand{\fN}{\mathfrak{N}} +\newcommand{\fO}{\mathfrak{O}} +\newcommand{\fP}{\mathfrak{P}} +\newcommand{\fQ}{\mathfrak{Q}} +\newcommand{\fR}{\mathfrak{R}} +\newcommand{\fS}{\mathfrak{S}} +\newcommand{\fT}{\mathfrak{T}} +\newcommand{\fU}{\mathfrak{U}} +\newcommand{\fV}{\mathfrak{V}} +\newcommand{\fW}{\mathfrak{W}} +\newcommand{\fX}{\mathfrak{X}} +\newcommand{\fY}{\mathfrak{Y}} +\newcommand{\fZ}{\mathfrak{Z}} + + +% Define commands for fraktur upper-case letters in math mode +\newcommand{\sA}{\mathscr{A}} +\newcommand{\sB}{\mathscr{B}} +\newcommand{\sC}{\mathscr{C}} +\newcommand{\sD}{\mathscr{D}} +\newcommand{\sE}{\mathscr{E}} +\newcommand{\sF}{\mathscr{F}} +\newcommand{\sG}{\mathscr{G}} +\newcommand{\sH}{\mathscr{H}} +\newcommand{\sI}{\mathscr{I}} +\newcommand{\sJ}{\mathscr{J}} +\newcommand{\sK}{\mathscr{K}} +\newcommand{\sL}{\mathscr{L}} +\newcommand{\sM}{\mathscr{M}} +\newcommand{\sN}{\mathscr{N}} +\newcommand{\sO}{\mathscr{O}} +\newcommand{\sP}{\mathscr{P}} +\newcommand{\sQ}{\mathscr{Q}} +\newcommand{\sR}{\mathscr{R}} +\newcommand{\sS}{\mathscr{S}} +\newcommand{\sT}{\mathscr{T}} +\newcommand{\sU}{\mathscr{U}} +\newcommand{\sV}{\mathscr{V}} +\newcommand{\sW}{\mathscr{W}} +\newcommand{\sX}{\mathscr{X}} +\newcommand{\sY}{\mathscr{Y}} +\newcommand{\sZ}{\mathscr{Z}} + +% Define commands for lower-case letters with vector accents in math mode +\newcommand{\va}{\vec{a}} +\newcommand{\vb}{\vec{b}} +\newcommand{\vc}{\vec{c}} +\newcommand{\vd}{\vec{d}} +\newcommand{\ve}{\vec{e}} +\newcommand{\vf}{\vec{f}} +\let\vg\undefined \newcommand{\vg}{\vec{g}} % ESAIM +\newcommand{\vh}{\vec{h}} +\newcommand{\vi}{\vec{i}} +\newcommand{\vj}{\vec{j}} +\newcommand{\vk}{\vec{k}} +\newcommand{\vl}{\vec{l}} +\newcommand{\vm}{\vec{m}} +\newcommand{\vn}{\vec{n}} +\newcommand{\vo}{\vec{o}} +\newcommand{\vp}{\vec{p}} +\newcommand{\vq}{\vec{q}} +\newcommand{\vr}{\vec{r}} +\newcommand{\vs}{\vec{s}} +\newcommand{\vt}{\vec{t}} +\newcommand{\vu}{\vec{u}} +\let\vv\undefined \newcommand{\vv}{\vec{v}} % jnsao +\newcommand{\vw}{\vec{w}} +\newcommand{\vx}{\vec{x}} +\newcommand{\vy}{\vec{y}} +\newcommand{\vz}{\vec{z}} + +% Define commands for upper-case letters with vector accents in math mode +\newcommand{\vA}{\vec{A}} +\newcommand{\vB}{\vec{B}} +\newcommand{\vC}{\vec{C}} +\newcommand{\vD}{\vec{D}} +\newcommand{\vE}{\vec{E}} +\newcommand{\vF}{\vec{F}} +\newcommand{\vG}{\vec{G}} +\newcommand{\vH}{\vec{H}} +\newcommand{\vI}{\vec{I}} +\newcommand{\vJ}{\vec{J}} +\newcommand{\vK}{\vec{K}} +\newcommand{\vL}{\vec{L}} +\newcommand{\vM}{\vec{M}} +\newcommand{\vN}{\vec{N}} +\newcommand{\vO}{\vec{O}} +\newcommand{\vP}{\vec{P}} +\newcommand{\vQ}{\vec{Q}} +\newcommand{\vR}{\vec{R}} +\newcommand{\vS}{\vec{S}} +\newcommand{\vT}{\vec{T}} +\newcommand{\vU}{\vec{U}} +\newcommand{\vV}{\vec{V}} +\newcommand{\vW}{\vec{W}} +\newcommand{\vX}{\vec{X}} +\newcommand{\vY}{\vec{Y}} +\newcommand{\vZ}{\vec{Z}} + +% Define commands for numbers 0, 1 with vector accents in math mode +\newcommand{\vnull}{{\vec{0}}} +\newcommand{\vone}{{\vec{1}}} + +% Define commands for lower-case Greek letters with vector accents in math mode +\newcommand{\valpha}{{\vec{\alpha}}} +\newcommand{\vbeta}{{\vec{\beta}}} +\newcommand{\vgamma}{{\vec{\gamma}}} +\newcommand{\vdelta}{{\vec{\delta}}} +\newcommand{\vepsilon}{{\vec{\epsilon}}} +\newcommand{\vvarepsilon}{{\vec{\varepsilon}}} +\newcommand{\vzeta}{{\vec{\zeta}}} +\newcommand{\veta}{{\vec{\eta}}} +\newcommand{\vtheta}{{\vec{\theta}}} +\newcommand{\vvartheta}{{\vec{\vartheta}}} +\newcommand{\viota}{{\vec{\iota}}} +\newcommand{\vkappa}{{\vec{\kappa}}} +\newcommand{\vvarkappa}{{\vec{\varkappa}}} +\newcommand{\vlambda}{{\vec{\lambda}}} +\newcommand{\vmu}{{\vec{\mu}}} +\newcommand{\vnu}{{\vec{\nu}}} +\newcommand{\vomicron}{\vec{o}} +\newcommand{\vxi}{{\vec{\xi}}} +\newcommand{\vpi}{{\vec{\pi}}} +\newcommand{\vvarpi}{{\vec{\varpi}}} +\newcommand{\vrho}{{\vec{\rho}}} +\newcommand{\vvarrho}{{\vec{\varrho}}} +\newcommand{\vsigma}{{\vec{\sigma}}} +\newcommand{\vvarsigma}{{\vec{\varsigma}}} +\newcommand{\vtau}{{\vec{\tau}}} +\newcommand{\vupsilon}{{\vec{\upsilon}}} +\newcommand{\vphi}{{\vec{\phi}}} +\newcommand{\vvarphi}{{\vec{\varphi}}} +\newcommand{\vchi}{{\vec{\chi}}} +\newcommand{\vpsi}{{\vec{\psi}}} +\newcommand{\vomega}{{\vec{\omega}}} + +% Define commands for upper-case Greek letters with vector accents in math mode +\newcommand{\vAlpha}{{\vec{A}}} +\newcommand{\vBeta}{{\vec{B}}} +\newcommand{\vGamma}{{\vec{\Gamma}}} +\newcommand{\vDelta}{{\vec{\Delta}}} +\newcommand{\vEpsilon}{{\vec{E}}} +\newcommand{\vZeta}{{\vec{Z}}} +\newcommand{\vEta}{{\vec{H}}} +\newcommand{\vTheta}{{\vec{\Theta}}} +\newcommand{\vIota}{{\vec{I}}} +\newcommand{\vKappa}{{\vec{K}}} +\newcommand{\vLambda}{{\vec{\Lambda}}} +\newcommand{\vMu}{{\vec{M}}} +\newcommand{\vNu}{{\vec{N}}} +\newcommand{\vOmicron}{\vec{O}} +\newcommand{\vXi}{{\vec{\Xi}}} +\newcommand{\vPi}{{\vec{\Pi}}} +\newcommand{\vRho}{{\vec{P}}} +\newcommand{\vSigma}{{\vec{\Sigma}}} +\newcommand{\vTau}{{\vec{T}}} +\newcommand{\vUpsilon}{{\vec{\Upsilon}}} +\newcommand{\vPhi}{{\vec{\Phi}}} +\newcommand{\vChi}{{\vec{X}}} +\newcommand{\vPsi}{{\vec{\Psi}}} +\newcommand{\vOmega}{{\vec{\Omega}}} + +% Define commands for some blackboard characters in math mode, mainly used for sets +\newcommand{\bbA}{\mathbb{A}} +\newcommand{\bbB}{\mathbb{B}} +\newcommand{\bbC}{\mathbb{C}} +\newcommand{\bbD}{\mathbb{D}} +\newcommand{\bbE}{\mathbb{E}} +\newcommand{\bbF}{\mathbb{F}} +\newcommand{\bbG}{\mathbb{G}} +\newcommand{\bbH}{\mathbb{H}} +\newcommand{\bbI}{\mathbb{I}} +\newcommand{\bbJ}{\mathbb{J}} +\newcommand{\bbK}{\mathbb{K}} +\newcommand{\bbL}{\mathbb{L}} +\newcommand{\bbM}{\mathbb{M}} +\newcommand{\bbN}{\mathbb{N}} +\newcommand{\bbO}{\mathbb{O}} +\newcommand{\bbP}{\mathbb{P}} +\newcommand{\bbQ}{\mathbb{Q}} +\newcommand{\bbR}{\mathbb{R}} +\newcommand{\bbS}{\mathbb{S}} +\newcommand{\bbT}{\mathbb{T}} +\newcommand{\bbU}{\mathbb{U}} +\newcommand{\bbV}{\mathbb{V}} +\newcommand{\bbW}{\mathbb{W}} +\newcommand{\bbX}{\mathbb{X}} +\newcommand{\bbY}{\mathbb{Y}} +\newcommand{\bbZ}{\mathbb{Z}} + +\ifthenelse{\boolean{mathsemantics@syntax@shortbb}}{ + \providecommand{\C}{\bbC}% + \providecommand{\K}{\bbK}% + \providecommand{\N}{\bbN}% + \providecommand{\Q}{\bbQ}% + \providecommand{\R}{\bbR}% + \providecommand{\Z}{\bbZ}% +}{} + + +% Define \enclose command +% \enclose[a]{b}{c}{d} encloses content (c) in brackets (b,d) where the optional parameter +% a scales the brackets (big, Big, bigg, Bigg) or (auto)matically scales them. +% It can also be set to [none] do deactivate the brackets/enclosing +% \enclosespacing allows for additional spacing before and after the \enclose:d content +% https://blag.nullteilerfrei.de/2014/01/16/a-dynamic-bracketing-macro-in-latex/ +% The \enclose command is mainly meant for internal use; use \paren instead +\newcommand{\enclspacing}{} +\newcommand{\enclose}[4][]{% + \ifthenelse{\isempty{#1}}% + {\ifthenelse{\equal{#2}{.}}{}{#2}\enclspacing#3\enclspacing#4}% + {\ifthenelse{\equal{#1}{auto}}% given auto + {\mathopen{}\left#2\enclspacing#3\enclspacing\mathclose{}\right#4}% + {\ifthenelse{\equal{#1}{none}}% given none + {#3}% + {\csname#1l\endcsname#2\enclspacing#3\enclspacing\csname#1r\endcsname#4}% + }% end auto + }% end #1 empty +} + +% Define \encloseSet command to do { c | e } +% \enclose[a]{b}{c}{d}{e}{f} encloses content c and e in brackets (b,f) with a center delimiter d, where the optional parameter +% a scales the brackets (big, Big, bigg, Bigg) or (auto)matically scales them +% \enclosespacingSet allows for additional spacing before and after the center delimiter, the outer brackets gain a \encloseSpacing as \enclose: +% https://blag.nullteilerfrei.de/2014/01/16/a-dynamic-bracketing-macro-in-latex/ +% The \enclose command is mainly meant for internal use; use \paren instead +\newcommand{\enclspacingSet}{\,} +\newcommand{\encloseSet}[6][]{% + \ifthenelse{\isempty{#1}}% + {#2\enclspacing#3 \enclspacingSet#4\enclspacingSet #5\enclspacing#6}% + {\ifthenelse{\equal{#1}{auto}}% + {\left#2\enclspacing#3\enclspacingSet\middle#4\enclspacingSet#5\right#6}% + {\csname#1l\endcsname#2\enclspacing#3\enclspacingSet\csname#1\endcsname#4\enclspacingSet#5\enclspacing\csname#1r\endcsname#6}% + }% + } + +% Define \paren command +% \paren[a]bc{d} encloses content (d) in brackets b,c where the optional parameter +% a scales the brackets +\newcommand{\paren}[4][]{\enclose[#1]{#2}{#4}{#3}} + +% Define the \clap (complementing \{l,r}lap) and \math{l,c,r}lap commands, +% which horizontally smash the argument with alignment +% http://www.tug.org/TUGboat/Articles/tb22-4/tb72perlS.pdf +\def\clap#1{\hbox to 0pt{\hss#1\hss}} +\def\mathllap{\mathpalette\mathllapinternal} +\def\mathrlap{\mathpalette\mathrlapinternal} +\def\mathclap{\mathpalette\mathclapinternal} +\def\mathllapinternal#1#2{\llap{$\mathsurround=0pt#1{#2}$}} +\def\mathrlapinternal#1#2{\rlap{$\mathsurround=0pt#1{#2}$}} +\def\mathclapinternal#1#2{\clap{$\mathsurround=0pt#1{#2}$}} + +% Define the \mrep[a]{b}{c} command, which prints b but reserves the space for c. +% The optional argument a specifies the alignment {l,c,r}. The command works in text and math modes. +% https://groups.google.com/forum/?fromgroups#!topic/comp.text.tex/GikFchXJIM0 +\def\my@mathpalette#1#2#3#4{\mathchoice{#1\displaystyle{#2}{#3}{#4}}{#1\textstyle{#2}{#3}{#4}}{#1\scriptstyle{#2}{#3}{#4}}{#1\scriptscriptstyle{#2}{#3}{#4}}} +\def\mrepinternal#1#2#3#4{\makebox[\widthof{$#1#4$}][#2]{$#1\vphantom{#4}{#3}$}} +\newcommand{\mrep}[3][l]{\ifmmode\my@mathpalette\mrepinternal{#1}{#2}{#3}\else\makebox[\widthof{#3}][#1]{\vphantom{#3}#2}\fi}
\ No newline at end of file diff --git a/macros/latex/contrib/mathsemantics/mathsemantics.sty b/macros/latex/contrib/mathsemantics/mathsemantics.sty new file mode 100644 index 0000000000..193c74c33d --- /dev/null +++ b/macros/latex/contrib/mathsemantics/mathsemantics.sty @@ -0,0 +1,19 @@ +% +% mathsemantics.sty +% +\ProvidesPackage{mathsemantics}[2022/05/06 MathSemantics.sty v1.0.0] +\DeclareOption{shortbb}{% + \PassOptionsToPackage{shortbb}{mathsemantics-syntax} +} +\ProcessOptions\relax + +\RequirePackage{mathsemantics-commons} + +\RequirePackage{mathsemantics-syntax} +\RequirePackage{mathsemantics-abbreviations} +\RequirePackage{mathsemantics-names} + +\RequirePackage{mathsemantics-semantic} + +\RequirePackage{mathsemantics-manifolds} +\RequirePackage{mathsemantics-optimization}
\ No newline at end of file diff --git a/macros/latex/contrib/prociagssymp/README.txt b/macros/latex/contrib/prociagssymp/README.txt new file mode 100644 index 0000000000..98ddf544e7 --- /dev/null +++ b/macros/latex/contrib/prociagssymp/README.txt @@ -0,0 +1,25 @@ + +% This file is README.txt for the "procIAGssymp" package. +% Current version : [2022/05/05] +% Author: Battista Benciolini + +The package "procIAGssymp" provides (re-)definitions of some LaTeX +commands that can be useful for the preparation of a paper with +the style of the proceedings of symposia sponsored by the +International Association of Geodesy (IAG). + +I presume that "official" more refined and +up-to-date "sty" and "cls" file are now available +from the publisher. This package is therefore not as useful +as it was at the time of it's first publication, +but it is pehaps still conveniet for some user. + +The distribution includes : + +README.txt this file +procIAGssymp.sty the package +TestprocIAGssymp.tex external documentation, example, suggestions +TestprocIAGssymp.pdf external documentation, example, suggestions + +===================== END of README file ====================== + diff --git a/macros/latex/contrib/prociagssymp/TestprocIAGssymp.pdf b/macros/latex/contrib/prociagssymp/TestprocIAGssymp.pdf Binary files differnew file mode 100644 index 0000000000..3963711a2c --- /dev/null +++ b/macros/latex/contrib/prociagssymp/TestprocIAGssymp.pdf diff --git a/macros/latex/contrib/procIAGssymp/TestPaper.tex b/macros/latex/contrib/prociagssymp/TestprocIAGssymp.tex index ca22412f35..d0343bda46 100644 --- a/macros/latex/contrib/procIAGssymp/TestPaper.tex +++ b/macros/latex/contrib/prociagssymp/TestprocIAGssymp.tex @@ -2,62 +2,58 @@ % OF THE PACKAGE procIAGssymp.sty % AND AN EXAMPLE OF ITS USE % -% File : TestPaper.tex +% File : TestprocIAGssymp.tex (current version 2022-05-05) % Author: Battista Benciolini -% E-mail: <Battista.Benciolini@ing.unitn.it> -% Date : January 11, 2002 +% E-mail: <Battista.Benciolini@unitn.it> % See file procIAGssymp.sty for more information +% % \documentclass[a4paper,twocolumn,10pt]{article} % \usepackage{procIAGssymp} - \pagestyle{empty} % optional -% \setcounter{page}{11} % optional \title{The package procIAGssymp.sty for the formatting - of a paper with the style of the proceeding of + of a paper with the style of the proceedings of symposia sponsored by IAG} -\author{B.Benciolini\thanks{e-mail: battista.benciolini@ing.uitn.it} +\author{B.Benciolini\thanks{e-mail: battista.benciolini@unitn.it} \and No Second Author \and No Third Author\thanks{No-Where Institute}} \date{ } \hbadness=10000 \vbadness=10000 \begin{document} \maketitle - \thispagestyle{empty} % optional \paragraph{Abstract.} The package \texttt{procIAGssymp.sty} has been designed to help the formatting of a paper with the style -of the proceeding of symposia sponsored by the -"International Association of Geodesy (IAG)" published -by "Springer-Verlag Berlin Heidelberg NewYork". +of the proceedings of symposia sponsored by the +"International Association of Geodesy (IAG)". This paper itself is an example of the use of the package. It contains instructions and suggestions for the use of the package, while most of the comment included in \texttt{procIAGssymp.sty} are of a more technical nature. +\paragraph{WARNING:} +I have not recently checked the instruction from +the publisher of the proceedings of IAG-sponsored-symposia. +I presume that "official" more refined and +up-to-date "sty" and "cls" files +are now available from the publisher. +This package is therefore not as useful +as it was at the time of it's first publication, +but it is pehaps still conveniet for some user. \linea \section{Introduction} The package \texttt{procIAGssymp.sty} provides some (re-)definitions -of \LaTeX commands. The use of the package is explained in this paper. +of \LaTeX commands. The use of the package is explained in this text. \par\noindent I have tried to provide a package that helps in the preparation of a paper that corresponds to the instructions distributed by the publisher of the proceedings of -IAG-sponsored-symposia (i.e. by Springer-Verlag), but . . . -please read the IMPORTANT NOTES inside the file \texttt{procIAGssymp.sty}. -\par\noindent The most curious readers are +IAG-sponsored-symposia, but please read the subsection +\textbf{Important notes} below. +\par\noindent The curious readers are invited to look directly at the source of this file and, more important, to the code in the file \texttt{procIAGssymp.sty}. \section{Suggestions for the user} -\subsection{General page lay-out and page numbering} +\subsection{General page lay-out} The general lay-out of the pages is controlled by some assignment made by \texttt{procIAGssymp.sty} AND by the use of the class \texttt{article} that must be loaded with the proper options, i.e. \verb+[a4paper,twocolumn,10pt]+ . -\par\noindent -The package itself does not modify the page numbering -with respect to the \LaTeX standard. -If it is necessary to avoid page numbering this can be obtained -putting \verb+\pagestyle{empty}+ somewhere in the preamble of the -file and \verb+\thispagestyle{empty}+ immediately after -\verb+\maketitle+. -If it is necessary to start page numbering from $n$, this can be -obtained with \verb+\setcounter{page}{+$n$\verb+}+. \subsection{Top-matter} The title and the author(s) must be prepared with \verb+\title{ . . .}+ and \verb+\author{ . . .}+ and they will be @@ -70,7 +66,7 @@ same address must be listed consecutively and must be followed by \verb+\thanks{. . .}+ (with the address as argument). To see an example you can see the code of this file. \subsection{Sectioning} -The use of \verb+\section{. . . }+ and \verb+\subsection{. . . }+, +The use of \verb+\section{. . . }+ and \verb+\subsection{. . . }+ can be done as in any \LaTeX paper. These commands have been redefined so that they produce the first level and second level headers in the proper format. @@ -79,9 +75,6 @@ style. The command \verb+\section*{References}+ can be used to start the reference list. One of the following sections is just a test of the various sectioning commands. -\section{The choice of the font} -The standard Computer Modern fonts are used. -I have not tried any other font. \section{Test of sectioning (1st level)} \subsection{Test of sectioning (2nd level)} \subsubsection{Test of sectioning (3rd level)} @@ -107,43 +100,46 @@ and with several packages including: \texttt{amssymb}, \texttt{apalike}, \texttt{array}, \texttt{epsfig}, \texttt{graphicx} and \texttt{verbatim}. I have not found any compatibility problem. +\section{Some info from the internal documentation} +\subsection{Important Notes} +\begin{enumerate} +\item The files that are distributed are : +\begin{itemize} +\item \verb+README.txt+ , +\item \verb+procIAGssymp.sty+ , +\item \verb+TestprocIAGssymp.tex+ , +\item \verb+TestprocIAGssymp.pdf+ . +\end{itemize} +\item The copyright holder of this package is its author. +This program may be used, distributed and/or modified under +the conditions of the LaTeX Project Public License. +The latest version of this license is in: +\texttt{http://www.latex-project.org/lppl.txt} +\item When this package is used the correspondence between the +obtained result and any requirement and prescription +must be judged by the user. +\item The release of this package on CTAN is a personal initiative +of its author. The mention of IAG and of the publisher +of the proceedings of the symposia sponsored by IAG does +not imply any involvement of these entities in this initiative. +\end{enumerate} +\subsection{History} +\begin{description} +\item[2000-2002:] development, test, in-house use, +\item[2002:] released in CTAN, +\item[2022:] general revision, +changes in the comments and documentation, new release in CTAN. +\end{description} +% +\subsection{Acknowledgment} +People listed here after contributed with suggestions. +Some of them also provided fragments of code. \\ +Claretta Carrara, Nico Snew, Claudio Beccari. +% \section{Recommendation} -I recommend all the user of the package \texttt{procIAGssymp.sty} +I recommend all the users of the package \texttt{procIAGssymp.sty} to send me any comment about it. -\vfill\eject -\section*{APPENDIX \\ Other \TeX{} and \LaTeX{} material} -This is an appendix not directly related to the main topic of this pages. -Some of the \TeX{} and \LaTeX{} tools that I have prepared -for personal use can be useful for others \TeX-friends. -\paragraph{}\textbf{ -A plain-TeX output routine for multi-column page} can be found in my -personal web site \texttt{http://ing.unitn.it/\~{}bencioli}. -The file is quite simple and it is internally documented. -\paragraph{}\textbf{ -A \LaTeX2e package that allows the re-use of the content of} -\verb+\title+ \textbf{ -and} \verb+\author+\textbf{ anywhere in the document} is -available on CTAN at : -\texttt{. . . /macro/latex/contrib/suppoted/rectopma} -\paragraph{}\textbf{A \LaTeX2e class for multi-author volumes.} -The class \verb+collective.cls+ is a tool designed for the -preparation of a document composed by several contributions written -independently by different authors and binded together in the -proper format by an editor. The typical applications are -the preparation of the proceedings of a meeting or of an issue -of a journal. -The editor can do the job preparing a file, the {\em main file} -that uses the document class \verb+collective+ and that -loads the various papers, the {\em contributions}, that are prepared -by the authors as standard (La)TeX files. A \textbf{preliminary} -release of \verb+collective.cls+ is available on request. -I will send it by e-mail upon request. It -works with some limitations, but I think it is already a useful tool. -The "standard "distribution requires doc-strip for installation; the -unpacked set, including the class file, documentation and an example, is -also available. (I have recently seen an other package with a similar -pourpose posted in the CTAN. ) \end{document} \endinput %% -%% End of file TestPaper.tex
\ No newline at end of file +%% End of file TestprocIAGssymp.tex diff --git a/macros/latex/contrib/procIAGssymp/procIAGssymp.sty b/macros/latex/contrib/prociagssymp/procIAGssymp.sty index 19c272b9f8..9db8245f92 100644 --- a/macros/latex/contrib/procIAGssymp/procIAGssymp.sty +++ b/macros/latex/contrib/prociagssymp/procIAGssymp.sty @@ -1,4 +1,4 @@ -\ProvidesPackage{procIAGssymp}[2002/01/11] +\ProvidesPackage{procIAGssymp}[2022/05/05] %************************************************* %* * %* This file is * @@ -6,17 +6,18 @@ %* procIAGssymp.sty * %* ---------------- * %* * -%* it contains (re-)definitions for the * +%* it contains (re-)definitions for the * %* proceedings of IAG sponsored symposia * %* * %* Author: Battista Benciolini * %* * -%* Address: Dip. Ing. Civile e Ambientale * +%* Address: Dip. di Ingegneria Civile * +%* Ambientale e Meccanica * %* Via Mesiano, 77 * %* I-38050 Trento * %* ITALY * %* * -%* e-mail: Battista.Benciolini@ing.unitn.it * +%* e-mail: Battista.Benciolini@unitn.it * %* * %************************************************* % @@ -27,22 +28,30 @@ % This package provides (re-)definitions of some LaTeX commands % that can be useful for the preparation of a paper with % the style of the proceeding of symposia sponsored by the -% "International Association of Geodesy (IAG)" published -% by "Springer-Verlag Berlin Heidelberg NewYork". +% International Association of Geodesy (IAG). % % % IMPORTANT NOTES % =============== % +% 0- WARNING +% I have not recently checked the instruction from +% the publisher of the proceedings of IAG-sponsored-symposia. +% I presume that "official" more refined and +% up-to-date "sty" and "cls" files +% are now available from the publisher. +% This package is therefore not as useful +% as it was at the time of it's first publication, +% but it is pehaps still convenient for some user. +% % 1 - This file is part of a program (in the meaning specified -% by the LPPL- see next point)) that includes two files -% posted in the same folder: +% by the LPPL- see next point) that includes: +% - README.txt % - procIAGssymp.sty (= this file) -% - TestPaper.tex (= sample and suggestions) -% The copiright holder of this package is its author. -% (sorry for the obvius statment, the LPPL suggests to -% explicitelly mention the copiright holder) -% 2 - This program may be used, distributed and/or modified under +% - TestprocIAGssymp.tex (= sample and suggestions) +% - TestprocIAGssymp.pdf (= sample and suggestions) +% 2 - The copyright holder of this package is its author. +% This program may be used, distributed and/or modified under % the conditions of the LaTeX Project Public License. % The latest version of this license is in: % http://www.latex-project.org/lppl.txt @@ -50,36 +59,34 @@ % obtained result and any requirement and prescription % must be judged by the user. % 4 - The release of this package on CTAN is a personal initiative of -% its author. The mention of IAG and Springer-Verlag does not -% imply any involvement of these entities in this initiative. +% its author. The mention of IAG and of the publisher +% of the procedings of the symposia sponsored by IAG does +% not imply any involvement of these entities in this initiative. % % % HISTORY % ======= -% -% May, 2000 : first version -% June 2001 : version used for proceedings of HM98 symposium -% January 7, 2002 : small improvements, better documentation, -% part of the code (not related with the declared -% purpose) moved to different packages, first -% release in CTAN -% January 11, 2002 : improvements suggested by N.S. +% 2000-2002 : development, test, in-house use +% 2002 : released in CTAN +% 2022 : general revision, +% small changes in the comments and documentation, +% new release in CTAN % % -% AKNOWLADGMENT -% ============= +% AKNOWLEDGMENT +% ============= % -% Peaple listed here after contributed with suggestions and -% with fragments of code: Claretta Carrara, Nico Snew. +% People listed here after contributed with suggestions. +% Some of them also provided fragments of code. +% Claretta Carrara, Nico Snew, Claudio Beccari. % % -------------------------------------------------------------------- % % % The following redefinition of \@maketitle is quite simplified with % respect to the standard one. The data is not printed; the title is -% not centred and it is in sans-serif font; the author is no -% longer in tabular environment; the author and its address -% are \raggedright. +% not centered and it is in sans-serif style; the author is no longer +% in tabular environment; the author and its address are left justified. \def\@maketitle{% %% \newpage %% \null @@ -106,8 +113,8 @@ \global\afterthanksfalse} % % -% redefinition of \section and \subsection for -% 1st and 2nd order headings +% redefinition of sectioning commands tu use proper font and spacing +% 1st and 2nd order headings (section and subsrcion) %%% WARNING : is character size correct ?? % \renewcommand\section{\@startsection% @@ -126,7 +133,7 @@ {2mm}% %afterskip {\normalfont\sffamily\bfseries}} %style % -% redefinition of \subsubsection, \paragraph and \subparagraph +% higher order headings (subsubsection, paragraph and subparagraph) % \renewcommand\subsubsection{\@startsection% {subsubsection}% @@ -164,4 +171,4 @@ % can be used to put some space and a rule after the abstract \newcommand{\linea}{\vskip1mm\noindent\rule{74mm}{.5pt}} % -% end end end
\ No newline at end of file +% end end end |