L A TEX version 1.0.0 Guido Gonzato, Ph.D. <gonzato@sci.univr.it> Università di Verona (Italy) Dipartimento Scientifico e Tecnologico 2002 9 29 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...................................... 4 2 (File) 4 2.1 File/New.......................................... 4 2.2 File/Save As....................................... 5 2.3 File/Save As Template............................. 6 2.4 File/Import.................................. 6 2.5 File/Page Setup.................................. 6 2.5.1 Page Setup/Headers and Footers /................... 7 2.6 File/Printer Setup................................... 7 i
2.7 File/Print Preview.................................... 8 2.8 File/Print............................................ 8 2.9 File/Versions....................................... 8 3 (Edit) 9 3.1 Edit/Autotext....................................... 9 4 (Insert) 10 4.1 Insert/Breaks,............................... 10 4.2 Insert/Enumerated List................................. 10 4.3 Insert/Special Character................................ 11 4.3.1 (EURO).................................... 13 4.4 Insert/Formula......................................... 14 4.5 Insert/Footnote........................................ 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.13 Insert/Shapes...................................... 19 4.14 Insert/Line........................................ 20 4.15 Insert/Hyperlink................................. 21 4.16 Insert/Comment..................................... 21 5 (Format) 21 5.1 Format/Line Spacing................................... 21 5.2 Format/Character.................................... 21 5.2.1 Format/Character Size............................. 22 5.2.2 Format/Character Font........................... 23 5.2.3 Format/Character Colour............................. 25 5.3 Format/Paragraph.................................... 25 5.3.1 Format/Paragraph Horizontal Alignment.............. 26 5.3.2 Format/Paragraph Vertical Alignment................ 26 5.3.3 Format/Paragraph Margins.......................... 28 5.3.4 Format/Paragraph Indentation...................... 28 ii
5.4 Format/Paragraph Border and Shade.................. 29 5.5 Format/Colour......................................... 30 5.6 Format/Columns..................................... 30 6 (Table) 31 7 (Tools) 33 7.1 Tools/Default Language................................. 33 7.2 Tools/Hyphenation.................................. 33 7.3 Tools/Spell Check.................................. 34 8 (Help) 34 9 34 A (Document Templates) 35 1 Edit......................... 9 2........................................ 12 3 marvosym................................... 13 4............................................... 22 5............................................. 23 6............................................... 24 7............................................ 24 8 L A TEX........................................... 27 9 table............................................... 32 1.............................. 17 2 Gnuplot............................................. 18 3 Book template............................................ 35 4 Report template........................................... 35 5 Letter template............................................ 36 6 How to write a notice........................................ 36 7 How to write a poster........................................ 37 iii
1, L A TEX. L A TEX.,. a, b, c.,,,,.. 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.. L A TEX. L A TEX 1 128k, Z80. WordStar CP/M 720K! 1
1.1 1, http://www.ctan.org/starter.html The (Not So) Short Introduction to L A TEX 2ε *a A Gentle Introduction to TEX., *b 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 (typesetting).? :. L A TEX. L A TEX (source), 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).. Jed, (http://space.mit.edu/ davis/jed/), Word- Star/Borland Emacs. LyX (http://www.lyx.org) WYSIWYG. *c *a http://www.doeun.pe.kr/frames/lshort.html. *b / MS. / MS. *c LyX CJK-LyX., CJK-LyX Windows. 2
1.1 1,. GNU TEXMACS (http://www.texmacs.org). UNIX. WinEdt (http://www.winedt.com) Windows L A TEX. shareware. L A TEX. 1.1.1 L A TEX.,, (cut, copy and paste), (search and replace) :, (blocks:moving, filtering, etc) (spell checking) (word counting) (macros). GNU Emacs vi 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. 3
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.! *d 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} *d MiKTEX. MiKTEX 2.1 [MiKTEX Options] [Packages] [Formats] [L A TEX] [L A TEX Packages]. 4
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 5
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 *e. 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,... *e [ ]., { }. 6
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{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. 7
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 pdflatex Acrobat.pdf..pdf..pdf., hyperref pdflatex,.pdf. *f 4.15. pdflatex, 4.12.! 2.8 File/Print previewer lpr file.ps. *g.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. *f,. *g,. 8
4 (EDIT) 3 (Edit) L A TEX. 1 ( ). Edit/Cut, Edit/Copy, Edit/Paste, Edit/Find, Edit/Replace. Action Emacs vi jed start selection Ctrl-@ or n/a Ctrl-KB Ctrl-SPACE end selection n/a n/a Ctrl-KK cut Ctrl-W nd Ctrl-KY copy Alt-W ny Ctrl-KH paste Ctrl-Y P Ctrl-KC find Ctrl-S / Ctrl-QF replace Ctrl-% s/old/new/gc Ctrl-QA 1: Edit. 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}.. 9
4 (INSERT) 4 (Insert) 4.1 Insert/Breaks,,. L A TEX.. ( ) \linebreak \newline, \\.., \par. *h, \newpage \clearpage. \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. *h \\,. *r. 2 \labelitemi, \labelitemii, \labelitemiii, \labelitemiv. 10
4.3 Insert/Special Character 4 (INSERT) \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, [TODO: enumerate.] 4.3 Insert/Special Character, L A TEX., \,,. 2., pifont \ding., \ding{100}., \dingfill, \dingline \dinglist. \fill, \line, \list / Dingbat. 11
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 \texttrademark a \textordfeminine o \textordmasculine 2:. 12
4.4 Insert/Special Character 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. \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 4.3.1 (EURO) marvosym,. \EUR. 3. *i marvosym. Y (\Yingyang). [TODO: add the Dingbat table.] *i marvosym. 13
4.5 Insert/Formula 4 (INSERT) 4.4 Insert/Formula L A TEX. $. I like math: $xˆn + xˆn \neq \quad zˆn \forall n \neq 2$ is my favourite theorem. I like math:x n + x n z n n 2 is my favourite theorem. displaymath equation. equation. *j : \begin{equation} xˆn + xˆn \neq zˆn \quad \forall n \neq 2 \label{eq:fermat} \end{equation} \ref{eq:fermat}? : x n + x n z n n 2 (1) 1? 4.5 Insert/Footnote \footnote{footnote text}. \footnote. *k \renewcommand{\thefootnote}{**} \footnote {.}%. **. **.. \renewcommand{\thefootnote} {\Roman{footnote}} \footnote{ }, \footnote{ }. I, II. I II *j TEX L A TEX.. L A TEX ( ). *k <=> endnotes. 14
4.7 Insert/Indices 4 (INSERT). This\footnote{the first.} \newcounter{myfootnote} This 1 and this 2 are footnotes:please read note 1 \setcounter{myfootnote} again. {\value{footnote}} 1 the first. and that\footnote{the second.} are footnotes: please 2 the second. read note \footnotemark [\value{myfootnote}] again. 4.6 Insert/Indices,, L A TEX. \section \chapter. L A TEX. \tableofcontents \listoffigures \listoftables *l 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. *l. 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.. % 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.,, \label \pageref.. 16
4.12 Insert/Margin Notes 4 (INSERT) \paragraph{example.} \label{par:example} \pageref{par:example} \ref{par:example}. Example. 4.9. 17 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. \begin{figure}[htbp] % [htbp] % : here, top, % bottom, or separate page. \begin{center} \texttt{=8-)} \end{center} \caption{ } \label{fig:mysmiley} \end{figure} =8-) 1:! 17
4.12 Insert/Figure 4 (INSERT).. 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) Z \begin{figure} \begin{center} \fbox{\includegraphics [width=0.5\textwidth, angle=-90]{gnuplot}} \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. *m.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...pdf.ps,.! % define the variable \ifpdf \newif\ifpdf \ifx\pdfoutput\undefined \pdffalse *m..dvi..dvi.jpg.gif.,.eps.dvi. 18
4.13 Insert/Shapes 4 (INSERT) \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: mention wrapfig] 18 Too many unprocessed floats! L A TEX. 3, \clearpage (figure). 4.13 Insert/Shapes picture \circle, \oval., picture. epic eepic ( ), Xfig (http://www.xfig.org)., Xfig UNIX. *n Xfig., eepic. eepic POSTSCRIPT. special flag L A TEX. L A TEX. 3 *n Xfig Windows, X Server cygwin UNIX. Xfig java jfig. (http://tech-www.informatik.uni-hamburg. de/applets/jfig/) 19
4.15 Insert/Line 4 (INSERT), 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. 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 20
5.2 Insert/Hyperlink 5 (FORMAT) 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. 5.1 Format/Line Spacing TEX \baselinestretch{amount}., \baselinestretch 7 mm doublespace setspace (.) singlespace, onehalfspace, doublespace. 5.2 Format/Character 4. 21
5.2 Format/Character 5 (FORMAT) 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 \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:. (emphasized).,., \emph. *o 5. 5.2.1 Format/Character Size extsizes., 8 12, 14, 17, 20., 17. (preamble). \documentclass[17pt]{extarticle} type1cm.. *o, \emph,.. 22
5.2 Format/Character 5 (FORMAT) Font size tiny scriptsize footnotesize small normalsize large Large LARGE huge Huge Example sample text sample text sample text sample text sample text sample text sample text sample text sample text sample text 5: \fontsize{72pt}{72pt}\selectfont No Smoking \fontsize, (baseline).. \resizebox{!}{1cm}{1-cm tall} 5.2.2 Format/Character Font 1-cm tall L A TEX Metafont..,. Times, Helvetica, Sans Serif..., L A TEX POSTSCRIPT. : *p 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. *q.! *p txfonts pxfonts. *q. 7. 23
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:. This is Computer Modern Roman, {\fontfamily{phv}\selectfont This is Computer this Modern Roman, this is Helvetica! is Helvetica!}, L A TEX POSTSCRIPT., Avantgarde Computer Modern Sans Serif,. \rmdefault (roman) \sfdefault (sans serif) \ttdefault (typewriter) \bfdefault (boldface) \mddefault (medium) \itdefault (italics) \sldefault (slanted) \scdefault (small caps) 24
5.3 Format/Paragraph 5 (FORMAT) \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. \\. *r (environments) L A TEX.,... *r \\. \par. \\.,. 25
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. 26
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 Math arrays Centered lines Labelled lists Numbered lists Sequence of aligned equations Displayed equation Floating figures Flushed left lines Flushed right lines Bulleted lists Letters Generic list environment Miniature page Picture with text, arrows, lines and circles Indented environment with paragraph indentation Indented environment with no paragraph indentation Align text arbitrarily Floating tables Align text in columns Bibliography or reference list Theorems, lemmas, etc For hand crafted title pages Simulating typed input For poetry and other things 8: L A TEX. 27
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,... *s \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. 1 cm. *s chngpage. 28
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} {,!} },! 29
5.6 Format/Colour 5 (FORMAT) \linewidth minipage (width). ( ).,. \framebox[\width]{ }... \framebox[2\width][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} 30
6 (TABLE) \columnsep. \columnseprule.. *t 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{ table.} % labels are used for cross references; % for example, "see Table \ref{tab:sampletab}" \label{tab:sampletab} \end{center} % \end{small} \end{table} 9. 4.12,. *t. 2 ( ),,. multicols flushend, cuted. 31
6 (TABLE) 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: provide a few examples.] 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 [TODO: floatflt.] 32
7 (TOOLS) 7 (Tools) 7.1 Tools/Default Language L A TEX.. Chapter Index,, ç é. ( \c c \ e.) *u babel. \usepackage[italian]{babel}, ASCII 4 ( ), isolatin1.,.. TEX.,,. jed é \ e. *v. 7.2 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}. *u.,. 4 ASCII 32 ( ) 126 ( ). *v jed. 33
9.0 Tools/Spell Check 9 7.3 Tools/Spell Check L A TEX. *w. 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,. news:comp.text.tex. GNU/Linux tetex, TEX/L A TEX., TEXMF/doc... 9 c Guide Gonzato, 2001. GNU.,.. *w L A TEX. / MS,... 34
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} \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. 35
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. 36
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{minimape} environment to prevent that. \end{textblock} \end{document} 7:How to write a poster. 37