1 <!-- This file is part of Shapes. -->
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. -->
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. -->
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/>. -->
16 <!-- Copyright 2008, 2010 Henrik Tidefelt -->
18 <section id="syntax/tex">
21 <p>The <str-Shapes /> language was designed to be used with <str-LaTeX /> for typesetting labels in the graphics.</p>
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>
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:
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" />
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>:
42 \usepackage[T1]{fontenc}
43 \usepackage[utf8]{inputenc}
47 <p>To produce the labels themselves, one simply calls the function <value namespace="..Shapes..Graphics" 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" -->]]>
54 </example-with-output>