
 LaTex support in jfig


 The FIG file format includes a special flag to mark text objects
 as 'special', and such text objects are treated specially by the
 fig2dev converter program. When converting to LaTeX or PicTeX macros,
 or when using the combined Postscript/LaTeX export format, the
 special text objects are passed on to LaTex. This means that you 
 can write formulae using the LaTeX syntax in xfig, and LaTeX will
 later typeset them.

 Starting with jfig2, the jfig editor includes its own (limited)
 LaTeX interpreter, so that you can preview such text objects 
 directly while drawing your figures. While the parser is quite
 simple, it understands many of the simple TeX and LaTeX macros,
 including most math mode symbols. 

 In the jfig2 editor, use menu->view->Show TeX strings to switch
 between the traditional and the TeX-enabled display mode. Note
 that text object editing should be done in the traditional mode,
 because no text cursor can be shown for TeX-mode text objects.

 -------

 Based on the Java2D rendering and the embedded TrueType CM-fonts,
 you can also use the built-in LaTeX functions when using new
 built-in PDF- and image-export functions from jfig; that is, you
 can create PDF files or bitmap images including LaTeX symbols
 and formulae without running LaTeX. The typographic quality is
 far from the output quality of real TeX, but can be ok for many
 simple things.

 Another important use of TeX-mode is to include attributes texts
 in jfig drawings while still maintaining compatibility with the
 FIG file format and the fig2dev export tools. In attributed texts,
 you can change text font, font size, and colors inside one text
 object.

 Attributed text objects can

 * use multiple fonts (normal, italic, bold) 
 * use multiple font sizes
 * use multiple colors, e.g. to highlight important words,
 * use mathematical symbols, including super- and subscripts.

 -------


 To give a few examples, the following strings are valid as attributed
 jfig text objects:
 
 {\black black, {\red red}, {\green green}, and black again}

  Text with {\em highlighted} words and {\tt typewriter} text.

 $a^{2} + b^{2} = c^{2}$

 $\cos^{2}(\alpha) + sin^{2}(\alpha) = 1$

 $float = (-1)^{sign} \cdot\ 2^{exp-127} \cdot\ (1 + mantisse^{-23})$

 $\sum_{i=0}^{n}  = n(n+1)/2$        (inline formula)

 $\Sum{i=0}{n} = \frac{n (n+1)}{2}$  (display style)

 $S_{i}(t+1) = {\xiipt (1/N)} \sum_{j=0}^{N-1} J_{ij} \cdot\ S_j(t)$


 -------


 Note that the following constructs are not (yet) supported:
 
 * accents
 * non-grouped subscripts and superscripts, e.g $x_i$ does not work,
   while $x_{i}$ should work.
 * a few math symbols
 * user-defined macros 

 * advanced math formatting, e.g. matrices
 * display math: the parser interprets "$$formula$$" as 
   $empty math$ formula-as-text $empty empty$



 ------


 The source code of jfig.utils.LP2 (the LaTeX parser) is included in the
 jfig3.jar archive file. Don't hesitate to add new symbols, new functions, 
 or improved functionality, and share your modified code.

 Please see the jfig-tutorial and the source code for the full list of
 supported TeX/LaTeX macros. The following list gives an overview:

 (1) Font selection:

 \bf                 normal text {\bf bold text} normal again
 \it                 {\it italic text}
 \em                 {\em emphasized {\em double emphasized}} text
 \rm                 {\rm roman upright font}
 \mathrm             $math italic {\mathrm{upright math font}} more italic$
 \tt                 normal text {\tt typewriter text} normal again
 \btt                normal {\btt bold typewriter}
 \itt                normal {\itt italic typewriter}

 (2) Font size selection: absolute or relative to base size

 \fivept             FIG font size {\fivept 5pt size}, FIG size again
 \sixpt
 \sevenpt
 \eightpt
 \ninept
 \tenpt
 \elevenpt
 \twelvept
 \thirteenpt
 \fourteenpt
 \fifteenpt
 \sixteenpt
 \seventeenpt
 \twentypt
 \twentytwopt
 \twentyfourpt
 \twentyfivept
 \twentysevenpt
 \thirtypt
 \thirtyfivept
 \fourtypt
 \fiftypt

 \xpt
 \xipt
 \xiipt
 \xiiipt
 \xivpt
 \xvpt
 \xviipt
 \xxpt
 \xxivpt
 \xxvpiipt
 \xxxpt
 \xxxvpt
 \xlpt

 (3) Color selection:

 \black              FIG color {\black black}, {\red red}, FIG color
 \red
 \green
 \blue
 \cyan
 \magenta
 \yellow
 \white
 \darkblue
 \lightblue
 \darkgreen
 \darkred
 \darkpink
 \gold
 
 (4) Greek letters:

 \alpha, \beta, \gamma, ... \omega
 \Alpha, \Beta, \Gamma, ... \Omega

 (5) Several ASCII chars and currency symbols:
 
 \hashsign      #
 \atsign        @
 \lbracket      [
 \backslash     \
 \rbracket      ]
 \lessthan      <
 \equals        =
 \greaterthan   >
 \lbrace        {
 \verticalbar   |
 \rbrace        }
 \tilde         ~

 \$             US dollar
 \euro          euro
 \pound         british pound
 \pts           spanish pesetas

 \celsius       
 \fahrenheit

 (6) Math symbols

 Lots of them, see the source code or class documentation for a list, e.g.

 \leftarrow ... \updownarrow
 \Leftarrow ... \Updownarrow
 \nearrow ... \swarrow
 \hookleftarrow ... \leftharpoonup, ...
 \mapsto
 \nleftarrow ... \nRightarrow

 \forall
 \complement
 \partial
 \exists
 \nexists
 \varnothing
 \triangle
 \nabla
 \in
 \notElementIn
 \mathEpsilon
 \ni

 \prod
 \coprod
 \sum
 \minus
 \mp
 \wedge
 \vee
 \cap
 \cup
 \int
 \iint
 \iiint
 \oint
 \ll \gg \define \wr \infty
 \art \circ \cullet \cdot \cdotvar \star
 \root \cubicroot \fourthroot 
 \oplus \ominus \otimes \oslash \odot
 \sin \cos \tan \tanh \atan \exp \ln \log

 \telephone \smiley \male \female
 \clubsuit \spadesuit \heartsuit \diamondsuit


 (7) spacing commands

 \!   short negative space
 \,   short space

 \thinspace
 \emspace
 \qquad







