How to write documents in LaTeX

How to write documents in LaTeX

Generating a LaTeX document needs some changes depending on target document type, authoring platform or target language. I summarized LaTeX authoring procedures for some common cases.
  1. Target Document Type: PDF

    When you just want to generate a pdf document, pdflatex is preferred.

    Compared to use latex and dvips (or dvipdf), using pdflatex produces documents of better quality and allows hyperlinks within a pdf document. Another advantage of pdflatex is that you can use pdf files as embedded graphics.

    A pdf graphic file can be generated from different sources: it can be converted from existing eps file or it can be generated from any printable format using Adobe pdfwriter. The latter allows you generate graphics your familiar tool like Microsoft Powerpoint and generate scalable vector graphic file.

    (Makefile for pdflatex)

  2. Target document type: PS or PDF

    In a traditional way, you can generate a target document from LaTeX using latex and dvips / dvipdf. This case is applied when you want to generate a target document both for ps and pdf and when you you need to submit embedded graphics as EPS files separately, which is not uncommon for a conference paper submission.

    In this case, you generate a dvi file from your tex file using latex command. A dvi file is an intermediate device independent file format that can be converted to other target format files later. A dvips command is needed to convert a dvi file to a ps file. A dvipdf command is needed to convert a dvi file to a pdf file. A dvipdf command has different versions (e.g. dvipdf, dvipdfm, dvipdfmx) depending on the target platform and cababilities. A version of dvipdf that correctly generate document for your platform needs to be checked.

    (Makefile for latex and dvips/dvipdf)

  3. Generating embedded graphics

    When target is PS, convert all the embedded graphics into EPS format. OpenOffice is preferred to generate EPS format from a generic drawing file. After you draw figures with drawing program, export the file to .eps file. You can also change the size of a figure in the page property. OpenOffice is available in different platforms including Windows, Linux, Solaris, etc.

    When target is PDF, convert all the embedded graphics into PDF format. You can use Acrobat pdfwriter for this.

    GIMP is a tool that can be used to convert a graphics file to another format.

    epstopdf, jpeg2ps, bmeps are some of the command-line tools to convert graphics files.

  4. How to embed PDF fonts

    Some publishers require embedding fonts inside the PDF document. In case the document is pdf format, you can use the following command. This command converts 'paper.pdf' to 'paper_embed.pdf' by embedding all the fonts within the document.

    gs -sDEVICE=pdfwrite -q -dBATCH -dNOPAUSE -dSAFER -dPDFX -dPDFSETTINGS=/prepress -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode -sOutputFile=paper_embed.pdf -c '<> setdistillerparams' -f paper.pdf -c quit

    The following Makefile embeds the fonts after it compiles the latex document. When the target document is 'paper.pdf', the Makefile outputs the font-embedded document into 'paper_embed.pdf'.

    (Makefile to embed PDF fonts)

  5. How to change the margin

    Some publishers require specific margin for the document before submission. The following line can be embedded in the latex file for this:


  6. Generating Korean document with LaTeX

    Install Korean version of LaTeX following the links:

    Run lambda for UTF-8 encoded document and run latex for EUC-KR encoded document to generate a dvi file.

    (Installing Hangul LaTeX)

    After dvi is created, use dvipdfmx to convert dvi to pdf.

    (Makefile for UTF-8)
    (Makefile for EUC-KR)