After installation TexText will appear under Extensions ‣ Text ‣ Tex Text:
When you select it, a dialog will appear that lets you enter any LaTeX
code you want (presumably your formula).
Tip
Once you have opened TexText via the menu entry in an Inkscape session
you can subsequently open it using the keyboard shortcut ALT + Q
(“Previous extension”).
You enter your LaTeX code into the edit box . In the case the
the GTK GUI bindings are available it will show you line and column numbers. If you
additionally installed GTKSourceView it will also highlight the syntax
with colors. You can add any valid and also multi-line LaTeX code.
There are additional settings which can be adjusted to your needs:
The TeX command to be used for compiling your code (group box ).
Possible options are: pdflatex, xelatex, lualatex. See
section Available TeX compilers for more details.
The alignment relative to the previous version of your code (group
box , only available when re-editing your code). See section Alignment of the output.
Your LaTeX code and the accompanying settings will be stored within the
new SVG node in the document. This allows you to edit the LaTeX node
later by selecting it and running the Tex Text extension (which will
then show the dialog containing the saved values).
There is a preview button as well, which shortens the feedback cycle
from entry to result considerably, so use it! See section Preview button
Your LaTeX code can be compiled using three different compilers:
pdflatex, xelatex, lualatex (as long as the corresponding
commands are found by your system). You can select the command in the
combobox . The last two ones are especially useful for using UTF-8
input or if you require Lua commands. Of course you can use UTF-8 input
with the pdflatex command as well as long as you provide
usepackage[utf8]{inputenc} in your preamble file (see Preamble file).
Some things to be kept in mind:
Place the required lua packages in your preamble file if you want to
compile your code with lualatex.
If you use lualatex/ xelatex for the very first time on your
system it may take some time until the fonts are setup properly.
During that time TexText might be unresponsive.
Windows: xelatex tends to be very slow on Windows machines, see
this post on
Stackexchange.
Be aware of including the required packages in the preamble file if you
use special commands in your code that rely on such packages. The
preamble file can be chosen by the selector . The default preamble
file shipped with TexText includes the following:
This will be typeset, converted to SVG and inserted into your Inkscape
document. If no documentclass or documentstyle is specified
in the preamble file, documentclass{article} is used by default.
In most of the cases you will need to adjust the size of the produced
SVG output to match the conditions of your drawing. This can be done by
two methods:
After compilation adjust the size of the SVG output using the mouse
in Inkscape. You should lock the width and height to keep the
proportion. Be careful to not break the group!
Before compilation you specify a scale factor in the spinbox of the
groupbox .
Both methods are fully compatible. If you scale your SVG output in
Inkscape the numerical value of the spinbox will be adjusted
appropriately when you open TexText on that node later. In both cases
the scale factor is preserved when you re-edit your code.
A scale factor of 1 means that the output is sized as it would appear in
a regular LaTeX document, i.e., a font size of xpt in LaTex matches
that of xpt in Inkscape:
There are two additional buttons in the groupbox :
Reset: This button is only available when re-editing existing
TexText nodes. It resets the scale factor to the value the code has
been compiled with the last time. This is useful when playing around
with the scale factor and decide to not change the scale factor.
As previous: This button sets the scale factor of the currently
edited node to the value of the node which has been edited
previously. This is useful when you found a scale factor to be
suitable and want to apply this scale factor also to any new or
existing nodes you open for editing.
If you have re-sized the SVG output in Inkscape without keeping the
proportions the re-compiled output will be placed with correct
proportions according to the alignment.
When you edit existing nodes it is likely that the size of the produced
output will change, for example if you modify the input $sin(x)$ to
$intsin(x)text{d}x$. The entries of the spinbox determine how
the new node is aligned relatively to the old node. The default
behaviour is middlecenter, i.e. the middle of the new node is placed
on the middle of the old node. Available options are:
topleft
topcenter
topright
middleleft
middlecenter
middleright
bottomleft
bottomcenter
bottomright
Of course, the content of the groupbox is only available when
editing existing nodes.
There are two ways for colorization of the output:
The most natural way is to select the produced SVG output in Inkscape and set the fill
color to the same value according to your needs. When you re-compile your node this color will be persevered as long as
you do not use any color specifications in your LaTeX code.
New in version 1.5.0: No strokes checkbox
Note, that bars occuring in \frac, \sqrt, \overline and other commands are
colored only by this method if you check the Nostrokes option in the SVG-Output
box (see Dialog overview). Please note that setting
of this option will considerably increase compilation time due to Inkscape API
limitations. Hence, this option is disabled by default in new nodes.
You can also colorize characters individually be selecting them with the mouse
after having pressed F2. Be careful not to break the group.
Caution
Individual colorization of single characters done in Inkscape will not be
kept after re-compilation.
Alternatively, you can use LaTeX commands like
textcolor in your code to colorize the node according to your
needs. The required color package is already included in the default_packages.tex
preamble file shipped with TexText. If you use such commands any colorization done
by Inkscape will be lost after re-compilation. This method is the recommended one if you
would like a character wise colorization of your output.
When pressing the Preview button your code will be compiled and the result
is displayed as an image in the area below the LaTeX code input field. If the
output extends a certain size it is displayed scaled so it fits into the available
area. You can double click into the preview image to obtain the result in original
size. Then, you can use the horizontal and vertical scroll bars to navigate along
your result. Double clicking again will bring you back to the scaled version of the
output.
If you are using a darkmode theme you can select the option Whitepreviewbackground
option from the View menu :
Finally, click the Save button to insert the compiled code into your document.
In the Settings menu you can configure by ConfirmClosingWindow if TexText should ask for
confirmation to close the window in case you made changes to your text. Furthermore, under CloseTexTextShortcut
you can select a shortcut for closing the TexText window.
You have the following options:
Escape (default)
CTRL+Q
None: No shortcut active. Depending on your operating system a standard shortcut maybe
available (e.g. ALT + F4 on Windows).
You can open the View menu which offers some possibilities
to configure the code editor:
FontSize: Here you can set the font size used in the code editor (since version 1.7.0).
WordWrap: If this option is checked long lines are wrapped automatically to window width.
Showlinenumbers: If this option is checked line numbers are printed on the left hand side of the editor.
Enabledautoindent: If this option is checked current indentation is preserved when breaking a new line (this is not an intelligent code dependent indentation feature).
InsertspacesinsteadofTabs If this option is checked each time you press the Tab key a number of spaces as defined in TabsWidth is inserted instead of a tabulator character.