Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mathtools support for tex reader/writer #249

Open
jgm opened this issue Jan 24, 2025 · 0 comments
Open

Add mathtools support for tex reader/writer #249

jgm opened this issue Jan 24, 2025 · 0 comments

Comments

@jgm
Copy link
Owner

jgm commented Jan 24, 2025

https://us.mirrors.cicku.me/ctan/macros/latex/contrib/mathtools/mathtools.pdf
is a package that extends/replaces amsmath.

New things:

% Adjustment of spacing

\mathllap[〈mathstyle〉]{〈math〉}
\mathrlap[〈mathstyle〉]{〈math〉}
\mathmbox{〈math〉}
\mathclap[〈mathstyle〉]{〈math〉}
\clap{〈text〉}
\mathmakebox[〈width〉][〈pos〉]{〈math〉}

\cramped[〈mathstyle〉]{〈math〉}


\crampedllap[〈mathstyle〉]{〈math〉}
\crampedclap[〈mathstyle〉]{〈math〉}
\crampedrlap[〈mathstyle〉]{〈math〉}


\begin{crampedsubarray}{〈col〉} 〈contents〉
\end{crampedsubarray}
\crampedsubstack{〈lines separated by
\\ 〉}

\smashoperator[〈pos〉]{〈operator with limits〉}

\adjustlimits{〈operator1〉}_{〈limit1〉} {〈operator2〉}_{〈limit2〉}

\SwapAboveDisplaySkip

% Tags and refs

\newtagform{〈name〉}[〈inner_format〉]{〈left〉}{〈right〉}
\renewtagform{〈name〉}[〈inner_format〉]{〈left〉}{〈right〉}
\usetagform{〈name〉}

\refeq{〈label〉}

\noeqref{〈label,label,. . . 〉}

% Extensible symbols

\xleftrightarrow[〈sub〉]{〈sup〉}
\xLeftarrow[〈sub〉]{〈sup〉}
\xhookleftarrow[〈sub〉]{〈sup〉}
\xmapsto[〈sub〉]{〈sup〉}
\xRightarrow[〈sub〉]{〈sup〉}
\xLeftrightarrow[〈sub〉]{〈sup〉}
\xhookrightarrow[〈sub〉]{〈sup〉}

\xrightharpoondown[〈sub〉]{〈sup〉}
\xleftharpoondown[〈sub〉]{〈sup〉}
\xrightleftharpoons[〈sub〉]{〈sup〉}
\xrightharpoonup[〈sub〉]{〈sup〉}
\xleftharpoonup[〈sub〉]{〈sup〉}
\xleftrightharpoons[〈sub〉]{〈sup〉}

\xlongrightarrow[〈sub〉]{〈sup〉}
\xlongleftarrow[〈sub〉]{〈sup〉}

\xLongrightarrow[〈sub〉]{〈sup〉}
\xLongleftarrow[〈sub〉]{〈sup〉}


\underbracket[〈rule thickness〉] [〈bracket height〉]{〈arg〉}
\overbracket[〈rule thickness〉] [〈bracket height〉]{〈arg〉}
\underbrace{〈arg 〉}
\LaTeXunderbrace{〈arg 〉}
\overbrace{〈arg 〉}
\LaTeXoverbrace{〈arg 〉}

% Math environments

\begin{matrix*} [〈col〉]〈contents〉\end{matrix*}
\begin{pmatrix*}[〈col〉] 〈contents〉
\end{pmatrix*}
\begin{bmatrix*}[〈col〉] 〈contents〉
\end{bmatrix*}
\begin{Bmatrix*}[〈col〉] 〈contents〉
\end{Bmatrix*}
\begin{vmatrix*}[〈col〉] 〈contents〉
\end{vmatrix*}
\begin{Vmatrix*}[〈col〉] 〈contents〉
\end{Vmatrix*}


