Pro Yearly is on sale from $80 to $50! »

TeX and LaTeX

TeX and LaTeX

TEX: typesetting system
LATEX: document preparation system

026b37dcab26247d630fa1ef58fa5dbc?s=128

Adriano J. Holanda

April 28, 2010
Tweet

Transcript

  1. TEX: typesetting system L A TEX: document preparation system Adriano

    de Jesus Holanda Departamento de F´ ısica e Matem´ atica FFCLRP-USP 2010-04-28
  2. TEX L ATEX Further Details Outline 1 TEX Introduction Basics

    Running TEX Hoω αbout Mαth? 2 L A TEX Introduction Basics Common Structure BIBTEX 3 Further Details
  3. TEX L ATEX Further Details Introduction TEX – τ χ

    (greek: “art/craft”) Typesetting system Prof. Donald Erwin Knuth Emeritus Professor of “The Art of Computer Programming” (TAOCP) Stanford University, USA Main contributor to the Analysis of Algorithms field using asymptotic notation Motivation Unsatisfaction with printed version of TAOCP2 2nd ed., due to declined quality of the typesetting using new software and digital printer technology.
  4. TEX L ATEX Further Details Introduction TEXfamily Language → TEX

    (Pascal); Font engine → METAFONT; Font family → Computer Modern; Output format → Device independent format (DVI) [Fuchs, 1979].
  5. TEX L ATEX Further Details Introduction Processing steps TeX TeX

    [Knuth, 1978]
  6. TEX L ATEX Further Details Introduction Processing steps TeX TeX

    [Knuth, 1978] DVI [Fuchs, 1979] tex
  7. TEX L ATEX Further Details Introduction Processing steps X converter

    TeX TeX [Knuth, 1978] DVI [Fuchs, 1979] tex
  8. TEX L ATEX Further Details Introduction Processing steps X converter

    Y converter TeX TeX [Knuth, 1978] DVI [Fuchs, 1979] tex
  9. TEX L ATEX Further Details Introduction Processing steps TeX TeX

    [Knuth, 1978] DVI [Fuchs, 1979] tex PostScript [Adobe, 1982]
  10. TEX L ATEX Further Details Introduction Processing steps TeX TeX

    [Knuth, 1978] DVI [Fuchs, 1979] tex PostScript [Adobe, 1982] dvips
  11. TEX L ATEX Further Details Introduction Processing steps TeX TeX

    [Knuth, 1978] DVI [Fuchs, 1979] tex PostScript [Adobe, 1982] dvips
  12. TEX L ATEX Further Details Introduction Processing steps TeX TeX

    [Knuth, 1978] DVI [Fuchs, 1979] tex PostScript [Adobe, 1982] dvips
  13. TEX L ATEX Further Details Introduction Typographic concepts Unit of

    measure: PostScript point ≡ 1 72 in ∼ = 0.3528mm; 4in 300pt 10cm
  14. TEX L ATEX Further Details Introduction Typographic concepts Glyph: pictorial

    representation of typographical token;
  15. TEX L ATEX Further Details Introduction Typographic concepts Kerning: Shifting

    between pair of consecutive glyphs. +
  16. TEX L ATEX Further Details Introduction Typographic concepts Kerning: Shifting

    between pair of consecutive glyphs. -
  17. TEX L ATEX Further Details Basics Boxes height Reference point

    depth Baseline width
  18. TEX L ATEX Further Details Basics Boxes height Reference point

    depth Baseline width
  19. TEX L ATEX Further Details Basics Boxes Examples 10 pt

    characters
  20. TEX L ATEX Further Details Basics Boxes Examples 10 pt

    characters
  21. TEX L ATEX Further Details Basics Boxes Examples 10 pt

    characters
  22. TEX L ATEX Further Details Basics Glue Stretchability example width

    5 width 6 width 3 width 8 space 9 stretch 3 shrink 1 width 52 space 9 stretch 6 shrink 2 width 52 space 12 stretch 0 shrink 0 width 52
  23. TEX L ATEX Further Details Basics Glue Stretchability example width

    5 width 6 width 3 width 8 space 9 stretch 3 shrink 1 width 52 space 9 stretch 6 shrink 2 width 52 space 12 stretch 0 shrink 0 width 52 “TEX! Please, make the horizontal list into a box that is 58 units wide” width 58
  24. TEX L ATEX Further Details Basics Glue Stretchability example 9

    + (+6/9)x3 = 9 + 2 9 + (+6/9)x6 = 9 + 4 12 + (+6/9)x0 = 12 + 0 width 58
  25. TEX L ATEX Further Details Basics Glue Shrinkability example width

    5 width 6 width 3 width 8 space 9 stretch 3 shrink 1 width 52 space 9 stretch 6 shrink 2 width 52 space 12 stretch 0 shrink 0 width 52
  26. TEX L ATEX Further Details Basics Glue Shrinkability example width

    5 width 6 width 3 width 8 space 9 stretch 3 shrink 1 width 52 space 9 stretch 6 shrink 2 width 52 space 12 stretch 0 shrink 0 width 52 “TEX! Please, make the horizontal list into a box that is 51 units wide” width 51
  27. TEX L ATEX Further Details Basics Glue Shrinkability example 9

    + (−1/3)x1 = 9 − 0.33 9 + (−1/3)x2 = 9 − 0.66 12 + (−1/3)x0 = 12 − 0 width 51
  28. TEX L ATEX Further Details Basics Vertical boxes

  29. TEX L ATEX Further Details Basics Vertical boxes \baselineskip= glue

    \lineskip= glue \lineskiplimit= dimen
  30. TEX L ATEX Further Details Basics Vertical boxes \baselineskip=12pt plus

    2pt \lineskip=3pt minus 1pt \lineskiplimit=2pt 5pt 3pt
  31. TEX L ATEX Further Details Basics Vertical boxes \baselineskip=12pt plus

    2pt \lineskip=3pt minus 1pt \lineskiplimit=2pt 5pt 3pt 4pt
  32. TEX L ATEX Further Details Basics Vertical boxes \baselineskip=12pt plus

    2pt \lineskip=3pt minus 1pt \lineskiplimit=2pt 5pt 4pt 3pt
  33. TEX L ATEX Further Details Basics Vertical boxes \baselineskip=12pt plus

    2pt \lineskip=3pt minus 1pt \lineskiplimit=2pt 5pt 3pt 4pt + 2pt = 6pt
  34. TEX L ATEX Further Details Basics Vertical boxes 8pt 1pt

    \baselineskip=12pt plus 2pt \lineskip=3pt minus 1pt \lineskiplimit=2pt 3pt
  35. TEX L ATEX Further Details Basics Vertical boxes 8pt \baselineskip=12pt

    plus 2pt \lineskip=3pt minus 1pt \lineskiplimit=2pt 3pt - 1pt = 2pt 3pt
  36. TEX L ATEX Further Details Running TEX Running TEX(1) Setting

    horizontal size $ tex $ **\relax $ *\input story $ *\hsize=3in \input story $ *\hsize=2.5in \input story $ *\hsize=2in \input story $ *\end $ xdvi texput.dvi
  37. TEX L ATEX Further Details Running TEX Running TEX(2) Setting

    tolerance $ tex $ **\relax $ *\input story $ *\hsize=2in \tolerance=1600 \input story $ *\hsize=1.5in \input story $ *\tolerance=10000 \input story $ *\hsize=.75in \input story $ *\end $ xdvi texput.dvi
  38. TEX L ATEX Further Details Hoω αbout Mαth? $Mαth symbols$

    greek letters Input Output $\alpha$ α $\gamma$ γ $\Gamma$ Γ $\Psi$ Ψ $\Omega$ Ω
  39. TEX L ATEX Further Details Hoω αbout Mαth? $Mαth symbols$

    greek letters Input Output $\alpha$ α $\gamma$ γ $\Gamma$ Γ $\Psi$ Ψ $\Omega$ Ω operators Input Output $\sum$ $\prod$ $\int$ $\cap$ ∩ $\vee or \lor$ ∨
  40. TEX L ATEX Further Details Hoω αbout Mαth? $Mαth formulαs$

    Input Output $xˆ2$ x2 $x 2$ x2 $2ˆx$ 2x $xˆ2yˆ2$ x2y2 $x ˆ2y ˆ2$ x2y2 $x 2y 2$ x2y2 $ 2F 3$ 2F3 Input Output $xˆ{2y}$ x2y $2ˆ{2ˆx}$ 22x $2ˆ{2ˆ{2ˆx}}$ 222x $y {x 2}$ yx2 $y {xˆ2}$ yx2
  41. TEX L ATEX Further Details Hoω αbout Mαth? + $$

    Mαth $$ $$ \sqrt{1+ \sqrt{1+\sqrt{1+\sqrt{1+\sqrt{1+x}}}}} \eqno(1) $$ 1 + 1 + 1 + 1 + √ 1 + x (1)
  42. TEX L ATEX Further Details Hoω αbout Mαth? + +

    $$ Mαth $$ a0 + 1 a1 + 1 a2 + 1 a3 + 1 a4 (2)
  43. TEX L ATEX Further Details Introduction L A TEX– Document

    preparation system The father Leslie Lamport Mathematician and Programmer Microsoft Research Motivation Unsatisfaction with TEX80 macros writen by Max Diaz when he was writing a book
  44. TEX L ATEX Further Details Basics L A TEX Macro

    Example Macro \documentclass[a4paper, 12pt]{article}
  45. TEX L ATEX Further Details Basics L A TEX Macro

    Example Macro \documentclass[a4paper, 12pt]{article} Expansion: <load file> /usr/share/texmf-texlive/tex/latex/base/article.cls
  46. TEX L ATEX Further Details Basics L A TEX Macro

    Example Macro \documentclass[a4paper, 12pt]{article} Expansion: <set document size to A4 paper> \DeclareOption{a4paper} {\setlength\paperheight {297mm}% \setlength\paperwidth {210mm}}
  47. TEX L ATEX Further Details Basics L A TEX Macro

    Example Macro \documentclass[a4paper, 12pt]{article} Expansion: <set glyph to 12 point> \DeclareOption{12pt}{\renewcommand\@ptsize{2}}
  48. TEX L ATEX Further Details Common Structure L A TEXdocument:

    basic structure \documentclass[a4paper, 12pt]{article} % preamble \usepackage[parameter]{package} \begin{document} \section{First section name} text text text \subsection{Second section name} text text text \subsubsection{Third section name} text text text \end{document}
  49. TEX L ATEX Further Details Common Structure L A TEXdocument:

    basic structure \documentclass[a4paper, 12pt]{article} % preamble \usepackage[parameter]{package} \begin{document} \section{First section name} text text text \subsection{Second section name} text text text \subsubsection{Third section name} text text text \end{document}
  50. TEX L ATEX Further Details Common Structure L A TEXdocument:

    basic structure \documentclass[a4paper, 12pt]{article} % preamble \usepackage[parameter]{package} \begin{document} \section{First section name} text text text \subsection{Second section name} text text text \subsubsection{Third section name} text text text \end{document}
  51. TEX L ATEX Further Details Common Structure L A TEXdocument:

    basic structure \documentclass[a4paper, 12pt]{article} % preamble \usepackage[parameter]{package} \begin{document} \section{First section name} text text text \subsection{Second section name} text text text \subsubsection{Third section name} text text text \end{document}
  52. TEX L ATEX Further Details Common Structure L A TEXdocument:

    basic structure \documentclass[a4paper, 12pt]{article} % preamble \usepackage[parameter]{package} \begin{document} \section{First section name} text text text \subsection{Second section name} text text text \subsubsection{Third section name} text text text \end{document}
  53. TEX L ATEX Further Details Common Structure L A TEXdocument:

    basic structure \documentclass[a4paper, 12pt]{article} % preamble \usepackage[parameter]{package} \begin{document} \section{First section name} text text text \subsection{Second section name} text text text \subsubsection{Third section name} text text text \end{document}
  54. TEX L ATEX Further Details BIBTEX Bibliographic database filename.bib @BOOK{latexbook,

    AUTHOR = ”Leslie Lamport”, TITLE = ”LaTeX: A Document Preparation System”, PUBLISHER = ”Addison-Wesley”, YEAR = 1986 }
  55. TEX L ATEX Further Details BIBTEX Bibliographic database filename.bib @BOOK{latexbook,

    AUTHOR = ”Leslie Lamport”, TITLE = ”LaTeX: A Document Preparation System”, PUBLISHER = ”Addison-Wesley”, YEAR = 1986 } filename.tex Producing Greek letters is as easy as$\pi$˜\cite{latexbook}.
  56. TEX L ATEX Further Details BIBTEX Bibliographic database filename.bib @BOOK{latexbook,

    AUTHOR = ”Leslie Lamport”, TITLE = ”LaTeX: A Document Preparation System”, PUBLISHER = ”Addison-Wesley”, YEAR = 1986 } filename.tex Producing Greek letters is as easy as$\pi$˜\cite{latexbook}. $ echo ‘‘run bibtex and latex 2 times’’ $ bibitex filename
  57. TEX L ATEX Further Details BIBTEX Bibliographic database filename.bib @BOOK{latexbook,

    AUTHOR = ”Leslie Lamport”, TITLE = ”LaTeX: A Document Preparation System”, PUBLISHER = ”Addison-Wesley”, YEAR = 1986 } filename.tex Producing Greek letters is as easy as$\pi$˜\cite{latexbook}. $ echo ‘‘run bibtex and latex 2 times’’ $ bibitex filename $ latex filename $ latex filename
  58. TEX L ATEX Further Details BIBTEX Bibliographic database @BOOK{latexbook, AUTHOR

    = ”Leslie Lamport”, TITLE = ”LaTeX: A Document Preparation System”, PUBLISHER = ”Addison-Wesley”, YEAR = 1986 } manuscript Producing Greek letters is as easy as π [1]. References [1] Leslie Lamport. LaTeX: A Document Preparation System. Addison-Wesley, 1986.
  59. TEX L ATEX Further Details BIBTEX “Three L A TEXmistakes

    that people should stop making?” 1 Worrying too much about formatting and not enough about content;
  60. TEX L ATEX Further Details BIBTEX “Three L A TEXmistakes

    that people should stop making?” 1 Worrying too much about formatting and not enough about content; 2 Worrying too much about formatting and not enough about content;
  61. TEX L ATEX Further Details BIBTEX “Three L A TEXmistakes

    that people should stop making?” 1 “ Worrying too much about formatting and not enough about content; 2 Worrying too much about formatting and not enough about content; 3 Worrying too much about formatting and not enough about content.” (Leslie Lamport)
  62. TEX L ATEX Further Details TEX’s children COnTEXt;

  63. TEX L ATEX Further Details TEX’s children COnTEXt; pdfTEX, pdfL

    A TEX;
  64. TEX L ATEX Further Details TEX’s children COnTEXt; pdfTEX, pdfL

    A TEX; Ω;
  65. TEX L ATEX Further Details TEX’s children COnTEXt; pdfTEX, pdfL

    A TEX; Ω; XETEX;
  66. TEX L ATEX Further Details TEX’s children COnTEXt; pdfTEX, pdfL

    A TEX; Ω; XETEX; LuaTEX.
  67. TEX L ATEX Further Details References Donald Erwin Knuth The

    TEXbook. Addison-Wesley, 20th printing, 1991. Yannis Haralambous Fonts & encodings O’Reilly Media, 1st edition, 2007. Leslie Lamport LaTeX: A Document Preparation System Addison-Wesley, 2nd edition, 1994.
  68. TEX L ATEX Further Details Very useful URLs • http://www.ctan.org

    – Comprehensive TeX Archive Network ( CTAN); • http://www-cs-faculty.stanford.edu/~knuth/ – Donald Knuth homepage; • http://www.lamport.org – Leslie Lamport homepage.
  69. TEX L ATEX Further Details Where to find me? http://adrianoholanda.org