作者YungLee (不滚石头)
看板LaTeX
标题Re: [问题] 这段是什麽意思
时间Sun Nov 18 23:22:37 2007
※ 引述《calcutta (cul)》之铭言:
: 请问一下@begintheorem 前面那个老鼠号是什麽意思
: \def\@begintheorem#1#2{\par\addvspace{12\p@}
: \list{}{\leftmargin\z@\rightmargin\leftmargin}%
: \ifSFB@indentsty
: \item[]\hspace*{\SFB@indent}{\bfseries #1\ #2 }\itshape
: \ifdim \SFB@indent=\z@ \leftmarginii 3em \else \leftmarginii \SFB@indent \fi
: \else
: \item[]{\bfseries #1\ #2 }\itshape
: \leftmarginii 3em
: \fi}
: \def\@opargbegintheorem#1#2#3{\par\addvspace{12\p@}
: \list{}{\leftmargin\z@\rightmargin\leftmargin}%
: \ifSFB@indentsty
: \item[]\hspace*{\SFB@indent}{\bfseries #1\ #2 (#3) }\itshape
: \ifdim \SFB@indent=\z@ \leftmarginii 3em \else \leftmarginii \SFB@indent \fi
: \else
: \item[]{\bfseries #1\ #2 (#3) }\itshape
: \leftmarginii 3em
: \fi}
: \def\@endtheorem{\endlist}
@ (at) 键, 在原始的 tex 输入码中不归於字母 (letter) 类, 而另归於 other 类,
因此原本不可用於定义巨集。
但若输入 \makeatletter 後, @ 就可当作一般字母用,直到 \makeatother 之後才
又不能再用。
因此常用在巨集定义档中,用来定义不准备让使用者直接呼叫的巨集,用一般的程
式语言来讲,使用了 @ 的名的巨集,相当於 private 函数。
但若知道这个原则,使用者必要时在文档中可以如下使用 :
\makeatletter
% 补充指令,作为非 Float 图,表之 caption
\newcommand\figcaption{\def\@captype{figure}\caption} %
\newcommand\tabcaption{\def\@captype{table}\caption} %
\makeatother
这里利用曾经被定义过的 private 巨集 (with @),定义新的巨集指令。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.231.159.30