0

I used the code $d_n$ and what came out was really "d_n", instead of "n" becoming the subscript of $d$.

I tried other formulas including _, all of which failed to render the subscript.

What could be the probable causes of this?

I'll put my code here

\documentclass{ctexart}
\usepackage[a4paper,margin=2cm]{geometry}
\usepackage{expl3}
\usepackage{graphicx}
\usepackage{xfp}
\input{insbox.tex}
\usepackage{amssymb,amsmath,amsthm,amsfonts}
\everymath{\displaystyle}
\usepackage[fontsize=12pt]{fontsize}
\usepackage{tasks}
\ExplSyntaxOn
\seq_new:N \分值表

\newcounter{题号}
\newcommand{\题}[1]{
    \stepcounter{题号}
    \par\noindent\textbf{\large\the题号.}(#1分)
    \seq_put_right:Nn \分值表 {#1}
}
\newcommand{\作表}[1]{
    \begin{center}\begin{tabular*}{\linewidth}
    {@{\extracolsep{\fill}}|c|*{#1}{c|}} \hline
    题号\int_step_inline:nn{#1}{&##1}\\\hline
    分值&\seq_use:Nn \分值表 {&} \\\hline
    得分\int_step_inline:nn{#1}{&}\\\hline
    \end{tabular*}\end{center}
}
\newcommand{\ans}{\noindent\textbf{解:}}
\begin{document}
......
\end{document}
3
  • 1
    you have not posted any example subscript... I note you have \ExplSyntaxOn but no \ExplSyntaxOff so _ is a letter here for use in command names, not a subscript command Oct 2, 2022 at 14:11
  • It worked, thanks.
    – youthdoo
    Oct 2, 2022 at 14:28
  • Note that \分值表 is not a good name for a sequence. It should be something like \l_youthodoo_分值表_seq. The recommended naming scheme helps in avoiding clashes.
    – egreg
    Oct 2, 2022 at 15:34

1 Answer 1

1

I note you have \ExplSyntaxOn but no \ExplSyntaxOff so _ is a letter here for use in command names, not a subscript command.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .