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}
\ExplSyntaxOn
but no\ExplSyntaxOff
so_
is a letter here for use in command names, not a subscript command\分值表
is not a good name for a sequence. It should be something like\l_youthodoo_分值表_seq
. The recommended naming scheme helps in avoiding clashes.