\begin{smallmatrix*} [〈col〉]〈contents〉\end{smallmatrix*}
\begin{psmallmatrix} 〈contents〉
\end{psmallmatrix}
\begin{psmallmatrix*}[〈col〉] 〈contents〉
\end{psmallmatrix*}
\begin{bsmallmatrix} 〈contents〉
\end{bsmallmatrix}
\begin{bsmallmatrix*}[〈col〉] 〈contents〉
\end{bsmallmatrix*}
\begin{Bsmallmatrix} 〈contents〉
\end{Bsmallmatrix}
\begin{Bsmallmatrix*}[〈col〉] 〈contents〉
\end{Bsmallmatrix*}
\begin{vsmallmatrix} 〈contents〉
\end{vsmallmatrix}
\begin{vsmallmatrix*}[〈col〉] 〈contents〉
\end{vsmallmatrix*}
\begin{Vsmallmatrix} 〈contents〉
\end{Vsmallmatrix}
\begin{Vsmallmatrix*}[〈col〉] 〈contents〉
\end{Vsmallmatrix*}

\begin{multlined}[〈pos〉][〈width〉] 〈contents〉
\end{multlined}
\shoveleft[〈dimen〉]{〈arg 〉}
\shoveright[〈dimen〉]{〈arg 〉}

\begin{dcases}\end{dcases}
\begin{dcases*}\end{dcases*}
\begin{rcases}\end{rcases}
\begin{rcases*}\end{rcases*}
\begin{drcases}\end{drcases}
\begin{drcases*}\end{drcases*}
\begin{cases*}\end{cases*}

\MoveEqLeft[〈number〉]

\Aboxed{〈left hand side Example & right hand side〉}

\MakeAboxedCommand\Aboxedname\boxmacro

\ArrowBetweenLines[〈symbol〉]
\ArrowBetweenLines*[〈symbol〉]

\vdotswithin{〈symbol〉}
\shortvdotswithin{〈symbol〉}
\shortvdotswithin*{〈symbol〉}
\MTFlushSpaceAbove
\MTFlushSpaceBelow

\intertext{〈text 〉}
\shortintertext{〈text 〉}

\DeclarePairedDelimiter{〈cmd〉}{〈left_delim〉}{〈right_delim〉}


\DeclarePairedDelimiterX{〈cmd〉}[〈num args〉]{〈left_delim〉}{〈right_delim〉}{〈body〉}
\delimsize

\DeclarePairedDelimiterXPP{〈cmd〉}[〈num args〉]{〈pre code〉}{〈left_delim〉}
{〈right_delim〉}{〈post code〉}{〈body〉}

%expert use:
\reDeclarePairedDelimiterInnerWrapper{〈macro name〉}%
{〈star or nostarnonscaled or nostarscaled〉}{〈code〉}

% Special symbols


\lparen
\rparen

\vcentcolon
\ordinarycolon

% This affects typesetting of the string :=

\mathtoolsset{centercolon}
\mathtoolsset{centercolon=false}

\dblcolon ::
\coloneq :=
\Coloneq ::=
\colonapprox :≈
\Colonapprox ::≈
% Legacy duplicate names:
\coloneqq :=
\eqqcolon =:
% Extra symbols added Summer 2022:
\approxcolon ≈:
\Approxcolon ≈::
\colondash :−
\Colondash ::−
\eqcolon
\colonsim
\Coloneqq
\simcolon
\dashcolon
=:
\Eqcolon =:: :∼
\Colonsim ::∼
::=
\Eqqcolon =::
∼:
\Simcolon ∼:: −:
\Dashcolon −::

\nuparrow
\ndownarrow
\bigtimes

% Left sub/supscripts

\prescript{〈sup〉}{〈sub〉}{〈arg〉}

\DeclareMathSizes{〈dimen〉}{〈dimen〉}{〈dimen〉}{〈dimen〉}

% more:

\begin{spreadlines}{〈dimen〉} 〈contents〉 \end{spreadlines}

\splitfrac{〈start line〉}{〈continuation〉} \splitdfrac{〈start line〉}{〈continuation〉}

\xmathstrut[〈depth increase〉]{〈increase〉}

Some of these would essentially just need to be ignored (fine-grained spacing). The Special symbols would need to be added to the ToTeX.hs records structure.

For discussion see jgm/pandoc#10558

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant