Doc: Initiate transition to next generation documentation
[shapes.git] / doc / parts / syntax / tex.sxml
blobf7ea76143c08645924e65122d1ff6459ec282113
1 <!-- This file is part of Shapes.                                           -->
2 <!--                                                                        -->
3 <!-- Shapes is free software: you can redistribute it and/or modify         -->
4 <!-- it under the terms of the GNU General Public License as published by   -->
5 <!-- the Free Software Foundation, either version 3 of the License, or      -->
6 <!-- any later version.                                                     -->
7 <!--                                                                        -->
8 <!-- Shapes is distributed in the hope that it will be useful,              -->
9 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of         -->
10 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          -->
11 <!-- GNU General Public License for more details.                           -->
12 <!--                                                                        -->
13 <!-- You should have received a copy of the GNU General Public License      -->
14 <!-- along with Shapes.  If not, see <http://www.gnu.org/licenses/>.        -->
15 <!--                                                                        -->
16 <!-- Copyright 2008, 2010 Henrik Tidefelt                                   -->
18 <section id="syntax/tex">
19 <title>LaTeX</title>
20 <top>
21 <p>The <str-Shapes /> language was designed to be used with <str-LaTeX /> for typesetting labels in the graphics.</p>
22 </top>
23 <body>
24 <p>The <str-Shapes /> compiler goes to some lengths to avoid calling <str-LaTeX /> too many times, but the problems this can cause is more of a tool matter than a language issue.  Here, we shall just describe the laguage constructs that relate to producing labels with <str-LaTeX />.</p>
26 <p>
27         First, there are a few directives that just transfer text to the top of the <str-LaTeX /> document where the labels are to appear:
28 <pre>
29 ##documentclass <replacable-text name="class-name" />
30 ##classoption <replacable-text name="comma-separated-options" />
31 ##preamble <replacable-text name="line-of-text" />
32 ##documenttop <replacable-text name="line-of-text" />
33 ##no-lmodernT1
34 ##no-utf8
35 </pre>
36 </p>
38 <p>
39         The default document class is <em>article</em>, but this can be changed with the first of these directives.  The following three directives are self-explanatory, and may appear several times.  The last two disable the use of packages that are otherwise included by default.  When they are not disabled, the following goes before the lines from <inline>##preamble</inline>:
40 <pre>
41 \usepackage{lmodern}
42 \usepackage[T1]{fontenc}
43 \usepackage[utf8]{inputenc}
44 </pre>
45 </p>
47 <p>To produce the labels themselves, one simply calls the function <value name="TeX" />, as the following example shows.</p>
49 <example-with-output title="Example" internal-id="example:boxedeq">
50 <image pdf="features/boxedeq.pdf" jpg="features/boxedeq_y_small.jpg" />
51 <source file="features/boxedeq.shape">
52 <![CDATA[<!--#include depth="0" virtual="$(BUILDDIR)$(EXAMPLES)features/boxedeq.shape" -->]]>
53 </source>
54 </example-with-output>
56 </body>
57 </section>