KTUG 한국 텍 사용자 그룹

Menu

KTUG :: Q&A 마당 › expl3로 카운터 형식 재정의하기

yihoze | 2015.10.28 20:15:15 | 메뉴 건너뛰기 쓰기

\NewDocumentCommand \MyFootnoteStyle {m}

{

\renewcommand\thefootnote{#1{footnote}}

}


\MyFootnoteStyle{\arabic} 또는 \MyFootnoteStyle{\fnsymbol} 이렇게 할 때, 기대한 대로 잘 됩니다.


여기에서 백슬래시없이 다음과 같이 하면


\MyFootnoteStyle{arabic} 

\MyFootnoteStyle{fnsymbol}


더 멋질 것 같아, \exp_args를 사용해서 해보려 했는데, 예상과 달리 잘 풀리지 않았습니다.

\csname 대신 \use:c 나 \cs:w를 쓰면 될 줄 알았는데 그렇지 않았습니다. 


***


\documentclass{article} 

\usepackage{xparse}

\def\foo{Lorem ipsum dolor sit amet, consectetuer adipiscing elit.}


\ExplSyntaxOn

\NewDocumentCommand \MyFootnoteStyle { m }

{

\renewcommand\thefootnote{\csname #1\endcsname{footnote}}

\renewcommand\thempfootnote{\csname #1\endcsname{mpfootnote}}

}

\ExplSyntaxOff


\begin{document}

\MyFootnoteStyle{fnsymbol}

\foo\footnote{Testing}

\MyFootnoteStyle{arabic}

\foo\footnote{Testing}

\foo\footnote{Testing}

\MyFootnoteStyle{alph}

\foo\footnote{Testing}

\MyFootnoteStyle{Alph}

\foo\footnote{Testing}

\MyFootnoteStyle{roman}

\foo\footnote{Testing}

\MyFootnoteStyle{Roman}

\foo\footnote{Testing}

\MyFootnoteStyle{fnsymbol}

\foo\footnote{Testing}

\end{document}


댓글 [4]

댓글 쓰기

목록

KTUG 한국 텍 사용자 그룹