Chemmacros 오류: "추가 정렬 탭이 \cr...로 변경되었습니다."

Chemmacros 오류: "추가 정렬 탭이 \cr...로 변경되었습니다."

chemmacros를 로드할 때 다음과 같은 오류 메시지가 나타납니다(이해가 안 됩니다...):

! Extra alignment tab has been changed to \cr.
<template> ...egin \relax \d@llarend \endtemplate 
                                                  
l.62 \end{document}
                   
You have given more \span or & marks than there were
in the preamble to the \halign or \valign now in progress.
So I'll assume that you meant to type \cr instead.

로드하지 않으면 작동하는 매우 단순화된 테스트 문서입니다. {chemmacros}여기서는 모든 패키지 등을 PDF로 인쇄하려고 합니다.

\documentclass{scrreprt}
\usepackage{xparse}
\usepackage{etoolbox}
\usepackage{longtable}
\usepackage{calc}
\usepackage{array}
\usepackage{booktabs}
\usepackage{seqsplit}
%\usepackage{chemmacros}
\listfiles%

\AtEndDocument{\printfilelist}%
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}%
\ExplSyntaxOn%
\NewDocumentCommand{\printfilelist}{}{%
    \setlength{\LTleft}{\fill}%
    \setlength{\LTright}{\fill}%
    \begin{longtable}{@{}%
            >{\ttfamily}%
            L{0.3\textwidth-\tabcolsep}%
            L{\widthof{9999/99/99}}%
            >{\raggedright}%
            p{0.7\textwidth-\widthof{9999/99/99}-3\tabcolsep}%
            @{}}%
        \toprule%
        \multicolumn{1}{@{}l}{\bfseries File~name} & \multicolumn{1}{c}{\bfseries Date} & \bfseries File~info%
        \tabularnewline%
        \midrule%
        \endhead%
        \bottomrule%
        \endfoot%
        \Holou_print_filelist:%
    \end{longtable}%
}%
\tl_new:N \l_filelist_body_tl%
\tl_new:N \l_fileinfo_tl%
\cs_new_protected:Npn \Holou_print_filelist: {%
    \clist_map_inline:cn {@filelist}{%
        \Holou_print_fileinfo:n {##1}%
    }%
    \tl_use:N \l_filelist_body_tl%
}%
\cs_new_protected:Npn \Holou_print_fileinfo:n #1 {%
    \regex_match:nnT { \.(sty|cls|tex|clo|fd|cfg|bbx|cbx|lbx|ldf|def|hak)\Z } {#1}{%
        \Holou_print_pkginfo:n {#1}%
    }%
}%
\cs_new_protected:Npn \Holou_print_pkginfo:n #1 {%
    \tl_set_eq:Nc \l_fileinfo_tl {ver@#1}%
    \tl_replace_once:Nnn \l_fileinfo_tl {~} {&}%
    \tl_put_right:Nx \l_filelist_body_tl {%
        \exp_not:N \seqsplit{#1}%
        &%
        \exp_not:V \l_fileinfo_tl%
        \exp_not:N \tabularnewline%
    }%
}%
\ExplSyntaxOff%

\begin{document}
    
\end{document}

{chemmacros}다음은 코드의 기능을 확인하려는 사람들을 위한 가 없는 그림입니다 .여기에 이미지 설명을 입력하세요

이제 내 질문은 로드할 때 작동하지 않는 이유입니다 {chemmacros}. 내가 뭔가 잘못한 걸까요? :디

해결 방법(편집): 문제는 chemmacros 파일 정보의 &-기호였습니다. 예를 들어 \tl_replace_all:Nnn \l_fileinfo_tl {&} {-}날짜 뒤의 첫 번째 ~-기호를 교체하여 &-기호를 추가하기 전에 지금 막 교체했습니다. 울리케님, 감사합니다. <3

답변1

&댓글 에서 이미 논의한 것처럼 chemmacros. 파일 정보를 문자열화하여 이 문제를 해결할 수 있습니다.

바꾸다

\tl_set_eq:Nc \l_fileinfo_tl {ver@#1}

~에 의해

\tl_set:Nx \l_fileinfo_tl { \tl_to_str:c {ver@#1} }

예를 들어 코드가 작동합니다…

여기에 이미지 설명을 입력하세요

관련 정보