From 276f0d2d16de46cdbe5f71560ea806531260d1eb Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 21 Dec 2022 20:48:01 +0000 Subject: pdfmsym (21dec22) git-svn-id: svn://tug.org/texlive/trunk@65324 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/generic/pdfmsym/README.md | 21 +- .../texmf-dist/doc/generic/pdfmsym/pdfmsym-doc.pdf | Bin 190599 -> 219777 bytes .../texmf-dist/doc/generic/pdfmsym/pdfmsym-doc.tex | 170 +++++++++-- Master/texmf-dist/tex/generic/pdfmsym/pdfmsym.tex | 314 +++++++++++++++++++-- 4 files changed, 444 insertions(+), 61 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/generic/pdfmsym/README.md b/Master/texmf-dist/doc/generic/pdfmsym/README.md index 5954add2ed1..f79a98d1cbd 100644 --- a/Master/texmf-dist/doc/generic/pdfmsym/README.md +++ b/Master/texmf-dist/doc/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/Master/texmf-dist/doc/generic/pdfmsym/pdfmsym-doc.pdf b/Master/texmf-dist/doc/generic/pdfmsym/pdfmsym-doc.pdf index 6e0305bb561..bd2dab960b6 100644 Binary files a/Master/texmf-dist/doc/generic/pdfmsym/pdfmsym-doc.pdf and b/Master/texmf-dist/doc/generic/pdfmsym/pdfmsym-doc.pdf differ diff --git a/Master/texmf-dist/doc/generic/pdfmsym/pdfmsym-doc.tex b/Master/texmf-dist/doc/generic/pdfmsym/pdfmsym-doc.tex index f7e84d1bb40..9c621958323 100644 --- a/Master/texmf-dist/doc/generic/pdfmsym/pdfmsym-doc.tex +++ b/Master/texmf-dist/doc/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{} /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{}{}} 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{}} 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{}} 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{}} 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{}} 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{}} 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{}{}{}{}{}{}} This creates a text mode +\macroexp{\pdf@drawing@macro{}{}{}{}{}{}} 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{}{}{}{}{}{}