나는 나를 위해 테이블을 만드는 테이블 만들기 프로그램을 가지고있다. 그러나 한 가지 문제점은 잘 작성되지 않았다는 것입니다. end {tabular}에 대한 새 명령 \? 구문과 탈출하기
예를 들어, 나는 다음과 같습니다 테이블을하고 싶습니다 :
\begin{tabular}{|l|lll|l|}
\cline{1-1} \cline{5-5}
id & x & y & y & sum \\ \cline{1-1} \cline{5-5}
a & 1 & 2 & 3 & 6 \\ \cline{1-1} \cline{5-5}
b & 1 & 2 & . & 3 \\ \hline
c & \multicolumn{1}{l|}{.} & \multicolumn{1}{l|}{.} & . & . \\ \hline
\end{tabular}
때때로, 그러나, end{tabular}\\
을 읽는 end{tabular}
명령의 끝에 백 슬래시를 추가합니다. 일부 환경에서는 threeparttable
및 center
과 같은 오류가 발생합니다.
나는이 프로그램의 소스 코드를 내 컴퓨터에서 편집하고 응답하지 않는 관리자에게 전자 메일을 보냈습니다. 여러 컴퓨터에서 여러 동료와이 코드를 공유해야하는 곧 프로젝트가 생기며 모든 사람이 패키지 코드를 변경하기위한 정확한 명령을 찾을 수 없습니다. 이것은 일반적으로 재현성에 대한 오류를 고려하기 시작하지도 않습니다.
이 문제를 해결하려면 라텍스에서 \end{tabular}\\
을 end{tabular}
으로 읽는 것이 좋습니다. 하지만 내 자신의 명령을 정의하려고하면 구문을 작동시키지 못합니다. 누군가이 정의를 만들 수있게 도와 줄 수 있습니까? \newcommand{\end{tabular}\\}{\end{tabular}}
이 작동하지 않는 이유를 모르겠습니다.
편집 :
MWE를 추가했습니다. 다음 코드는 ShareLatex를 사용하여 컴파일하지 않습니다. end{tabular}\\
뒤에 "There is no line to end here
"을 입력하면 빈 줄에 오류가 표시됩니다. end{tabular}
(백 슬래시 없음)으로 끝나는 코드의 두 번째 청크는 정상적으로 컴파일됩니다.
\documentclass[12pt]{article}
\usepackage[a4paper, margin = .5in]{geometry}
\usepackage{pdflscape}
\usepackage{threeparttable}
\begin{document}
\begin{table}
\caption{My test table}
\begin{center}
\begin{threeparttable}
\small
\begin{tabular}{lll}
a & b & c \\
2 & 3 & 4 \\
this & that & here
\end{tabular}\\
\begin{tablenotes}
\item
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}
\end{document}
이 코드는 실행되는 두 번째 코드 블록입니다.
\documentclass[12pt]{article}
\usepackage[a4paper, margin = .5in]{geometry}
\usepackage{pdflscape}
\usepackage{threeparttable}
\begin{document}
\begin{table}
\caption{My test table}
\begin{center}
\begin{threeparttable}
\small
\begin{tabular}{lll}
a & b & c \\
2 & 3 & 4 \\
this & that & here
\end{tabular}
\begin{tablenotes}
\item
\end{tablenotes}
\end{threeparttable}
\end{center}
\end{table}
\end{document}
유스 케이스가 어디에서 오류를 발생시키는 지 보여주는 코드를 제공 할 수 있습니까? – Werner
방금 추가되었습니다. – genauguy