LyX 정의되지 않은 제어 시퀀스 \input

LyX 정의되지 않은 제어 시퀀스 \input

저는 새로운 사용자입니다. 나는 lyX와 특히 \input{file.tex}올바르게 사용하는 방법에 문제가 있습니다. 오류: "정의되지 않은 제어 순서". 실제로 LyX가 경로를 인식하고 찾을 수 있도록 경로를 어디에 지정해야 하는지 잘 모르겠습니다. 지금까지는 Insert > float > table을 사용했습니다(여기서 2개의 다른 테이블을 추가할 것입니다). LateX 프리앰블(문서 > 설정 > LateX 프리앰블)에서 다음을 사용하고 있습니다.

% Packages for tables
\usepackage{booktabs}% Pretty tables
\usepackage{threeparttablex}% For Notes below table

% *****************************************************************
% siunitx
% *****************************************************************
\newcommand{\sym}[1]{\rlap{#1}} 

\usepackage{siunitx}
    \sisetup{
        detect-mode,
        group-digits            = false,
        input-symbols           = ( ) [ ] - +,
        table-align-text-post   = false,
        input-signs             = ,
        }   

% Character substitution that prints brackets and the minus symbol in text mode. Thanks to David Carlisle
\def\yyy{%
  \bgroup\uccode`\~\expandafter`\string-%
  \uppercase{\egroup\edef~{\noexpand\text{\llap{\textendash}\relax}}}%
  \mathcode\expandafter`\string-"8000 }

\def\xxxl#1{%
\bgroup\uccode`\~\expandafter`\string#1%
\uppercase{\egroup\edef~{\noexpand\text{\noexpand\llap{\string#1}}}}%
\mathcode\expandafter`\string#1"8000 }

\def\xxxr#1{%
\bgroup\uccode`\~\expandafter`\string#1%
\uppercase{\egroup\edef~{\noexpand\text{\noexpand\rlap{\string#1}}}}%
\mathcode\expandafter`\string#1"8000 }

\def\textsymbols{\xxxl[\xxxr]\xxxl(\xxxr)\yyy}


% *****************************************************************
% Estout related things
% *****************************************************************
\let\estinput=\input % define a new input command so that we can still flatten the document

\newcommand{\estwide}[3]{
        \vspace{.75ex}{
            \textsymbols% Note the added command here
            \begin{tabular*}
            {\textwidth}{@{\hskip\tabcolsep\extracolsep\fill}l*{#2}{#3}}
            \toprule
            \estinput{#1}
            \bottomrule
            \addlinespace[.75ex]
            \end{tabular*}
            }
        }   

\newcommand{\estauto}[3]{
        \vspace{.75ex}{
            \textsymbols% Note the added command here
            \begin{tabular}{l*{#2}{#3}}
            \toprule
            \estinput{#1}
            \bottomrule
            \addlinespace[.75ex]
            \end{tabular}
            }
        }

% Allow line breaks with \\ in specialcells
\newcommand{\specialcell}[2][c]{%
    \begin{tabular}[#1]{@{}c@{}}#2\end{tabular}
}

% *****************************************************************
% Custom subcaptions
% *****************************************************************
% Note/Source/Text after Tables
% The new approach using threeparttables to generate notes that are the exact width of the table.
\newcommand{\Figtext}[1]{%
    \begin{tablenotes}[para,flushleft]
    \hspace{6pt}
    \hangindent=1.75em
    #1
    \end{tablenotes}
    }
\newcommand{\Fignote}[1]{\Figtext{\emph{Note:~}~#1}}
\newcommand{\Figsource}[1]{\Figtext{\emph{Source:~}~#1}}
\newcommand{\Starnote}{\Figtext{* p < 0.1, ** p < 0.05, *** p < 0.01. Standard errors in parentheses.}}% Add significance note with \starnote

귀하의 지원에 감사드립니다! 감사합니다!

답변1

이 명령은 \input{}사용자 프리앰블은 물론 프리앰블 없이 새 LyX 파일에서도 작동해야 합니다. 문서 본문에서 다음을 시도해 보세요.

  1. Ctrl+L(이것은 ERT - 사악한 빨간색 텍스트 - 상자를 만듭니다)
  2. ERT 상자 안에 쓰거나 \input{/your/path/here/file}(확장자는 생략 가능 .tex) 단순히 \input{file} 하위 문서가 기본 문서와 동일한 디렉터리에 있을 때 쓰세요.

의 메뉴에서도 동일한 결과를 얻을 수 있습니다 Insert > File > Children document(또는 이와 유사한 일부에서는 정확한 영어 라벨을 확인할 수 없습니다). 결과는 동일하며 유일한 차이점은 LyX에서 무시되는 LaTeX 코드 대신 Lyx 창을 통해 변경할 수 있는 클릭 가능한 회색 상자가 표시된다는 것입니다.

MWE

"정의되지 않은 제어 순서" 오류가 발생하는 경우 이는 하위 문서의 잘못된 명령으로 인한 것입니다. file.tex완전한 LaTeX 문서가 아니라 문서 본문의 일부여야 합니다 . 먼저 \input{}일반 텍스트(" Hello, Word!"이면 충분함)나 다음과 같은 간단한 테이블로 제대로 작동하는지 확인하세요.

\begin{tabular}{|l|l|l|}
\hline
    11 & 12 & 13\\
    21 & 22 & 23\\
    31 & 32 & 33\\
\hline
\end{tabular}

관련 정보