\newcommand의 \end{tabu}

\newcommand의 \end{tabu}

나는\end{tabu}\newcommand

\documentclass{article}

\usepackage{tabu}

\newcommand
{\tableBegin}[1]
{
    \begin{tabu}[#1]
    % some other stuff
}

\newcommand
{\tableEnd}
{\end{tabu}}

\begin{document}

\tableBegin{ccc}
1 & 2 & 3 \\
a & b & c
\tableEnd
%\end{tabu}

\end{document}

\tableEnd하지만 대신 사용하면 \end{tabu}다음과 같은 오류가 발생합니다. ! Missing $ inserted.

답변1

tabu(AMS 환경 tabularx등과 같은) 본문을 인수로 사용하여 \end{tabu}소스에서 명시적으로 찾습니다. 이 문제를 해결하는 것이 가능하지만 그렇게 하지 않고 문서화된 환경 이름을 사용하는 것이 더 간단합니다.

\tableBegin/EndLaTeX 규칙과 매우 다르므로 새로운 환경을 정의해 보는 것은 어떨까요?

관련 정보