1 / 19

Introduction to

Introduction to. Jeroen Buijs. Contents. Today What is LaTeX ? What do we need? Our first example : The Nature LaTeX template Writing articles in Latex Basic commands References Figures Tables Math, Chemistry and Life Sciences Next Presentations in LaTeX Posters in LaTeX

Download Presentation

Introduction to

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introductionto Jeroen Buijs

  2. Contents • Today • What is LaTeX? What do we need? • Our first example: The Nature LaTeX template • Writingarticles in Latex • Basic commands • References • Figures • Tables • Math, Chemistry and Life Sciences • Next • Presentations in LaTeX • Posters in LaTeX • Installation of stand-aloneversion

  3. What is (La)TeX? • TeX is essentially a Markup Language (like HTML, XML and RTF) • TeX written in 70´s • TEX is a typesetting language written by Donald Knuth. • Plain TEX easy for simple documents (without equations, chapters etc). • Otherwise very tricky. • LaTeX is an extension of TeX • Macro packages to make TeX easier to use

  4. Latex vs. Word Processors • WYSIWYG - WYMIWYG • High typeset quality • Easy to include formulas& references • Source file format is not bounded to a particular OS or platform • Implementations exist for all platforms (DOS, Windows, Unix,..) • Free • Steeplearning curve • Requirescompilation

  5. How to make a document • Writer only makes source • Software creates document source compiler document

  6. How to make a document source compiler document • SeveralgoodLaTeX editors exist, e.g. • TeXniccenter, www.texniccenter.org (Windows only) • TeXstudio, http://texstudio.sourceforge.net/ (“all major OS”) • TeXmaker, http://www.xm1math.net/texmaker/ (Linux, MacOSx, Windows)

  7. How to make a document source compiler document • The set of programs that makes it possible to compile TeX and LaTeXdocuments is called a TEX distribution. • There are many (La)TeX distributions available for different operating systems. The most commonly used ones are • Windows • proTeXt, http://www.tug.org/protext/ • (includesMikTeX & TeXstudio)) • MixTeX, http://www.miktex.org • Mac: MacTeX, https://tug.org/mactex/ • Unix/GNU/Linux: TeX Live, http://www.tug.org/texlive/

  8. How to make a document source compiler document TeXdistributionscomewithdifferent programs toobtain different output formats. We willusepdflatextocreate pdf documents

  9. How to make a document source compiler document • Stand-aloneversion • Online editors & compilers: • WriteLaTeX, ShareLaTeX: https://www.sharelatex.com • Graphical interface combining WISYWIG with WYSIWYM: http://www.lyx.org • Exercise1: • Createan account on ShareLaTeX • Create a new articleintendedforNature • In the Menu, make sureto select pdflatexand a spell checker • Compileandreflect on the relation source – finaldocument • Where do youspell check your document?

  10. The main file: XXX.tex • The main file contains a preambleand a document environment • The preamble • defines the class (and overall style) of your document bydefining the document class • tells the compiler which packages includingall kinds of extra (style) definitionsyouwilluse • containsyourowndefinitionsandcommands • The document environment • Starts with\begin{document}, endswith\end{document} • Contains the contents of your document • There are other files involved as well. In this case: • A file defining the bibliographystyle (XXX.bst) • A file containing the content of the references (XXX.bib)

  11. The main file: XXX.tex • Exercise 2: • Change the title. • Change totwoauthorsandaddnames. • Compileand download the PDF. Tolearn more on packages andcommands, let’sbuildourownarticlefrom scratch using the standard article class Excellent referenceforall “basic stuff”: The notso short introductiontoLaTeX2e Andifyou’restuck? Google! Exercise 3: Using the standard article class, use (Share)LaTeXtocreate a pdf containingpage 1 of the article “Recent insights into Candida albicansbiofilm resistance mechanisms” by Mathé and Van Dijck.

  12. References • Choose a bibliographystyle. For thisjournal, we use the chicagobibstyle.Addthis file toyour project: http://mirrors.ctan.org/biblio/bibtex/contrib/chicago/chicago.bst • Create a bib file thatwillcontainyourreferencesandadd the first reference in BibTeX format, e.g. byusingTeXMeD • Tell TeXtoinclude the references at the end of the document in the right style • Include the natbib package • Insert a \bibliograhystyleand\bibliographycommand • Add the citation in the tekst using the \citecommand

  13. Figures • The package graphicxcanbeusedtoincludevariousgraphic formats • (like pdf, jpg, png) • Figures are typicallyadded as floatsby the • \begin{figure} … \end{figure} environment • In a multicol environment, floats are notallowedtofloat. We canuse the float package and the option [H] to do so…: • Preamble: • \usepackage{graphicx,float} • In the document: • \begin{figure}[H] • \centering • \includegraphics[width=0.9\linewidth]{qBasePlus_example} • \caption{qBasePlus} • \label{fig:qbp} • \end{figure}

  14. Figures Always use vector basedgraphic formats ifpossible. Easiest way is toconvertthemallto pdf Exercise 4a: Add the figure qBasePlus_Example.pdf toyourarticle. First use the blindtext package toaddsome extra textbeforeandafter the picture. Add a cross referenceto the figure in yourtext.

  15. Figures Or even better: let’screateourowngraphfrom the raw data. We use the packages pgfplotsandtikztodo this. We don’t want tooverloadourmain file, sowe’ll put the figure in a seperatetex-file using the standalone document class, andincludeitafterwards. Exercise 4b: Create a new file qbpfig.texanduseybar (pgfplots package) torecreate the figure. Use the \includestandalonecommand of the standalone package toinclude the figure in yourarticle.

  16. Figures Possibleresult: • Advantages: • The font andstyle are the same as those of yourtext. • Youcanchoose the most appropriate way torepresentyour data • Take a look hereto get anidea of the strength of this package: • http://www.texample.net/tikz/examples/all/

  17. Tables Toincludetables, we canusetablefloatsand the tabularenvironment. For complex tables, youcanuse spreadsheet-to-latex converters, e.g. Excel2LaTeX, http://www.ctan.org/pkg/excel2latex Exercise 4c: Add a tabletoyourarticle. Ifyou want, installanduse a spreadsheet converter. Alternatively, youcanusean online LaTeXtable generator.

  18. Math, Chemistry & Bio stuff • LaTeX is verygood in typesetting mathematicalandchemicalformulas. • For ‘complexer’ mathematics, use the amsmath package. • For chemicalformulas, use the chemfig package • Therealsoexistsome bio-related packages, like: • texshade, fordisplaying the key changes in DNA • textopo, to draw transmembraneproteinsfrom a SwissProt file Exercise 5: (choosewhatyoulike) Add a Michaelis-Menten (or someother) equationtoyourarticle. Add the 2D formulaforethenoltoyourarticle. Check out one of the life science packages

  19. Presentations in LaTeX Note: There is a lot of discussion, even within the LaTeX community, About the use of LaTeXfor making presentations – althoughverygood Resultscanbeobtainedforscientificpresentations, somearguethat It’s tocumbersometoproducegoodresults without visual software… The best way tocreatepresentations in LaTeX, is byusing the beamer class Example!

More Related