Your SlideShare is downloading. ×
LaTeX for begyndere
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

LaTeX for begyndere

1,038
views

Published on

LaTeX introduction. …

LaTeX introduction.

March 3, 1999


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,038
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Hello world! Først skrives filen, eksempel.tex i en editor: documentclass{article} begin{document} Hello world! end{document}
  • 2. Dernæst udføres LTEX-kommandoen på filen: A hadrian:~% latex eksempel.tex This is TeX, Version 3.14159 (Web2C 7.2) (eksempel.tex LaTeX2e <1997/12/01> patch level 2 Babel <v3.6h> and hyphenation patterns for english, french, german, danish, dumylang, nohyphenation, loaded. (/home/origo3/TeX/texmf/tex/latex/base/article.cls Document Class: article 1997/10/10 v1.3x Standard LaTeX document class (/home/origo3/TeX/texmf/tex/latex/base/size10.clo)) No file eksempel.aux. [1] (eksempel.aux) ) Output written on eksempel.dvi (1 page, 232 bytes). Transcript written on eksempel.log. hadrian:~%
  • 3. Udvidet eksempel, eks2.tex: documentclass[a4paper,12pt]{article} begin{document} Many years ago, there was an Emperor, who was so excessively fond of new clothes, that he spent all his money in dress. He did not trouble himself in the least about his soldiers; nor did he care to go either to the theatre or the chase, except for the opportunities then afforded him for displaying his new clothes. He had a different suit for each hour of the day; and as of any other king or emperor, one is accustomed to say, ‘‘he is sitting in council,’’ it was always said of him, ‘‘The Emperor is sitting in his wardrobe.’’ Time passed merrily in the large town which was his capital; strangers arrived every day at the court. One day, two rogues, calling themselves weavers, made their appearance. They gave out that they knew how to weave stuffs of the most beautiful colors and elaborate patterns, the clothes manufactured from which should have the wonderful property of remaining invisible to everyone who was unfit for the office he held, or who was extraordinarily simple in character. ‘‘These must, indeed, be splendid clothes!’’ thought the Emperor. ‘‘Had I such a suit, I might at once find out what men in my realms are unfit for their office, and also be able to distinguish the wise from the foolish! This stuff must be woven for me immediately.’’ And he caused large sums of money to be given to both the weavers in order that they might begin their work directly. end{document}
  • 4. Titler, forfatter, afsnit, m.m. . . . (eks3.tex): documentclass[a4paper,12pt]{article} title{The Emperor’s New Clothes} author{Hans Christian Andersen} begin{document} maketitle section{Fo{}rste afsnit} Many years ago, there was an Emperor, who was so excessively fond of new clothes, that he spent all his money in dress. He did not trouble himself in the least about his soldiers; nor did he care to go either to the theatre or the chase, except for the opportunities then afforded him for displaying his new clothes. He had a different suit for each hour of the day; and as of any other king or emperor, one is accustomed to say, ‘‘he is sitting in council,’’ it was always said of him, ‘‘The Emperor is sitting in his wardrobe.’’ subsection{Fo{}rste underafsnit} Time passed merrily in the large town which was his capital; strangers arrived every day at the court. One day, two rogues, calling themselves weavers, made their appearance. They gave out that they knew how to weave stuffs of the most beautiful colors and elaborate patterns, the clothes manufactured from which should have the wonderful property of remaining invisible to everyone who was unfit for the office he held, or who was extraordinarily simple in character. subsection{Andet underafsnit} ‘‘These must, indeed, be splendid clothes!’’ thought the Emperor. ‘‘Had I such a suit, I might at once find out what men in my realms are unfit for their office, and also be able to distinguish the wise from the foolish! This stuff must be woven for me immediately.’’ And he caused large sums of money to be given to both the weavers in order that they might begin their work directly. end{document}
  • 5. Documentclasses: ¯ article ¯ report ¯ book ¯ letter ¯ slides Almindelige class-options: ¯ 10pt, 11pt og 12pt ¯ a4paper, a5paper, letter, . . . ¯ twocolumn og onecolumn ¯ twoside og oneside
  • 6. Dokumentstruktur Titel, forfatter og dato: ¯ title, author, date og maketitle Afsnit: ¯ part ¯ chapter (ikke i article-class’en) ¯ section, subsection og subsubsection ¯ paragraph og subparagraph
  • 7. Lister Itemize Noget tekst fo{}r en liste begin{itemize} item Her er et punkt med meget indhold. Det meste er nonsens. item Et andet punkt end{itemize} Noget tekst før en liste ¯ Her er et punkt med meget indhold. Det meste er nonsens. ¯ Et andet punkt
  • 8. Enumerate Noget tekst fo{}r en liste begin{enumerate} item Her er et punkt med meget indhold. Det meste er nonsens. item Et andet punkt end{enumerate} Noget tekst før en liste 1. Her er et punkt med meget indhold. Det meste er nonsens. 2. Et andet punkt
  • 9. Description Noget tekst fo{}r en liste begin{description} item[Hest] Her er et punkt med meget indhold. Det meste er nonsens. item[Ko] Et andet punkt end{description} Noget tekst før en liste Hest Her er et punkt med meget indhold. Det meste er nonsens. Ko Et andet punkt
  • 10. Specielle tegn og kommandoer Danske tegn og accenter LTEX-kode A Resultat LTEX-kode A Resultat ae æ AE Æ o ø O Ø aa å AA Å ’e é t{oo} oo Specielle kommandoer LTEX-kode A Resultat TeX TEX LaTeX LTEX A today 9. marts 1999
  • 11. Særlige tegn De følgende tegn har en særlig betydning i LTEX, A da de bruges i forbindelse med kommandoer o.lign. # $ % & ~ _ ^ { } det kan naturligvis lade sig gøre at skrive dem alligevel. Ligaturer, bindestreger og lign. LTEX-kode A Resultat og ikke fi fi fi ffi ffi ffi fl fl fl ffl ffl ffl - - - -- – -- --- — ---
  • 12. De magiske ting documentclass[a4paper,12pt,danish]{article} usepackage{babel} usepackage[T1]{fontenc} usepackage[latin1]{inputenc} Herefter kan du ¯ skrive æ, ø og å direkte i LTEX-koden (så er det A nemmere at lave stavekontrol på teksten). ¯ ord med specielle tegn bliver delt. ¯ der foretages danske orddelinger ¯ et utal af andre ting tilpasses danske forhold (fx today, 9. marts 1999 vs. March 9, 1999).
  • 13. Andre anvendelige ting Fodnoter Fodnotera laves med footnote{Som denne}. Krydsreferencer Krydsreferencer laves ved at lave en label{LigeHer} og der refereres til denne med ref{LigeHer} for afsnitsnummeret eller pageref{LigeHer} for sidenummeret. Indholdsfortegnelser Indholdsfortegnelse genereres automatisk med kommandoen tableofcontents. LTEX skal A køres to (sommetider tre) gange for at få referencerne korrekte. a Som denne
  • 14. Indhold Hello world! 1 Dokumentstruktur 6 Lister 7 Itemize . . . . . . . . . . . . . . . . . . . 7 Enumerate . . . . . . . . . . . . . . . . . 8 Description . . . . . . . . . . . . . . . . 9 Specielle tegn og kommandoer 10 Danske tegn og accenter . . . . . . . . . 10 Specielle kommandoer . . . . . . . . . . 10 Særlige tegn . . . . . . . . . . . . . . . . 10 Ligaturer, bindestreger og lign. . . . . . . 11 De magiske ting 12 Andre anvendelige ting 13
  • 15. Fodnoter . . . . . . . . . . . . . . . . . . 13 Krydsreferencer . . . . . . . . . . . . . . 13 Indholdsfortegnelser . . . . . . . . . . . 13 Tabeller . . . . . . . . . . . . . . . . . . 16 Alskens pakker . . . . . . . . . . . . . . 17 Matematik 18 Mere information 19
  • 16. Tabeller begin{tabular}{|lcr|} hline Hovdyr & klovdyr & rovdyr hline hline Heste & Køer & Ulven Løb Ibrahim & Mælkekvote & Ulven kommer hline end{tabular} Hovdyr klovdyr rovdyr Heste Køer Ulven Løb Ibrahim Mælkekvote Ulven kommer
  • 17. Alskens pakker Der findes et utal af pakker der implementerer det du har brug for. Vi har allerede set Babel. Pakker inkluderes i preamblet i dit dokument med usepackage[options]{pakkenavn} Et eksempel er billeder: usepackage[dvips]{graphicx} og i dokumentteksten: includegraphics[height=3cm]{lamport.eps}
  • 18. Matematik Matematik i løbende tekst skrives mellem $-tegn, hvorimod „displayed paragraphs“ skrives mellem [ og ]. I math mode betyder mellemrum slet ikke noget, så både $abc$ og $ a b c $ giver . Der er utroligt mange LTEX-makroer til rådighed, A for eksempel cos, sum, infty, iff, frac, sqrt, omega og vec, og _ og ^ antager nye betydninger. Resultatet er, at man kan skrive ting som ½ Ö Ó× ¼ ¾ ´µ ¼ ½ så let som [ sum_{1}^{infty} cos vec{omega}’ = 42 iff sqrt{frac{pi}{e}} = 0 ]
  • 19. Mere information ¯ Tobias Oetiker et. al.: The Not So Short Introduction To LTEX 2 A (CTAN:info/lshort/english/). ¯ Leslie Lamport: LTEX: A Documentation A Preparation System (ISBN: 0201529831). ¯ CTAN – Comprehensive TEX Archive Network (Mirror http://sunsite.auc.dk/pub/tex/ctan). ¯ DK-TUG hjemmeside og mailliste (http://sunsite.auc.dk/dk-tug/).