发现 texbook 这本书还是不容易看懂的。下面这一段我看了好几篇还是没弄清楚 \newif 的用法。
To facilitate \if... constructions, plain TEX has a \newif
macro, such that
after you say '\newif\ifabc' three control sequences will be
defined: \ifabc
(for testing the switch), \abctrue (for making the switch true), and
\abcfalse (for
making it false). The \phantom problem is now solved in Appendix B by writing
\newif\ifhph \newif\ifvph
\def\hphantom{\hphtrue\vphfalse\phant}
and with similar definitions of \vphantom and \phantom. There is no
longer any need
for a \ph macro; again \phant tests \ifhph and \ifvph. Appendix E contains other
examples of conditionals created by \newif. New conditionals are
initially false.
另外,ThuThesis 中是这样使用 \newif 的 (当然我也没看懂)。
\newif\ifthu@bachelor\thu@bachelorfalse
\DeclareOption{bachelor}{\thu@bachelortrue}
\ifthu@bachelor\relax\else
Best regards.
Hi, all:
发现 texbook 这本书还是不容易看懂的。下面这一段我看了好几篇还是没弄清楚 \newif 的用法。
To facilitate \if... constructions, plain TEX has a \newif
macro, such that
after you say '\newif\ifabc' three control sequences will be
defined: \ifabc
(for testing the switch), \abctrue (for making the switch true), and
\abcfalse (for
making it false).
The \phantom problem is now solved in Appendix B by writing
\newif\ifhph \newif\ifvph
\def\hphantom{\hphtrue\vphfalse\phant}
and with similar definitions of \vphantom and \phantom. There is no
longer any need
for a \ph macro; again \phant tests \ifhph and \ifvph. Appendix E contains other
examples of conditionals created by \newif. New conditionals are
initially false.
另外,ThuThesis 中是这样使用 \newif 的 (当然我也没看懂)。
\newif\ifthu@bachelor\thu@bachelorfalse
\DeclareOption{bachelor}{\thu@bachelortrue}
\ifthu@bachelor\relax\else
Best regards.
多谢, 解释地很清楚,我明白了。
我原来主要是没理解这句话:
three control sequences will be defined.