diff options
Diffstat (limited to 'macros')
-rw-r--r-- | macros/generic/pdfmsym/README.md | 21 | ||||
-rw-r--r-- | macros/generic/pdfmsym/pdfmsym-doc.pdf | bin | 190599 -> 219777 bytes | |||
-rw-r--r-- | macros/generic/pdfmsym/pdfmsym-doc.tex | 170 | ||||
-rw-r--r-- | macros/generic/pdfmsym/pdfmsym.tex | 314 | ||||
-rw-r--r-- | macros/luatex/generic/tsvtemplate/LICENSE | 287 | ||||
-rw-r--r-- | macros/luatex/generic/tsvtemplate/README | 23 | ||||
-rw-r--r-- | macros/luatex/generic/tsvtemplate/tsvtemplate.doc | 108 | ||||
-rw-r--r-- | macros/luatex/generic/tsvtemplate/tsvtemplate.pdf | bin | 0 -> 57753 bytes | |||
-rw-r--r-- | macros/luatex/generic/tsvtemplate/tsvtemplate.sty | 3 | ||||
-rw-r--r-- | macros/luatex/generic/tsvtemplate/tsvtemplate.tex | 27 | ||||
-rw-r--r-- | macros/texinfo/latest/texinfo.tex | 177 |
11 files changed, 994 insertions, 136 deletions
diff --git a/macros/generic/pdfmsym/README.md b/macros/generic/pdfmsym/README.md index 5954add2ed..f79a98d1cb 100644 --- a/macros/generic/pdfmsym/README.md +++ b/macros/generic/pdfmsym/README.md @@ -1,10 +1,25 @@ # PDF Math Symbols - pdfMsym -## version 1.0.2 +## version 1.1.0 + The pdfMsym package provides mathematical symbols for PDF-dependent TeX compilers. -Read the documentation (documentation.pdf) for more details. +pdfMsym requires the font size in order to properly scale its symbols, so the following two lines must be added to your document in order to properly load it: + + \input pdfmsym + \pdfmsymsetscalefactor{10} + +assuming you want to load the package at a 10pt font, you can change the 10 to whatever suits your needs. +If you do not add the `\pdfmsymsetscalefactor` line, all of the macros which require pdf drawing won't work, as well as possibly some other macros. + +The pdfMsym package also provides a relatively easy-to-use interface for creating new symbols. +Read the documentation (pdfmsym-doc.pdf) for more details. + The pdfMsym package is provided under the MIT license. -Compile the documentation via `pdftex pdfsym-doc.tex`. +Compile the documentation via `pdftex pdfmsym-doc.tex`. The pdfMsym package was created and is maintained by Slurp who can be reached via email: slurper04@gmail.com Please report any bugs or issues with the package, doing so would be greatly appreciated. +Suggestions for features to add to the package will also be greatly appreciated. + +Thank you for using pdfMsym, + - Slurp diff --git a/macros/generic/pdfmsym/pdfmsym-doc.pdf b/macros/generic/pdfmsym/pdfmsym-doc.pdf Binary files differindex 6e0305bb56..bd2dab960b 100644 --- a/macros/generic/pdfmsym/pdfmsym-doc.pdf +++ b/macros/generic/pdfmsym/pdfmsym-doc.pdf diff --git a/macros/generic/pdfmsym/pdfmsym-doc.tex b/macros/generic/pdfmsym/pdfmsym-doc.tex index f7e84d1bb4..9c62195832 100644 --- a/macros/generic/pdfmsym/pdfmsym-doc.tex +++ b/macros/generic/pdfmsym/pdfmsym-doc.tex @@ -48,6 +48,7 @@ \catcode`\/=0% \catcode`\$=12% \catcode`\\=12% + \catcode`\#=12% \catcode`\%=12 \setbox1=\hbox\bgroup}} \def\endcode{% \egroup\egroup% @@ -98,15 +99,17 @@ }} \def\showcasevecc#1#2#3{\hbox to\hsize{\hss\vbox{\tabskip=5pt\openup3\jot% -\halign{\tt\hskip 1cm\string##\tabskip=0pt\hfil&\quad##\hfil&\quad\hfil##\tabskip=5pt\cr +\halign{\tt\hskip 1cm\string##\tabskip=0pt\hfil&&\quad##\hfil&\quad\hfil##\tabskip=5pt\cr \omit\tt\string#1: & \tt\string#1 & \tt\expandafter\string\csname short\m@strip#1\endcsname% \cr\noalign{\kern3pt\hrule\kern3pt} - \displaystyle & $\displaystyle #2$ & $\displaystyle #3$\cr - \textstyle & $\textstyle #2$ & $\textstyle #3$\cr - \scriptstyle & $\scriptstyle #2$ & $\scriptstyle #3$\cr - \scriptscriptstyle & $\scriptscriptstyle #2$ & $\scriptscriptstyle #3$\cr} + \displaystyle & $\displaystyle #1{#2}$ & $\displaystyle \csname short\m@strip#1\endcsname{#3}$ \cr + \textstyle & $\textstyle #1{#2}$ & $\textstyle \csname short\m@strip#1\endcsname{#3}$ \cr + \scriptstyle & $\scriptstyle #1{#2}$ & $\scriptstyle \csname short\m@strip#1\endcsname{#3}$ \cr + \scriptscriptstyle & $\scriptscriptstyle #1{#2}$ & $\scriptscriptstyle \csname short\m@strip#1\endcsname{#3}$ \cr} }\hss}\bigskip} +\def\showcaseveccs#1#2#3#4{\showcasevecc{#1}{#3}{#4}\showcasevecc{#2}{#3}{#4}} + \def\showcasearrow#1#2#3#4{\hbox to\hsize{\hss\vbox{\tabskip=0pt\openup3\jot \halign{\tt\hskip 1cm\string##\tabskip=0pt\hfil&\quad##\hfil&\quad\hfil##\hfil\quad&\quad\hfil##\tabskip=5pt\cr \omit\tt\string#1: & \tt\string#1 & \tt\expandafter\string\csname long\m@strip#1\endcsname & @@ -138,7 +141,7 @@ {\setbox0=\hbox{\fakebold{\pdfMsym}}\centerline{\hbox to8\wd0{\hfil\it version \pdfMsymversion}}} \centerline{\it S. Lurp} \centerline{\tt slurper04@gmail.com} -\centerline{\it December 15, 2022} +\centerline{\it December 21, 2022} \bigskip \hbox to \hsize{\hfil\vbox{\hsize=.7\hsize @@ -156,20 +159,20 @@ Unfortunately, some macros are not supported by \xetex. \hrule }\hfil} -\vfill\break +\vfill\eject \footline={\hfil\folio\hfil} \section{An Introduction to \scalebox[2]{\fakebold\pdfMsym}} The main motivator for creating \pdfMsym{} was \TeX's poor implementation of the \macroname\overrightarrow{} macro which many times yields unsavory results. -For example \icode \overrightarrow{\hbox{ABC}}/eicode{} yields: +For example \icode \overrightarrow{\rm ABC}/eicode{} yields: -$$ \overrightarrow{\hbox{ABC}} $$ +$$ \overrightarrow{\rm ABC} $$ As you can see, the arrow overlaps with the {\tt ABC} which is undesirable. -This can be fixed by altering the \macroname\rightarrow{} macro, but I decided to make a more versatile alternative. -The \pdfMsym{} alternative, \macroname\vecc{}, on the other hand yields: +This can be fixed by altering the \macroname\rightarrow{} macro, but I decided to make a more versatile alternative: +the \pdfMsym{} alternative \macroname\vecc{}: $$ \vecc{\hbox{ABC}} $$ @@ -195,11 +198,21 @@ This section will simply be an exhaustive list of all the predefined symbols \pd \subsection{Math Symbols} {\tabskip=10pt plus 5pt minus 5pt\openup3\jot\halign to \hsize{{\hsize=.45\hsize#}\hfil&\hfil{\hsize=.45\hsize#}\cr -\vbox{\showcase\dwedge{A\dwedge B}} & \vbox{\showcase\dcup{A\dcup B}}\cr -\vbox{\showcase\bigdwedge{A\dwedge\bigdwedge_{n=1}^N B_n}} & \vbox{\showcase\bigdcup{A\dcup\bigdcup_{n=1}^N B_n}}\cr -\noalign{\vfil\eject} +\vbox{\showcase\dwedge{A\dwedge B}} & \vbox{\showcase\bigdwedge{A\dwedge\bigdwedge_{n=1}^N B_n}}\cr +\vbox{\showcase\circwedge{A\circwedge B}} & \vbox{\showcase\bigcircwedge{A\circwedge\bigcircwedge_{k=1}^n A_k}}\cr +\noalign{\vfill\eject} +\vbox{\showcase\dcup{A\dcup B}} & \vbox{\showcase\bigdcup{A\dcup\bigdcup_{n=1}^N B_n}}\cr \vbox{\showcase\aint{f(x) + \aint_a^b g(x)\, dx}} & \vbox{\showcase\divs{n\divs m}}\cr -\vbox{\showcase\ndivs{n\ndivs m}} & \cr}} +\vbox{\showcase\ndivs{n\ndivs m}} & \vbox{\showcase\bigforall{P: \bigforall_{x\in X}Q(x)}}\cr +\vbox{\showcase\bigexists{P: \bigexists_{x\in X}Q(x)}} & \cr}} + +\bigskip +\pdfMsym{} also provides arbitrary length closed loop integrals via +\macrousage \oiNint{<N>} /emacrousage +which creates an $N$ dimensional closed loop integral. +Similarly \macroname\biNint{} creates a similar integral sign but rectangular instead of elliptical. + +\line{\hfil$\displaystyle{\textstyle\oiNint{3}_A^B}\quad\oiNint{3}_A^B\hfil\biNint{3}_{A}^{B}\quad{\textstyle\biNint{3}_A^B}$\hfil} Additionally, \macroname\lightning{} is provided as a textmode command and renders \lightning. @@ -209,16 +222,17 @@ Each vector comes as a pair: the normal form and the short form. The normal form is meant to cover longer material while the short form covers shorter material. \bigskip -\showcasevecc\vecc{\vecc{\hbox{ABC}}}{\shortvecc{a}} -\showcasevecc\lvecc{\lvecc{\hbox{ABC}}}{\shortlvecc{a}} -\showcasevecc\overrightharp{\overrightharp{\hbox{ABC}}}{\shortoverrightharp{a}} +\showcaseveccs\vecc\undervecc{\rm ABC}a +\showcasevecc\lvecc{\rm ABC}a +\showcasevecc\underlvecc{\rm ABC}a +\showcaseveccs\straightvecc\understraightvecc{\rm ABC}a \vfill\eject -\showcasevecc\overleftharp{\overleftharp{\hbox{ABC}}}{\shortoverleftharp{a}} -\showcasevecc\oveleftrrightvecc{\overleftrightvecc{\hbox{ABC}}}{\shortoverleftrightvecc{a}} -\showcasevecc\oveleftrrightharp{\overleftrightharp{\hbox{ABC}}}{\shortoverleftrightharp{a}} -\showcasevecc\overrightleftharp{\overrightleftharp{\hbox{ABC}}}{\shortoverrightleftharp{a}} -\showcasevecc\straightvecc{\straightvecc{\hbox{ABC}}}{\shortstraightvecc{a}} -\showcasevecc\straightlvecc{\straightlvecc{\hbox{ABC}}}{\shortstraightlvecc{a}} +\showcaseveccs\straightlvecc\understraightlvecc{\rm ABC}a +\showcaseveccs\overrightharp\underrightharp{\rm ABC}a +\showcaseveccs\overleftharp\underleftharp{\rm ABC}a +\showcaseveccs\overleftrightvecc\underleftrightvecc{\rm ABC}a +\showcaseveccs\overleftrightharp\underleftrightharp{\rm ABC}a +\showcaseveccs\overrightleftharp\underrightleftharp{\rm ABC}a \unless\ifx\pdfxform\undefined The \macroname\constvec{} macro has the following usage: @@ -241,7 +255,6 @@ And creates an extended arrow to fit both the top and bottom material. \showcasearrow\varrightharp{A\varrightharp B}{A\longvarrightharp B}{A\xvarrightharp{ABC}[abc] B} \showcasearrow\varleftharp{A\varleftharp B}{A\longvarleftharp B}{A\xvarleftharp{ABC}[abc] B} \showcasearrow\varleftrightarrow{A\varleftrightarrow B}{A\longvarleftrightarrow B}{A\xvarleftrightarrow{ABC}[abc] B} -\vfill\eject \showcasearrow\varleftrightharp{A\varleftrightharp B}{A\longvarleftrightharp B}{A\xvarleftrightharp{ABC}[abc] B} \showcasearrow\varrightleftharp{A\varrightleftharp B}{A\longvarrightleftharp B}{A\xvarrightleftharp{ABC}[abc] B} \showcasearrow\varmapsto{A\varmapsto B}{A\longvarmapsto B}{A\xvarmapsto{ABC}[abc] B} @@ -252,6 +265,22 @@ And creates an extended arrow to fit both the top and bottom material. \showcasearrow\varcirclerightarrow{A\varcirclerightarrow B}{A\longvarcirclerightarrow B}{A\xvarcirclerightarrow{ABC}[abc] B} \showcasearrow\varcircleleftarrow{A\varcircleleftarrow B}{A\longvarcircleleftarrow B}{A\xvarcircleleftarrow{ABC}[abc] B} +As well as single-stroke arrows, \pdfMsym{} provides double stroke arrows which are analogous to single stroke arrows and have +an identical usage. + +\bigskip +\showcasearrow\varRightarrow{A\varRightarrow B}{A\longvarRightarrow B}{A\xvarRightarrow{ABC}[abc] B} +\showcasearrow\varLeftarrow{A\varLeftarrow B}{A\longvarLeftarrow B}{A\xvarLeftarrow{ABC}[abc] B} +\showcasearrow\varCirclerightarrow{A\varCirclerightarrow B}{A\longvarCirclerightarrow B}{A\xvarCirclerightarrow{ABC}[abc] B} +\showcasearrow\varCircleleftarrow{A\varCircleleftarrow B}{A\longvarCircleleftarrow B}{A\xvarCircleleftarrow{ABC}[abc] B} +\showcasearrow\varSquarerightarrow{A\varSquarerightarrow B}{A\longvarSquarerightarrow B}{A\xvarSquarerightarrow{ABC}[abc] B} +\showcasearrow\varSquareleftarrow{A\varSquareleftarrow B}{A\longvarSquareleftarrow B}{A\xvarSquareleftarrow{ABC}[abc] B} +\showcasearrow\varRibbonrightarrow{A\varRibbonrightarrow B}{A\longvarRibbonrightarrow B}{A\xvarRibbonrightarrow{ABC}[abc] B} +\showcasearrow\varRibbonleftarrow{A\varRibbonleftarrow B}{A\longvarRibbonleftarrow B}{A\xvarRibbonleftarrow{ABC}[abc] B} +\showcasearrow\squaredarrow{A\squaredarrow B}{A\longsquaredarrow B}{A\xsquaredarrow{ABC}[abc] B} +\showcasearrow\roundedarrow{A\roundedarrow B}{A\longroundedarrow B}{A\xroundedarrow{ABC}[abc] B} + +\vfill\eject \subsection{Wide Accents} Wide accents provide variants to the commonly used accents like \macroname\widehat{} and \macroname\widetilde. Unlike these accents, \pdfMsym's wide accents can grow arbitrarily large. @@ -273,11 +302,13 @@ $$ \suum_{\hbox{abcdef}}^{\hbox{ABCDEF}} \qquad \prood_{\hbox{abcdef}}^{\hbox{AB These are not available in \xetex. \fi -\vfill\eject \section{Defining Your Own Symbols} -\pdfMsym{} provides an interface for creating your own mathematical symbols through the use of \macroname\pdfliteral s. -This interface requires prior knowledege of drawing with PDFs. +The following section outlines the interface which \pdfMsym{} utilizes to create its symbols. +Some of the macros require knowledge of {\scten pdf}'s native graphics operators, which is not explained here. +For resources on that, consult Adobe's {\scten pdf} Reference, chapter $4$ (Graphics). + +\subsection{The Macros} \macroexp{\@linehead@type{<pdf code>}{<width>}} This creates a ``linehead'' which is used to cap lines, like \macroname\@rarrow{} ($\@rarrow{.4}{2.5}$). @@ -293,8 +324,11 @@ For example, the definition of \macroname\@rarrow{} is: \def\@rarrow {\@linehead@type{0 0 m 2 0 l 1 0 0 1 0 1.5 c 2 0 m 1 0 0 -1 0 -1.5 c S}{2}} /endcode -The predefine lineheads are +The predefined lineheads are \icode \@rarrow, \@larrow, \@rharp, \@lharp, \@rdharp, \@rlharp, \@mapcap, \@rsarrow, \@lsarrow, \@backhook, \@fronthook, \@doublerarrow, \@doublelarrow, /hfil/break\@circlecap/eicode. +And the predefined double-stroked/wide lineheads are +\icode \@Rarrow, \@Larrow, \@Linecap, \@Rightcirclecap, \@Leftcirclecap, \@Rightsquarecap, \@Leftsquarecap, \@Rightribboncap, +/hfil/break\@Leftribboncap/eicode. \emacroexp \macroexp{\@vecc@def{<vector name>}<left cap><right cap>} This creates a vector macro, like \macroname\vecc. @@ -305,6 +339,14 @@ For example, the definition of the {\tt vecc} vectors is: /endcode \emacroexp +\macroexp{\@undervecc@def{<vector name>}<left cap><right cap>} This creates an under-vector macro, like \macroname\undervecc. +This creates both the normal and short variations of the vector. +For example, the definition of the {\tt undervecc} vectors is: +\begincode +\@undervecc@def{undervecc}\@linecap\@rarrow +/endcode +\emacroexp + \macroexp{\@arrow@def{<arrow name>}<left cap><right cap>} This creates an arrow macro, like \macroname\varrightarrow. This creates the normal, long, and extendable versions of the arrow. For example, the definition of the {\it varrightarrow} vectors is: @@ -313,6 +355,18 @@ For example, the definition of the {\it varrightarrow} vectors is: /endcode \emacroexp +\macroexp{\@Arrow@def{<arrow name>}<left cap><right cap><height displacement>} This creates a double-stroked arrow, like +\macroname\varRightarrow. +This macro creates the normal, long, and extendable versions of the arrow. +{\it height displacement} is half the difference in height between the two strokes (the difference of height between one stroke +and the center). +For the default double stroke linecaps \pdfMsym{} defines, this should be $1$. +For example, the definition of {\it varRightarrow} is: +\begincode +\@Arrow@def{varRightarrow}\@Linecap\@Rarrow{1} +/endcode +\emacroexp + \macroexp{\@wide@accent{<pdf code>}} This creates a wide accent, like \macroname\varwidecheck. The width of the drawing by the {\it pdf code} should be $1$, and it should be filled not stroked (since the accent is transformed to stretch over the material beneath it). @@ -323,7 +377,7 @@ For example, the definition of \macroname\varwidecheck{} is: /endcode \emacroexp -\macroexp{\pdf@drawing@macro{<name>}{<pdf code>}{<width>}{<height>}{<horizontal skew>}{<depth>}} This creates a text mode +\macroexp{\pdf@drawing@macro{<name>}{<pdf code>}{<width>}{<height>}{<depth>}{<horizontal skew>}} This creates a text mode symbol like \macroname\lightning. It is important that the {\it pdf code} fits inside the box created by {\it width, height,\/} and {\it depth} since the drawing is placed inside of an XForm and so anything outside the box will be cropped. @@ -338,7 +392,7 @@ For example, the definition of \macroname\lightning{} is: /endcode \emacroexp -\macroexp{\pdf@drawing@math@macro{<name>}{<pdf code>}{<width>}{<height>}{<skew>}{<depth>}<style scaling>} This creates a math +\macroexp{\pdf@drawing@math@macro{<name>}{<pdf code>}{<width>}{<height>}{<depth>}{<skew>}<style scaling>} This creates a math mode symbol like \macroname\divs. The first few parameters are identical in use as \macroname\pdf@drawing@macro's, and {\it style scaling} is used to set the scaling for the symbol in different math styles. @@ -378,6 +432,34 @@ Another example, this time the definition of \macroname\bigdcup{} is: /endcode \emacroexp +\macroexp{\@skewedlim@op{<operator>}{<sup1>}{<sub1>}{<sup2>}{<sub2>}{<sup3>}{<sub3>}{<default limit>}} +This creates a large math operator with skewed limits, like \macroname\int. +{\it operator} should be a math operator, {\it sup1} and {\it sub1} are the skews of the superscript and subscript of the +operator, respectively under \macroname\nolimits. +Similarly {\it sup2} and {\it sub2} are the skews for \macroname\limits, and {\it sup3} and {\it sub3} are the +skews for the default limit (if this is not followed by \macroname\limits{} or \macroname\nolimits) which is given by +{\it default limit}. + +For example, \macroname\@oiNint{} is defined to be a macro which creates the shape of \macroname\oiNint{} (see below), and +\macroname\oiNint{} is defined as +\begincode +\def\oiNint#1{\@skewedlim@op{\mathop{\@oiNint{#1}}}{-4}{6}{-10}{10}{-4}{6}\nolimits} +/endcode +\emacroexp + +\macroexp{\putexsym{<symbol>}<left cap><right cap>{<height displacement>}{<skew>}} This draws a double stroked drawing on top of +{\it symbol} whose caps are {\it left cap} and {\it right cap} with a height displacement (the half the space between strokes) of +{\it height displacement}. +{\it skew} alters the space between the end of {\it symbol} and where the double stroked drawing is drawn. +For example, \macroname\@oiNint, which gives the shape of \macroname\oiNint, is defined as +\begincode +\def\@oiNint#1{\putexsym{\iNint{#1}}\@BigLeftcirclecap\@BigRightcirclecap{2.5}{4}} +/endcode +\macroname\iNint{} is a macro +\macrousage \iNint{<N>} /emacrousage +which prints {\it N} integrals with a kern \macroname\iNint@kern@{} between each one. +\emacroexp + \unless\ifx\pdfxform\undefined \macroexp{\@wide@operator{<name>}<operator>{<first cut>}{<second cut>}} This creates an extendable operator of {\it operator} whose name is {\it name}, like \macroname\suum. @@ -397,4 +479,30 @@ $$ \@show@slices{suum} $$ These macros are not available for \xetex. \emacroexp \fi + +\subsection{The Dimensions} +For fine-tuning of symbols, it may be useful to familiarize oneself with the various dimensions \pdfMsym{} utilizes for various +purposes throught its symbol definitions. +Dimensions are all defined as macros, and are all dimensionless. +If a dimension is defined as $1$ then it corresponds to $1$ in $10$pt font. + +{\everycr{\noalign{\kern10pt}}\halign{\tt\vtop{\hsize=.2\hsize#}\hfil\tabskip=.05\hsize&\hfil\vtop{\hsize=.75\hsize#}\tabskip=0pt\cr +\string\@font@scale & The amount of scaling relative to $10$pt, this is defined via \macroname\pdfmsymsetscalefactor.\cr +\string\vecc@w & The height of the arrows, similarly there is \macroname\vecc@hw{} which must be equal to half of \macroname\vecc@w.\cr +\string\vecc@skew & \pdfMsym{} leaves a space of \macroname\vecc@skew{} between the ends of material and the endpoints of +the vector on top or below the material.\cr +\string\vecc@X@s\par\string\vecc@X@sf & \macroname\vecc@X@s{} is the ratio of the scaling factor (as a decimal) of the +$X$ math style ($X$ can be {\tt displaystyle}, {\tt textstyle}, etc.). +Similarly \macroname\vecc@X@sf{} should be numerically equivalent to \macroname\vecc@X@s{} but written as a fraction. +\pdfMsym{} scales (many, but not all, see \macroname\exsym@X@s{} and \macroname\exsym@X@sf) math macros according to these values.\cr +\string\vecc@skip & The amount of space between material and the vector symbol above or below it.\cr +\string\arrow@skip & The math kerning to be used around an arrow. +\macroname\arrow@skip{} must be defined as glue, eg \icode \mkern1mu/eicode.\cr +\string\xarrow@buffer & The amount of extra arrow to add between the caps of an extendable arrow and when the above/below material begins.\cr +\string\accent@skew & Analogous to \macroname\vecc@skew{} but for extendable accents.\cr +\string\accent@raise & Analogous to \macroname\vecc@skip{} but for extendable accents.\cr +\string\exsym@X@s\par\string\exsym@X@sf & Analogous to \macroname\vecc@X@s{} and \macroname\vecc@X@sf but used by \macroname\putexsym.\cr +\string\iNint@kern@ & The amount of kerning to put between integral signs in \macroname\iNint. +This must be given as glue, eg. \icode \mkern-10mu\mathchoice{\mkern-5mu}{}{}{}/eicode.\cr +}} \end diff --git a/macros/generic/pdfmsym/pdfmsym.tex b/macros/generic/pdfmsym/pdfmsym.tex index 732d9b1c6a..f08317ac56 100644 --- a/macros/generic/pdfmsym/pdfmsym.tex +++ b/macros/generic/pdfmsym/pdfmsym.tex @@ -8,9 +8,12 @@ \catcode`\@=11 \def\pdfMsym{{\scten pdf}{\rm M}{\scten sym}} -\def\pdfMsymversion{1.0.2} +\def\pdfMsymversion{1.1.0} + +\ifx\@gobble\undefined + \long\def\@gobble#1{} +\fi -\def\@gobble#1{} \def\m@strip{\expandafter\@gobble\string} \ifx\@ifnextchar\undefined @@ -28,8 +31,18 @@ } \fi -\def\@firstoftwo#1#2{#1} -\def\@secondoftwo#1#2{#2} +\ifx\@firstoftwo\undefined + \long\def\@firstoftwo#1#2{#1} + \long\def\@secondoftwo#1#2{#2} +\fi + +\long\def\pdfmsym@afterfi#1#2\fi{\fi#1} + +\def\pdfmsym@repeated#1#2{% + \ifnum#1>0 % + \pdfmsym@afterfi{#2\expandafter\pdfmsym@repeated\expandafter{\the\numexpr #1-1\relax}{#2}}% + \fi% +} \begingroup\lccode`\?=`\p \lccode`\!=`\t % \lowercase{\endgroup @@ -71,8 +84,8 @@ {\@@linehead@type{#3}{#4}{#1}{#2}[1][1]}% } -\def\@rarrow {\@linehead@type{0 0 m 2 0 l 1 0 0 1 0 1.5 c 2 0 m 1 0 0 -1 0 -1.5 c S}{2}} -\def\@larrow {\@linehead@type{2 0 m 0 0 l 1 0 2 1 2 1.5 c 0 0 m 1 0 2 -1 2 -1.5 c S}{2}} +\def\@rarrow {\@linehead@type{0 0 m 2 0 l 1 0 0 1.2 0 1.5 c 2 0 m 1 0 0 -1.2 0 -1.5 c S}{2}} +\def\@larrow {\@linehead@type{2 0 m 0 0 l 1 0 2 1.2 2 1.5 c 0 0 m 1 0 2 -1.2 2 -1.5 c S}{2}} \def\@rharp {\@linehead@type{0 0 m 2 0 l 1 0 0 1 0 1.5 c S}{2}} \def\@lharp {\@linehead@type{2 0 m 0 0 l 1 0 2 1 2 1.5 c S}{2}} \def\@rdharp {\@linehead@type{0 0 m 2 0 l 1 0 0 -1 0 -1.5 c S}{2}} @@ -81,44 +94,98 @@ \def\@mapcap {\@linehead@type{0 1.5 m 0 -1.5 l 0 0 m 1 0 l S}{1}} \def\@rsarrow{\@linehead@type{0 0 m 2 0 l 0 1 l 2 0 m 0 -1 l S}{2}} \def\@lsarrow{\@linehead@type{2 0 m 0 0 l 2 1 l 0 0 m 2 -1 l S}{2}} -\def\@backhook{\@linehead@type{.5 1 m .25 1 0 .75 0 .5 c 0 .25 .25 0 .5 0 c S}{0.5}} -\def\@fronthook{\@linehead@type{0 1 m .25 1 .5 .75 .5 .5 c .5 .25 .25 0 0 0 c S}{0.5}} -\def\@doublerarrow{\@linehead@type{0 0 m 2 0 l 1 0 0 1 0 1.5 c 2 0 m 1 0 0 -1 0 -1.5 c 2 0 m 4 0 l 3 0 2 1 2 1.5 c 4 0 m 3 0 2 -1 2 -1.5 c S}{4}} -\def\@doublelarrow{\@linehead@type{4 0 m 2 0 l 3 0 4 1 4 1.5 c 2 0 m 3 0 4 -1 4 -1.5 c 2 0 m 0 0 l 1 0 2 1 2 1.5 c 0 0 m 1 0 2 -1 2 -1.5 c S}{4}} +\def\@backhook{\@linehead@type{1 2 m .5 2 0 1.5 0 1 c 0 .5 .5 0 1 0 c S}{1}} +\def\@fronthook{\@linehead@type{0 2 m .5 2 1 1.5 1 1 c 1 .5 .5 0 0 0 c S}{1}} +\def\@doublerarrow{\@linehead@type{0 0 m 2 0 l 1 0 0 1.2 0 1.5 c 2 0 m 1 0 0 -1.2 0 -1.5 c 2 0 m 4 0 l 3 0 2 1.2 2 1.5 c 4 0 m 3 0 2 -1.2 2 -1.5 c S}{4}} +\def\@doublelarrow{\@linehead@type{4 0 m 2 0 l 3 0 4 1.2 4 1.5 c 2 0 m 3 0 4 -1.2 4 -1.5 c 2 0 m 0 0 l 1 0 2 1.2 2 1.5 c 0 0 m 1 0 2 -1.2 2 -1.5 c S}{4}} \def\@circlecap{\@linehead@type{0 0 m 0 .5 .5 1 1 1 c 1.5 1 2 .5 2 0 c 2 -.5 1.5 -1 1 -1 c .5 -1 0 -.5 0 0 c S}{2}} +\def\@Rarrow {\@linehead@type{0 -1 m 1 -1 l 0 1 m 1 1 l 3 0 m 1.5 0 0 2 0 2.5 c 3 0 m 1.5 0 0 -2 0 -2.5 c S}{3}} +\def\@Larrow {\@linehead@type{3 -1 m 2 -1 l 3 1 m 2 1 l 0 0 m 1.5 0 3 2 3 2.5 c 0 0 m 1.5 0 3 -2 3 -2.5 c S}{3}} +\def\@Linecap {\@linehead@type{0 -1 m 1 -1 l 0 1 m 1 1 l S}{1}} +\def\@Rightcirclecap{\@linehead@type{0 1 m .5 1 1 .5 1 0 c 1 -.5 .5 -1 0 -1 c S}{1}} +\def\@Leftcirclecap{\@linehead@type{1 1 m .5 1 0 .5 0 0 c 0 -.5 .5 -1 1 -1 c S}{1}} +\def\@Rightsquarecap{\@linehead@type{0 1 m 1 1 l 1 -1 l 0 -1 l S}{1}} +\def\@Leftsquarecap{\@linehead@type{1 1 m 0 1 l 0 -1 l 1 -1 l S}{1}} +\def\@Rightribboncap{\@linehead@type{0 1 m 2 1 l 0 0 l 2 -1 l 0 -1 l S}{2}} +\def\@Leftribboncap{\@linehead@type{1.5 1 m 0 1 l 1.5 0 l 0 -1 l 1.5 -1 l S}{1.5}} +\def\@Circlescap{\@linehead@type{0 -1 m 0 -.5 .5 0 1 0 c 1.5 0 2 -.5 2 -1 c 2 -1.5 1.5 -2 1 -2 c .5 -2 0 -1.5 0 -1 c + 0 1 m 0 1.5 .5 2 1 2 c 1.5 2 2 1.5 2 1 c 2 .5 1.5 0 1 0 c .5 0 0 .5 0 1 c S}{2}} + \def\vecc@w{.4} \def\vecc@hw{.2} \def\vecc@skew{2.5} \def\vecc@displaystyle@s{1} \def\vecc@displaystyle@sf{1} \def\vecc@textstyle@s{1} \def\vecc@textstyle@sf{1} \def\vecc@scriptstyle@s{.8} \def\vecc@scriptstyle@sf{8 / 10} \def\vecc@scriptscriptstyle@s{.6} \def\vecc@scriptscriptstyle@sf{6 / 10} +\def\vecc@skip{.4} + +%\def\@@@vecc@type#1#2#3#4#5{% +% \mathord{\mathop{\kern\z@#1}\limits^{% +% \mkern\vecc@skew mu% +% #2{\vecc@w}{\vecc@hw}[#4][#5]% +% \cleaders\hrule height \dimexpr \vecc@w pt * #4 * \@font@scale\relax\hfill% +% #3{\vecc@w}{\vecc@hw}[#4][#5]% +% \mkern\vecc@skew mu}% +%}} + +\def\@@@vecc@type#1#2#3#4#5#6{% + \vbox{\offinterlineskip% + \ialign{##\cr + $\m@th\mkern\vecc@skew mu% + #2{\vecc@w}{\vecc@hw}[#4][#5]% + \cleaders\hrule height \dimexpr \vecc@w pt * #4 * \@font@scale\relax\hfill% + #3{\vecc@w}{\vecc@hw}[#4][#5]% + \mkern\vecc@skew mu$\cr\noalign{\kern\dimexpr\vecc@skip ex * #4\relax}%% + $\m@th#6#1$\cr% + }% + }% +} -\def\@@@vecc@type#1#2#3#4#5{% - \mathord{\mathop{\kern\z@#1}\limits^{% - \mkern\vecc@skew mu% - #2{\vecc@w}{\vecc@hw}[#4][#5]% - \cleaders\hrule height \dimexpr \vecc@w pt * #4 * \@font@scale\relax\hfill% - #3{\vecc@w}{\vecc@hw}[#4][#5]% - \mkern\vecc@skew mu}% -}} - -\def\@@vecc@type#1#2{\@@@vecc@type#2{\csname vecc@\m@strip#1@sf\endcsname}{\csname vecc@\m@strip#1@s\endcsname}} +\def\@@vecc@type#1#2{\@@@vecc@type#2{\csname vecc@\m@strip#1@sf\endcsname}{\csname vecc@\m@strip#1@s\endcsname}{#1}} \def\@vecc@type#1#2#3{\mathpalette\@@vecc@type{{#1}{#2}{#3}}} +\def\@@@undervecc@type#1#2#3#4#5#6{% + \vtop{\offinterlineskip% + \ialign{##\cr + $\m@th#6#1$\cr\noalign{\kern\dimexpr\vecc@skip ex * #4\relax}% + $\m@th\mkern\vecc@skew mu% + #2{\vecc@w}{\vecc@hw}[#4][#5]% + \cleaders\hrule height \dimexpr \vecc@w pt * #4 * \@font@scale\relax\hfill% + #3{\vecc@w}{\vecc@hw}[#4][#5]% + \mkern\vecc@skew mu$\cr% + }% + }% +} + +\def\@@undervecc@type#1#2{\@@@undervecc@type#2{\csname vecc@\m@strip#1@sf\endcsname}{\csname vecc@\m@strip#1@s\endcsname}{#1}} +\def\@undervecc@type#1#2#3{\mathpalette\@@undervecc@type{{#1}{#2}{#3}}} + \def\@vecc@def#1#2#3{% \expandafter\def\csname #1\endcsname##1{\@vecc@type{##1}{#2}{#3}}% \expandafter\def\csname short#1\endcsname##1{{\def\vecc@skew{0}\csname #1\endcsname{##1}}}% } +\def\@undervecc@def#1#2#3{% + \expandafter\def\csname #1\endcsname##1{\@undervecc@type{##1}{#2}{#3}}% + \expandafter\def\csname short#1\endcsname##1{{\def\vecc@skew{0}\csname #1\endcsname{##1}}}% +} + +\def\@overunder@def#1#2#3{\@vecc@def{over#1}{#2}{#3}\@undervecc@def{under#1}{#2}{#3}} + \@vecc@def{vecc}\@linecap\@rarrow \@vecc@def{lvecc}\@larrow\@linecap -\@vecc@def{overrightharp}\@linecap\@rharp -\@vecc@def{overleftharp}\@lharp\@linecap -\@vecc@def{overleftrightvecc}\@larrow\@rarrow -\@vecc@def{overleftrightharp}\@lharp\@rdharp -\@vecc@def{overrightleftharp}\@ldharp\@rharp \@vecc@def{straightvecc}\@linecap\@rsarrow \@vecc@def{straightlvecc}\@lsarrow\@linecap +\@undervecc@def{undervecc}\@linecap\@rarrow +\@undervecc@def{underlvecc}\@larrow\@linecap +\@undervecc@def{understraightvecc}\@linecap\@rsarrow +\@undervecc@def{understraightlvecc}\@lsarrow\@linecap + +\@overunder@def{rightharp}\@linecap\@rharp +\@overunder@def{leftharp}\@lharp\@linecap +\@overunder@def{leftrightvecc}\@larrow\@rarrow +\@overunder@def{leftrightharp}\@lharp\@rdharp +\@overunder@def{rightleftharp}\@ldharp\@rharp \unless\ifx\pdfxform\undefined \def\@@constvec#1#2#3{{% @@ -132,7 +199,7 @@ \fi \def\arrow@skip{\mkern1mu} -\def\xarrow@buffer{3} +\def\xarrow@buffer{1} \def\@@@xarrow@type#1#2#3#4#5#6#7{\mathrel{\arrow@skip% \vcenter{\hbox{$#7% #1{\vecc@w}{\vecc@hw}[#5][#6]% @@ -185,6 +252,93 @@ \@arrow@def{varcirclerightarrow}\@circlecap\@rarrow \@arrow@def{varcircleleftarrow}\@larrow\@circlecap +\def\@subscriptconvdef#1#2{\expandafter\let\csname \m@strip#1@subconv\endcsname=#2} +\def\@subscriptconv#1{\csname \m@strip#1@subconv\endcsname} +\@subscriptconvdef\displaystyle\scriptstyle +\@subscriptconvdef\textstyle\scriptstyle +\@subscriptconvdef\scriptstyle\scriptscriptstyle +\@subscriptconvdef\scriptscriptstyle\scriptscriptstyle + +\def\@@Arrow@rule#1#2#3{% + \lower\dimexpr #2 * #3 * \@font@scale\relax + \vbox{% + \hrule width #1 height \dimexpr \vecc@w pt * #3 * \@font@scale\relax depth 0pt% + \kern\dimexpr #2 * #3 * \@font@scale * 2 - \vecc@w pt * #3 * \@font@scale\relax% + \hrule width #1 height \dimexpr \vecc@w pt * #3 * \@font@scale\relax depth 0pt% + }% +} + +% #1 width #2 bar height difference #3 mathstyle scale (fraction) +\def\@Arrow@rule#1#2#3{% + \@@Arrow@rule{\dimexpr #1 * #3\relax}{#2}{#3}% +} + +% #1 left cap +% #2 right cap +% #3 bar displacement +% #4 top material +% #5 bottom material +% #6 mathstyle scale (fraction) +% #7 mathstyle scale (decimal) +% #8 mathstyle +\def\@@@xArrow@type#1#2#3#4#5#6#7#8{\mathrel{\arrow@skip% + {\setbox0=\hbox{$#8-$}\raise.5\dimexpr\ht0-\dp0-(\vecc@w pt * #6 * \@font@scale)\relax\hbox{$#8% + \setbox0=\hbox{$\@subscriptconv#8#5$}% + #1{\vecc@w}{\vecc@hw}[#6][#7]% + \@Arrow@rule{\xarrow@buffer pt}{#3 pt}{#6}% + \lower\dimexpr (#3 pt + \vecc@skip ex) * #6 * \@font@scale+\ht0\relax + \vbox{\offinterlineskip% + \ialign{\hfil##\hfil\cr + $\@subscriptconv#8#4$\cr\noalign{\kern\dimexpr\vecc@skip ex * #6 * \@font@scale\relax}% + \leaders\hrule height \dimexpr \vecc@w pt * #6 * \@font@scale\relax\hfill\cr% + \noalign{\kern\dimexpr #3 pt * #6 * \@font@scale * 2 - \vecc@w pt * #6 * \@font@scale\relax}% + \leaders\hrule height \dimexpr \vecc@w pt * #6 * \@font@scale\relax\hfill\cr\noalign{\kern\dimexpr\vecc@skip ex * #6 * \@font@scale\relax}% + $\@subscriptconv#8#5$\cr% + }% + }% + \@Arrow@rule{\xarrow@buffer pt}{#3 pt}{#6}% + #2{\vecc@w}{\vecc@hw}[#6][#7]% + $}}% + \arrow@skip% +}} + +\def\@@xArrow@type#1#2{\@@@xArrow@type#2{\csname vecc@\m@strip#1@sf\endcsname}{\csname vecc@\m@strip#1@s\endcsname}{#1}} +\def\@xArrow@type#1#2#3#4#5{\mathpalette\@@xArrow@type{{#1}{#2}{#3}{#4}{#5}}} + +\def\@@@Arrow@type#1#2#3#4#5#6#7{\mathrel{\arrow@skip% + \vcenter{\hbox{$#7% + #1{\vecc@w}{\vecc@hw}[#5][#6]% + \@Arrow@rule{#3}{#4pt}{#5}% + #2{\vecc@w}{\vecc@hw}[#5][#6]% + $}}\arrow@skip% +}} + +\def\@@Arrow@type#1#2{\@@@Arrow@type#2{\csname vecc@\m@strip#1@sf\endcsname}{\csname vecc@\m@strip#1@s\endcsname}{#1}} +\def\@Arrow@type#1#2#3#4{\mathpalette\@@Arrow@type{{#1}{#2}{#3}{#4}}} + +\def\@Arrow@def#1#2#3#4{% + \expandafter\def\csname #1\endcsname{\@Arrow@type{#2}{#3}{1ex}{#4}}% + \expandafter\def\csname long#1\endcsname{\@Arrow@type{#2}{#3}{2ex}{#4}}% + \expandafter\def\csname @x#1\endcsname##1[##2]{\@xArrow@type{#2}{#3}{#4}{##1}{##2}}% + \expandafter\def\csname x#1\endcsname##1{% + \@ifnextchar[ {\csname @x#1\endcsname{##1}}% + {\csname @x#1\endcsname{##1}[]}% + }% +} + +\@Arrow@def{varRightarrow}\@Linecap\@Rarrow{1} +\@Arrow@def{varLeftarrow}\@Larrow\@Linecap{1} +\@Arrow@def{varCirclerightarrow}\@Leftcirclecap\@Rarrow{1} +\@Arrow@def{varCircleleftarrow}\@Larrow\@Rightcirclecap{1} +\@Arrow@def{varSquarerightarrow}\@Leftsquarecap\@Rarrow{1} +\@Arrow@def{varSquareleftarrow}\@Larrow\@Rightsquarecap{1} +\@Arrow@def{varRibbonrightarrow}\@Leftribboncap\@Rarrow{1} +\@Arrow@def{varRibbonleftarrow}\@Larrow\@Rightribboncap{1} +\@Arrow@def{roundedarrow}\@Leftcirclecap\@Rightcirclecap{1} +\@Arrow@def{squaredarrow}\@Leftsquarecap\@Rightsquarecap{1} +\@Arrow@def{rightPP}\@Circlescap\@Rightcirclecap{1} +\@Arrow@def{leftPP}\@Leftcirclecap\@Circlescap{1} + \def\accent@skew{.4} \def\accent@raise{.25} \def\@@@wide@accent#1#2#3{{% @@ -212,6 +366,86 @@ \def\varwidehat{\@wide@accent{0 0 m .5 .9 l 1 0 l 1 .3 l .5 1.6 l 0 .3 l f}} \def\varwidetilde{\@wide@accent{0 0 m .25 1.5 .45 1.1 .5 1 c .55 .9 .75 0 1 1.5 c 1 1.75 l .75 .5 .55 1.4 .5 1.5 c .45 1.6 .25 2 0 .25 c f}} +\def\@skewedlim@op@done#1#2#3#4#5{#1^{\mkern-#2mu#4}_{\mkern-#3mu#5}} +\def\@skewedlim@op@supsub#1#2#3#4_#5{\@skewedlim@op@done{#1}{#2}{#3}{#4}{#5}} +\def\@skewedlim@op@subsup#1#2#3#4^#5{\@skewedlim@op@done{#1}{#2}{#3}{#5}{#4}} +\def\@skewedlim@op@sub#1#2#3#4#5{% + \@ifnextchar^ {\@skewedlim@op@subsup{#1}{#2}{#3}{#5}}% + {\@skewedlim@op@done{#1}{#2}{#3}{}{#5}}% +} +\def\@skewedlim@op@sup#1#2#3#4#5{% + \@ifnextchar_ {\@skewedlim@op@supsub{#1}{#2}{#3}{#5}}% + {\@skewedlim@op@done{#1}{#2}{#3}{#5}{}}% +} +\def\@skewedlim@op@nsup#1#2#3{% + \@ifnextchar_ {\@skewedlim@op@sub{#1}{#2}{#3}}% + {\@skewedlim@op@done{#1}{#2}{#3}{}{}}% +} +\def\@@skewedlim@op#1#2#3{% + \@ifnextchar^ {\@skewedlim@op@sup{#1}{#2}{#3}}% + {\@skewedlim@op@nsup{#1}{#2}{#3}}% +} + +\def\@skewedlim@op@limits{% + \ifx\@skewedlim@char\nolimits% + \pdfmsym@afterfi{\@@skewedlim@op{\@skewedlim@atom\nolimits}{\@skewedlim@nolim@supskew}{\@skewedlim@nolim@subskew}}% + \else% + \pdfmsym@afterfi{\ifx\@skewedlim@char\limits% + \pdfmsym@afterfi{\@@skewedlim@op{\@skewedlim@atom\limits}{\@skewedlim@lim@supskew}{\@skewedlim@lim@subskew}}% + \else% + \pdfmsym@afterfi{\@@skewedlim@op{\@skewedlim@atom\@skewedlim@preflim}{\@skewedlim@preflim@supskew}{\@skewedlim@preflim@subskew}\@skewedlim@char}% + \fi}% + \fi% +} + +\def\@skewedlim@op#1#2#3#4#5#6#7#8{% + \def\@skewedlim@atom{#1}% + \def\@skewedlim@nolim@supskew{#2}\def\@skewedlim@nolim@subskew{#3}% + \def\@skewedlim@lim@supskew{#4}\def\@skewedlim@lim@subskew{#5}% + \def\@skewedlim@preflim@supskew{#6}\def\@skewedlim@preflim@subskew{#7}% + \def\@skewedlim@preflim{#8}% + \afterassignment\@skewedlim@op@limits% + \let\@skewedlim@char=% +} + +\def\exsym@displaystyle@s{1} \def\exsym@displaystyle@sf{1} +\def\exsym@textstyle@s{.7} \def\exsym@textstyle@sf{7 / 10} +\def\exsym@scriptstyle@s{.7} \def\exsym@scriptstyle@sf{7 / 10} +\def\exsym@scriptscriptstyle@s{.6} \def\exsym@scriptscriptstyle@sf{6 / 10} +% #1 main symbol +% #2 left cap +% #3 right cap +% #4 height difference +% #5 width skew +% #6 mathstyle scale (fraction) +% #7 mathstyle scale (decimal) +% #8 mathstyle +\def\@@putexsym#1#2#3#4#5#6#7#8{{% + \setbox0=\hbox{$\m@th#8#1$}% + \setbox1=\hbox{$\m@th#2{\vecc@w}{\vecc@hw}[#6][#7]$}% + \kern\dimexpr\wd1 - #5 pt * #6 * \@font@scale\relax\rlap{$#8#1$}\kern-\dimexpr\wd1 - #5pt * #6 * \@font@scale\relax% + \raise.5\dimexpr\ht0-\dp0\relax + \vbox{\hbox{$#8#2{\vecc@w}{\vecc@hw}[#6][#7]\@@Arrow@rule{\dimexpr\wd0- #5 pt * #6 * \@font@scale * 2\relax}{#4 pt}{#6}#3{\vecc@w}{\vecc@hw}[#6][#7]$}}% +}} + +\def\@putexsym#1#2{\@@putexsym#2{\csname exsym@\m@strip#1@sf\endcsname}{\csname exsym@\m@strip#1@s\endcsname}{#1}} +\def\putexsym#1#2#3#4#5{\mathpalette\@putexsym{{#1}{#2}{#3}{#4}{#5}}} + +\def\@BigRightcirclecap{\@linehead@type{0 2.5 m 1 2.5 2 1.25 2 0 c 2 -1.25 1 -2.5 0 -2.5 c S}{2}} +\def\@BigLeftcirclecap{\@linehead@type {2 2.5 m 1 2.5 0 1.25 0 0 c 0 -1.25 1 -2.5 2 -2.5 c S}{2}} +\def\@BigRightsquarecap{\@linehead@type {0 2.5 m 1 2.5 l 1 -2.5 l 0 -2.5 l S}{1}} +\def\@BigLeftsquarecap{\@linehead@type{1 2.5 m 0 2.5 l 0 -2.5 l 1 -2.5 l S}{1}} +\def\@BigCirclescap{\@linehead@type{0 -2 m 0 -1 1 0 2 0 c 3 0 4 -1 4 -2 c 4 -3 3 -4 2 -4 c 1 -4 0 -3 0 -2 c + 0 2 m 0 3 1 4 2 4 c 3 4 4 3 4 2 c 4 1 3 0 2 0 c 1 0 0 1 0 2 c S}{4}} + +\def\iNint@kern@{\mkern-10mu\mathchoice{\mkern-5mu}{}{}{}} +\def\iNint#1{\pdfmsym@repeated{\numexpr #1-1\relax}{\int\iNint@kern@}\int} +\def\@oiNint#1{\putexsym{\iNint{#1}}\@BigLeftcirclecap\@BigRightcirclecap{2.5}{4}} +\def\@biNint#1{\putexsym{\iNint{#1}}\@BigLeftsquarecap\@BigRightsquarecap{2.5}{4}} + +\def\oiNint#1{\@skewedlim@op{\mathop{\@oiNint{#1}}}{-4}{6}{-10}{10}{-4}{6}\nolimits} +\def\biNint#1{\@skewedlim@op{\mathop{\@biNint{#1}}}{-6}{6}{-10}{10}{-6}{6}\nolimits} + \def\@@putsym#1#2#3{{\setbox0=\hbox{$#1#2$}\rlap{\hbox to \wd0{\hss$#1#3$\hss}}}} \def\@putsym#1#2{\@@putsym#1#2} \def\putsym#1#2{\mathpalette\@putsym{{#1}{#2}}\mathopen{}#1} @@ -219,6 +453,8 @@ \def\aint{\mathop{}\mathclose{}\putsym\int-} \def\dwedge{\mathbin{\putsym\wedge\cdot}} \def\bigdwedge{\mathop{\putsym\bigwedge\cdot}} +\def\circwedge{\mathbin{\putsym\wedge\smallcircle}} +\def\bigcircwedge{\mathop{\putsym\bigwedge\smallcircle}} \def\dcup{\mathbin{\putsym\cup\cdot}} \def\bigdcup{\mathop{\putsym\bigcup\cdot}} @@ -271,7 +507,9 @@ {#5 * \@firstoftwo#9} {#6 * \@firstoftwo#9}% \expandafter\def\csname @#1@\endcsname##1##2{\math@drawing@get{#1}{##1}}% - \expandafter\def\csname #1\endcsname{\expandafter\mathpalette\csname @#1@\endcsname{}} + \expandafter\def\csname #1\endcsname{\expandafter\mathpalette\csname @#1@\endcsname{}}% + \expandafter\def\csname @center@#1@\endcsname##1##2{\vcenter{\hbox{\math@drawing@get{#1}{##1}}}}% + \expandafter\def\csname center@#1\endcsname{\expandafter\mathpalette\csname @center@#1@\endcsname{}}% } \def\math@sym@defs{% @@ -300,6 +538,28 @@ {5.4pt}{10pt}{0pt}{.2pt} {{1}{1}}{{7 / 10}{.7}}{{11 / 20}{.55}} \def\divs{\mathrel{\@divs}} + + \pdf@drawing@math@macro{@bigforall} + {.8 w 1 J 1 j + 0 9.5 m 6 -4 l 12 9.5 l + 2.8 4 m 9.2 4 l S} + {14pt}{10.8pt}{4.8pt}{1pt} + {{7 / 10}{.7}}{{5 / 10}{.5}}{{35 / 100}{.35}} + \def\bigforall{\mathop{\@bigforall}} + + \pdf@drawing@math@macro{@bigexists} + {.8 w 1 J 1 j + 0 9.5 m 8 9.5 l 8 -4.5 l 0 -4.5 l + 1 2.5 m 7.9 2.5 l S} + {10pt}{10.8pt}{4.8pt}{1pt} + {{7 / 10}{.7}}{{5 / 10}{.5}}{{35 / 100}{.35}} + \def\bigexists{\mathop{\@bigexists}} + + \pdf@drawing@math@macro{@smallcircle} + {.3 w 0 .5 m 0 .75 .25 1 .5 1 c .75 1 1 .75 1 .5 c 1 .25 .75 0 .5 0 c .25 0 0 .25 0 .5 c S} + {1.6pt}{1.6pt}{.3pt}{.3pt} + {{1}{1}}{{7 / 10}{.7}}{{6 / 10}{.6}} + \let\smallcircle=\center@@smallcircle } % Thanks to Plante for this macro (it is a generalized version of the one found in TeX Pearls 2006 by diff --git a/macros/luatex/generic/tsvtemplate/LICENSE b/macros/luatex/generic/tsvtemplate/LICENSE new file mode 100644 index 0000000000..4153cd3775 --- /dev/null +++ b/macros/luatex/generic/tsvtemplate/LICENSE @@ -0,0 +1,287 @@ + EUROPEAN UNION PUBLIC LICENCE v. 1.2 + EUPL © the European Union 2007, 2016 + +This European Union Public Licence (the ‘EUPL’) applies to the Work (as defined +below) which is provided under the terms of this Licence. Any use of the Work, +other than as authorised under this Licence is prohibited (to the extent such +use is covered by a right of the copyright holder of the Work). + +The Work is provided under the terms of this Licence when the Licensor (as +defined below) has placed the following notice immediately following the +copyright notice for the Work: + + Licensed under the EUPL + +or has expressed by any other means his willingness to license under the EUPL. + +1. Definitions + +In this Licence, the following terms have the following meaning: + +- ‘The Licence’: this Licence. + +- ‘The Original Work’: the work or software distributed or communicated by the + Licensor under this Licence, available as Source Code and also as Executable + Code as the case may be. + +- ‘Derivative Works’: the works or software that could be created by the + Licensee, based upon the Original Work or modifications thereof. This Licence + does not define the extent of modification or dependence on the Original Work + required in order to classify a work as a Derivative Work; this extent is + determined by copyright law applicable in the country mentioned in Article 15. + +- ‘The Work’: the Original Work or its Derivative Works. + +- ‘The Source Code’: the human-readable form of the Work which is the most + convenient for people to study and modify. + +- ‘The Executable Code’: any code which has generally been compiled and which is + meant to be interpreted by a computer as a program. + +- ‘The Licensor’: the natural or legal person that distributes or communicates + the Work under the Licence. + +- ‘Contributor(s)’: any natural or legal person who modifies the Work under the + Licence, or otherwise contributes to the creation of a Derivative Work. + +- ‘The Licensee’ or ‘You’: any natural or legal person who makes any usage of + the Work under the terms of the Licence. + +- ‘Distribution’ or ‘Communication’: any act of selling, giving, lending, + renting, distributing, communicating, transmitting, or otherwise making + available, online or offline, copies of the Work or providing access to its + essential functionalities at the disposal of any other natural or legal + person. + +2. Scope of the rights granted by the Licence + +The Licensor hereby grants You a worldwide, royalty-free, non-exclusive, +sublicensable licence to do the following, for the duration of copyright vested +in the Original Work: + +- use the Work in any circumstance and for all usage, +- reproduce the Work, +- modify the Work, and make Derivative Works based upon the Work, +- communicate to the public, including the right to make available or display + the Work or copies thereof to the public and perform publicly, as the case may + be, the Work, +- distribute the Work or copies thereof, +- lend and rent the Work or copies thereof, +- sublicense rights in the Work or copies thereof. + +Those rights can be exercised on any media, supports and formats, whether now +known or later invented, as far as the applicable law permits so. + +In the countries where moral rights apply, the Licensor waives his right to +exercise his moral right to the extent allowed by law in order to make effective +the licence of the economic rights here above listed. + +The Licensor grants to the Licensee royalty-free, non-exclusive usage rights to +any patents held by the Licensor, to the extent necessary to make use of the +rights granted on the Work under this Licence. + +3. Communication of the Source Code + +The Licensor may provide the Work either in its Source Code form, or as +Executable Code. If the Work is provided as Executable Code, the Licensor +provides in addition a machine-readable copy of the Source Code of the Work +along with each copy of the Work that the Licensor distributes or indicates, in +a notice following the copyright notice attached to the Work, a repository where +the Source Code is easily and freely accessible for as long as the Licensor +continues to distribute or communicate the Work. + +4. Limitations on copyright + +Nothing in this Licence is intended to deprive the Licensee of the benefits from +any exception or limitation to the exclusive rights of the rights owners in the +Work, of the exhaustion of those rights or of other applicable limitations +thereto. + +5. Obligations of the Licensee + +The grant of the rights mentioned above is subject to some restrictions and +obligations imposed on the Licensee. Those obligations are the following: + +Attribution right: The Licensee shall keep intact all copyright, patent or +trademarks notices and all notices that refer to the Licence and to the +disclaimer of warranties. The Licensee must include a copy of such notices and a +copy of the Licence with every copy of the Work he/she distributes or +communicates. The Licensee must cause any Derivative Work to carry prominent +notices stating that the Work has been modified and the date of modification. + +Copyleft clause: If the Licensee distributes or communicates copies of the +Original Works or Derivative Works, this Distribution or Communication will be +done under the terms of this Licence or of a later version of this Licence +unless the Original Work is expressly distributed only under this version of the +Licence — for example by communicating ‘EUPL v. 1.2 only’. The Licensee +(becoming Licensor) cannot offer or impose any additional terms or conditions on +the Work or Derivative Work that alter or restrict the terms of the Licence. + +Compatibility clause: If the Licensee Distributes or Communicates Derivative +Works or copies thereof based upon both the Work and another work licensed under +a Compatible Licence, this Distribution or Communication can be done under the +terms of this Compatible Licence. For the sake of this clause, ‘Compatible +Licence’ refers to the licences listed in the appendix attached to this Licence. +Should the Licensee's obligations under the Compatible Licence conflict with +his/her obligations under this Licence, the obligations of the Compatible +Licence shall prevail. + +Provision of Source Code: When distributing or communicating copies of the Work, +the Licensee will provide a machine-readable copy of the Source Code or indicate +a repository where this Source will be easily and freely available for as long +as the Licensee continues to distribute or communicate the Work. + +Legal Protection: This Licence does not grant permission to use the trade names, +trademarks, service marks, or names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the copyright notice. + +6. Chain of Authorship + +The original Licensor warrants that the copyright in the Original Work granted +hereunder is owned by him/her or licensed to him/her and that he/she has the +power and authority to grant the Licence. + +Each Contributor warrants that the copyright in the modifications he/she brings +to the Work are owned by him/her or licensed to him/her and that he/she has the +power and authority to grant the Licence. + +Each time You accept the Licence, the original Licensor and subsequent +Contributors grant You a licence to their contributions to the Work, under the +terms of this Licence. + +7. Disclaimer of Warranty + +The Work is a work in progress, which is continuously improved by numerous +Contributors. It is not a finished work and may therefore contain defects or +‘bugs’ inherent to this type of development. + +For the above reason, the Work is provided under the Licence on an ‘as is’ basis +and without warranties of any kind concerning the Work, including without +limitation merchantability, fitness for a particular purpose, absence of defects +or errors, accuracy, non-infringement of intellectual property rights other than +copyright as stated in Article 6 of this Licence. + +This disclaimer of warranty is an essential part of the Licence and a condition +for the grant of any rights to the Work. + +8. Disclaimer of Liability + +Except in the cases of wilful misconduct or damages directly caused to natural +persons, the Licensor will in no event be liable for any direct or indirect, +material or moral, damages of any kind, arising out of the Licence or of the use +of the Work, including without limitation, damages for loss of goodwill, work +stoppage, computer failure or malfunction, loss of data or any commercial +damage, even if the Licensor has been advised of the possibility of such damage. +However, the Licensor will be liable under statutory product liability laws as +far such laws apply to the Work. + +9. Additional agreements + +While distributing the Work, You may choose to conclude an additional agreement, +defining obligations or services consistent with this Licence. However, if +accepting obligations, You may act only on your own behalf and on your sole +responsibility, not on behalf of the original Licensor or any other Contributor, +and only if You agree to indemnify, defend, and hold each Contributor harmless +for any liability incurred by, or claims asserted against such Contributor by +the fact You have accepted any warranty or additional liability. + +10. Acceptance of the Licence + +The provisions of this Licence can be accepted by clicking on an icon ‘I agree’ +placed under the bottom of a window displaying the text of this Licence or by +affirming consent in any other similar way, in accordance with the rules of +applicable law. Clicking on that icon indicates your clear and irrevocable +acceptance of this Licence and all of its terms and conditions. + +Similarly, you irrevocably accept this Licence and all of its terms and +conditions by exercising any rights granted to You by Article 2 of this Licence, +such as the use of the Work, the creation by You of a Derivative Work or the +Distribution or Communication by You of the Work or copies thereof. + +11. Information to the public + +In case of any Distribution or Communication of the Work by means of electronic +communication by You (for example, by offering to download the Work from a +remote location) the distribution channel or media (for example, a website) must +at least provide to the public the information requested by the applicable law +regarding the Licensor, the Licence and the way it may be accessible, concluded, +stored and reproduced by the Licensee. + +12. Termination of the Licence + +The Licence and the rights granted hereunder will terminate automatically upon +any breach by the Licensee of the terms of the Licence. + +Such a termination will not terminate the licences of any person who has +received the Work from the Licensee under the Licence, provided such persons +remain in full compliance with the Licence. + +13. Miscellaneous + +Without prejudice of Article 9 above, the Licence represents the complete +agreement between the Parties as to the Work. + +If any provision of the Licence is invalid or unenforceable under applicable +law, this will not affect the validity or enforceability of the Licence as a +whole. Such provision will be construed or reformed so as necessary to make it +valid and enforceable. + +The European Commission may publish other linguistic versions or new versions of +this Licence or updated versions of the Appendix, so far this is required and +reasonable, without reducing the scope of the rights granted by the Licence. New +versions of the Licence will be published with a unique version number. + +All linguistic versions of this Licence, approved by the European Commission, +have identical value. Parties can take advantage of the linguistic version of +their choice. + +14. Jurisdiction + +Without prejudice to specific agreement between parties, + +- any litigation resulting from the interpretation of this License, arising + between the European Union institutions, bodies, offices or agencies, as a + Licensor, and any Licensee, will be subject to the jurisdiction of the Court + of Justice of the European Union, as laid down in article 272 of the Treaty on + the Functioning of the European Union, + +- any litigation arising between other parties and resulting from the + interpretation of this License, will be subject to the exclusive jurisdiction + of the competent court where the Licensor resides or conducts its primary + business. + +15. Applicable Law + +Without prejudice to specific agreement between parties, + +- this Licence shall be governed by the law of the European Union Member State + where the Licensor has his seat, resides or has his registered office, + +- this licence shall be governed by Belgian law if the Licensor has no seat, + residence or registered office inside a European Union Member State. + +Appendix + +‘Compatible Licences’ according to Article 5 EUPL are: + +- GNU General Public License (GPL) v. 2, v. 3 +- GNU Affero General Public License (AGPL) v. 3 +- Open Software License (OSL) v. 2.1, v. 3.0 +- Eclipse Public License (EPL) v. 1.0 +- CeCILL v. 2.0, v. 2.1 +- Mozilla Public Licence (MPL) v. 2 +- GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3 +- Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) for + works other than software +- European Union Public Licence (EUPL) v. 1.1, v. 1.2 +- Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) or Strong + Reciprocity (LiLiQ-R+). + +The European Commission may update this Appendix to later versions of the above +licences without producing a new version of the EUPL, as long as they provide +the rights granted in Article 2 of this Licence and protect the covered Source +Code from exclusive appropriation. + +All other changes or additions to this Appendix require the production of a new +EUPL version. diff --git a/macros/luatex/generic/tsvtemplate/README b/macros/luatex/generic/tsvtemplate/README new file mode 100644 index 0000000000..3431a27d10 --- /dev/null +++ b/macros/luatex/generic/tsvtemplate/README @@ -0,0 +1,23 @@ +SUMMARY + +This is a simple tsv reader for LuaLaTex and plain luaTeX. + + +INSTALLATION + +Move all files in this repository to a place where TeX can find them. + +You can generate the manual with + + luatex tsvtemplate.doc + + +COPYING + +(c) 2022 Esger Renkema + +These files may be distributed under the terms of the European Union Public +Licence (EUPL) version 1.2 or later. A copy can be obtained at: + +https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 + diff --git a/macros/luatex/generic/tsvtemplate/tsvtemplate.doc b/macros/luatex/generic/tsvtemplate/tsvtemplate.doc new file mode 100644 index 0000000000..bae8ac6478 --- /dev/null +++ b/macros/luatex/generic/tsvtemplate/tsvtemplate.doc @@ -0,0 +1,108 @@ + +\input minim-doc.sty + +\nopagenumbers +\setbox\notehead=\vtop to 0pt + {\halign{&\strut#\quad\cr a1&b1&c1\cr a2&b2&c2\cr a3&b3&c3\cr} + \vskip-\baselineskip} + +\startmetadata + author {Esger Renkema} + title {tsvtemplate} + date {2022-01-01} + version {2022/1.0} + keywords {tsv; tab-separated values} + stopmetadata +\maketitle +\stopformulatagging + +This is a small package with a single purpose: reading tab-separated value +(tsv) files and applying a template to the content of their rows. + + +\section Loading this package + +Plain tex users can say ⟦\input tsvtemplate⟧; latex users can say +⟦\usepackage {tsvtemplate}⟧. You must use the lua(la)tex compiler. + + +\section Using this package + +The main command of this package is ⟦*\tsvtemplate⟧, used like this + +{\leftskip2em +⟦*\tsvtemplate⟧⟦ [names,of,the,columns] + {... template ...} {filename.tsv}⟧\par} + +This will read the file named ⟦filename.tsv⟧ row-by-row and assign the +contents of the fields of every row to the control sequences +⟦\names \of \the \columns⟧. These control sequences can then be used in the +⟦template⟧, which will be repeated for every row. + +If you do not specify column names, they will be read from the first line of +the file. In that case spaces will be ignored, so that a column headed by e.g. +⟦Postal Code⟧ is available as ⟦\PostalCode⟧. + +In the latex case, an environment is also available as + +{\leftskip2em +⟦\begin{⟧⟦*tsv template⟧⟦}[names,of,the,columns]{filename.tsv} + ... template ... +\end{⟧⟦*tsv template⟧⟦}⟧\par} + + +\section Field separators + +You can use other field separators than tabs by using the lower-level command +⟦*\applytemplate⟧; in fact, ⟦\tsvtemplate[fields]⟧ is equivalent to + +{\leftskip2em +⟦*\applytemplate⟧⟦ \^^I {fields}⟧\par} + +(Note that ⟦\^^I⟧ is just the tab character, preceded by a backslash. For +colon-separated values you could say ⟦\:⟧ etc.) +The ⟦fields⟧ may be separated either by commas or by the separator character. +Note that they are no longer optional: leave the argument empty in order to +have tsv read the first line of the file as a header line. + + +\section Limitations + +Every row in the tsv file must have the exact same number of columns; an error +is emitted otherwise. + +When reading files with commas or semicolons as field separators, be aware of +programs generating fields surrounded by double quotes (⟦"⟧ characters) +containing commas (or semicolons) themselves. Such files will confuse this +package. The best thing you can do is convert them to proper tsv, which has no +need for quoting. + + +\section Implementation + +\font\eighttt {Latin Modern Mono:script=latn;+smcp;} at 8pt +\font\eightit {Latin Modern Roman/I:script=latn;} at 8pt +\def\r#1{\baselineskip10pt\input{#1}} +\def\showfile#1{\begingroup + \noindent \vrule height 2pt depth 8pt + \raise1.6pt\vbox{\hrule width 2em} file: #1\par\nointerlineskip + \let\tentt\eighttt\let\tenit\eightit + \baselineskip10pt \leftskip1em + \hbox{\vrule\vtop{⟦\relax\input{#1}⟧}}\nointerlineskip + \vskip-\baselineskip\endgroup + \noindent \raise1.6pt\hbox{\vrule height 1em}% + \raise1.6pt\vbox{\hrule width 8em}\par} + +The latex style file simply loads the plain tex implementation: + +\showfile{tsvtemplate.sty} + +\dots which has been kept quite short, so that you may the more easier copy and +modify it to suit your own needs: + +\showfile{tsvtemplate.tex} + +\licencesection + +\bye + diff --git a/macros/luatex/generic/tsvtemplate/tsvtemplate.pdf b/macros/luatex/generic/tsvtemplate/tsvtemplate.pdf Binary files differnew file mode 100644 index 0000000000..69a153d519 --- /dev/null +++ b/macros/luatex/generic/tsvtemplate/tsvtemplate.pdf diff --git a/macros/luatex/generic/tsvtemplate/tsvtemplate.sty b/macros/luatex/generic/tsvtemplate/tsvtemplate.sty new file mode 100644 index 0000000000..dc0102faac --- /dev/null +++ b/macros/luatex/generic/tsvtemplate/tsvtemplate.sty @@ -0,0 +1,3 @@ +% An environment for \LaTeX. +\ProvidesPackage{tsvtemplate} \RequirePackage{environ} \input tsvtemplate +\NewEnviron{tsv template}[2][]{\applytemplate\^^I{#1}{\BODY}{#2}} diff --git a/macros/luatex/generic/tsvtemplate/tsvtemplate.tex b/macros/luatex/generic/tsvtemplate/tsvtemplate.tex new file mode 100644 index 0000000000..3e17dd3921 --- /dev/null +++ b/macros/luatex/generic/tsvtemplate/tsvtemplate.tex @@ -0,0 +1,27 @@ +% Do not read this file twice. +\ifdefined\tsvloaded\expandafter\endinput\fi +\chardef\tsvloaded\catcode`\& \catcode`\&=11 + +% Implement a tsv reader. +\long\def\applytemplate#1#2#3#4{\begingroup\openin\&r#4 + \def\&w##1##2{\errmessage{#4: ##1 fields at line \the\&o\space + (##2 discarded)}}\catcode`#112 \errorcontextlines0 \ifx\&z#2\&z + {\catcode`\ 9 \global\read\&r to\&f}\else {\catcode`\,13 + \&e\edef\scantextokens{,}{\Uchar`#1}\global\&d{&f}{#2}}\fi + \&e\&b\Uchar`#1{#3}} +\long\def\&d#1#2{\&e\edef\csname#1\endcsname{\scantextokens{#2}}} +\let\&e\expandafter\newcount\&o\newcount\&p\def\&q{\par}\newread\&r\def\&z{\&z} +\def\&s#1{\&w{Not enough}{line}} \def\&t#1\&z#2{\&w{Too many}{fields}} +\def\&a#1{\advance#11 } \long\def\&b#1#2{\&o0 \&p0 + \def\&x##1#1{\ifx\&z##1\&z\let\&x\relax\else\&a\&p\&d{&\the\&p}{##1}\fi\&x}% + \&e\&x\&f#1#1\chardef\&m\&p \long\def\&x##1#1{\&a\&p \ifx\&z##1\&e\&s\else + \&d{\csname &\the\&p\endcsname}{##1}\ifnum\&p=\&m\&e\&y\fi\fi\&x}% + \long\def\&y\fi\&x##1#1{\fi{#2}\ifx\&z##1\relax\else\&e\&t\fi}\&p0 + \def\&n{\read\&r to\&l \ifx\&q\&l\closein\&r\let\&n\relax + \else\&a\&o{\&e\&x\&l#1\&z#1}\fi\&n}\&n\endgroup} + +% A shorthand for Plain \TeX. +\def\tsvtemplate{\futurelet\&px\&pa} +\def\&pc{\&pb[]}\def\&pb[#1]{\applytemplate\^^I{#1}} +\def\&pa{\ifx\&px[\&e\&pb\else\&e\&pc\fi} +\catcode`\&=\tsvloaded diff --git a/macros/texinfo/latest/texinfo.tex b/macros/texinfo/latest/texinfo.tex index fbdfab8a8f..3e0f1c53b0 100644 --- a/macros/texinfo/latest/texinfo.tex +++ b/macros/texinfo/latest/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2022-11-12.22} +\def\texinfoversion{2022-12-19.22} % % Copyright 1985, 1986, 1988, 1990-2022 Free Software Foundation, Inc. % @@ -591,6 +591,9 @@ % @/ allows a line break. \let\/=\allowbreak +% @- allows explicit insertion of hyphenation points +\def\-{\discretionary{\normaldash}{}{}}% + % @. is an end-of-sentence period. \def\.{.\spacefactor=\endofsentencespacefactor\space} @@ -1537,9 +1540,10 @@ output) for that.)} \next} \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} - \def\pdflink#1{% + \def\pdflink#1{\pdflinkpage{#1}{#1}}% + \def\pdflinkpage#1#2{% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} - \setcolor{\linkcolor}#1\endlink} + \setcolor{\linkcolor}#2\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \else % non-pdf mode @@ -1786,10 +1790,11 @@ output) for that.)} \next} \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} - \def\pdflink#1{% + \def\pdflink#1{\pdflinkpage{#1}{#1}}% + \def\pdflinkpage#1#2{% \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}% - \setcolor{\linkcolor}#1\endlink} + \setcolor{\linkcolor}#2\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} % % @@ -2134,6 +2139,11 @@ end \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% \fi\fi +% +% This is what gets called when #5 of \setfont is empty. +\let\cmap\gobble +% +% (end of cmaps) % Set the font macro #1 to the font named \fontprefix#2. @@ -2149,11 +2159,10 @@ end \def\setfont#1#2#3#4#5{% \font#1=\fontprefix#2#3 scaled #4 \csname cmap#5\endcsname#1% + \ifx#2\ttshape\hyphenchar#1=-1 \fi + \ifx#2\ttbshape\hyphenchar#1=-1 \fi + \ifx#2\ttslshape\hyphenchar#1=-1 \fi } -% This is what gets called when #5 of \setfont is empty. -\let\cmap\gobble -% -% (end of cmaps) % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix @@ -2815,13 +2824,6 @@ end % @sansserif, explicit sans. \def\sansserif#1{{\sf #1}} -% We can't just use \exhyphenpenalty, because that only has effect at -% the end of a paragraph. Restore normal hyphenation at the end of the -% group within which \nohyphenation is presumably called. -% -\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} -\def\restorehyphenation{\hyphenchar\font = `- } - \newif\iffrenchspacing \frenchspacingfalse @@ -2890,27 +2892,29 @@ end % Switch to typewriter. \tt % - % But `\ ' produces the large typewriter interword space. + % `\ ' produces the large typewriter interword space. \def\ {{\spaceskip = 0pt{} }}% % - % Turn off hyphenation. - \nohyphenation - % \plainfrenchspacing #1% }% \null % reset spacefactor to 1000 } -% We *must* turn on hyphenation at `-' and `_' in @code. -% (But see \codedashfinish below.) +% This is for LuaTeX: It is not sufficient to disable hyphenation at +% explicit dashes by setting `\hyphenchar` to -1. +\def\dashnobreak{% + \normaldash + \penalty 10000 } + +% We must turn on hyphenation at `-' and `_' in @code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. +% We explicitly allow hyphenation at these characters +% using \discretionary. % -% Unfortunately, TeX uses one parameter (\hyphenchar) to control -% both hyphenation at - and hyphenation within words. -% We must therefore turn them both off (\tclose does that) -% and arrange explicitly to hyphenate at a dash. -- rms. +% Hyphenation at - and hyphenation within words was turned off +% by default for the tt fonts using the \hyphenchar parameter of TeX. { \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active \catcode`\`=\active @@ -2923,7 +2927,7 @@ end \let-\codedash \let_\codeunder \else - \let-\normaldash + \let-\dashnobreak \let_\realunder \fi % Given -foo (with a single dash), we do not want to allow a break @@ -3200,7 +3204,7 @@ end % definition of @key with no lozenge. % -\def\key#1{{\setregularquotes \nohyphenation \tt #1}\null} +\def\key#1{{\setregularquotes \tt #1}\null} % @clicksequence{File @click{} Open ...} \def\clicksequence#1{\begingroup #1\endgroup} @@ -3747,6 +3751,7 @@ $$% % Open one extra group, as we want to close it in the middle of \Etitlepage. \begingroup \parindent=0pt \textfonts + \headingsoff % Leave some space at the very top of the page. \vglue\titlepagetopglue % No rule at page bottom unless we print one at the top with @title. @@ -3774,11 +3779,9 @@ $$% % If we use the new definition of \page, we always get a blank page % after the title page, which we certainly don't want. \oldpage + \pageone \endgroup % - % Need this before the \...aftertitlepage checks so that if they are - % in effect the toc pages will come out with page numbers. - \HEADINGSon } \def\finishtitlepage{% @@ -3947,7 +3950,6 @@ $$% } \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting -\HEADINGSoff % it's the default % When we turn headings on, set the page number to 1. \def\pageone{ @@ -3971,7 +3973,7 @@ $$% \pageone \HEADINGSsinglex } -\def\HEADINGSon{\HEADINGSdouble} +% \def\HEADINGSon{\HEADINGSdouble} % defined by \CHAPPAGon \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} \let\HEADINGSdoubleafter=\HEADINGSafter @@ -5616,6 +5618,11 @@ might help (with 'rm \jobname.?? \jobname.??s')% \newdimen\entryrightmargin \entryrightmargin=0pt +% for PDF output, whether to make the text of the entry a link to the page +% number. set for @contents and @shortcontents where there is only one +% page number. +\newif\iflinkentrytext + % \entry typesets a paragraph consisting of the text (#1), dot leaders, and % then page number (#2) flushed to the right margin. It is used for index % and table of contents entries. The paragraph is indented by \leftskip. @@ -5642,7 +5649,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% } \def\entrybreak{\unskip\space\ignorespaces}% \def\doentry{% - % Save the text of the entry + % Save the text of the entry in \boxA \global\setbox\boxA=\hbox\bgroup \bgroup % Instead of the swallowed brace. \noindent @@ -5652,12 +5659,21 @@ might help (with 'rm \jobname.?? \jobname.??s')% % with catcodes occurring. } {\catcode`\@=11 +% #1 is the page number \gdef\finishentry#1{% - \egroup % end box A + \egroup % end \boxA \dimen@ = \wd\boxA % Length of text of entry + % add any leaders and page number to \boxA. \global\setbox\boxA=\hbox\bgroup - \unhbox\boxA - % #1 is the page number. + \ifpdforxetex + \iflinkentrytext + \pdflinkpage{#1}{\unhbox\boxA}% + \else + \unhbox\boxA + \fi + \else + \unhbox\boxA + \fi % % Get the width of the page numbers, and only use % leaders if they are present. @@ -5676,6 +5692,8 @@ might help (with 'rm \jobname.?? \jobname.??s')% \fi \fi \egroup % end \boxA + % + % now output \ifdim\wd\boxB = 0pt \noindent\unhbox\boxA\par \nobreak @@ -6375,7 +6393,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \fi } -\parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname} +\parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname\HEADINGSon} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager @@ -6392,7 +6410,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \global\let\pchapsepmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} -\CHAPPAGon +\setchapternewpage on % \chapmacro - Chapter opening. % @@ -6772,6 +6790,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \def\thistitle{}% no title in double-sided headings % Record where the Roman numerals started. \ifnum\romancount=0 \global\romancount=\pagecount \fi + \linkentrytexttrue } % \raggedbottom in plain.tex hardcodes \topskip so override it @@ -6899,7 +6918,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3#4{% - \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% + \tocentry{\shortchaplabel{#2}\labelspace #1}{#4}% } % Appendices, in the main contents. @@ -6914,7 +6933,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % Unnumbered chapters. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} -\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} +\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{#4}} % Sections. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} @@ -6946,24 +6965,24 @@ might help (with 'rm \jobname.?? \jobname.??s')% % Move the page numbers slightly to the right \advance\entryrightmargin by -0.05em \chapentryfonts - \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \tocentry{#1}{#2}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup \secentryfonts \leftskip=\tocindent - \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \tocentry{#1}{#2}% \endgroup} \def\dosubsecentry#1#2{\begingroup \subsecentryfonts \leftskip=2\tocindent - \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \tocentry{#1}{#2}% \endgroup} \def\dosubsubsecentry#1#2{\begingroup \subsubsecentryfonts \leftskip=3\tocindent - \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \tocentry{#1}{#2}% \endgroup} % We use the same \entry macro as for the index entries. @@ -6972,9 +6991,6 @@ might help (with 'rm \jobname.?? \jobname.??s')% % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} -\def\dopageno#1{{\rm #1}} -\def\doshortpageno#1{{\rm #1}} - \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} \def\subsecentryfonts{\textfonts} @@ -7410,7 +7426,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \endgroup % \def\setupverb{% - \tt % easiest (and conventionally used) font for verbatim + \tt \def\par{\leavevmode\endgraf}% \setcodequotes \tabeightspaces @@ -7587,32 +7603,28 @@ might help (with 'rm \jobname.?? \jobname.??s')% \exdentamount=\defbodyindent } -\def\dodefunx#1{% - % First, check whether we are in the right environment: - \checkenv#1% - % - % As above, allow line break if we have multiple x headers in a row. - % It's not a great place, though. - \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi - % - % And now, it's time to reuse the body of the original defun: - \expandafter\gobbledefun#1% -} -\def\gobbledefun#1\startdefun{} +\newtoks\defidx +\newtoks\deftext -% \printdefunline \deffnheader{text} +\def\useindex#1{\defidx={#1}\ignorespaces} + +% Called as \printdefunline \deffooheader{text} % \def\printdefunline#1#2{% \begingroup \plainfrenchspacing - % call \deffnheader: + % call \deffooheader: #1#2 \endheader + % create the index entry + \defcharsdefault + \edef\temp{\noexpand\doind{\the\defidx}{\the\deftext}}% + \temp % common ending: \interlinepenalty = 10000 \advance\rightskip by 0pt plus 1fil\relax \endgraf \nobreak\vskip -\parskip - \penalty\defunpenalty % signal to \startdefun and \dodefunx + \penalty\defunpenalty % signal to \startdefun and \deffoox % Some of the @defun-type tags do not enable magic parentheses, % rendering the following check redundant. But we don't optimize. \checkparencounts @@ -7621,7 +7633,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \def\Edefun{\endgraf\medbreak} -% \makedefun{deffoo}{ (definition of \deffooheader) } +% \makedefun{deffoo} (\deffooheader parameters) { (\deffooheader expansion) } % % Define \deffoo, \deffoox \Edeffoo and \deffooheader. \def\makedefun#1{% @@ -7636,8 +7648,18 @@ might help (with 'rm \jobname.?? \jobname.??s')% \doingtypefnfalse % distinguish typed functions from all else \parseargusing\activeparens{\printdefunline#3}% }% - \def#2{\dodefunx#1}% - \def#3% + \def#2{% + % First, check whether we are in the right environment: + \checkenv#1% + % + % As in \startdefun, allow line break if we have multiple x headers + % in a row. It's not a great place, though. + \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi + % + \doingtypefnfalse % distinguish typed functions from all else + \parseargusing\activeparens{\printdefunline#3}% + }% + \def#3% definition of \deffooheader follows } \newif\ifdoingtypefn % doing typed function? @@ -7662,18 +7684,23 @@ might help (with 'rm \jobname.?? \jobname.??s')% \fi\fi } +\def\defind#1#2{ + \defidx={#1}% + \deftext={#2}% +} + % Untyped functions: % @deffn category name args \makedefun{deffn}#1 #2 #3\endheader{% - \doind{fn}{\code{#2}}% + \defind{fn}{\code{#2}}% \defname{#1}{}{#2}\magicamp\defunargs{#3\unskip}% } % @defop category class name args \makedefun{defop}#1 {\defopheaderx{#1\ \putwordon}} \def\defopheaderx#1#2 #3 #4\endheader{% - \doind{fn}{\code{#3}\space\putwordon\ \code{#2}}% + \defind{fn}{\code{#3}\space\putwordon\ \code{#2}}% \defname{#1\ \code{#2}}{}{#3}\magicamp\defunargs{#4\unskip}% } @@ -7681,7 +7708,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % @deftypefn category type name args \makedefun{deftypefn}#1 #2 #3 #4\endheader{% - \doind{fn}{\code{#3}}% + \defind{fn}{\code{#3}}% \doingtypefntrue \defname{#1}{#2}{#3}\defunargs{#4\unskip}% } @@ -7689,7 +7716,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % @deftypeop category class type name args \makedefun{deftypeop}#1 {\deftypeopheaderx{#1\ \putwordon}} \def\deftypeopheaderx#1#2 #3 #4 #5\endheader{% - \doind{fn}{\code{#4}\space\putwordon\ \code{#1\ \code{#2}}}% + \defind{fn}{\code{#4}\space\putwordon\ \code{#1\ \code{#2}}}% \doingtypefntrue \defname{#1\ \code{#2}}{#3}{#4}\defunargs{#5\unskip}% } @@ -7698,14 +7725,14 @@ might help (with 'rm \jobname.?? \jobname.??s')% % @deftypevr category type var args \makedefun{deftypevr}#1 #2 #3 #4\endheader{% - \doind{vr}{\code{#3}}% + \defind{vr}{\code{#3}}% \defname{#1}{#2}{#3}\defunargs{#4\unskip}% } % @deftypecv category class type var args \makedefun{deftypecv}#1 {\deftypecvheaderx{#1\ \putwordof}} \def\deftypecvheaderx#1#2 #3 #4 #5\endheader{% - \doind{vr}{\code{#4}\space\putwordof\ \code{#2}}% + \defind{vr}{\code{#4}\space\putwordof\ \code{#2}}% \defname{#1\ \code{#2}}{#3}{#4}\defunargs{#5\unskip}% } @@ -7722,7 +7749,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % @deftp category name args \makedefun{deftp}#1 #2 #3\endheader{% - \doind{tp}{\code{#2}}% + \defind{tp}{\code{#2}}% \defname{#1}{}{#2}\defunargs{#3\unskip}% } @@ -10489,7 +10516,7 @@ directory should work if nowhere else does.} \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}% \DeclareUnicodeCharacter{00AF}{\={ }}% % - \DeclareUnicodeCharacter{00B0}{\textdegree} + \DeclareUnicodeCharacter{00B0}{\textdegree}% \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}% \DeclareUnicodeCharacter{00B2}{$^2$}% \DeclareUnicodeCharacter{00B3}{$^3$}% |