L A TEX version 1.0.6 Guido Gonzato, Ph.D. <gonzato@sci.univr.it> Università di Verona (Italy) Facoltà di Scienze MM. FF. NN. TEX (KTUG) 2003 12 30 L A TEX.,. L A TEX L A TEX., L A TEX.. 1 1 1.1..................................................... 2 1.1.1.......................................... 3 1.1.2.................................................. 3 1.2.................................................. 5 2 (File) 5 2.1 (File/New)................................................... 5 2.2 (File/Save As... )............................................. 6 2.3 (File/Save As Template)...................................... 6 2.4 (File/Import)........................................... 6 2.5 (File/Page Setup)........................................... 7 2.5.1 / (Page Setup/Headers and Footers)............................. 8 2.6 (File/Printer Setup)........................................... 8 2.7 (File/Print Preview)......................................... 9 Ca Vignal II, Strada Le Grazie 15, 37134 Verona (Italy) i
2.8 (File/Print)..................................................... 9 2.9 (File/Versions)................................................ 9 3 (Edit) 9 3.1 (Edit/Autotext)................................................ 10 4 (Insert) 10 4.1, (Insert/Breaks)......................................... 10 4.2 (Insert/Enumerated List).......................................... 11 4.3 (Insert/Special Character).......................................... 12 4.3.1 (EURO).............................................. 13 4.4 (Insert/Formula).................................................. 13 4.5 (Insert/Footnote)................................................. 14 4.5.1....................................................... 14 4.6 (Insert/Indices)............................................... 15 4.7 (Insert/Vertical and Horizontal Space)............................... 15 4.8 (Insert/Tabs)..................................................... 16 4.9 (Insert/Cross Reference)........................................... 16 4.10 (Insert/Margin Notes)............................................. 17 4.11 / (Insert/Frame)............................................... 17 4.12 (Insert/Figure)................................................ 17 4.12.1....................................... 19 4.13 (Insert/Shapes)................................................ 20 4.14 (Insert/Line).................................................. 21 4.15 (Insert/Hyperlink).......................................... 21 4.16 (Insert/Comment)................................................ 22 5 (Format) 22 5.1 (Format/Line Spacing)............................................ 23 5.2 (Format/Character).............................................. 23 5.2.1.................................................... 24 5.2.2 (Format/Character Size)...................................... 25 5.2.3 (Format/Character Font).................................... 25 5.2.4 (Format/Character Colour)...................................... 27 5.3 (Format/Paragraph)............................................. 27 5.3.1 (Format/Paragraph Horizontal Alignment)....................... 28 5.3.2 (Format/Paragraph Vertical Alignment)......................... 28 5.3.3 (Format/Paragraph Margins).................................... 29 5.3.4 (Format/Paragraph Indentation)............................... 30 5.4 (Format/Paragraph Border and Shade)............................ 30 5.5 (Format/Colour).................................................. 31 5.6 (Format/Columns).............................................. 31 6 (Table) 32 ii
6.1.......................................... 34 6.1.1.................................................. 35 6.2 slashbox............................................... 35 6.3 L A TEX............................................. 36 7 (Tools) 36 7.1 (Tools/Mail Merges)......................................... 36 7.2 (Tools/Labels)............................................. 37 7.3 (Tools/Default Language).......................................... 39 7.4 (Tools/Hyphenation)........................................... 40 7.5 (Tools/Spell Check)........................................... 40 8 (Help) 40 9 41 A (Document Templates) 42 1 Emacs, Vim, Jed(IDE mode)................................. 4 2............................................ 12 3........................................................ 23 4........................................................ 24 5........................................................ 26 6 L A TEX.................................................... 28 7......................................................... 33 1.......................................... 18 2 A Gnuplot graph.................................................... 18 3 Book template..................................................... 42 4 Report template.................................................... 42 5 Letter template..................................................... 43 6 How to write a notice................................................ 43 7 How to write a poster................................................ 44 iii
1, L A TEX. L A TEX.,..,,,,.. L A TEX(HLaTeX). PDF. Utopia,. KTUG(http: //www.ktug.or.kr).,. 1, L A TEX. L A TEX,. L A TEX. L A TEX...,. WYSIWYG L A TEX.,.,,, 1.,, L A TEX., L A TEX. plain TEX. L A TEX.. L A TEX,. :-) L A TEX.. L A TEX. L A TEX, http://www.tug.org/begin.html *i The (Not So) Short Introduction to L A TEX 2ε *ii A Gentle Introduction to TEX. 1 128k, Z80. WordStar CP/M 720K! *i http://www.ctan.org/starter.html, URL. *ii http://www.doeun.pe.kr/frames/lshort.html. 1
1.1 1, *iii L A TEX. L A TEX,...,. 1.1. L A TEX.. L A TEX..,,. 1.1.2. TEX CTAN(The Comprehensive TeX Archive Network). http://www.ctan.org.., CTAN:, CTAN TeX. L A TEX CTAN://systems,, CTAN http://www.tex.ac.uk/tex-archive/ systems/.. L A TEX (typesetting).? :. L A TEX. L A TEX (source), WYSIWYG WYSIWYG. ( Windows (notepad) ), TEX (TEXnicians). GNU Emacs (http://www.gnu.org/software/emacs/emacs.html) Xemacs (http://www. xemacs.org) AUCTEX (CTAN://support/auctex). vi Vim (http://www.vim.org).. Jed, (http://space.mit.edu/~davis/jed/), Emacs. CTAN://support/jed jed L A TEX. Kile (http://kile.sourceforge.net) KDE L A TEX.. Texmaker (http://perso.club-internet.fr/pascal.brachet/texmaker/index.html) Kile KDE. LyX (http://www.lyx.org) WYSIWYG. *iv,. *iii MS. MS. *iv LyX CJK-LyX., CJK-LyX Windows. 2
1.1 1 GNU TEXMACS (http://www.texmacs.org) UNIX L A TEX. WinEdt (http://www.winedt.com) Windows L A TEX. shareware. Windows L A TEX http://home.arcor.de/itsfd/texwin. htm. TeXnicCenter WinShell., L A TEX http://www.esm.psu.edu/mac-tex/. L A TEX. 1.1.1 L A TEX.,,,. 1, GNU emacs vim IDE jed. 1.1.2 tetex, GNU/Linux TEX. MiKTEX. 1. CTAN. gzip tar (.tar.gz). 2. L A TEX. $TEXMF/tex/latex. 3.. 4..sty, latex newstyle.ins.sty. latex newstyle.dtx. 5. texhash, tetex. $TEXMF. GNU/Linux /usr/share/ texmf. root, $HOME,, $HOME/texmf,..sty $HOME/.bash profile. export TEXINPUTS="~/texmf:" 3
1.1 1 Action Emacs Vim Jed (command mode) Alt-X ESC Alt-X (insert mode) n/a i a o O n/a (line editor mode) n/a : n/a Ctrl-X Ctrl-F :e Ctrl-KE Ctrl-Xi :r Ctrl-KR Ctrl-X Ctrl-S :w Ctrl-KD Ctrl-X Ctrl-W name :w name Ctrl-KS Ctrl-XK :q Ctrl-KQ change buffer Ctrl-XB bn Ctrl-KN Ctrl-XU u Ctrl-U Ctrl-^ Ctrl-R Ctrl-G Ctrl-U Ctrl-X Ctrl-C :qa! Ctrl-KX Alt-B b Ctrl-A Alt-F w Ctrl-F Ctrl-A 0 Ctrl-QS Ctrl-E $ Ctrl-QD Alt-V Ctrl-U Ctrl-R Ctrl-V Ctrl-D Ctrl-C ( ) Alt-< 1G Ctrl-QR ( ) Alt-> G Ctrl-QC Alt-G n. n.g Ctrl-QI Ctrl-H X BS Ctrl-D x Alt-G Alt-DEL db Alt-BS Alt-D dw Ctrl-T Ctrl-K d$ Ctrl-QY Ctrl-A Ctrl-K dd Ctrl-Y Ctrl-S text /text Ctrl-QS Alt-% :s/old/new/g Ctrl-QA Ctrl-SPACE v Ctrl-KB Ctrl-W D Ctrl-KY Alt-W Y Ctrl-KH Ctrl-Y P Ctrl-KC 1: Emacs, Vim, Jed(IDE mode) 4
2.1 2 ( FILE) MiKTEX, C:\localtexmf\tex \latex\newpackage., MiKTeX (MikTeX Options) Refresh now., initexmf -u.! *v 1.2. L A TEX 2ε. 1..,,.. 2. L A TEX.,..., L A TEX.., (, )...,. 2 (File) L A TEX. (File/Open), (File/Save), (File/Close). 2.1 (File/New) L A TEX. \documentclass{article} \begin{document} %. \end{document} L A TEX.., (title),., (cite). *v MiKTEX. MiKTEX 2.2 (MiKTeX Package Manager).. 5
2.4 ( File/Save As... ) 2 ( FILE) \documentclass[a4paper,12pt]{article} \begin{document} \title{ } \author{ ~ ~ } \date{, \today} \maketitle \begin{abstract}. \end{abstract} \tableofcontents \listoftables \listoffigures \section{ } \label{sec:start}. \cite{gonzato}. \section{end} \label{sec:end}. ~\ref{sec:start}~. \begin{thebibliography}{99} \bibitem{gonzato} Gonzato G. \textit{\latex{} for Word Processor Users}. CTAN, 2001. \end{thebibliography} \end{document} A (templates). 2.2 (File/Save As... ) Save As.... L A TEX. latex2html: http://saftsack.fs.uni-bayreuth.de/~latex2ht/, CTAN://support/latex2html latex2rtf: CTAN://support/latex2rtf PDF 2.7. 2.3 (File/Save As Template) L A TEX (templates), L A TEX.. 2.4 (File/Import) L A TEX. 6
2.5 ( File/Page Setup) 2 ( FILE) rtf2latex: CTAN://support/rtf2latex html2latex: CTAN://support/html2latex wvware MS Word L A TEX. http://wvware.sourceforge.net. Abiword MS Word L A TEX. http://www.abisource.com txt2tex : CTAN://support/txt2tex L A TEX. *2latex. 2.5 (File/Page Setup),, \documentclass *vi. a4paper, a5paper, b5paper, letterpaper, legalpaper, executivepaper. portrait( ), landscape landscape( ).. \documentclass[a5paper,landscape,12pt]{article}. \setlength{\leftmargin}{2cm} \setlength{\rightmargin}{2cm} \setlength{\oddsidemargin}{2cm} \setlength{\evensidemargin}{2cm} \setlength{\topmargin}{-1cm} \setlength{\textwidth}{18cm} \setlength{\textheight}{25cm} geometry,. geometry,..,. \geometry{paperwidth=25cm} \geometry{paperheight=35cm} % or: \geometry{papersize={25cm,35cm}} \geometry{width=20cm} % total width \geometry{heigth=30cm} % total heigth *vi [ ]., { }. 7
2.7 ( File/Printer Setup) 2 ( FILE) % or: \geometry{total={20cm,30cm}} \geometry{textwidth=18cm} % width - marginpar \geometry{textheight=25cm} % heigth - header - footer % or: \geometry{body={18cm,25cm}} \geometry{left=3cm} % left margin \geometry{right=1.5cm} % right margin % or: \geometry{hmargin={3cm,2cm}} \geometry{top=2cm} % top margin \geometry{bottom=3cm} % bottom margin % or: \geometry{vmargin={2cm,3cm}} \geometry{marginparwidth=2cm} \geometry{head=1cm} % header space. \usepackage[left=3cm, right=2cm]{geometry} 2.5.1 / (Page Setup/Headers and Footers) fancyhdr \pagestyle{fancy}. (book.cls ). (fancy)..,,,.. \lhead{} % empty \chead{hello, world!} \rhead{page \thepage} % page number \lfoot{} \cfoot{\textbf{hello!}} \rfoot{} 2.6 (File/Printer Setup). L A TEX. UNIX. lpr -P printername. lpr -# 10 10. lpr -r.. 8
3.0 ( File/Print Preview) 3 ( EDIT) 2.7 (File/Print Preview) L A TEX,..dvi (latex file.tex) xdvi yap DVI..dvi dvips POSTSCRIPT Ghostview. dvipdfm *vii pdflatex Acrobat.pdf. Acrobat.pdf..pdf. dvipdf ( Linux ).dvi.ps,.pdf. *viii pdflatex. hyperref url.pdf. 4.15. pdflatex, 4.12. b 2.8 (File/Print) lpr file.ps.. 2.9 (File/Versions) L A TEX version RCS (Revision Control System) CVS (Concurrent Version Control System). CVS RCS http://www. linuxdoc.org/howto/cvs-rcs-howto.html. 3 (Edit) L A TEX. 1, Edit/Cut, Edit/Copy, Edit/Paste, Edit/Find, Edit/Replace.. L A TEX (environment) *vii PDF dvipdfm DVIPDFMx. Hirata Shunsaku dvipdfm-cjk. DVPIDFMx.pdf,. http://project.ktug.or.kr/dvipdfmx/. *viii.ps.pdf Adobe Distiller PSTill, Ghostscript ps2pdf. dvipdf dvips,., dvipdfm DVIPDFMx.dvi.pdf. 9
4.2 ( Edit/Autotext) 4 ( INSERT).,. this is \textbf{bold text;}\\ this is also {\bfseries bold text;}\\ \begin{bfseries} this is bold text, too! \end{bfseries} \textbf{ }! this is bold text; this is also bold text; this is bold text, too!! 3.1 (Edit/Autotext), PS POSTSCRIPT., *ix L A TEX. \def\ps {\textsc{postscript}}, \PS \textsc{postscript}.. 4 (Insert) 4.1, (Insert/Breaks). ( ) \linebreak \newline, \\. \\. \\[1cm].., \par. *x, \newpage \clearpage. \newline, \linebreak..\linebreak.\newline,...,. \clearpage \newpage ( )., \cleardoublepage \clearpage. 4.12. *ix. *x \\,. \\. *xxiii. 10
4.2 ( Insert/Enumerated List) 4 ( INSERT) 4.2 (Insert/Enumerated List) ( [ ] ) itemize enumerate. \item. \begin{itemize} \item[*]. \item[-]. \item[.]. \end{itemize} *. -... 1 4 2., \arabic, \roman (viii), \Roman, \alph \Alph,, \fnsymbol. fnsymbol. \begin{itemize} \renewcommand{\labelitemi}{*} \renewcommand{\labelitemii}{-} \item 1, \item 1, \begin{itemize} \item 2, \item 2, \end{itemize} \item 1, \end{itemize} * 1, * 1, - 2, - 2, * 1,, enumerate, : \begin{enumerate} \renewcommand{\labelenumi} {\Alph{enumi}} \renewcommand{\labelenumii} {\roman{enumii}} \item 1, \item 1, \begin{enumerate} \item 2, \item 2, \end{enumerate} \item 1, \end{enumerate} A 1, B 1, i 2, ii 2, C 1, enumerate. enumerate,. A a I i 1, \Alph, 2 \labelitemi, \labelitemii, \labelitemiii, \labelitemiv. 11
4.3 ( Insert/Special Character) 4 ( INSERT) L A TEX $ \$ or \textdollar & \& % \% \_ or \textunderscore { \{ or \textbraceleft } \} or \textbraceright < $<$ or \textless > $>$ or \textgreater \ \textbackslash \textbar \textbullet \textdaggerdbl \textdagger \textparagraph \textsection c \textcopyright ˆ \textasciicircum \textasciitilde $\sim$ R \textregistered TM \texttrademark a \textordfeminine o \textordmasculine 2: \alph, \Roman, \roman, \arabic.. \begin{enumerate}[{ } I.] \item \label{item:first} \item \item. \ref{item:first}. \end{enumerate} I. II. III.. I. 4.3 (Insert/Special Character), L A TEX., \,,. 2.. pifont \ding, \dingfill, \dingline, \dinglist. \ding Dingbat. \fill, \line, \list Dingbat. 12
4.5 ( Insert/Formula) 4 ( INSERT) \begin{dinglist}{43} \item one \item two \item three \end{dinglist} one two three,. \begin{dingautolist}{172} \item one \item two \item three \end{dingautolist} 1 one 2 two 3 three. L A TEX,. CTAN://info/symbols/comprehensive/ 4.3.1 (EURO) marvosym,. \EUR. 4.4 (Insert/Formula) L A TEX. $. I like math: $x^n + y^n \neq z^n \forall n \neq 2$ is my favourite theorem. I like math: x n +y n z n n 2 is my favourite theorem. displaymath equation. equation. *xi. \begin{equation} x^n + x^n \neq z^n \quad \forall n \neq 2 \label{eq:fermat} \end{equation} ~\ref{eq:fermat}.. 1. x n + x n z n n 2 (1) *xi equation, L A TEX (article, book ). \documentclass [leqno]. [fleqn] (f lushleft-ed equation). amsmath.. 13
4.5 ( Insert/Footnote) 4 ( INSERT) 4.5 (Insert/Footnote) \footnote[n]{footnote text}. ( ) [n]. \footnote. \renewcommand{\thefootnote}{read me!} \footnote {.}%. read read me!. me!.. \renewcommand{\thefootnote} {\Roman{footnote}} \footnote{ }, \footnote{ }. \renewcommand{\thefootnote} {\fnsymbol{footnote}}.\footnote[8]{!} I, II.. I II! \fnsymbol{footnote}, 1 9.... \footnotemark. \footnote{the first.}% \newcounter{myfootnote}% \setcounter{myfootnote} {\value{footnote}}% \footnote{the second.}. \footnotemark[\value{myfootnote}]. 1 2. 1. 1 the first. 2 the second. : minipage mpfootnote thempfootnote. 4.5.1 endnotes... \let\footnote=\endnote,. 14
4.7 ( Insert/Indices) 4 ( INSERT) \newpage \begingroup \parindent 0pt \parskip 2ex \def\enotesize{\normalsize} \theendnotes \endgroup. endnotes.sty. 4.6 (Insert/Indices),, L A TEX. \section \chapter. L A TEX. \tableofcontents \listoffigures \listoftables *xii makeindex makeidx. \index L A TEX.. \usepackage{makeidx} \makeindex \newcommand{\wordindex}[1]{\index{#1}#1} %... \printindex \makeindex, \printindex. L A TEX makeindex latex., latex makeindex latex. \wordindex \wordindex{ }.. 4.7 (Insert/Vertical and Horizontal Space). L A TEX,... \null ~ \vfill \hfill. *xii. 15
4.9 ( Insert/Tabs) 4 ( INSERT) one \hfill two\\ \vfill ~ \hfill three \hfill ~\\ \vfill four \hfill five \null one four three two five L A TEX.. ~., \hspace. This is a \hspace{2cm} 2-cm-wide hole. This is a 2-cm-wide hole. 4.8 (Insert/Tabs) tabbing TAB.. \begin{tabbing} % let s set the tab positions ~ \hspace{1cm} \= ~ \hspace{2cm} \= ~ \hspace{2.5cm} \= \kill % discard text Zero \> One \> Two \> Three \\ Zero \> One \> \> Three \+ \\ % go right Zero \> Two \> Three \- \\ % go left Zero \> One \> Two \\ \pushtabs % save tab positions new tab 1{\ldots} \= new tab 2 \\ new \> tab \\ \poptabs % restore tab positions Zero \> One \> Two \> Three \end{tabbing} Zero One Two Three Zero One Three Zero Two Three Zero One Two new tab 1... new tab 2 new tab Zero One Two Three tabular table. 4.9 (Insert/Cross Reference) \label, \ref, \pageref. prefix:suffix. prefix (chapter) cha, (equation) eq, (figure) fig, / (sections) sec, (table) tab.,, \label, \ref. \pageref. 16
4.12 ( Insert/Margin Notes) 4 ( INSERT) \paragraph{example.} \label{par:example} ~\pageref{par:example}~ ~\ref{par:example}~. Example.. 17 4.9 label (prefix).,. \begin{enumerate} \item. \ref{item:end}. \label{item:start} \item.( ) \item. \ref{item:start}. \label{item:end} \end{enumerate} 1.. 3. 2..( ) 3.. 1. 4.10 (Insert/Margin Notes). \marginpar{text}. 4.11 / (Insert/Frame).. textpos. 7. ( A.) minipage. minipage. minipage, boxedminipage boxedminipage.. \begin{boxedminipage}[c]{0.6\linewidth}... text... \end{boxedminipage} 4.12 (Insert/Figure) (L A TEX epslatex.ps Using Imported Graphics in L A TEX 2ε.) (figure), figure. 1.. b 17
4.12 ( Insert/Figure) 4 ( INSERT) \begin{figure}[htbp] % [htbp] %. here, top, % bottom, separate page( ). \begin{center} \texttt{=8-)} \end{center} \caption{.} \label{fig:mysmiley} \end{figure} =8-) 1:.. L A TEX L A TEX.,, \ref{fig:label}. (floats). here H. Encapsulated POSTSCRIPT (.eps), graphicx L A TEX. 2. Gnuplot 3D graph sin(x*x + y*y)/(x*x + y*y) \begin{figure} \begin{center} \fbox{\includegraphics [width=0.5\textwidth, angle=-90] {gnuplot.ps}} \caption{a Gnuplot graph.} \label{fig:gnuplot} \end{center} \end{figure} 1 0.8 0.6 0.4 0.2 0-0.2-0.4-4 Z -3-2 -1 X 0 1 2 3-1 0 1-2 -3 4-4 2 3 Y 4 2: A Gnuplot graph. latex dvips, EPS. *xiii pdflatex PDF JPG, PNG..jpg,.gif,.png.eps. ImageMagick (http://www.imagemagick.org) GIMP (http://www.gimp.org)., POSTSCRIPT. POSTSCRIPT jpeg2ps (http://www. pdflib.com/jpeg2ps/index.html) bmeps (CTAN://support/bmeps)..jpg *xiii..dvi..dvi.jpg.gif.,.eps.dvi. DVIPDFMx EPS. graphicx EPS DVIPDFMx, graphicx [dvipdfm] EPS PDF. KTUG TIP. http://www.doeun.pe.kr/uselatex/ref-files/gfaq/ 18
4.12 ( Insert/Figure) 4 ( INSERT),. Z PDFL A TEX.eps.pdf.pdf. EPS.pdf epstopdf..pdf.ps. *xiv % define the variable \ifpdf \newif\ifpdf \ifx\pdfoutput\undefined \pdffalse \else \pdfoutput=1 \pdftrue \fi... % include the right options \ifpdf \usepackage[pdftex]{graphicx} \pdfcompresslevel=9 \else \usepackage{graphicx} \fi... % include the right graphic file \ifpdf \includegraphics{file.pdf} \else \includegraphics{file.eps} \fi Z 18 figure( ) Too many unprocessed floats L A TEX. \clearpage floats. morefloats floats 36. 4.12.1, wrapfig picins, floatflt. *xv *xiv \newif\ifpdf, \usepackage{ifpdf}, \ifpdf... \else... \fi. *xv wrapfig. picins. wrapfig picins. 19
4.13 ( Insert/Shapes) 4 ( INSERT) If you meet this guy, give hime some money. \newcommand\xsmile{\huge\texttt{=8-)}} \parpic{\xsmile} {The reason may not be apparent to you, but I can assure that your money will end up in good hands. I say again, if you meet this guy, give him some money: he knows how to use it properly. OK?} If you meet this guy, give hime some money. =8-) The reason may not be apparent to you, but I can assure that your money will end up in good hands. I say again, if you meet this guy, give him some money: he knows how to use it properly. OK? floatflt floatingtable. 4.13 (Insert/Shapes) L A TEX \circle, \oval picture., picture. epic eepic ( ), Xfig (http://www.xfig.org)., Xfig UNIX. *xvi Xfig., eepic. eepic POSTSCRIPT. special flag L A TEX. L A TEX., small.fig. File/Export... Language LaTeX picture + eepic macros. small.eepic.. This is a picture drawn with Xfig: This is a picture drawn with Xfig:\\ \input{small.eepic}, eepic pdflatex. Combined PS/LaTeX (both parts) (export). small.pstex small.pstex t. small.tex. *xvi Xfig Windows, X Server cygwin UNIX. Xfig java jfig. (http://tech-www.informatik.uni-hamburg.de/ applets/jfig/) 20
4.15 ( Insert/Line) 4 ( INSERT) \documentclass{article} \usepackage{graphicx} \pagestyle{empty} \begin{document}. \end{document}.ps.eps 4.12. pstricks. http://www.tug.org/ applications/pstricks/. L A TEX POSTSCRIPT. epix (http://mathcs.holycross.edu/~ahwang/current/epix.html) L A TEX. 4.14 (Insert/Line) \rule. This is a page-wide rule:\\ \rule{\linewidth}{1pt} but this one is shorter and thicker:\\ \rule{2cm}{2mm} This is a page-wide rule: but this one is shorter and thicker: \dotfill... \dotfill \EUR~10...................................... 10 4.15 (Insert/Hyperlink) url URL,. hyperref dvipdfm pdflatex url URL.pdf!,. \usepackage[colorlinks,urlcolor=blue,filecolor=magenta]{hyperref} \usepackage{url}. CJKbookmarks, \special DVIPDFMx. 21
5.1 ( Insert/Comment) 5 ( FORMAT) \usepackage[dvipdfm,colorlinks,urlcolor=blue,filecolor=magenta,cjkbookmarks]{hyperref} \AtBeginDvi{\special{pdf:tounicode KSCms-UHC-UCS2}} \usepackage{url}. \hypertarget{ctan}{ctan} \url{http://www.ctan.org}, \href{http://www.ctan.org}{ctan://}. \href{run:midifile.mid}{midi }. \hyperlink{ctan}{ }. CTAN http://www.ctan.org, CTAN://. MIDI.. \hypertarget \hyperlink HTML. \href URL. run:.,. Acrobat Reader. UNIX Acrobat..mailcap /etc/mailcap. audio/midi;/usr/bin/timidity %s audio/*; xmms %s video/*; xine -pfhq %s hyperref. 4.16 (Insert/Comment) L A TEX %. comment comment. 5 (Format) \documentclass. (10, 11, 12 ), (a4paper, a5paper, b5paper, letterpaper, legalpaper, executivepaper) (portrait, landscape).. \documentclass[a5paper,landscape,12pt]{article} 5.2.2. 22
5.2 ( Format/Line Spacing) 5 ( FORMAT) 5.1 (Format/Line Spacing) setspace singlespace, onehalfspace, doublespace. \spacing{amount} amount. *xvii \begin{spacing}{2.5} These two lines \\ are crazily spaced! \end{spacing} \begin{spacing}{1} Much better, these lines\\ have a pretty space. \end{spacing} These two lines are crazily spaced! Much better, these lines have a pretty space. 5.2 (Format/Character) 3, 4. Text attribute Environment form Example \textnormal textnormal main document font \textrm rmfamily roman \textit itshape italics \emph n/a emphasis \textmd mdseries medium weight (default) \textbf bfseries boldface \textup upshape upright (default) \textsl slshape slanted \textsf sffamily sans serif \textsc scshape SMALL CAPS \texttt ttfamily typewriter \underline underline underline \textsuperscript n/a this is superscript \mathrm n/a x n + y n z n n 2 \mathbf n/a x n + y n z n n 2 \mathsf n/a x n + y n z n n 2 \mathtt n/a x n + y n z n n 2 \mathit n/a x n + y n z n n 2 \mathnormal n/a x n + y n z n n 2 \mathcal n/a \ + \ \ \ = 3: (emphasized).,., \emph *xvii setspace floats (footnote) 1.0. setspace, L A TEX \linespread.. \linespread{1.5} 23
5.2 ( Format/Character) 5 ( FORMAT). *xviii.. this is $_{\mbox{\footnotesize{subscript}}}$ this is subscript Font size Example tiny sample text scriptsize footnotesize small normalsize large Large LARGE huge Huge sample text sample text sample text sample text sample text sample text sample text sample text sample text 4: 5.2.1... ulem.. *xix \uline{important} \huline{ } \uuline{urgent} \huuline{ } \uwave{boat} \huwave{ } \sout{wrong} \hsout{ } \xout{removed} \hxout{ } important urgent boat wrong /////////////// removed //////// : ulem \emph. \emph.. \usepackage[normalem]{ulem} *xviii,, \emph,.. *xix myulem. ulem L A TEX. myulem http://faq.ktug.or.kr/mywiki/karnes. 24
5.2 ( Format/Character) 5 ( FORMAT) 5.2.2 (Format/Character Size) extsizes., 8 12, 14, 17, 20., 17. (preamble). \documentclass[17pt]{extarticle} type1cm.. \fontsize{72pt}{72pt}\selectfont No Smoking (... ) \fontsize, (baseline).. \resizebox{!}{1cm}{1-cm tall} 1-cm tall 5.2.3 (Format/Character Font) L A TEX METAFONT..,. Times, Helvetica, Sans Serif..., L A TEX POSTSCRIPT.. avant, avangar, bookman, chancery, charter, courier, helvet, helvetic, ncntrsbk, newcent, palatcm, palatino, pifont, times, utopia, zapfchan. \usepackage{times}. L A TEX Computer Modern. POSTSCRIPT. *xx. POSTSCRIPT (font family). 5. *xxi *xx times palatino POSTSCRIPT. PSNFSS., times mathptmx, txfonts, palatino mathpazo, pxfonts, utopia fourier. *xxi. L A TEX 5. \hfontfamily. 25
5.2 ( Format/Character) 5 ( FORMAT) cmr cmss cmtt pag pbk phv pnc ppl ptm pcr mj gt tz Computer Modern Roman Computer Modern Sans Serif Computer Modern Typewriter Avantgarde Bookman Helvetica New Century Schoolbook Palatino Times Courier LAT E X ( ) ( ) ( ) 5: Z. This is Computer Modern Roman, {\fontfamily{phv}\selectfont this is Helvetica!} This is Computer Modern Roman, this is Helvetica!, L A TEX POSTSCRIPT., Avantgarde Computer Modern Sans Serif,. *xxii \rmdefault (roman) \sfdefault (sans serif) \ttdefault (typewriter) \bfdefault (boldface) \mddefault (medium) \itdefault (italics) \sldefault (slanted) \scdefault (small caps) \updefault (upright) *xxii L A TEX \mjdefault, \gtdefault. 26
5.3 ( Format/Paragraph) 5 ( FORMAT) Sans Serif Avantgarde. % Avantgarde replaces sans serif \renewcommand{\sfdefault}{pag} 5.2.4 (Format/Character Colour) color. black, white, red, green, blue, cyan, magenta, yellow.. \textcolor{red}{this is red.}\\ \color{blue} This text is blue!\\ So is this. Let s change.\\ \definecolor{mygreen} {rgb}{0.1,1,0.1} \color{mygreen} This is my shade of green!\\ \color{black} \colorbox{cyan}{a cyan box}\\ \fcolorbox{blue}{green} {A green box in a blue frame} This is red. This text is blue! So is this. Let s change. This is my shade of green! A cyan box A green box in a blue frame, \pagecolor...? 5.3 (Format/Paragraph) L A TEX. \\. *xxiii (environments) L A TEX.,... \begin{environment}...text goes here... \end{environment} center. \begin{center} \end{center} *xxiii \\. \par. \\.,. 27
5.3 ( Format/Paragraph) 5 ( FORMAT) Environment array center description enumerate eqnarray equation figure flushleft flushright itemize letter list minipage picture quotation quote tabbing table tabular thebibliography theorem titlepage verbatim verse Purpose ( ),,, ( ), 6: L A TEX. 6.. 5.3.1 (Format/Paragraph Horizontal Alignment) (justified).,, flushleft, flushright, center. \raggedright, \raggedleft, \centering.. 5.3.2 (Format/Paragraph Vertical Alignment) L A TEX. Enter, L A TEX.,. \smallskip, \medskip, \bigskip. 28
5.3 ( Format/Paragraph) 5 ( FORMAT), \vskip{parameter}.. These paragraphs will be separated by 1.3 cm:\\ \vskip 1.3cm there is a 1.3 cm gap above me. These paragraphs will be separated by 1.3 cm: there is a 1.3 cm gap above me. \vskip., \vskip. 1.5 cm \vskip \null. \null \vskip 1.3 cm This text comes after 1.3 cm... This text comes after 1.3 cm..., \vfill.. {\ldots} \vfill {\ldots}........ 5.3.3 (Format/Paragraph Margins) (margins) 2.5,... *xxiv \newenvironment{margins}[2] { \begin{list}{} { \setlength{\leftmargin}{#1} \setlength{\rightmargin}{#2} } \item } {\end{list}}, margins. *xxiv chngpage. 29
5.4 ( Format/Paragraph Border and Shade) 5 ( FORMAT) As you can see, this paragraph has normal margins. \begin{margins}{0.5cm}{1cm} But please note that this paragraph has custom margins. \end{margins} As you can see, this paragraph has normal margins. But please note that this paragraph has custom margins. 5.3.4 (Format/Paragraph Indentation) \parindent. 1cm. \setlength{\parindent}{1cm} \indent, \noindent., \parskip. \setlength{\parskip}{3pt} 5.4 (Format/Paragraph Border and Shade) framed \parbox. calc. framed. \setlength{\framerule}{2pt} \setlength{\framesep}{5pt} \begin{framed}! \end{framed} \definecolor{shadecolor}{rgb} {0.9,0.8,1} \begin{shaded},? \end{shaded}!,? boxedminipage boxedminipage., \framebox{ \begin{minipage}[c]{\linewidth} \end{minipage} } 30
5.6 ( Format/Colour) 5 ( FORMAT) boxedminipage., \parbox. \noindent \fbox{ \parbox{\linewidth -2 \fboxsep -2 \fboxrule} {,!} },! \linewidth minipage (width). ( ).,. \framebox[\width]{ }... \framebox[2\width][r]{ } ( [r]). 5.5 (Format/Colour).. \colorbox{yellow}{ \begin{minipage} {0.8\linewidth} \end{minipage} } 5.2.4. 5.6 (Format/Columns) \twocolumn \onecolumn 1 2, 2 1.,. \documentclass. multicol. multicols. 2. 31
6 ( TABLE) \columnseprule=1pt \begin{multicols}{2}[\subsection{\entry{format}{columns}}] The commands \cmd{twocolumn}... \end{multicols} \columnsep. \columnseprule.. *xxv 6 (Table)... table ( 4.12 ). tabular.... \begin{table}[htbp] % placement: here, top, bottom, separate page % \begin{small} % sets the table font \begin{center} % optional % 4-column table; alignment is left, centered, right, fixed width \begin{tabular}{ l c rp{4cm} } \hline % horizontal line \textbf{left} & \textbf{centre} & \textbf{right} & \textbf{4 cm} \\ \hline row 1, col 1 & row 1, col 2 & row 1, col 3 & row 1, col 4 \\ \cline{1-2} % horizontal line spanning columns 1-2 row 2, col 1 & row 2, col 2 & row 2, col 3 & row 2, col 4 \\ \cline{1-2} \multicolumn{2}{ c }{spanning two columns} & row 3, col 3 & row 3, col 4 \\ \cline{1-3} row 4, col 1 & row 4, col 2 & row 4, col 3 & ~ \hfill right \\ % force a space with "\ " row 5, col 1 & row 5, col 2 & row 5, col 3 & left \hfill ~ \\ row 5, col 1 & row 5, col 2 & row 5, col 3 & ~ \hfill centre \hfill ~ \\ \hline \end{tabular} %\caption{a sample table.} \caption{ } % labels are used for cross references; % for example, "see Table~\ref{tab:sampletab}" \label{tab:sampletab} \end{center} *xxv. 2 ( ),,. multicols flushend, cuted, balance. 32
6 ( TABLE) % \end{small} \end{table} 7. Left Centre Right 4 cm row 1, col 1 row 1, col 2 row 1, col 3 row 1, col 4 row 2, col 1 row 2, col 2 row 2, col 3 row 2, col 4 spanning two columns row 3, col 3 row 3, col 4 row 4, col 1 row 4, col 2 row 4, col 3 right row 5, col 1 row 5, col 2 row 5, col 3 left row 5, col 1 row 5, col 2 row 5, col 3 centre 7:. rotating sidewaystable. rotating., tabularx. X.. \begin{sidewaystable} \begin{tabularx}{7.5cm}{ l X X } \hline \textbf{normal} & \textbf{tilted} & \textbf{wider} \\ \hline normal & \rotatebox{30}{i m tilted!} & I m wider \\ \hline \end{tabularx} \end{sidewaystable} normal tilted wider I m tilted! wider normal tabular., longtable, supertabular, xtab. colortbl. 33
6.1 6 ( TABLE) Colour by row:\\\vskip 2mm \begin{tabular}{ l c r } \hline \rowcolor{cyan} one & two & three\\ \rowcolor{green} one & two & three\\ \rowcolor{yellow} one & two & three\\ \hline \end{tabular} Colour by row: one two three one two three one two three Colour by column:\\\vskip 2mm \begin{tabular} { >{\columncolor{cyan}}l >{\color{red} \columncolor{green}}c >{\columncolor{yellow}}r } \hline one & two & three\\ one & two & three\\ one & two & three\\ \hline \end{tabular} Colour by column: one two three one two three one two three 6.1 (height)., 0 \rule. *xxvi \\. \begin{tabular}{lll} one & two & three\\ 0.3 centimeters & \textbf{after} & this line\\[0.3cm] one & two & three\\ one & two & three\\ \rule{0pt}{1.2cm}1.2 centimeters & \textbf{before} & this line\\ \end{tabular} one two three 0.3 centimeters after this line one two three one two three 1.2 centimeters before this line *xxvi 0 Strut. (tabular) \arraystretch. \renewcommand{\arraystretch}{1.6}. 34
6.3 slashbox 6 ( TABLE) 6.1.1 tabular. @,. &. \begin{tabular}{r@{.}l} 3&14159\\ 1&61803\\ 1&41421\\ 100&00000 \end{tabular} 3.14159 1.61803 1.41421 100.00000 dcolumn. dcolumn D. D, L A TEX (,. ),.,. 1,., \mbox. \begin{tabular}{ D{.}{,}{4.2} % D{.}{.}{5} D{.}{.}{-1} } \hline \mbox{one} & \mbox{two} & \mbox{three} \\ 10.33 & 10.33 & 10.33 \\ 1000 & 1000 & 1000 \\ 5.1 & 5.1 & 5.1 \\ 3.14 & 3.14159 & 3.14159 \\ \hline \end{tabular} One Two Three 10,33 10.33 10.33 1000 1000 1000 5,1 5.1 5.1 3,14 3.14159 3.14159 6.2 slashbox \backslashbox. \begin{tabular}{ l l l } \hline \backslashbox[2cm]{lesson}{date} & Monday & Tuesday \\ \hline Stratigraphy & room A & room A \\ Chemistry & room B & Lab $\alpha$ \\ Physics & room C & Lab $\beta$ \\ \hline \end{tabular} Date Lesson Monday Tuesday Stratigraphy room A room A Chemistry room B Lab α Physics room C Lab β 35
7.1 LAT E X 7 ( TOOLS) 6.3 L A TEX. ASCII,. ASCII.cvf. ;. L A TEX. UNIX. *xxvii.cvf. #!/bin/sh # dat2tex: converts tabular data to a tabular environment if [ $#!= 1 ]; then echo "Usage: $0 <datafile>" exit 1 fi # is this a cvs file? grep ";" $1 > /dev/null if [ $? = 0 ]; then AWK="awk -F;" else AWK=awk fi # ok awk, make my day $AWK {if (1 == FNR) { \ printf "\\begin\{tabular\}\{"; \ for (i = 1; i <= NF; i++) {printf "l"}; \ printf "\}\n" } for (i = 1; i < NF; i++) \ {printf $i" & "} printf $NF" \\\\ \n"} \ END {printf "\\end\{tabular\}\n"} $1 # end of dat2tex 7 (Tools) 7.1 (Tools/Mail Merges) L A TEX textmerg..,. *xxvii Excel Excel Tabular. http: //faq.ktug.or.kr/mywiki/excel2tabular. Math N Table. http://physics.khu. ac.kr/~reds/hpack_project/k-download.htm. 36
7.2 ( Tools/Labels) 7 ( TOOLS) \Name, \Surname, \Title (fields).. data.dat. \documentclass{article} \usepackage{textmerg} \begin{document} % let s declare the variable fields: % \Void is for empty lines \Fields{\Name\Surname\Title-\Void} \Merge{data.dat}{% Dear \Title{} \Surname,\\ may I call you \Name?\\ Yours,\\ \hspace{3cm}guido\clearpage} \end{document} \Void.,.. data.dat. Guido Gonzato Dr. Francesco Mulargia Prof. Carol John-Paul II Pope.. 7.2 (Tools/Labels),. 3 8 20, labels. 10 10. \documentclass[a4paper,12pt]{article} \usepackage{labels} \LabelCols=3 % n. of columns of labels \LabelRows=8 % n. of rows of labels 37
7.2 ( Tools/Labels) 7 ( TOOLS) \LeftBorder=8mm % borders of each label \RightBorder=8mm \TopBorder=5mm \BottomBorder=5mm \LabelGridtrue % show the grid \numberoflabels=10 % number of labels of each type to print % the text of the label is specified by % the \addresslabel[]{} macro: \begin{document} \addresslabel[\large] % optional arguments {\textbf{guido Gonzato}, Ph.D.\\ \textsl{linux system manager}} % now on to the boxed labels \boxedaddresslabel[\fboxsep=4mm\fboxrule=1mm] {\textbf{guido Gonzato}, Ph.D.\\ \textsl{linux system manager}} \end{document}. \documentclass[a4paper,12pt]{article} \usepackage{labels} \LabelCols=3 \LabelRows=8 \LeftBorder=3mm \RightBorder=3mm \TopBorder=8mm \BottomBorder=8mm \LabelGridtrue \begin{document} % use either this environment: \begin{labels} 1$^{st}$ name 1$^{st}$ address 1$^{st}$ city, state, zipcode 2$^{nd}$ name 2$^{nd}$ address 2$^{nd}$ city, state, zipcode 3$^{rd}$ name 3$^{rd}$ address 3$^{rd}$ city, state, zipcode \end{labels} % or an external file containing exactly the same text: % \labelfile{addresses.dat} \end{document} 38
7.3 ( Tools/Default Language) 7 ( TOOLS) textmerg labels. 7.3 (Tools/Default Language) L A TEX.. Chapter Index,, ç é. ( \c c \ e.) *xxviii L A TEX language.dat (tetex \$TEXMF/tex/generic/config/language. dat ).. babel. \usepackage[italian,english]{babel}, ASCII 3 ( ), isolatin1.,.. TEX.,,. jed é \ e. define latex_mode_hook () { set_abbrev_mode (1); if ( () = abbrev_table_p ("LaTeX") ) use_abbrev_table ("LaTeX"); #ifdef WIN32 % prevent clash with movement keys undefinekey ("àà", "LaTeX-Mode"); definekey (" \\ a", "àà", "LaTeX-Mode"); #else local_setkey (" \\ a", "à"); #endif local_setkey (" \\ e", "é"); local_setkey (" \\ e", "è"); local_setkey (" \\ \\i{}", "ì"); local_setkey (" \\ o", "ò"); local_setkey (" \\ u", "ù"); } *xxviii.,. 3 ASCII 32 ( ) 126 ( ). 39
8.0 ( Tools/Hyphenation) 8 ( HELP). 7.4 (Tools/Hyphenation) L A TEX.. \-.. \hyphenation{ge-o-phy-sics, ge-o-lo-gy, earth} L A TEX earth. \mbox. Do not hyphen \mbox{internationalisation}, please. 7.5 (Tools/Spell Check) L A TEX. *xxix ispell aspell. UNIX ispell. shell> ispell -t mydocument.tex -t ispell TEX L A TEX. -d. shell> ispell -d italiano -t mydocument.tex 8 (Help) L A TEX. CTAN. http://www.ctan.org/tex-archive/info/. info latex (UNIX ). http://www.giss.nasa.gov/latex/.. http://www.ctan.org/tex-archive/info/latexhelpbook/ L A TEX,. *xxix L A TEX. MS,... 40
9 news:comp.text.tex.. GNU/Linux tetex, TEX/L A TEX., TEXMF/doc... 9 c Guide Gonzato, 2001-2002. GNU.,.. 41
A (DOCUMENT TEMPLATES) A (Document Templates) article 2.1.. \documentclass[twoside,11pt]{book} \begin{document} \frontmatter \begin{titlepage} \title{the Book of Mine} \end{titlepage} \author{john B. Smith} \maketitle \tableofcontents \mainmatter \part{the Beginning} \chapter{introduction} \section{let s Start} The book starts here. \part{the End} \backmatter Thank you for reading this book. \end{document} 3: Book template. \documentclass[twoside,12pt]{report} % tables and figures at the end: \usepackage{endfloat} \begin{document} \title{final Report} \author{john B. Smith} \date{london, \today} \maketitle \begin{abstract} This is the final report. \end{abstract} \tableofcontents \listoftables \listoffigures \part{start} \chapter{begin} \section{introduction} The report starts here. \end{document} 4: Report template. 42
A (DOCUMENT TEMPLATES) \documentclass[12pt]{letter} \begin{document} \address{my address} \signature{guido} \begin{letter}{john s address} \opening{dear John,} Thank you for being my friend. \closing{hope to see you soon,} \ps{p.s. Say hello to granny!} \encl{my son s photographs!} \end{letter} \end{document} 5: Letter template. \documentclass[a4paper]{article} \usepackage{type1cm} \usepackage{times} \usepackage{color} \usepackage{rotating} \pagestyle{empty} \begin{document} \begin{sidewaysfigure} \fontsize{2.5cm}{2.5cm}\selectfont \centerline{\textcolor{blue}{\textbf{please:}}} \vskip 1cm \fontsize{4cm}{3cm}\selectfont \centerline{\textcolor{red}{do NOT}} \centerline{\textcolor{red}{smoke}} \centerline{\textcolor{red}{here!}} \vskip 1cm \fontsize{2cm}{2cm}\selectfont \centerline{\textcolor{magenta}{if you do,}} \centerline{\textcolor{magenta}{you ll be \emph{deboned!}}} \end{sidewaysfigure} \end{document} 6: How to write a notice. 43
A (DOCUMENT TEMPLATES) \documentclass{article} \usepackage[absolute,showboxes]{textpos} \usepackage{color} \usepackage{framed} \usepackage{graphicx} \setlength{\tphorizmodule}{10mm} % standard unit of length \setlength{\tpvertmodule}{\tphorizmodule} \setlength{\tpboxrulesize}{1pt} % box line width % start everything near the top-left corner \textblockorigin{0mm}{0mm} \begin{document} \setlength{\parindent}{0pt} \definecolor{shadecolor}{rgb}{0.9,1,1} \begin{textblock}{5}(0,0) % this block is 5 modules wide; height is % automatically determined \begin{center} \begin{minipage}[c]{0.8 \linewidth} \begin{shaded} This block is placed with its top left corner at the origin on the page, which has been set to (0mm,0mm). The internal margin and the shading are provided by the \texttt{minipage} and \texttt{shaded} environments. \end{shaded} \end{minipage} \end{center} \end{textblock} \begin{textblock}{6}(10,1) \includegraphics[width=6cm,angle=-90]{gnuplot.ps} This picture is at (10,1). Note that rotating it by -90 makes it overflow the margin. \end{textblock} \begin{textblock}{5}[0.5,0.5](2.5,8) This block is at position (2.5,8), but because the optional argument [0.5,0.5] has been given, it is the centre of the block which is located at that point, rather than the top-left corner. \end{textblock} \begin{textblock}{3,4}(6,4) The dimensions of this block are 3$\times$4 cm. Its origin is position (6,4) on the page. Note that the text overflows the margin in some cases; you ll want to use the \texttt{minipage} environment to prevent that. \end{textblock} \end{document} 7: How to write a poster. 44