<page xmlns="http://projectmallard.org/1.0/"
      xmlns:its="http://www.w3.org/2005/11/its"
      type="topic"
      id="build_tools">

<info>
  <link type="guide" xref="index" />
</info>

<title>Build Tools</title>

<synopsis>
  <p>The purpose of the build tools is to generate a document in the PDF, DVI or PS
  format.</p>
</synopsis>

<links type="section" />

<section id="overview">
  <title>Introduction</title>

  <p>Several different tools can be used for a document compilation. There are some
  low-level commands, and one higher-level tool: Latexmk.</p>

  <table rules="rowgroups">
    <title>Low-level commands</title>
    <thead>
      <tr>
        <td><p>Label</p></td>
        <td><p>Command</p></td>
      </tr>
    </thead>
    <tbody its:translate="no">
      <tr>
        <td><p>LaTeX → DVI</p></td>
        <td><p><cmd>latex</cmd></p></td>
      </tr>
      <tr>
        <td><p>LaTeX → PDF</p></td>
        <td><p><cmd>pdflatex</cmd></p></td>
      </tr>
    </tbody>
    <tbody its:translate="no">
      <tr>
        <td><p>DVI → PDF</p></td>
        <td><p><cmd>dvipdf</cmd></p></td>
      </tr>
      <tr>
        <td><p>DVI → PS</p></td>
        <td><p><cmd>dvips</cmd></p></td>
      </tr>
      <tr>
        <td><p>PS → PDF</p></td>
        <td><p><cmd>ps2pdf</cmd></p></td>
      </tr>
    </tbody>
    <tbody>
      <tr>
        <td><p>Bibliography</p></td>
        <td its:translate="no"><p><cmd>bibtex</cmd></p></td>
      </tr>
      <tr>
        <td><p>Index</p></td>
        <td its:translate="no"><p><cmd>makeindex</cmd></p></td>
      </tr>
    </tbody>
  </table>

  <p>Compiling a LaTeX document can involve to execute several low-level commands, in a
  certain order and a certain number of times. Here is an example:</p>
  <screen its:translate="no">
$ latex document.tex
$ bibtex document.aux
$ latex document.tex
$ dvips -t a4 document.dvi
$ ps2pdf document.ps</screen>

  <p>Using a higher-level tool such as Latexmk simplify a lot all this process,
  since only one command is required. Indeed, Latexmk can detect how many times the
  <cmd>latex</cmd> or <cmd>pdflatex</cmd> command must be called, and whether
  <cmd>bibtex</cmd> or <cmd>makeindex</cmd> is required. By default, GNOME LaTeX
  uses Latexmk.</p>
</section>

<section id="execute">
  <title>Execute a Build Tool</title>

  <p>There are several means to execute a build tool:</p>
  <list>
    <item><p>Open the <gui style="menu">Build</gui> menu.</p></item>
    <item><p>Use the buttons in the main toolbar.</p></item>
    <item><p>Use the shortcut: <key>F2</key> → <key>F11</key>.</p></item>
  </list>

  <p>The build tool is executed on the currently opened file. If the file belongs to a
  <link xref="projects">project</link>, it is executed on the project's main file.</p>

  <note style="important">
    <title>Hidden Build Tools</title>
    <p>By default, a lot of build tools are hidden, so they can't be executed. To view
    the full list of build tools, activate or configure them, read the
    <link xref="#general_configuration" /> section.</p>
  </note>
</section>

<section id="general_configuration">
  <title>General Configuration</title>

  <p>
    To configure the build tools, go to:
    <guiseq>
      <gui style="menu">Build</gui>
      <gui style="menu">Manage Build Tools</gui>
    </guiseq>
  </p>

  <p>You will see the list of all the default build tools, and a second list
  with your personal build tools. There are check buttons to enable or disable
  them. When a build tool is disabled, it's not possible to execute it. You can
  perform some actions, like moving a tool up or down, open its properties,
  delete or copy it, create a new one, etc.</p>

  <note style="tip">
    <p>Double-click on a build tool will open its properties.</p>
  </note>
</section>

<section id="jobs">
  <title>Jobs of a Build Tool</title>

  <p>In the properties of a build tool, the tricky part is to configure the jobs.
  A build tool can execute several jobs. Each job contains two pieces of
  information:</p>
  <list>
    <item><p>The command, which can use placeholders.</p></item>
    <item><p>The post processor (see <link xref="#post-processors" />).</p></item>
  </list>

  <p>When an error occurs during a job's execution, the execution of the build
  tool is aborted, so the next jobs are not launched.</p>
</section>

<section id="post-processors">
  <title>Post Processors</title>
  <p>The purpose of a post processor is to filter the command output and extract
  the useful information. Four post processors are available:</p>

  <terms>
    <item>
      <title its:translate="no">no-output</title>
      <p>The output is simply not displayed.</p>
    </item>
    <item>
      <title its:translate="no">all-output</title>
      <p>All the output is displayed, without filter.</p>
    </item>
    <item>
      <title its:translate="no">latex</title>
      <p>Filter the output of the <cmd>latex</cmd> or <cmd>pdflatex</cmd> commands.
      There can be three types of errors: critical errors, warnings, or bad boxes. There
      are also some other useful information: the size of the document, the number of
      pages, and the number of errors.</p>
    </item>
    <item>
      <title its:translate="no">latexmk</title>
      <p>Used for the <cmd>latexmk</cmd> command. Internally, this post processor uses
      other ones: <em>latex</em> and <em>all-output</em>.</p>
    </item>
  </terms>
</section>
</page>
