<?xml version="1.0" encoding="UTF-8"?>
<chapter version="5.0" xml:id="tdocChapExercises"
         xmlns="http://docbook.org/ns/docbook"
         xmlns:xlink="http://www.w3.org/1999/xlink"
         xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xmlns:trans="http://docbook.org/ns/transclusion"
         xmlns:svg="http://www.w3.org/2000/svg"
         xmlns:m="http://www.w3.org/1998/Math/MathML"
         xmlns:html="http://www.w3.org/1999/xhtml"
         xmlns:db="http://docbook.org/ns/docbook">
  <title>Exercises</title>

  <section xml:id="tdocSectExerciseLatex">
    <title>LaTeX</title>

    <section xml:id="tdocExerciseLatexHello">
      <title>LaTeX hello,... world</title>

      <qandaset defaultlabel="qanda" xml:id="tdocQandaLatexHello">
        <qandadiv>
          <qandaentry>
            <question>
              <para>Use the <link
              xlink:href="https://www.tug.org/texworks">TeXworks</link> GUI to
              create this <link
              xlink:href="../Tdoc/Ref/Screen/latexHelloWorld.pdf">PDF
              result</link>.</para>
            </question>

            <answer>
              <programlisting language="tex">\documentclass[11pt]{article} % use larger type; default would be 10pt

\usepackage[utf8]{inputenc} % set input encoding (not needed with XeLaTeX)

\title{Basic example}
\author{The Author}

\begin{document}
\maketitle

\section{A hello world example}

Your text goes here.

\subsection{A subsection}

This may become a real subsection when adding further text ...

\end{document}</programlisting>
            </answer>
          </qandaentry>
        </qandadiv>
      </qandaset>
    </section>

    <section xml:id="tdocExerciseLatexElements">
      <title>Important elements</title>

      <qandaset defaultlabel="qanda" xml:id="tdocQandaLatexElements">
        <qandadiv>
          <qandaentry>
            <question>
              <para>Create an <classname>article</classname> document creating
              separate sections each containing one of the following
              items:</para>

              <itemizedlist>
                <listitem>
                  <para>Nested lists and enumerations</para>
                </listitem>

                <listitem>
                  <para>Complex table using sophisticated formatting possible
                  spanning multiple pages (<classname>supertabular</classname>
                  environment?)</para>
                </listitem>

                <listitem>
                  <para>A figure based on either raster or symbolic
                  format.</para>
                </listitem>

                <listitem>
                  <para>Complex formula</para>
                </listitem>
              </itemizedlist>
            </question>
          </qandaentry>
        </qandadiv>
      </qandaset>
    </section>

    <section xml:id="tdocExerciseLatexMacro">
      <title>Macro</title>

      <qandaset defaultlabel="qanda" xml:id="tdocQandaLatexMacro">
        <qandadiv>
          <qandaentry>
            <question>
              <para>Create a user defined command <code>\mysalute</code>
              expecting two parameters to be used in the following way:</para>

              <programlisting language="tex">\mysalute{Mr.}{Jim Bean}</programlisting>

              <para>The formatting expectation is:</para>

              <blockquote>
                <para>Mr Jim <emphasis role="bold">Bean</emphasis></para>
              </blockquote>

              <para>Mind the user's name to become boldface.</para>

              <tip>
                <para>Read about <code>\newcommand</code> optionally allowing
                for parameters.</para>
              </tip>
            </question>

            <answer>
              <programlisting language="tex">\newcommand{\mysalute}[2]{Hello #1 \textbf{#2}}</programlisting>
            </answer>
          </qandaentry>
        </qandadiv>
      </qandaset>
    </section>

    <section xml:id="tdocExerciseLatexExampleDoc">
      <title>A complete document</title>

      <qandaset defaultlabel="qanda" xml:id="tdocQandaLatexExampleDoc">
        <qandadiv>
          <qandaentry>
            <question>
              <para>Use one of your previous writings (e.g <quote
              xml:lang="de">Wissenschaftliches Arbeiten</quote>) to create a
              LaTeX document based on the following features:</para>

              <itemizedlist>
                <listitem>
                  <para>Bibliography residing in an external BiBtex
                  file</para>
                </listitem>

                <listitem>
                  <para>Internal cross references implemented by
                  <code>\label</code>, <code>\ref</code> and
                  <code>\pageref</code>. You may want to define appropriate
                  macros.</para>
                </listitem>

                <listitem>
                  <para>An index containing an alphabetical list of words and
                  expressions with the pages of the book upon which they are
                  to be found.</para>

                  <tip>
                    <para>Use the <package>makeidx</package> package</para>
                  </tip>
                </listitem>
              </itemizedlist>
            </question>
          </qandaentry>
        </qandadiv>
      </qandaset>
    </section>
  </section>

  <section xml:id="tdocSectExerciseDocbook">
    <title>Docbook</title>

    <itemizedlist>
      <listitem>
        <para>Rewrite your LaTeX Exercises <xref
        linkend="tdocExerciseLatexHello"/>, <xref
        linkend="tdocExerciseLatexElements"/> and <xref
        linkend="tdocExerciseLatexExampleDoc"/> using Docbook 5.</para>
      </listitem>

      <listitem>
        <para>Change the Webhelp generation process by setting the <parameter
        linkend="tdocSectUseIdAsFilename">use.id.as.filename</parameter>
        parameter.</para>

        <tip>
          <mediaobject>
            <imageobject>
              <imagedata fileref="Ref/Screen/xmlmindDocbocXslConfig.png"/>
            </imageobject>
          </mediaobject>
        </tip>
      </listitem>

      <listitem>
        <para>Generate both Webhelp and PDF output using XMLmind's <command
        xlink:href="http://www.xmlmind.com/xmleditor/_distrib/doc/xxetool">xxetool</command>
        scripting facilities.</para>
      </listitem>

      <listitem>
        <para>Generate HTML output using the <quote>vanilla</quote> <link
        xlink:href="https://sourceforge.net/projects/docbook/files/docbook-xsl-ns">Docbook
        XSL style sheets</link>.</para>

        <tip>
          <para>The <command>saxon9he-xslt</command> processor command is
          available for processing purposes. See <uri
          xlink:href="http://www.saxonica.com/html/documentation/using-xsl/commandline.html">http://www.saxonica.com/html/documentation/using-xsl/commandline.html</uri>.</para>
        </tip>
      </listitem>

      <listitem>
        <para>Generate PDF output using Fop on top of the <link
        xlink:href="https://sourceforge.net/projects/docbook/files/docbook-xsl-ns">Docbook
        XSL style sheets</link>.</para>

        <tip>
          <para>The <link
          xlink:href="http://www.renderx.com/tools/xep.html">RenderX XEP FO
          processor</link> is available at
          <filename>/usr/share/xep.academic/xep.bat</filename>. You'll have
          to:</para>

          <orderedlist>
            <listitem>
              <para>Execute <command>saxon9he-xslt</command> converting your
              document to Formatting Objects using the <link
              xlink:href="https://sourceforge.net/projects/docbook/files/docbook-xsl-ns">Docbook
              XSL style sheets</link>.</para>
            </listitem>

            <listitem>
              <para>Convert the resulting <filename>.fo</filename> file to PDF
              using <filename>xep.bat</filename>.</para>
            </listitem>
          </orderedlist>
        </tip>
      </listitem>
    </itemizedlist>
  </section>
</chapter>