JSUG - LaTeX Introduction by Christoph Pickl
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

JSUG - LaTeX Introduction by Christoph Pickl

on

  • 1,226 views

visit www.jsug.at for more stuff

visit www.jsug.at for more stuff

Statistics

Views

Total Views
1,226
Views on SlideShare
1,225
Embed Views
1

Actions

Likes
0
Downloads
24
Comments
0

1 Embed 1

http://www.slashdocs.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

JSUG - LaTeX Introduction by Christoph Pickl Presentation Transcript

  • 1. Introduction to LaTeX Christoph Pickl Monday, February 23, 2009 1
  • 2. Who knows (La-)TeX? Monday, February 23, 2009 2
  • 3. Who has ever written a document with it? Monday, February 23, 2009 3
  • 4. Who has ever written a package? Monday, February 23, 2009 4
  • 5. Agenda 1. Basics – First steps with LaTeX • Creating a LaTeX-Document with commands and environments 2. Intermediate – Becoming a TeXpert • Structuring text, font styles, images, tables 3. Advanced – Becoming a real Guru • Math, references, custom commands and environments Monday, February 23, 2009 5
  • 6. Basics First steps with LaTeX Monday, February 23, 2009 6
  • 7. standard dokumentenklassen sind nicht so gut (USA spezifisch, unflexibel) Ingredients KOMA-skript bietet abhilfe! Oder besser: memoir klasse • Documentclass • book, article, ... • Packages • Commands foobar[optarg]{reqarg} • Environments begin{foo} ... end{foo} Monday, February 23, 2009 7
  • 8. All you need is ... documentclass[myoptions]{mydocumentclass} usepackage[latin1]{inputenc} usepackage[ngerman]{babel} usepackage{mypackage} % layout definitions % etc ... begin{document} % actual content of the document end{document} Monday, February 23, 2009 8
  • 9. Document Content • Linefeeds will seperate paragraphs from each other: My first paragraph. ↵ Sentence two will be on same line. ↵ ↵ My second paragraph. ↵ % enforce linebreak, or use newline command ↵ My third paragraph. Monday, February 23, 2009 9
  • 10. Titlepage • First of all define some metadata ... title{{LaTeX} Introduction} author{Christoph Pickl} date{today} • ... then invoke proper command: begin{document} maketitle newpage % ... end{document} Monday, February 23, 2009 10
  • 11. Intermediate Becoming a TeXpert Monday, February 23, 2009 11
  • 12. Ingredients • Structuring Text • Font Styles • Lists • Images • Tables Monday, February 23, 2009 12
  • 13. Structuring Text documentclass[a4paper]{scrartcl} usepackage[latin1]{inputenc} usepackage[ngerman]{babel} title{{LaTeX} Introduction} author{Christoph Pickl} date{today} begin{document} % maketitle % newpage input{} erzeugt keinen seitenumbruch include{01_mychapter} end{document} Monday, February 23, 2009 13
  • 14. Structuring Text ctd. • Make use of section, subsection, subsubsection, paragraph, ... section{Introduction} subsection{All you need is ldots} subsection{Titlepage} section{Intermediate} subsection{Structuring Text} subsubsection{Table of Contents} • Automatically print contents with tableofcontents Monday, February 23, 2009 14
  • 15. Font Styles Command Output Foobar textbf{Foobar} Foobar textit{Foobar} Foobar texttt{Foobar} x tiny{x}, scriptsize{x} x xx small{x}, large{x}, xx Large{x}, LARGE{x} xx huge{x}, Huge{x} Monday, February 23, 2009 15
  • 16. Lists • Define an unordered list (using a default circle as bullet icon): begin{itemize} item My first item end{itemize} • Define an ordered list (using default arabic digits with a trailing dot): begin{enumerate} item My first item item My second item end{enumerate} Monday, February 23, 2009 16
  • 17. Images • First have to include a required package: usepackage{graphicx} • Then put the image via includegraphics in a figure environment: begin{figure}[!h] % enforce position here (top, page, bottom) centering includegraphics{Christoph_Pickl_himself.png} caption{Picture of Christoph Pickl} label{IMG:christoph_pickl} end{figure} Monday, February 23, 2009 17
  • 18. Tables • Tables are actually only tabulators with borders: begin{table}[htpb] begin{center} begin{tabular}{l|c|c} % alignment via: left, center, right & textbf{Heading 1} textbf{Heading 2} hline hline & Row 1 & Cell 1/1 & Cell 2/1 hline Row 2 & Cell 1/2 & Cell 2/2 end{tabular} end{center} caption{This is my first table} label{TBL:first_table} end{table} Monday, February 23, 2009 18
  • 19. Advanced Becoming a real Guru Monday, February 23, 2009 19
  • 20. Ingredients • Math Formulas • Citations • References • Own Commands & Environments Monday, February 23, 2009 20
  • 21. Mathematical Formulas • Put all of your math stuff in dollar signs: The variable $x$ contains the value of $y$. • Typeset some more complicate formulas: neg (A rightarrow B ) hspace{0.4cm}Rightarrow hspace{0.4cm} neg ( neg A vee B ) hspace{0.4cm} Rightarrow hspace{0.4cm} neg neg A wedge neg B hspace{0.4cm}Rightarrow hspace{0.4cm} A wedge neg B Monday, February 23, 2009 21
  • 22. Citations • First have to define bibliography database: begin{thebibliography}{99} bibitem[PiPr09]{BIB:pickl_preining_book} Christoph Pickl and Norbert Preining: textit{Some non-existing book}. O'Reilly Inc., {bf 2009} end{thebibliography} • Anywhere in the text reference the book via the cite command: As mentioned in~cite{BIB:pickl_preining_book}. • For a more sophisticating approach have a look at bibtex Monday, February 23, 2009 22
  • 23. References • Put labels on images, tables, sections, ... begin{figure} includegraphics{Christoph_Pickl_himself.png} caption{Picture of Christoph Pickl} label{IMG:christoph_pickl} end{figure} • Then reference the section itself or the page it occurs: As you can see in Figure~ref{IMG:christoph_pickl} on page~ pageref{IMG:christoph_pickl}. Label auch auf section draufgeben Monday, February 23, 2009 23
  • 24. Custom Commands & Environments • For example, create a shortcut to include graphics: newcommand{mycmd}[1]{ begin{figure}centeringincludegraphics{#1}end{figure} } mycmd{Christoph_Pickl_himself.png} • Or a shortcut to produce a centered math environment: newenvironment{myenv}[1] { textbf{#1} says: begin{center}begin{math} } { end{math}end{center} } begin{myenv} x Rightarrow y end{myenv} http://en.wikibooks.org/wiki/LaTeX/Customizing_LaTeX Monday, February 23, 2009 24
  • 25. Summary • Commands and environments form the basic concepts • More functionality is provided via packages • All common elements are supported out-of-the-box: • Lists, tables, images, automatic indices, references, footnotes, ... • Have to know many commands, but very powerful underneath Monday, February 23, 2009 25
  • 26. Links • http://tobi.oetiker.ch/lshort/lshort.pdf • http://web.student.tuwien.ac.at/~e0525580/rsrc/Christoph_Pickl- Latex_Schnelleinstieg.pdf • http://www.dante.de/faq/de-tex-faq/html/de-tex-faq.html • http://www.haptonstahl.org/latex/index.php • http://www.artofproblemsolving.com/LaTeX/AoPS_L_GuideLay.php Monday, February 23, 2009 26