Seqsplit 与 detokenize 出现错误

Seqsplit 与 detokenize 出现错误

我想在表格单元格内写一些带下划线的单词。如果这些单词可以不用\_下划线来写就更好了。我还想像命令一样在任何地方将这些单词连字符连接起来。我尝试在里面\seqsplit使用,但出现错误。\seqsplit\detokenize

梅威瑟:

\documentclass{article}
\usepackage{seqsplit}
\usepackage{array}

\begin{document}



\begin{center}
    \begin{tabular}{ | m{5em}| } 
        \hline
        SOME\_LONG\_COMMAND  \\\hline
        \detokenize{SOME_LONG_COMMAND}  \\\hline
        \seqsplit{SOME\_LONG\_COMMAND}  \\\hline
        \seqsplit{\detokenize{SOME_LONG_COMMAND}} \\\hline

    \end{tabular}
\end{center}


\end{document}

答案1

\documentclass{article}
\usepackage{seqsplit}
\usepackage{array}
\usepackage[T1]{fontenc} %needed for correct underscores with pdflatex
\begin{document}



\begin{center}
    \begin{tabular}{ | m{5em}| }
        \hline
        SOME\_LONG\_COMMAND  \\\hline
        \detokenize{SOME_LONG_COMMAND}  \\\hline
        \seqsplit{SOME\_LONG\_COMMAND}  \\\hline
        \expandafter\seqsplit\expandafter{\detokenize{SOME_LONG_COMMAND}} \\\hline

    \end{tabular}
\end{center}


\end{document}

相关内容