1

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. Commented Nov 23, 2019 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 Commented Nov 23, 2019 at 14:05

1 Answer 1

5

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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.