0

I have been using the following \subsup command

\newcommand{\subsup}{
\makeatletter
\AtBeginDocument{
\check@mathfonts
\fontdimen16\textfont2=2.5pt
\fontdimen17\textfont2=2.5pt
\fontdimen14\textfont2=4.5pt
\fontdimen13\textfont2=4.5pt}
\makeatother}

in order to change the default positions of subscripts and superscripts in math mode. I used the \subsup command when needed and I was compiling with MikTex.

\documentclass{article}
\usepackage{amsmath}
\usepackage[lite]{mtpro2}

\newcommand{\subsup}{
\makeatletter
\AtBeginDocument{
\check@mathfonts
\fontdimen16\textfont2=2.5pt
\fontdimen17\textfont2=2.5pt
\fontdimen14\textfont2=4.5pt
\fontdimen13\textfont2=4.5pt}
\makeatother}

\subsup
\begin{document}
\[ x_A \]
\end{document}

When I switched to TexLive I got the following errors

Package amsmath Error: \check allowed only in math mode. \begin{document} Font \nullfont has only 7 fontdimen parameters. \begin{document}

In order to fix that I had to call the same code without the \subsup command, just placed right before \begin{document}

\documentclass{article}
\usepackage{amsmath}
\usepackage[lite]{mtpro2}

\makeatletter
\AtBeginDocument{
\check@mathfonts
\fontdimen16\textfont2=2.5pt
\fontdimen17\textfont2=2.5pt
\fontdimen14\textfont2=4.5pt
\fontdimen13\textfont2=4.5pt}
\makeatother
\begin{document}
\[ x_A \]
\end{document}

Is there another simple way to use this code by command?

2
  • Please give us a complete example that shows how you're using the command.
    – Teepeemm
    Nov 23 '19 at 13:47
  • 1
    any differences in tex errors will be due to using different latex release or different packages, not due to using texlive rather than miktex Nov 23 '19 at 14:05
4

You have the catcode change in the wrong place, \makeatletter does nothing here

\newcommand{\subsup}{
\makeatletter
\AtBeginDocument{
\check@mathfonts
\fontdimen16\textfont2=2.5pt
\fontdimen17\textfont2=2.5pt
\fontdimen14\textfont2=4.5pt
\fontdimen13\textfont2=4.5pt}
\makeatother}

you want

\makeatletter
\newcommand{\subsup}{
\AtBeginDocument{
\check@mathfonts
\fontdimen16\textfont2=2.5pt
\fontdimen17\textfont2=2.5pt
\fontdimen14\textfont2=4.5pt
\fontdimen13\textfont2=4.5pt}
}
\makeatother

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.