Re: [問題] 這段是什麼意思
※ 引述《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
討論串 (同標題文章)
LaTeX 近期熱門文章
PTT數位生活區 即時熱門文章