summaryrefslogtreecommitdiff
path: root/macros/generic
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-12-16 03:01:21 +0000
committerNorbert Preining <norbert@preining.info>2022-12-16 03:01:21 +0000
commit14c4ab52b25f4384f6db7938c2666fdd0f75a723 (patch)
tree00da17c9471442a0486f7901e54e4db06e0a6174 /macros/generic
parent9e62b694b4955e33f16762e5c1f9f67bf736cf5b (diff)
CTAN sync 202212160301
Diffstat (limited to 'macros/generic')
-rw-r--r--macros/generic/pdfmsym/README.md10
-rw-r--r--macros/generic/pdfmsym/pdfmsym-doc.pdfbin0 -> 190599 bytes
-rw-r--r--macros/generic/pdfmsym/pdfmsym-doc.tex400
-rw-r--r--macros/generic/pdfmsym/pdfmsym.tex344
4 files changed, 754 insertions, 0 deletions
diff --git a/macros/generic/pdfmsym/README.md b/macros/generic/pdfmsym/README.md
new file mode 100644
index 0000000000..5954add2ed
--- /dev/null
+++ b/macros/generic/pdfmsym/README.md
@@ -0,0 +1,10 @@
+# PDF Math Symbols - pdfMsym
+## version 1.0.2
+The pdfMsym package provides mathematical symbols for PDF-dependent TeX compilers.
+Read the documentation (documentation.pdf) for more details.
+The pdfMsym package is provided under the MIT license.
+
+Compile the documentation via `pdftex pdfsym-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.
diff --git a/macros/generic/pdfmsym/pdfmsym-doc.pdf b/macros/generic/pdfmsym/pdfmsym-doc.pdf
new file mode 100644
index 0000000000..6e0305bb56
--- /dev/null
+++ b/macros/generic/pdfmsym/pdfmsym-doc.pdf
Binary files differ
diff --git a/macros/generic/pdfmsym/pdfmsym-doc.tex b/macros/generic/pdfmsym/pdfmsym-doc.tex
new file mode 100644
index 0000000000..f7e84d1bb4
--- /dev/null
+++ b/macros/generic/pdfmsym/pdfmsym-doc.tex
@@ -0,0 +1,400 @@
+\catcode`\@=11
+
+\input pdfmsym
+\pdfmsymsetscalefactor{10}
+
+
+\let\@xp=\expandafter
+\font\scten = cmcsc10
+
+\def\fakebold#1{\pdf@literal{2 Tr .2 w}#1\pdf@literal{0 Tr 1 w}}
+\def\scalebox[#1]#2{{\setbox0=\hbox{#2}\hbox to#1\wd0{\pdfliteral{q #1 0 0 #1 0 0 cm}\rlap{#2}\pdfliteral{Q}\hfil}}}
+\def\begincenter{\bgroup\leftskip=0pt plus 1fill \rightskip=\leftskip}
+\def\endcenter{\par\egroup}
+
+\def\fbox#1{\vbox{\hrule\hbox{\vrule$#1$\vrule}\hrule}}
+
+\def\flip#1{{\setbox0=\hbox{#1}\kern\wd0\pdf@literal{q -1 0 0 1 0 0 cm}\rlap{#1}\pdf@literal{Q}}}
+
+\font\sevenrm = cmr7
+\def\MatheX{Math\kern-.1ex\lower .6ex\hbox {E}\kern -.125emX}
+\def\xetex{X\kern-.125em\lower.5ex\hbox{\flip{E}}\kern-.1667em\TeX}
+\def\LaTeX{L\kern-.36em{\setbox0=\hbox{T}\vbox to\ht0{\hbox{\sevenrm A}\vss}}\kern-.15em\TeX}
+
+\def\fontuse{\afterassignment\@@ \font\@@}
+\def\scalefont{\fontuse \curr@font scaled }
+
+%\def\title#1{\leavevmode\vskip.1\vsize\centerline{\fontuse cmcsc10 scaled 5000 \fakebold{#1}}\bigskip}
+\def\title#1{\leavevmode\vskip.1\vsize\centerline{\scalebox[8]{\fakebold{#1}}}\bigskip}
+
+\newcount\c@section
+\newcount\c@subsection
+\def\section#1{\bigskip\advance\c@section by 1 \c@subsection=0 \bgroup\fontuse cmbx10 scaled 2000 \the\c@section. #1\par\bigskip\egroup}
+\def\subsection#1{\medskip\advance\c@subsection by 1 \bgroup\fontuse cmbx10 scaled 1500 \the\c@section.\the\c@subsection. #1\par\medskip\egroup}
+
+\chardef\fslash=`\/
+{\catcode`\^^M=\active%
+\gdef\begincode{%
+ \bgroup\everypar={}%
+ \medskip%
+ \setbox0=\vbox\bgroup%
+ \global\dimen69=0pt%
+ \tt%
+ \catcode`\^^M=\active%
+ \def^^M{\egroup\ifnum\wd1>\dimen69 \global\dimen69=\wd1\fi\copy1\setbox1=\hbox\bgroup}%
+ \catcode`\ =\active%
+ \catcode`\{=12%
+ \catcode`\}=12%
+ \catcode`\/=0%
+ \catcode`\$=12%
+ \catcode`\\=12%
+ \catcode`\%=12 \setbox1=\hbox\bgroup}}
+\def\endcode{%
+ \egroup\egroup%
+ \hfil\hbox to \dimen69{\box0}\hfil\par%
+ \medskip%
+ %\let\@par=\par%
+ \egroup%
+}
+
+\def\icode{\bgroup\tt%
+ \catcode`\ =\active%
+ \catcode`\/=0%
+ \catcode`\{=12%
+ \catcode`\}=12%
+ \catcode`\$=12%
+ \catcode`\\=12%
+}
+\def\eicode{\egroup}
+
+{\catcode`\<=\active
+\gdef\macrousage{\bgroup\setbox0=\hbox\bgroup\tt%
+ \catcode`\ =\active%
+ \catcode`\/=0%
+ \catcode`\{=12%
+ \catcode`\}=12%
+ \catcode`\$=12%
+ \catcode`\\=12%
+ \catcode`\<=\active%
+ \def<##1>{$\langle${\it ##1}$\rangle$}%
+}}
+\def\emacrousage{\egroup\par\smallskip\centerline{\box0}\egroup\par\smallskip}
+\def\emacrousageB{\egroup\box0\egroup}
+
+\def\macroname#1{{\tt\string#1}}
+
+\chardef\lbrace="7B
+\chardef\rbrace="7D
+
+\def\macroexp#1{\par\smallskip\bgroup\leftskip=1cm\leavevmode\kern-1cm\macrousage \scantokens{#1}\emacrousageB:}
+\def\emacroexp{\par\egroup\smallskip}
+
+\def\showcase#1#2{{\openup3\jot\halign{\tt\hskip 1cm\string##\hfil&\quad\hfil##\cr
+ \omit\tt\string#1: & $\displaystyle#1$\cr\noalign{\kern3pt\hrule\kern3pt}
+ \displaystyle & $\displaystyle #2$\cr
+ \textstyle & $\textstyle #2$\cr
+ \scriptstyle & $\scriptstyle #2$\cr
+ \scriptscriptstyle & $\scriptscriptstyle #2$\cr}
+}}
+
+\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
+ \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}
+}\hss}\bigskip}
+
+\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 &
+ \tt\expandafter\string\csname x\m@strip#1\endcsname\cr\noalign{\kern3pt\hrule\kern3pt}
+ \displaystyle & $\displaystyle #2$ & $\displaystyle #3$ & $\displaystyle #4$\cr
+ \textstyle & $\textstyle #2$ & $\textstyle #3$ & $\textstyle #4$\cr
+ \scriptstyle & $\scriptstyle #2$ & $\scriptstyle #3$ & $\scriptstyle #4$\cr
+ \scriptscriptstyle & $\scriptscriptstyle #2$ & $\scriptscriptstyle #3$ & $\scriptscriptstyle #4$\cr}
+}\hss}\bigskip}
+
+\def\showcaseaccent#1#2{{\openup3\jot\halign{\tt\hskip 1cm\string##\hfil&\quad\hfil##\cr
+ \omit\tt\string#1: & \cr\noalign{\kern3pt\hrule\kern3pt}
+ \displaystyle & $\displaystyle #2$\cr
+ \textstyle & $\textstyle #2$\cr
+ \scriptstyle & $\scriptstyle #2$\cr
+ \scriptscriptstyle & $\scriptscriptstyle #2$\cr}
+}}
+
+\parindent=0pt
+\parskip=3pt
+\hoffset=\dimexpr 2cm - 1in \relax
+\advance\hsize by -2\hoffset
+\voffset=2\hoffset
+\advance\vsize by -2\voffset
+
+\nopagenumbers
+\title{\pdfMsym}
+\unskip
+{\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}
+
+\bigskip
+\hbox to \hsize{\hfil\vbox{\hsize=.7\hsize
+\hrule
+\smallskip
+\begincenter
+The \pdfMsym{} package (the {\scten pdf} Math Symbols package) was created as an extension to the math macros provided by \TeX{} and \LaTeX{}.
+It provides more obscure symbols not found in popular preexisting and reimpliments macros which were viewed as flawed.
+
+A big part of the package was implemented through \macroname\pdfliteral s and other {\scten pdf} primitives.
+So the \pdfMsym{} package is intended for use with {\scten pdf}\TeX, Lua\TeX, \xetex, and their \LaTeX{} counterparts.
+Unfortunately, some macros are not supported by \xetex.
+\endcenter
+\smallskip
+\hrule
+}\hfil}
+
+\vfill\break
+
+\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:
+
+$$ \overrightarrow{\hbox{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:
+
+$$ \vecc{\hbox{ABC}} $$
+
+Along with a few other features, \pdfMsym{} provides a simple interface for creating your own style of arrows.
+
+\pdfMsym{} requires the current font size in order to properly scale its symbols, which must be provided after
+{\tt\string\input}ing {\tt pdfmsym.tex}.
+This can be done with the \macroname\pdfmsymsetscalefactor{} macro.
+If your font is 12pt then you can load \pdfMsym{} like so:
+
+\begincode
+\input pdfmsym
+\pdfmsymsetscalefactor{12}
+/endcode\par
+
+It is {\it imperative} that you set the scale factor after loading {\tt pdfmsym} as otherwise almost none of the macros will
+work.
+
+\section{The Predefined Symbols}
+
+This section will simply be an exhaustive list of all the predefined symbols \pdfMsym{} provides.
+
+\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\aint{f(x) + \aint_a^b g(x)\, dx}} & \vbox{\showcase\divs{n\divs m}}\cr
+\vbox{\showcase\ndivs{n\ndivs m}} & \cr}}
+
+Additionally, \macroname\lightning{} is provided as a textmode command and renders \lightning.
+
+\subsection{Vector Symbols}
+
+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}}
+\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}}
+
+\unless\ifx\pdfxform\undefined
+The \macroname\constvec{} macro has the following usage:
+\macrousage \constvec<vector macro>{<material>} /emacrousage
+And it centers the {\tt vector macro} above {\tt material} as if it had the same height as {\tt x}, cropping anything above
+that height.
+So for example \icode \constvec\vecc{abc}/eicode{} yields $\constvec\vecc{abc}$.
+This macro cannot be used in \xetex.
+\fi
+\subsection{Arrow Symbols}
+
+Each arrow comes as a triplet: the normal form, the long form, and the extendable form.
+The extendable form is similar to \macroname\xrightarrow{} and friends, an extendable arrow has the following use:
+\macrousage \xarrow{<top material>}[<bottom material>] /emacrousage
+And creates an extended arrow to fit both the top and bottom material.
+
+\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\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}
+\showcasearrow\varhookrightarrow{A\varhookrightarrow B}{A\longvarhookrightarrow B}{A\xvarhookrightarrow{ABC}[abc] B}
+\showcasearrow\varhookleftarrow{A\varhookleftarrow B}{A\longvarhookleftarrow B}{A\xvarhookleftarrow{ABC}[abc] B}
+\showcasearrow\vardoublerightarrow{A\vardoublerightarrow B}{A\longvardoublerightarrow B}{A\xvardoublerightarrow{ABC}[abc] B}
+\showcasearrow\vardoubleleftarrow{A\vardoubleleftarrow B}{A\longvardoubleleftarrow B}{A\xvardoubleleftarrow{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}
+
+\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.
+
+\bigskip
+{\tabskip=20pt plus 10pt minus 5pt\halign{{\hsize=.45\hsize#}\hfil&\hfil{\hsize=.45\hsize#}\cr
+\vbox{\showcaseaccent\varwidehat{\varwidehat{ABC}+D}} & \vbox{\showcaseaccent\varwidecheck{\varwidecheck{ABC}+D}}\cr}}
+\bigskip
+\hbox to\hsize{\hfil\vbox{\tabskip=20pt plus 10pt minus 5pt\showcaseaccent\varwidetilde{\varwidetilde{ABC}+D}}\hfil}
+
+\unless\ifx\pdfxform\undefined
+\subsection{Extendable Operators}
+Extendible operators extend to the width of the material in their limits.
+These operators should only be used in display mode, since they use the display modes of the operators.
+They are \macroname\suum{} and \macroname\prood{}:
+
+$$ \suum_{\hbox{abcdef}}^{\hbox{ABCDEF}} \qquad \prood_{\hbox{abcdef}}^{\hbox{ABCDEF}} $$
+
+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.
+
+\macroexp{\@linehead@type{<pdf code>}{<width>}} This creates a ``linehead'' which is used to cap lines, like
+\macroname\@rarrow{} ($\@rarrow{.4}{2.5}$).
+{\it pdf code} is the actual code used to draw the symbol, and it should be noted that all necessary transformations to the
+linehead are done by \macroname\@linehead@type{} and should not be included in the code.
+This includes the setting of the width and transforming the coordinate system.
+The {\it width} is the width of the drawing of the {\it pdf code}.
+
+This macro actually accepts more parameters, but they're used internally and therefore aren't necessary to explain.
+Therefore the only use this macro should be for is defining line heads.
+For example, the definition of \macroname\@rarrow{} is:
+\begincode
+\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
+\icode \@rarrow, \@larrow, \@rharp, \@lharp, \@rdharp, \@rlharp, \@mapcap, \@rsarrow, \@lsarrow, \@backhook, \@fronthook, \@doublerarrow, \@doublelarrow, /hfil/break\@circlecap/eicode.
+\emacroexp
+
+\macroexp{\@vecc@def{<vector name>}<left cap><right cap>} This creates a vector macro, like \macroname\vecc.
+This creates both the normal and short variations of the vector.
+For example, the definition of the {\tt vecc} vectors is:
+\begincode
+\@vecc@def{vecc}\@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:
+\begincode
+\@arrow@def{varrightarrow}\@linecap\@rarrow
+/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).
+Again this macro should only be used to define wide accents.
+For example, the definition of \macroname\varwidecheck{} is:
+\begincode
+\def\varwidecheck{\@wide@accent{0 1.3 m .5 -.4 l 1 1.3 l 1 1.6 l .5 .3 l 0 1.6 l f}}
+/endcode
+\emacroexp
+
+\macroexp{\pdf@drawing@macro{<name>}{<pdf code>}{<width>}{<height>}{<horizontal skew>}{<depth>}} 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.
+The {\it horizontal skew} can be used to shift the symbol so that it fits horizontally inside the box.
+For example, the definition of \macroname\lightning{} is:
+\begincode
+\pdf@drawing@macro{lightning} % The lightning symbol is drawn upright
+ {.86603 -.5 .5 .86603 0 0 cm % and rotated 30 degrees
+ 1 J 1 j .6 w
+ -3 10 m -3 4.133975 l 0 5.866025 l 0 0 l -1.125 1.5 l 0 0 l 1.125 1.5 l S}
+ {4.2pt}{10.5pt}{.5pt}{.9pt}
+/endcode
+\emacroexp
+
+\macroexp{\pdf@drawing@math@macro{<name>}{<pdf code>}{<width>}{<height>}{<skew>}{<depth>}<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.
+{\it style scaling} should be three groups: the first group is the scaling used in textstyle, the second in scriptstyle, and
+the third in scriptscriptstyle.
+Each of these scalings should consist of two components: the fractional scaling and the decimal scaling.
+So for example if we'd like to scale it by $0.6$ the scaling would be \icode {{6 /fslash 10}{0.6}}/eicode.
+This is necessary since \macroname\dimexpr{} doesn't play with decimals nicely, but \macroname\pdfliteral{} requires them.
+For example, the definition of \macroname\divs{} is:
+\begincode
+\pdf@drawing@math@macro{@divs}
+ {1.3 w 1 j
+ 2.5 1 0 .1 re
+ 2.5 5 0 .1 re
+ 2.5 9 0 .1 re B}
+ {5.4pt}{10pt}{0pt}{.2pt}
+ {{1}{1}}{{7 /fslash 10}{.7}}{{11 /fslash 20}{.55}}
+\def\divs{\mathrel{\@divs}} % Make divs a relation
+/endcode
+\emacroexp
+
+\macroexp{\putsym{<main symbol>}{<secondary symbol>}} This centers the {\it secondary symbol} over the {\it main symbol}, and
+can be used to create symbols like \macroname\aint.
+Note that doing this creates a symbol which acts like an Ord on the left side and whatever type of atom {\it main symbol} is
+on the right (glue-wise).
+So it may be necessary to add some math atom ``hackery'' around the \macroname\putsym{} in order to get the target glue.
+For example, the definition of \macroname\aint{} is:
+\begincode
+\def\aint{\mathop{}\mathclose{}\putsym\int-}
+/endcode
+The \icode \mathop{}\mathclose{}/eicode{} makes it act like an Op on the left (the \macroname\mathclose{} removes any glue
+added on the right of the \macroname\mathop).
+Usually the definition is simpler, but this is slightly more complicated since \macroname\int{} has specially placed limits.
+Another example, this time the definition of \macroname\bigdcup{} is:
+\begincode
+\def\bigdcup{\mathop{\putsym\bigcup\cdot}}
+/endcode
+\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.
+{\it first cut} is a decimal value which is where on the width of {\it operator} to make the first slice, and similar for
+{\it second cut}.
+The extendable part of the new operator is the area between the two cuts.
+For example, the definition of \macroname\suum{} is:
+\begincode
+\@wide@operator{suum}\sum{.52}{.6}
+/endcode
+You can see where the slices are for a wide operator using the \macroname\@show@slices{} macro, for example
+\begincode
+\@show@slices{suum}
+/endcode
+gives:
+$$ \@show@slices{suum} $$
+These macros are not available for \xetex.
+\emacroexp
+\fi
+\end
diff --git a/macros/generic/pdfmsym/pdfmsym.tex b/macros/generic/pdfmsym/pdfmsym.tex
new file mode 100644
index 0000000000..732d9b1c6a
--- /dev/null
+++ b/macros/generic/pdfmsym/pdfmsym.tex
@@ -0,0 +1,344 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% pdfMsym %
+% PDF Math Symbols Package %
+% Slurp December, 2022 %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\edef\strudelccode{\the\catcode`\@}
+\catcode`\@=11
+
+\def\pdfMsym{{\scten pdf}{\rm M}{\scten sym}}
+\def\pdfMsymversion{1.0.2}
+
+\def\@gobble#1{}
+\def\m@strip{\expandafter\@gobble\string}
+
+\ifx\@ifnextchar\undefined
+ \def\@@ifnextchar{%
+ \ifx\@reg@D\@reg@A %
+ \expandafter\@reg@B%
+ \else%
+ \expandafter\@reg@C%
+ \fi%
+ }
+
+ \def\@ifnextchar#1#2#3{%
+ \let\@reg@A=#1\relax\def\@reg@B{#2}\def\@reg@C{#3}%
+ \futurelet\@reg@D\@@ifnextchar%
+ }
+\fi
+
+\def\@firstoftwo#1#2{#1}
+\def\@secondoftwo#1#2{#2}
+
+\begingroup\lccode`\?=`\p \lccode`\!=`\t %
+\lowercase{\endgroup
+\def\@ignorept#1.#2?!{\ifnum#2=0 #1\else \ifnum#1=0 \expandafter\@remzero\fi#1.#2\fi}}
+\def\@remzero#10{#1}
+\def\@nopt#1{\expandafter\@ignorept\the\dimexpr #1\relax}
+
+\def\pdf@literal#1{\special{pdf:literal #1}}
+
+\unless\ifx\saveboxresource\undefined
+ \let\pdfxform=\saveboxresource
+ \let\pdfrefxform=\useboxresource
+ \let\pdflastxform=\lastsavedboxresourceindex
+\fi
+
+\def\@normtrans/{0.996264 0 0 0.996264 0 0 cm}
+\def\pdfmsymsettransforms{%
+ \edef\@pdfmsym@ytrans/{0.996264 0 0 \@nopt{0.996264pt * \@font@scale} 0 0 cm}%
+ \edef\@pdfmsym@trans/{\@nopt{0.996264pt * \@font@scale} 0 0 \@nopt{0.996264pt * \@font@scale} 0 0 cm}%
+}
+
+\def\pdfmsymsetscalefactor#1{%
+ \edef\@font@scale{#1 / 10}%
+ \pdfmsymsettransforms%
+ \math@sym@defs%
+}
+
+\def\@@linehead@type#1#2#3#4[#5][#6]{\hbox to \dimexpr #4pt * #5 * \@font@scale\relax{%
+ \pdf@literal{%
+ q \@pdfmsym@trans/
+ 0 #6 0 0 #6 0 0 cm
+ 0 1 0 0 1 0 #2 cm
+ 1 j 1 J #1 w
+ #3 Q%
+ }\hss}%
+}
+\def\@linehead@type#1#2#3#4{%
+ \@ifnextchar[ {\@@linehead@type{#3}{#4}{#1}{#2}}%
+ {\@@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\@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}}
+\def\@ldharp {\@linehead@type{2 0 m 0 0 l 1 0 2 -1 2 -1.5 c S}{2}}
+\def\@linecap{\@linehead@type{0 0 m 1 0 l S}{1}}
+\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\@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\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@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#3{\mathpalette\@@vecc@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}}}%
+}
+
+\@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
+
+\unless\ifx\pdfxform\undefined
+ \def\@@constvec#1#2#3{{%
+ \setbox1=\hbox{$#1#3$}%
+ \setbox0=\hbox{$#1\smash{#3}\vrule height1.3ex width0pt depth\dimexpr\dp1+1pt\relax$}%
+ \pdfxform0%
+ #2{\smash{\pdfrefxform\pdflastxform}\vphantom{x}}%
+ }}
+ \def\@constvec#1#2{\@@constvec#1#2}
+ \def\constvec#1#2{\mathpalette\@constvec{{#1}{#2}}}
+\fi
+
+\def\arrow@skip{\mkern1mu}
+\def\xarrow@buffer{3}
+\def\@@@xarrow@type#1#2#3#4#5#6#7{\mathrel{\arrow@skip%
+ \vcenter{\hbox{$#7%
+ #1{\vecc@w}{\vecc@hw}[#5][#6]%
+ \vrule width\dimexpr \xarrow@buffer pt * \@font@scale\relax height \dimexpr \vecc@w pt * #5 * \@font@scale\relax depth0pt%
+ \smash{\mathord{\mathop{\kern\z@\leaders\hrule height \dimexpr \vecc@w pt * #5 * \@font@scale\relax\hfill}\limits^{#3}_{#4}}}%
+ \vrule width\dimexpr \xarrow@buffer pt * \@font@scale\relax height \dimexpr \vecc@w pt * #5 * \@font@scale\relax depth0pt%
+ #2{\vecc@w}{\vecc@hw}[#5][#6]%
+ $}}%
+ \vphantom{\mathop{-}^{#3}_{#4}}% Fix vertical spacing
+ \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{\mathpalette\@@xarrow@type{{#1}{#2}{#3}{#4}}}
+
+\def\@@@arrow@type#1#2#3#4#5#6{\mathrel{\arrow@skip%
+ \vcenter{\hbox{$#6%
+ #1{\vecc@w}{\vecc@hw}[#4][#5]%
+ \vrule width \dimexpr #3 * #4\relax height \dimexpr \vecc@w pt * #4 * \@font@scale\relax depth 0pt%
+ #2{\vecc@w}{\vecc@hw}[#4][#5]%
+ $}}\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{\mathpalette\@@arrow@type{{#1}{#2}{#3}}}
+
+\def\@arrow@def#1#2#3{%
+ \expandafter\def\csname #1\endcsname{\@arrow@type{#2}{#3}{1ex}}%
+ \expandafter\def\csname long#1\endcsname{\@arrow@type{#2}{#3}{3ex}}%
+ \expandafter\def\csname @x#1\endcsname##1[##2]{\@xarrow@type{#2}{#3}{##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
+\@arrow@def{varleftarrow}\@larrow\@linecap
+\@arrow@def{varrightharp}\@linecap\@rharp
+\@arrow@def{varleftharp}\@lharp\@linecap
+\@arrow@def{varleftrightarrow}\@larrow\@rarrow
+\@arrow@def{varleftrightharp}\@lharp\@rdharp
+\@arrow@def{varrightleftharp}\@ldharp\@rharp
+\@arrow@def{varmapsto}\@mapcap\@rarrow
+\@arrow@def{varhookrightarrow}\@backhook\@rarrow
+\@arrow@def{varhookleftarrow}\@larrow\@fronthook
+\@arrow@def{vardoublerightarrow}\@linecap\@doublerarrow
+\@arrow@def{vardoubleleftarrow}\@doublelarrow\@linecap
+\@arrow@def{varcirclerightarrow}\@circlecap\@rarrow
+\@arrow@def{varcircleleftarrow}\@larrow\@circlecap
+
+\def\accent@skew{.4}
+\def\accent@raise{.25}
+\def\@@@wide@accent#1#2#3{{%
+ \setbox0=\hbox{$#3#1$}%
+ \vbox{\offinterlineskip%
+ \ialign{##\cr
+ \hbox to \wd0{\hskip\dimexpr \accent@skew ex * \@font@scale\relax%
+ \pdf@literal{%
+ q \@pdfmsym@ytrans/
+ \@nopt{\wd0 - \accent@skew ex * \@font@scale} 0 0 1 0 -.5 cm
+ #2
+ Q}%
+ \hss%
+ }\cr\noalign{\kern\accent@raise ex\relax}%
+ \box0\cr%
+ }%
+ }%
+}}
+
+
+\def\@@wide@accent#1#2{\@@@wide@accent#2#1}
+\def\@wide@accent#1#2{\mathpalette\@@wide@accent{{#2}{#1}}}
+
+\def\varwidecheck{\@wide@accent{0 1.3 m .5 -.4 l 1 1.3 l 1 1.6 l .5 .3 l 0 1.6 l f}}
+\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\@@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}
+
+\def\aint{\mathop{}\mathclose{}\putsym\int-}
+\def\dwedge{\mathbin{\putsym\wedge\cdot}}
+\def\bigdwedge{\mathop{\putsym\bigwedge\cdot}}
+\def\dcup{\mathbin{\putsym\cup\cdot}}
+\def\bigdcup{\mathop{\putsym\bigcup\cdot}}
+
+\long\def\@pdf@drawing@macro@def#1#2#3#4#5#6{%
+ \hbox to \dimexpr#3 * \@font@scale\relax{\hskip\dimexpr#6 * \@font@scale\relax%
+ \vrule width0pt height0pt depth\dimexpr#5 * \@font@scale\relax%
+ \vbox to \dimexpr#4 * \@font@scale\relax{\vss\pdf@literal{q \@pdfmsym@trans/ #2 Q}}\hss}%
+}
+
+\unless\ifx\pdfxform\undefined
+ \long\def\pdf@drawing@macro@def#1#2#3#4#5#6{{%
+ \setbox0=\@pdf@drawing@macro@def{#1}{#2}{#3}{#4}{#5}{#6}%
+ \pdfxform0%
+ \expandafter\xdef\csname @#1@xformno\endcsname{\the\pdflastxform}%
+ }}
+
+ \long\def\pdf@drawing@macro#1#2#3#4#5#6{%
+ \pdf@drawing@macro@def{#1}{#2}{#3}{#4}{#5}{#6}%
+ \expandafter\edef\csname #1\endcsname{\noexpand\leavevmode\noexpand\pdfrefxform\csname @#1@xformno\endcsname}%
+ }
+
+ \def\math@drawing@get#1#2{\expandafter\pdfrefxform\csname @#1@\m@strip#2@xformno\endcsname}
+\else
+ \long\def\pdf@drawing@macro#1#2#3#4#5#6{%
+ \expandafter\def\csname #1\endcsname{\@pdf@drawing@macro@def{#1}{#2}{#3}{#4}{#5}{#6}}%
+ }
+ \let\pdf@drawing@macro@def=\pdf@drawing@macro
+
+ \def\math@drawing@get#1#2{\csname #1@\m@strip#2\endcsname}
+\fi
+
+\long\def\pdf@drawing@math@macro#1#2#3#4#5#6#7#8#9{%
+ \pdf@drawing@macro@def{#1@displaystyle}{#2}{#3}{#4}{#5}{#6}%
+ \pdf@drawing@macro@def{#1@textstyle}
+ {\@secondoftwo#7 0 0 \@secondoftwo#7 0 0 cm #2}
+ {#3 * \@firstoftwo#7}
+ {#4 * \@firstoftwo#7}
+ {#5 * \@firstoftwo#7}
+ {#6 * \@firstoftwo#7}%
+ \pdf@drawing@macro@def{#1@scriptstyle}
+ {\@secondoftwo#8 0 0 \@secondoftwo#8 0 0 cm #2}
+ {#3 * \@firstoftwo#8}
+ {#4 * \@firstoftwo#8}
+ {#5 * \@firstoftwo#8}
+ {#6 * \@firstoftwo#8}%
+ \pdf@drawing@macro@def{#1@scriptscriptstyle}
+ {\@secondoftwo#9 0 0 \@secondoftwo#9 0 0 cm #2}
+ {#3 * \@firstoftwo#9}
+ {#4 * \@firstoftwo#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{}}
+}
+
+\def\math@sym@defs{%
+ \pdf@drawing@macro{lightning}
+ {.86603 -.5 .5 .86603 0 0 cm
+ 1 J 1 j .6 w
+ -3 10 m -3 4.133975 l 0 5.866025 l 0 0 l -1.125 1.5 l 0 0 l 1.125 1.5 l S}
+ {4.2pt}{10.5pt}{.5pt}{.9pt}
+%
+ \pdf@drawing@math@macro{@ndivs}
+ {0.4 w 1 j
+ 0 3 m 5 7 l s
+ 1.3 w
+ 2.5 1 0 .1 re
+ 2.5 5 0 .1 re
+ 2.5 9 0 .1 re B}
+ {5.4pt}{10pt}{0pt}{.2pt}
+ {{1}{1}}{{7 / 10}{.7}}{{11 / 20}{.55}}
+ \def\ndivs{\mathrel{\@ndivs}}
+%
+ \pdf@drawing@math@macro{@divs}
+ {1.3 w 1 j
+ 2.5 1 0 .1 re
+ 2.5 5 0 .1 re
+ 2.5 9 0 .1 re B}
+ {5.4pt}{10pt}{0pt}{.2pt}
+ {{1}{1}}{{7 / 10}{.7}}{{11 / 20}{.55}}
+ \def\divs{\mathrel{\@divs}}
+}
+
+% Thanks to Plante for this macro (it is a generalized version of the one found in TeX Pearls 2006 by
+% Bogusław Jackowski and Piotr Strzelczyk.
+% https://www.gust.org.pl/projects/pearls/2006p/boguslaw-jackowski/bachotex2006-boguslaw-jackowski-pearl1.pdf
+\unless\ifx\pdfxform\undefined
+ \def\@@slice#1{%
+ \pdfxform\csname #1\endcsname%
+ \global\setbox\csname #1\endcsname=\hbox{\pdfrefxform\pdflastxform}%
+ }
+
+ \def\@inner@newbox{\alloc@ 4\box \chardef \insc@unt} % Non-outer \newbox
+
+ \def\@slice#1#2#3#4{{%
+ \setbox0=\hbox{#1}%
+ \expandafter\@inner@newbox\csname #2@L\endcsname%
+ \expandafter\@inner@newbox\csname #2@C\endcsname%
+ \expandafter\@inner@newbox\csname #2@R\endcsname%
+ \global\setbox\csname #2@L\endcsname=\hbox{\copy0 \kern\dimexpr #3\wd0 - \wd0\relax}%
+ \global\setbox\csname #2@C\endcsname=\hbox{\kern-#3\wd0 \copy0 \kern\dimexpr #4\wd0 - \wd0\relax}%
+ \global\setbox\csname #2@R\endcsname=\hbox{\kern-#4\wd0 \copy0}%
+ \@@slice{#2@L}\@@slice{#2@C}\@@slice{#2@R}%
+ }}
+
+ \def\@show@slices#1{%
+ \hbox{\copy\csname #1@L\endcsname\vrule width .1pt
+ \copy\csname #1@C\endcsname\vrule width .1pt
+ \copy\csname #1@R\endcsname}
+ }
+
+ \def\@wide@operator#1#2#3#4{%
+ \@slice{$\displaystyle#2$}{#1}{#3}{#4}%
+ \expandafter\def\csname #1\endcsname{%
+ \mathop{\copy\csname #1@L\endcsname \xleaders\copy\csname #1@C\endcsname\hfill \copy\csname #1@R\endcsname}\limits%
+ }%
+ }
+
+ \@wide@operator{suum}\sum{.52}{.6}
+ \@wide@operator{prood}\prod{.48}{.52}
+\fi
+
+\catcode`\@=\strudelccode