KTUGFaq
KTUG FAQ
LaTeXPix&value=Yhchoe/FindPage › KTUGCollection2006&value=Yhchoe/TitleIndex › KC2008/KCmenu › KC2006/ó/TroubleShooting/TroubleShooting&value=KC2006/ó/TroubleShooting/TroubleShooting › 치歐/HLaTeX&value=은글꼴 › TeX
TeX Ҽ Ѵ. ؿ (integer) ִ.
1.1 ¶
\advance _variable_ by _number_
by ִ.
\newcount\mycnt\mycnt=1 \newdimen\mydim\mydim=10pt \advance\mycnt by1\advance\mydim by10.1pt \the\mycnt\quad\the\mydim
1.2 ¶
\multiply _variable_ by _number_
by ִ.
밪 .
\newcount\mycnt\mycnt=1 \newdimen\mydim\mydim=10.24pt \multiply\mycnt by4\multiply\mydim by2 \the\mycnt\quad\the\mydim
dimen ϴ counter̴.
1.3 ¶
\divide _variable_ by _number_
by .
\newcount\mycnt\mycnt=5 \newdimen\mydim\mydim=10.24pt \divide\mycnt by3\divide\mydim by3 \the\mycnt\quad\the\mydim
counter , . , ȴ.
̿Ͽ, Ư ڸ, 13 ڸ 3 ϴ ƾ غ.
⼭ \TmpInt Ƶ鿩 \count2 Ͽ. , 10 ٽ 10 Ͽ (10) ڸ ̴. 1 ڸ 3 ´. ƾ HLaTeX ڵ縦 óϱ ä ̱ ϴ.
\count@\TmpInt \ifnum\count@<\z@ \count@-\count@ \fi\count2\count@ \divide\count2 10 \multiply\count2 10 \advance\count@-\count2
1.4 ¶
̿ؼ ִ ϴ ũԴϴ. ִ ϴ ˰ Ŭ ˰ ߽̿ϴ.
\newcount\m \newcount\n \newcount\t \def\euclid#1#2{\m=#1 \n=#2 \ifnum\n>\m \t=\m \m=\n \n=\t \fi \ifnum\n=0 \number\m \else\t=\m \divide\m\n \multiply\m\n \advance\t-\m \euclid\n\t \fi}
̿մϴ.
Ʒ ԴѴ.
The greatest common divisor of $119$~and~$544$ is $\euclid{119}{544}.$ The greatest common divisor of $2166$~and~$6099$ is $\euclid{2166}{6099}.$
2.1 \newcounter, \setcounter ¶
\newcounter ο ī Ѵ. PlainTeX \newcount LaTeX Ư δ. , Ϲ \csname شϴ \ ī ν, Ŀ ϰ Ϸ Ͽ.
\documentclass{article} \usepackage{hfont} \usepackage{ifthen} \begin{document} %% newcounter \newcounter{ddd} % LaTeX . ī ddd \newcount\dddd % PlainTeX . ī \dddd %% setcounter \setcounter{ddd}{0} % LaTeX \dddd=0 % PlainTeX %% ī ϳ Ű \stepcounter{ddd} % īͿ 1 Ѵ.(LaTeX) \advance\dddd by 1% īͿ 1 Ѵ.(PlainTeX) \addtocounter{ddd}{3}% īͿ 3 Ѵ.(LaTeX) \advance\dddd by 3% īͿ 3 Ѵ.(PlainTeX) %% ǥ(LaTeX) \arabic{ddd} \Alph{ddd} \alph{ddd} \Roman{ddd} \roman{ddd} %% \theddd % LaTeX ddd ī θ \number\dddd % PlainTeX dddd ī θ . \the\dddd . %% Right ȴ. \ifthenelse{\equal{\value{ddd}}{\theddd}} {Right}{Wrong} %% \dddd ϳ Ű.(ddd=4, \the\dddd=5) \advance\dddd by 1 %% 翬 ٸ ̴. \ifthenelse{\equal{\value{ddd}}{\the\dddd}} {Right}{Wrong. \theddd\ is not equal to \the\dddd} \end{document}
3 Ǽ 䳻 : realcalc.tex ¶
Ұϴ realcalc.tex Frank Bochholz PlainTeX ̽ Űμ, Ǽ ó ξ.
ٷ ִ -2147483647.999999999 2147483647.999999999̰, Ǿ , Ǽ ʿ ̴.( Ҽ ٲپ ؾ ̴.)
LaTeX ̴.
\documentclass{article} \input realcalc \def\a{2.550} \def\b{3.660} \parindent=0pt \begin{document} \verb|\a|=\a \quad \verb|\b|=\b \begin{tabular}{cc} add & \Radd\c\a\b \Rtrunc\c2\c \Rtrunc\a2\a \Rtrunc\b2\b \c \verb|=| \a \verb|+| \b \\ subst & \Rsub\d\a\b \Rtrunc\d2\d \d \\ multiply & \Rmul\e\a\b \Rtrunc\e2\e \e \end{tabular} \end{document}
Contributors : Karnes