\ doifundef 안의 ConTeXt xtables가 컴파일되지 않습니다.

\ doifundef 안의 ConTeXt xtables가 컴파일되지 않습니다.

다음 미니 예제는 컴파일되지 않습니다.

\starttext
\doifundefined{undefined}{%
\startxtable
    \startxtablebody
        \startxrow
            \startxcell cell \stopxcell
        \stopxrow
    \stopxtablebody
\stopxtable}
\stoptext

이것이 내가 얻는 것입니다:

lcc@home:tex> context --batchmode xtable2.tex

resolvers       | trees | analyzing '/Users/lcc/Library/texlive/texmf-config'
resolvers       | trees | analyzing '/Users/lcc/Library/texlive/texmf'
mtx-context     | run 1: luatex --fmt="/Users/lcc/Library/texlive/texmf-var/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/formats/luatex/cont-en" --interaction="batchmode" --jobname="xtable2" --lua="/Users/lcc/Library/texlive/texmf-var/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/formats/luatex/cont-en.lui" --no-parse-first-line --c:batchmode --c:currentrun=1 --c:fulljobname="./xtable2.tex" --c:input="./xtable2.tex" --c:kindofrun=1 --c:maxnofruns=9 "cont-yes.mkiv"
This is LuaTeX, Version 0.95.0 (TeX Live 2016)
 system commands enabled.

resolvers       > trees > analyzing '/Users/lcc/Library/texlive/texmf-config'

resolvers       > trees > analyzing '/Users/lcc/Library/texlive/texmf'
open source     > 1 > 1 > /usr/local/texlive/current/texmf-dist/tex/context/base/mkiv/cont-yes.mkiv
system          > 'cont-new.mkiv' loaded
open source     > 2 > 2 > /usr/local/texlive/current/texmf-dist/tex/context/base/mkiv/cont-new.mkiv
close source    > 2 > 2 > /usr/local/texlive/current/texmf-dist/tex/context/base/mkiv/cont-new.mkiv
system          > files > jobname 'xtable2', input './xtable2', result 'xtable2'
fonts           > latin modern fonts are not preloaded
languages       > language 'en' is active
open source     > 2 > 3 > /Users/lcc/Projects/inactive/MVNECO/tex/xtable2.tex
close source    > 2 > 3 > /Users/lcc/Projects/inactive/MVNECO/tex/xtable2.tex
close source    > 1 > 3 > /usr/local/texlive/current/texmf-dist/tex/context/base/mkiv/cont-yes.mkiv

tex error       > tex error on line 0 in file : ! Emergency stop



<empty file>


mtx-context     | fatal error: return code: 1

없는 동일한 문서는 \doifundefined잘 컴파일되어 원하는 출력을 생성합니다. xtable을 조건부로 조판하려면 어떻게 해야 합니까?

texlive 2016과 함께 제공되는 최신 ConTeXt 배포판을 사용하고 있습니다.

답변1

xtable은 버퍼입니다. xtable을 포함하려면 다음 \startembeddedxtable대신 사용하세요 \startxtable.

\starttext
 \doifundefined{undefined}{%
 \startembeddedxtable
 \startxtablebody
    \startxrow
        \startxcell cell \stopxcell
    \stopxrow
\stopxtablebody
\stopembeddedxtable
}
\stoptext

다른 옵션은 명령이 정의되지 않은 경우 모드를 설정하고 해당 모드에 따라 내용을 처리합니다.

\starttext
\doifundefined{undefined}{\enablemode[alltables]}
\startmode[alltables]
\startxtable
    \startxtablebody
        \startxrow
            \startxcell cell \stopxcell
        \stopxrow
    \stopxtablebody
\stopxtable
\stopmode
\stoptext

또는 먼저 테이블의 내용을 버퍼에 저장하고 변수가 정의되지 않은 경우 버퍼를 처리합니다.

\starttext
\startbuffer[content]
\startxtable
    \startxtablebody
        \startxrow
            \startxcell cell \stopxcell
        \stopxrow
    \stopxtablebody
\stopxtable
\stopbuffer
\doifundefined{undefined}{\getbuffer[content]}
\stoptext

(한스 하겐)

관련 정보