latex workshop tutorial

Download Latex Workshop Tutorial

Post on 08-May-2015




9 download

Embed Size (px)


I go over ways of including pictures in LaTeX documents. I cover distinction between image formats viz. bitmaps and vector graphics. Finally I demonstrate a few tools to create vector graphics such as Inkscape, PSTricks and LatexDraw and a simple way of including LaTeX in your presentations i.e. TexMaths equations editor.


  • 1.Jayant Apte, Drexel UniversityPictures inPICTURES IN IN PRESENTATIONS Sponsored by IGSA, DIG, and GSAJAYANT APTE PhD Candidate Drexel University

2. Jayant Apte, Drexel UniversityPictures inOutline External graphics formats Importing bitmap graphics package Figure environment The sub-figure environmentCreating and importing vector graphics Creating vector graphics inside The package Latex-draw interface to pstricks LibreOffice with TexMaths 3. Jayant Apte, Drexel UniversityGraphics formats Bitmaps Without lossy compression With Lossy CompressionVector graphicsPictures in 4. Jayant Apte, Drexel UniversityPictures inBitmaps Store image information as pixels with each pixel of given color Greater the resolution, better the quality Greater the color-depth, better the quality(16 bits to represent intensity in a range is better than 8-bits)Better the quality, greater the storage sizeScaling and rotating affects picture qualityeg. PNG, JPEG, TIFF 5. Jayant Apte, Drexel UniversityPictures inOne image to describe us all 6. Jayant Apte, Drexel UniversityThe graphicx packagePictures in 7. Jayant Apte, Drexel UniversityPictures inA SIMPLE ATTEMPT 8. Jayant Apte, Drexel UniversityPictures inHow to use graphicx rightincludegraphics[attr1=val1, attr2=val2, ..., attrn=valn]{imagename} 9. Jayant Apte, Drexel UniversityPictures inAttributes for graphicx AttributeTypeDescriptionscalenumberwidthlengthThe width to which the figure should be scaledheightlengthThe height to which the figure should be scaledtotalheightlengthHeight plus depth of figure (to be used if figure is rotated)anglenumberAngle (in degrees) by which the figure is to be rotated counterclockwiseorigin3d coordinatesA magnification factorThe point about which rotation is to occur 10. Jayant Apte, Drexel UniversityScale attributePictures in 11. Jayant Apte, Drexel UniversityPictures inWidth and Height(and some placement) 12. Jayant Apte, Drexel UniversityPictures inGraphicx contd... The image included using graphicx will be treated by TeX as a gigantic letter. Hence all text alignment commands work with images added using graphicx Pictures appear exactly where you used includegraphics{}No caption 13. Jayant Apte, Drexel UniversitySide-by-side picturesPictures in 14. Jayant Apte, Drexel UniversityMore picturesPictures in 15. Jayant Apte, Drexel UniversityPictures inFloats in and The figure environment 16. Jayant Apte, Drexel UniversityPictures inFloats Floats are containers for things in a document that cannot be broken over a page. LaTeX by default recognizes "table" and "figure" floats Not part of the normal stream of text, but separate entities If not specified explicitly, LaTeX automatically places them where they fit the best Always have a caption describing them Always numbered so they can be referred to from elsewhere in the text 17. Jayant Apte, Drexel UniversityAdding a floatPictures in 18. Jayant Apte, Drexel UniversityPictures inAdding a picture inside a float 19. Jayant Apte, Drexel UniversityThe auto placementPictures in 20. Jayant Apte, Drexel UniversityPictures inOverriding auto-placement - [h][h]=place float here 21. Jayant Apte, Drexel UniversityPictures inFigure placement specifiers SpecifierPermissionhPlace the float here, i.e., approximately at the same point it occurs in the source text (however, not exactly at the spot)tPosition at the top of the pagebPosition at the bottom of the page.pPut on a special page for floats only.!Override internal parameters LaTeX uses for determining "good" float positions. 22. Jayant Apte, Drexel UniversityPictures inCiting figures inside documentGive your figure a labelCite using that label 23. Jayant Apte, Drexel UniversityPictures inThe sub-figure package This package provides support for the manipulation and reference of small or sub figures and tables within a single figure or table environmentSub-figures can be separately captioned, referencedCaptions can be included in the List-of-FiguresUsage(inside figure): subfigure[]{} 24. Jayant Apte, Drexel UniversityPictures inUsing sub-figure package 25. Jayant Apte, Drexel UniversityPictures inUsing sub-figure packageSimply use nextline to create rows of figures 26. Jayant Apte, Drexel UniversityPictures inVector Graphics Made with lines, Bzier curves, polygons and circles The mathematical properties of these objects parameters are storedEasy to scale or rotate without loss of qualityUse less memoryeg. .eps 27. Jayant Apte, Drexel UniversityPictures inHow to create vector graphics OmniGraffle(Mac Only)InkscapePSTricksAny wrapper to PStricks 28. Jayant Apte, Drexel UniversityPictures inInkscape 29. Jayant Apte, Drexel UniversityPictures inThe power of vector graphics 30. Jayant Apte, Drexel UniversityPictures inThe power of vector graphics 31. Jayant Apte, Drexel UniversityPictures inPSTricks PSTricks is a set of macros that allow the inclusion of PostScript drawings directly inside TeX or LaTeX code Written by Timothy Van Zandt and has been maintained in recent years by Denis Girou, Sebastian Rahtz and Herbert VossIt is a way of creating pictures by typing codeWhile very useful, it has a learning curve 32. Jayant Apte, Drexel UniversityPSTricks examplebegin{pspicture}(5,5) %% Triangle in red: psline[linecolor=red](1,1)(5,1)(1,4)(1,1) %% Bezier curve in green: pscurve[linecolor=green,linewidth=2pt,% showpoints=true](5,5)(3,2)(4,4)(2,3) %% Circle in blue with radius 1: pscircle[linecolor=blue,linestyle=dashed](3,2.5){1} end{pspicture}Pictures in 33. Jayant Apte, Drexel UniversityPictures inLaTeXDraw: A way around complications of PSTricks LaTeXDraw is a graphical drawing editor for LaTeX LaTeXDraw can be used to: 1) generate PSTricks code 2) directly create PDF or PS picturesLaTeXDraw is developed in Java and thus runs on top of Linux, Windows, and Mac OS X Download Link 34. Jayant Apte, Drexel UniversityPictures inLaTeXDraw: Demonstration 35. Jayant Apte, Drexel UniversityPictures inUsing LaTeXDraw generated script in TexWorks Go to Edit->Preferences Create a new typesetting tool called pdflatex+shellescape with shown arguments 36. Jayant Apte, Drexel UniversityPictures inIn persentations One can use beamer like GregoryOr one can use TexMaths extension to LibreOfficeTexMaths is an addon designed to provide LaTeX support into LibreOffice LaTeX equations can be inserted as images (SVG or PNG formats) the LaTeX code is saved into the image attribute for further editing 37. Jayant Apte, Drexel UniversityPictures inTeXMaths Installation for Linux Installation on Linux Install TexLive (on Debian based systems : sudo apt-get install texlive). Optionally install dvipng (on Debian based systems : sudo apt-get install dvipng). Optionally install dvisvgm (version 1.0.8 or later, deb package is here and rpm package is here). Open LibreOffice Writer and install the TexMaths extension using the Tools / Extension manager menu. Close and reopen LibreOffice Writer. You will see the new TexMaths toolbar. Click on the TexMaths System Configuration icon and fill the paths of your programs (usually /usr/bin for all). Run TexMaths by clicking on one of the TexMaths Equations iconsLink for Installation on other Oss:TexMaths Installation