L A TEX version 1.0.2 Guido Gonzato, Ph.D. <gonzato@sci.univr.it> TEX (KTUG) Università di Verona (Italy) Facoltà di Scienze MM. FF. NN. 2002 2 4 2002 10 19 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 L A TEX...................................... 5 2 (File) 5 2.1 (File/New).......................................... 5 2.2 (File/Save As... )................................... 6 2.3 (File/Save As Template)............................. 7 2.4 (File/Import).................................. 7 Ca Vignal II, Strada Le Grazie 15, 37134 Verona (Italy) i
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 2.8 (File/Print)............................................ 9 2.9 (File/Versions)...................................... 9 3 (Edit) 10 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).................................... 14 4.4 (Insert/Formula)........................................ 14 4.5 (Insert/Footnote)........................................ 15 4.6 (Insert/Indices)...................................... 16 4.7 (Insert/Vertical and Horizontal Space)..................... 16 4.8 (Insert/Tabs)............................................ 17 4.9 (Insert/Cross Reference)................................ 17 4.10 (Insert/Margin Notes).................................... 18 4.11 / (Insert/Frame)..................................... 18 4.12 (Insert/Figure)....................................... 18 4.13 (Insert/Shapes)...................................... 20 4.14 (Insert/Line)........................................ 22 4.15 (Insert/Hyperlink)................................. 22 4.16 (Insert/Comment)...................................... 22 5 (Format) 22 5.1 (Format/Line Spacing)................................... 23 5.2 (Format/Character).................................... 23 5.2.1 (Format/Character Size)............................ 24 5.2.2 (Format/Character Font)........................... 25 5.2.3 (Format/Character Colour)............................ 27 5.3 (Format/Paragraph).................................... 27 ii
5.3.1 (Format/Paragraph Horizontal Alignment).............. 28 5.3.2 (Format/Paragraph Vertical Alignment)............... 28 5.3.3 (Format/Paragraph Margins).......................... 30 5.3.4 (Format/Paragraph Indentation)..................... 30 5.4 (Format/Paragraph Border and Shade).................. 31 5.5 (Format/Colour)........................................ 32 5.6 (Format/Columns).................................... 32 6 (Table) 33 6.0.1......................................... 35 7 (Tools) 35 7.1 (Tools/Mail Merges)................................ 35 7.2 (Tools/Labels).................................... 36 7.3 (Tools/Default Language)................................ 37 7.4 (Tools/Hyphenation).................................. 38 7.5 (Tools/Spell Check).................................. 38 8 (Help) 39 9 39 A (Document Templates) 40 1 Emacs, Vim, Jed(IDE mode)......................... 4 2........................................ 13 3 marvosym................................... 14 4............................................... 23 5 Font sizes.............................................. 24 6............................................... 26 7 L A TEX....................................... 26 8 L A TEX........................................... 29 9 Table............................................... 34 iii
1................................. 19 2 Gnuplot............................................ 19 3 Book template............................................ 40 4 Report template........................................... 41 5 Letter template............................................ 41 6 How to write a notice........................................ 42 7 How to write a poster........................................ 43 iv
1, L A TEX. L A TEX.,..,,,,.. L A TEX(HLaTeX). PDF. Pxfonts,. 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. 1 128k, Z80. WordStar CP/M 720K! 1
1.1 1. 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., *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.. L A TEX CTAN:/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); vi Vim (http://www.vim.org).. *i http://www.ctan.org/starter.html, URL. *ii http://www.doeun.pe.kr/frames/lshort.html. *iii / MS. / MS. 2
1.1 1 Jed, (http://space.mit.edu/ davis/jed/), Word- Star/Borland Emacs. LyX (http://www.lyx.org) WYSIWYG. *iv,. GNU TEXMACS (http://www.texmacs.org) L A TEX. UNIX. 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 jed. 1.1.2 tetex GNU/Linux. MiKTEX. 1. CTAN. gzip tar archive. 2. L A TEX. $TEXMF/tex/latex. 3.. 4..sty,.sty. latex newstyle.ins. latex newstyle.dtx. *iv LyX CJK-LyX., CJK-LyX Windows. 3
1.1 1 Action Emacs Vim Jed (command mode) n/a ESC n/a (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-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 L A TEX 2 (FILE) 5. texhash, tetex. $TEXMF. GNU/Linux /usr/ share/texmf. MiKTEX, C:\localtexmf\tex \latex\newpackage., MiKTeX Options Refresh now., initexmf -u.! *v 1.2 L A TEX. 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} *v MiKTEX. MiKTEX 2.1 [MiKTEX Options] [Packages] [Formats] [L A TEX] [L A TEX Packages]. 5
2.3 (File/Save As... ) 2 (FILE) L A TEX.., (title),., (cite). \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{ } \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://tex/support/latex2html latex2rtf: CTAN://tex/support/latex2rtf 6
2.5 (File/Save As Template) 2 (FILE) 2.3 (File/Save As Template) L A TEX (templates), L A TEX.. 2.4 (File/Import) L A TEX. rtf2latex: CTAN://tex/support/rtf2latex html2latex: CTAN://tex/support/html2latex wvware MS Word L A TEX. http://www. wvware.com. *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,... *vi [ ]., { }. 7
2.6 (File/Printer Setup) 2 (FILE) \geometry{paperwidth=25cm} \geometry{paperheigth=35cm} % or: \geometry{papersize={25cm,35cm}} \geometry{width=20cm} % total width \geometry{heigth=30cm} % total heigth % or: \geometry{total={20cm,30cm}} \geometry{textwidth=18cm} % width - marginpar \geometry{textheigth=25cm} % heigth - header - footer % or: \geometry{body={18cm,25cm}} \geometry{left=3cm} % left margin \geometry{rigth=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. 8
3.0 (File/Print Preview) 3 (FILE) lpr -# 10. lpr -r.. 2.7 (File/Print Preview) L A TEX,..dvi (latex file.tex) xdvi yap..dvi dvips POSTSCRIPT, Ghostview. dvipdfm *vii pdflatex Acrobat.pdf..pdf..pdf., hyperref pdflatex,.pdf. *viii 4.15. pdflatex, 4.12.! 2.8 (File/Print) previewer lpr file.ps. *ix.pdf,,. 2.9 (File/Versions) L A TEX. UNIX Win32 RCS (Revision Control System) CVS (Concurrent Version Control System). CVS RCS http://www.linuxdoc.org/howto/cvs-rcs-howto.html. [TODO : version.] *vii PDF dvipdfm dvipdfm-cjk. Hirata Shunsaku. http://project.ktug.or.kr/dvipdfm-cjk/. *viii,. *ix,. 9
4 (INSERT) 3 (Edit) L A TEX. 1, Edit/Cut, Edit/Copy, Edit/Paste, Edit/Find, Edit/Replace.. L A TEX (environment).,. 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., L A TEX. \def\ps {\textsc{postscript}}, \PS \textsc{postscript}.. 4 (Insert) 4.1, (Insert/Breaks). ( ) \linebreak \newline, \\.., \par. *x, \newpage \clearpage. *x \\,. *xxiii. 10
4.2 (Insert/Enumerated List) 4 (INSERT) \linebreak. \newline..\linebreak.\newline,...,. \clearpage \newpage ( ). 4.12. 4.2 (Insert/Enumerated List) ( [ ] ) itemize enumerate. \item. \begin{itemize} \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, : 2 \labelitemi, \labelitemii, \labelitemiii, \labelitemiv. 11
4.3 (Insert/Special Character) 4 (INSERT) \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, [TODO: enumerate.] 4.3 (Insert/Special Character), L A TEX., \,,. 2., pifont \ding., \ding{100}., \dingfill, \dingline \dinglist. \fill, \line, \list / Dingbat. \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 12
4.3 (Insert/Special Character) 4 (INSERT) Character Character Sequence $ \$ 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 a o \texttrademark \textordfeminine \textordmasculine 2:. 13
4.4 (Insert/Formula) 4 (INSERT) j \Radioactivity B \Letter E \Lightning H \Mobilefone K \Coffeecup o \Football q \Cutright u \FAX v \Faxmachine Œ \Heart \Smiley \Bicycle y \Ladiesroom a \Laserbeam é \Capricorn ý \Bat þ \Womanface 3: marvosym. 4.3.1 (EURO) marvosym,. \EUR. 3. *xi marvosym. Y (\Yingyang). [TODO: Dingbat.] 4.4 (Insert/Formula) L A TEX. $. I like math: $xˆn + xˆn \neq zˆn \quad \forall n \neq 2$ is my favourite theorem. I like math: x n + x n z n n 2 is my favourite theorem. *xi marvosym. 14
4.5 (Insert/Footnote) 4 (INSERT) displaymath equation. equation. *xii : \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) 4.5 (Insert/Footnote) \footnote[n]{footnote text}. ( ) [n]. \footnote. *xiii \renewcommand{\thefootnote}{foot} \footnote {.}%. foot. foot.,. \renewcommand{\thefootnote} {\Roman{footnote}} \footnote{ }, \footnote{ }. \renewcommand{\thefootnote} {\fnsymbol{footnote}}.\footnote[8]{!} I, II.. I II! \fnsymbol{footnote}, 1 9.... *xii TEX L A TEX.. L A TEX ( ). *xiii <=> endnotes. 15
4.7 (Insert/Indices) 4 (INSERT) \footnotemark. This\footnote{the first.} \newcounter{\myfootnote} \setcounter{\myfootnote} {\value{footnote}} and that\footnote{the second.} are footnotes: please read note \footnotemark [\value{\myfootnote}] again. This 1 and this 2 are footnotes: please read note 1 again. 1 the first. 2 the second. 4.6 (Insert/Indices),, L A TEX. \section \chapter. L A TEX. \tableofcontents \listoffigures \listoftables *xiv 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,. *xiv. 16
4.9 (Insert/Tabs) 4 (INSERT).. \null \vfill \hfill. 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.. % let s set the tab positions \hskip 1cm \= \hskip 2cm \= \hskip 3cm \= \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 \\ 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. 17
4.12 (Insert/Margin Notes) 4 (INSERT),, \label \pageref.. \paragraph{example.} \label{par:example} \pageref{par:example} \ref{par:example}. Example.. 18 4.9 prefix.. \begin{enumerate} \item{first step: skip to \ref{item:end} \label{item:start}} \item{another step (unreferenced)} \item{end: go back to \ref{item:start} \label{item:end}} \end{enumerate} 1. first step: skip to 3 2. another step (unreferenced) 3. end: go back to 1 4.10 (Insert/Margin Notes). \marginpar{text}. 4.11 / (Insert/Frame).. textpos. 7. ( A.) 4.12 (Insert/Figure) (L A TEX epslatex.ps Using Imported Graphics in L A TEX 2ε.) (figure), figure. 1.!.. L A TEX L A TEX.,, \ref{fig:label}. 18
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:. (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} Z \begin{center} \fbox{\includegraphics [width=0.5\textwidth, angle=-90]{gnuplot.ps}} \caption{gnuplot.} \label{fig:gnuplot} \end{center} \end{figure} 1 0.8 0.6 0.4 0.2 0-0.2-0.4-4 -3-2 -1 X 0 1 2 3-1 0 1-2 -3 4-4 2 3 Y 4 2: Gnuplot..eps. *xv.jpg,.gif,.png.eps. ImageMagick. (http:// www.imagemagick.org) (free).,.jpg.eps jpeg2ps. (http: //www.pdflib.com/jpeg2ps/index.html) PDFL A TEX.pdf. epstopdf! *xv..dvi..dvi.jpg.gif.,.eps.dvi. 19
4.13 (Insert/Shapes) 4 (INSERT)...pdf.ps,. *xvi % 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 [TODO: wrapfig.] 18 Too many unprocessed floats! L A TEX. 3, \clearpage (figure). 4.13 (Insert/Shapes) picture \circle, \oval., picture. epic eepic ( ), Xfig *xvi dvipdfm-cjk. graphicx EPS dvipdfm-cjk, graphicx [dvipdfm] EPS PDF. KTUG TIP. http://www.doeun.pe.kr/uselatex/ref-files/gfaq/ 3 20
4.14 (Insert/Shapes) 4 (INSERT) (http://www.xfig.org)., Xfig UNIX. *xvii 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. \documentclass{article} \usepackage{graphicx} \pagestyle{empty} \begin{document}. \end{document}.ps.eps 4.12. [TODO: pstrick.] *xvii Xfig Windows, X Server cygwin UNIX. Xfig java jfig. (http://tech-www.informatik.uni-hamburg. de/applets/jfig/) 21
5.1 (Insert/Line) 5 (FORMAT) 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]{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.1. 22
5.2 (Format/Line Spacing) 5 (FORMAT) 5.1 (Format/Line Spacing) TEX \baselinestretch{amount}. *xviii, \baselinestretch 7 mm doublespace setspace (.) singlespace, onehalfspace, doublespace. 5.2 (Format/Character) 4, 5. 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 + x n z n n 2 \mathbf n/a x n + x n z n n 2 \mathsf n/a x n + x n z n n 2 \mathtt n/a x n + x n z n n 2 \mathit n/a x n + x n z n n 2 \mathnormal n/a x n + x n z n n 2 \mathcal n/a \ + \ \ \ 4:. *xviii L A TEX \linespread.. \linespread{1.5} 23
5.2 (Format/Character) 5 (FORMAT) (emphasized).,., \emph. *xix.. this is $_{\mbox{\footnotesize{subscript}}}$ Font size tiny scriptsize footnotesize small normalsize large Large LARGE huge Huge this is subscript Example sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text 5: Font sizes 5.2.1 (Format/Character Size) extsizes., 8 12, 14, 17, 20., 17. (preamble). \documentclass[17pt]{extarticle} type1cm.. \fontsize{72pt}{72pt}\selectfont No Smoking *xix,, \emph,.. 24
5.2 (Format/Character) 5 (FORMAT) \fontsize, (baseline).. \resizebox{!}{1cm}{1-cm tall} 1-cm tall 5.2.2 (Format/Character Font) L A TEX Metafont..,. Times, Helvetica, Sans Serif..., L A TEX POSTSCRIPT. : *xx avant, avangar, bookman, chancery, charter, courier, helvet, helvetic, ncntrsbk, newcent, palatcm, palatino, pifont, times, utopia, zapfchan. \usepackage{times}.. L A TEX POSTSCRIPT!. POSTSCRIPT (font family). 6. *xxi.! 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) *xx txfonts pxfonts. *xxi. L A TEX 7. \hfontfamily. *xxii L A TEX \mjdefault, \gtdefault. 25
5.2 (Format/Character) 5 (FORMAT) Family cmr cmss cmtt pag pbk phv pnc ppl ptm pcr Name Computer Modern Roman Computer Modern Sans Serif Computer Modern Typewriter Avantgarde Bookman Helvetica New Century Schoolbook Palatino Times Courier 6:. mj gt gs tz ( ) ( ) ( ) ( ) 7: L A TEX. 26
5.3 (Format/Paragraph) 5 (FORMAT) \scdefault (small caps) \updefault (upright) Sans Serif Avantgarde. % Avantgarde replaces sans serif \renewcommand{\sfdefault}{pag} 5.2.3 (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.,... *xxiii \\. \par. \\.,. 27
5.3 (Format/Paragraph) 5 (FORMAT) \begin{environment}...text goes here... \end{environment} center.. \begin{center} \end{center} 8.. 5.3.1 (Format/Paragraph Horizontal Alignment) (justified).,, flushleft, flushright, center. \raggedleft, \raggedright, \centering.. 5.3.2 (Format/Paragraph Vertical Alignment) L A TEX. Enter, L A TEX.,. \smallskip, \medskip, \bigskip., \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. 28
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 ( ),,, ( ), 8: L A TEX. 29
5.3 (Format/Paragraph) 5 (FORMAT) \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. 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. *xxiv chngpage. 30
5.4 (Format/Paragraph Border and Shade) 5 (FORMAT) \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., \framebox{ \begin{minipage}[c]{\linewidth} \end{minipage} } boxedminipage., \parbox. \noindent \fbox{ \parbox{\linewidth -2 \fboxsep -2 \fboxrule} {,!} },! 31
5.6 (Format/Colour) 5 (FORMAT) \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.3. 5.6 (Format/Columns) \twocolumn \onecolumn. \documentclass. multicols.. 2. \columnseprule=1pt \begin{multicols}{2}[\subsection{\entry{format}{columns}}] The commands \cmd{twocolumn}... \end{multicols} 32
6 (TABLE) \columnsep. \columnseprule.. *xxv 6 (Table).... \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 r p{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{ Table.} % labels are used for cross references; % for example, "see Table \ref{tab:sampletab}" \label{tab:sampletab} \end{center} % \end{small} \end{table} *xxv. 2 ( ),,. multicols flushend, cuted. 33
6 (TABLE) 9. 4.12,. 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 9: Table.,. rotating sidewaystable., longtable. [TODO:.] colortbl. 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 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 row: one two three one two three one two three Colour by column: one two three one two three one two three 34
7 (TOOLS) 6.0.1. 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 [TODO: \newcolumntype, \multicolumn{1}{c}{stuff}, floatflt.] 7 (Tools) 7.1 (Tools/Mail Merges) L A TEX textmerg..,. \Name, \Surname, \Title (fields).. \documentclass{article} \usepackage{textmerg} \begin{document} % let s declare the variable fields: 35
7.2 (Tools/Labels) 7 (TOOLS) % \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 \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 36
7.3 (Tools/Default Language) 7 (TOOLS) {\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} textmerg labels. 7.3 (Tools/Default Language) L A TEX.. Chapter Index,, ç é. ( 37
7.5 (Tools/Hyphenation) 7 (TOOLS) \c c \ e.) *xxvi babel. \usepackage[italian]{babel}, ASCII 4 ( ), isolatin1.,.. TEX.,,. jed é \ e. *xxvii. 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}. 7.5 (Tools/Spell Check) L A TEX. *xxviii. UNIX ispell. *xxvi.,. 4 ASCII 32 ( ) 126 ( ). *xxvii jed. *xxviii L A TEX. / MS,... 38
9 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,. news:comp.text.tex. GNU/Linux tetex, TEX/L A TEX., TEXMF/doc... 9 c Guide Gonzato, 2001-2002. GNU.,.. 39
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. 40
A (DOCUMENT TEMPLATES) \documentclass[twoside,12pt]{report} % tables and figures at the end: \usepackage{endfloat} \begin{document} \frontmatter \title{final Report} \author{john B. Smith} \date{london, \today} \maketitle \begin{abstract} This is the final report. \end{abstract} \tableofcontents \listoftables \listoffigures \mainmatter \part{start} \section{introduction} The report starts here. \end{document} 4: Report template. \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. 41
A (DOCUMENT TEMPLATES) \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. 42
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; heigth 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 she 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,7) 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} 43 7: How to write a poster.