Skip to content

Commit 1027f5f

Browse files
committed
Merge branch 'develop'
2 parents dcdce38 + c0f80da commit 1027f5f

File tree

17 files changed

+2560
-1842
lines changed

17 files changed

+2560
-1842
lines changed

AUTHORS.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@ went into the development of the project.
3232
- veltsov@github
3333
- Vladislav Gavryusev
3434
- xuestrange@github
35-
- user202729@github

CHANGELOG.rst

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
1+
Version 1.12.0 (2025-07-17)
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
- New: setup command line option `--use-tk` to force the usage of tkinter
4+
as UI. Alongside, the configuration file option `gui.toolkit` has been
5+
introduced. It allows the selection of the GUI toolkit to use in order to
6+
override the automatic detection. Possible values are `tk` or `gtk`.
7+
Additionally, `gui.use_gtk_source` can be used to turn GTKSourceView on or
8+
off, if the GTK toolkit is used.
9+
- New: If a subgroup of a TexText object has been selected a warning message
10+
will be displayed (previously an empty dialog opened prompting for
11+
new input).
12+
- New: Command line option `--recompile-all`: All TexText obejcts will
13+
be re-compiled (useful if preamble has been changed).
14+
- New: Added a section for command line usage of TexText to the documentation.
15+
Useful for debugging and CI tests.
16+
- Fixed: Re-edited TexText objects are placed in the foreground even if they
17+
were in the background before re-editing them (:issue:`467`)
18+
- Fixed: After re-editing TexText objects only subgroups of the object are
19+
selected after TexText closes (:issue:`460`)
20+
121
Version 1.11.1 (2025-03-13)
222
~~~~~~~~~~~~~~~~~~~~~~~~~~~
323
- New: The error dialog additionally presents a traceback of the error
4-
(thanks to user202729)
24+
(thanks to user202729)
525
- Fixed: Setup crashes when symbolic links are used in the user's extension
6-
folder (thanks to user202729).
26+
folder (thanks to user202729).
727
- Fixed: Setup crashes when Inkscape extension command subsystem fails
828

929
Version 1.11.0 (2025-01-06)
@@ -13,12 +33,12 @@ Version 1.11.0 (2025-01-06)
1333
colorized by setting the fill color. If they have been manually colored
1434
by setting the stroke color the lines disappear after re-compilation.
1535
- New: removed the Stroke to Path option, it is not necessary anymore due to
16-
the fix mentioned above.
36+
the fix mentioned above.
1737
- New: typst preamble and preview support
1838
- New: It is possible to change the command line options for the LaTeX compilers (useful e.g. to incorporate
19-
the -shell-escape option). See
20-
`this FAQ entry <https://textext.github.io/textext/usage/faq.html#compiling-latex-code-with-additional-command-line-options-e-g-shell-escape>`__
21-
in the documentation
39+
the -shell-escape option). See
40+
`this FAQ entry <https://textext.github.io/textext/usage/faq.html#compiling-latex-code-with-additional-command-line-options-e-g-shell-escape>`__
41+
in the documentation
2242
- Fixed: typst snippets contain a large empty background frame
2343
- Fixed: TexText fails silently if unhandled errors occur.
2444

build_windows_installer.nsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Unicode True
1919
; Welcome page
2020
!define MUI_WELCOMEPAGE_TEXT "Setup will guide you through the installation of ${PRODUCT_NAME} \
2121
${PRODUCT_VERSION}$\n$\nPlease note that this version of TexText is only compatible with Inkscape \
22-
1.3!$\n$\nClick Next to continue."
22+
1.4!$\n$\nClick Next to continue."
2323
!insertmacro MUI_PAGE_WELCOME
2424

2525
; License page

docs/source/conf.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@
2121
# -- Project information -----------------------------------------------------
2222

2323
project = 'TexText'
24-
copyright = '2023, TexText developers'
25-
author = 'Alexander Blinne, Antonio Russo, Brian Clarke, Florent Becker, Jan Winkler, Pit Garbe, Pauli Virtanen, Robert Szalai, Rafal Kolanski, Sergei Izmailov, Toru Araki, @veltsov, Vladislav Gavryusev'
24+
copyright = '2025, TexText developers'
25+
author = ('Alexander Blinne, Antonio Russo, Brian Clarke, dongguaguaguagua@github, Frank Skarman, Florent Becker, '
26+
'Jan Winkler, jocelynetienne@github, Jonas (the16thpythonist), Markus Wallerberger, Michael Struwig, '
27+
'Noel Kuntze, Patrick Kappl, Pit Garbe, Robert Szalai, Rafal Kolanski, Sergei Izmailov, Toru Araki, '
28+
'user202729@github, veltsov@github, Vladislav Gavryusev, xuestrange@github')
2629

2730
# The full version, including alpha/beta/rc tags
2831
release = open("../../textext/VERSION").readline().strip()
@@ -139,8 +142,8 @@
139142
# (source start file, target name, title,
140143
# author, documentclass [howto, manual, or own class]).
141144
latex_documents = [
142-
(master_doc, 'TexText.tex', 'TexText Documentation',
143-
'Alexander Blinne, Brian Clarke, Florent Becker, Jan Winkler, Pit Garbe, Pauli Virtanen, Robert Szalai, Rafal Kolanski, Sergei Izmailov, Toru Araki, @veltsov, Vladislav Gavryusev', 'manual'),
145+
(master_doc, 'TexText.tex', 'TexText Documentation', author,
146+
'manual'),
144147
]
145148

146149

docs/source/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ Key features
6666
usage/gui
6767
usage/faq
6868
usage/troubleshooting
69+
usage/command_line_usage
70+
usage/configuration
6971

7072

7173
.. toctree::

docs/source/install/advanced.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ options to adapt the installation process to your system configuration:
3838
--typst-executable TYPST_EXECUTABLE
3939
Full path to typst executable.
4040

41+
--use-tk
42+
Use the Tk Interface (tkinter) for the user interface instead of the GTK3 UI.
43+
This might be useful in cases where the GTK3 installation is broken, i.e.
44+
when loading of the framework works but execution errors occur. In that case
45+
TexText will not fall back to tkinter automatically. Hence, this switch can
46+
be used to bypass the GTK3 framework.
47+
4148
--portable-apps-dir INSTALLATION_DIRECTORY_OF_PORTABLEAPPS
4249
Windows only: If you use Inkscape from PortableApps use this parameter
4350
to specifiy the directory into which PortableApps has been installed, e.g.
@@ -58,7 +65,8 @@ options to adapt the installation process to your system configuration:
5865
Don't install extension (just check the requirements).
5966

6067
--keep-previous-installation-files
61-
Keep/discard files from previous installation, suppress prompt.
68+
Keep files from previous installation which might have been modified
69+
by the user (e.g. preamble files) without prompting the user
6270

6371
--all-users
6472
Install globally for all users (sudo/ admin privileges required)
@@ -71,3 +79,6 @@ options to adapt the installation process to your system configuration:
7179

7280
--color always, --color never
7381
Enables/disable console colors.
82+
83+
--verbose
84+
Print additional messages during setup

docs/source/install/linux.rst

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,30 +125,37 @@ For ArchLinux based systems with pacman as package manager
125125

126126
.. code-block:: bash
127127
128-
pacman -S inkscape
128+
sudo pacman -S inkscape
129129
130130
2. Due to a packaging error (as of Oct 25th 2024, see `this issue <https://gitlab.archlinux.org/archlinux/packaging/packages/inkscape/-/issues/6>`_)
131131
also install the following Python package:
132132

133133
.. code-block:: bash
134134
135-
pacman -S python-tinycss2
135+
sudo pacman -S python-tinycss2
136136
137-
3. Make sure you have a basic LaTeX system on your machine. At least the packages
137+
3. Optional: If you wish to have syntax highlighting and some other :ref:`nice features <usage-gui-config>`
138+
enabled in the |TexText|-Gui install GTKSourceView:
139+
140+
.. code-block:: bash
141+
142+
sudo pacman -S gtksourceview3
143+
144+
4. Make sure you have a basic LaTeX system on your machine. At least the packages
138145
:bash:`texlive-latex`, :bash:`texlive-latexrecommended`, :bash:`texlive-latexextra`
139146
are required. If not, install them:
140147

141148
.. code-block:: bash
142149
143150
pacman -S texlive-latex texlive-latexrecommended texlive-latexextra
144151
145-
4. Download the most recent |TexText| package from the
152+
5. Download the most recent |TexText| package from the
146153
:textext_current_release_page:`release`
147154
(direct links: :textext_download_zip:`Linux`, :textext_download_tgz:`Linux`).
148155

149-
5. Extract the package and change into the created directory.
156+
6. Extract the package and change into the created directory.
150157

151-
6. Run :bash:`setup.py` from your terminal:
158+
7. Run :bash:`setup.py` from your terminal:
152159

153160
.. code-block:: bash
154161
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
.. |TexText| replace:: **TexText**
2+
.. |Inkscape| replace:: **Inkscape 1.x**
3+
4+
.. role:: bash(code)
5+
:language: bash
6+
:class: highlight
7+
8+
.. role:: dos(code)
9+
:language: dos
10+
:class: highlight
11+
12+
13+
.. _commandlineusage:
14+
15+
==========================
16+
TexText Command Line Usage
17+
==========================
18+
19+
Next to the usage from within Inkscape |TexText| can also be invoked from the
20+
command line. This maybe used in third party apps or for debugging
21+
purposes.
22+
23+
.. contents:: :local:
24+
:depth: 2
25+
26+
Prerequisites
27+
=============
28+
29+
In order to use |TexText| from the command line some prerequisites must be met.
30+
At first, since |TexText| uses the Inkscape executable itself for the required
31+
pdf -> svg conversion, Inkscape must be installed on your system. Additionally,
32+
the path to the Inkscape extension system must be known.
33+
34+
Linux
35+
~~~~~
36+
37+
Since Inkscape is on your system all required Python libraries are already
38+
available for the system Python interpreter. You only have to ensure that the
39+
``PYTHONPATH`` variable contains the path to the Inkscape extension framework:
40+
41+
.. code-block:: bash
42+
43+
export PYTHONPATH=${PYTHONPATH}:/usr/share/inkscape/extensions
44+
45+
Windows
46+
~~~~~~~
47+
48+
On Windows Python is bundled within the Inkscape installation. You need to
49+
ensure that the Inkscape binary directory is in the system path so that
50+
``inkscape.exe`` and ``python.exe`` is found. Additionally, the ``PYTHONPATH``
51+
variable must contain the path to the Inkscape extension framework:
52+
53+
.. code-block:: doscon
54+
55+
set PATH=C:\Program Files\Inkscape\bin;%PATH%
56+
set PYTHONPATH=%PYTHONPATH%;C:\Program Files\Inkscape\share\inkscape\extensions
57+
58+
.. note::
59+
60+
If you are unsure where the Inkscape extension subsystem resides in your
61+
system execute the command
62+
63+
.. code-block:: bash
64+
65+
inkscape --system-data-directory
66+
67+
and add ``/extensions`` (or ``\extensions`` on Windows) to the output.
68+
69+
70+
Usage
71+
=====
72+
73+
On the command line, in principle, |TexText| operates as follows: It takes the
74+
content of an Inkscape SVG-document, does something with it (e.g. inserts a
75+
|TexText| object, modifies an existing |TexText| object, or re-compiles all
76+
existing |TexText| obejcts) and writes the resulting SVG-content into a new file
77+
or to ``stdout``.
78+
79+
The calling syntax is
80+
81+
.. code-block:: bash
82+
83+
python __main.py__ [-h] [--output OUTPUT] [--id IDS] [--selected-nodes SELECTED_NODES]
84+
[--text TEXT] [--preamble-file PREAMBLE_FILE]
85+
[--scale-factor SCALE_FACTOR] [--alignment ALIGNMENT]
86+
[--recompile-all-entries] [--tex_command TEX_COMMAND] [INPUT_FILE]
87+
88+
The function returns ``0`` in case compilation succeeded. It returns ``1``
89+
(bad setup) or ``60`` (program or compile errors) if execution failed.
90+
91+
Command Line Arguments
92+
======================
93+
94+
-h, --help
95+
Show help message and exit.
96+
97+
INPUT_FILE:
98+
The Inkscape SVG-file the content of with is taken and processed by
99+
|TexText|. This file is not modified. See the ``--output`` argument for
100+
more details.
101+
102+
--output OUTPUT
103+
Path of the file into which the output of |TexText| is written. If this
104+
argument is omitted the output is written to ``stdout``.
105+
106+
--id IDS
107+
The XML id attribute of the selected |TexText| object (or a list of ids
108+
if multiple are selected) in the SVG-Document one would like to modify.
109+
If this argument is omitted it is assumed that a new |TexText| object
110+
is going to be created and inserted into the SVG document. If the object
111+
is no |TexText| object nothing happens.
112+
113+
.. note::
114+
115+
Currently, |TexText| does only support a single id.
116+
117+
--selected-nodes SELECTED_NODES
118+
Not used by |TexText| (it is the XML id:subpath:position attribute
119+
of selected nodes of a path)
120+
121+
--text TEXT
122+
The LaTeX or typst code to compile. If this argument is omitted the GUI
123+
opens if ``--recompile-all-entries`` is not set. The GUI will show the
124+
content of the |TexText| object specified by ``--id`` or nothing if no id
125+
has been specified.
126+
127+
--preamble-file PREAMBLE_FILE
128+
Full path to the preamble file one would like to use for
129+
compilation.
130+
131+
--scale-factor SCALE_FACTOR
132+
The scale factor one would like to use for compilation. A scale factor
133+
``1.0`` means that the compiled LaTeX or typst output is inserted
134+
"as is" into the document.
135+
136+
--alignment ALIGNMENT
137+
Only evaluated when a |TexText| object is re-compiled. It controls how a
138+
modified |TexText| object is aligned with respect to the old object.
139+
Possible values are: ``top left``, ``top center``, ``top right``,
140+
``middle left``, ``middle center``, ``middle-right``, ``bottom left``,
141+
``bottom center``, and ``bottom right``.
142+
143+
--recompile-all-entries
144+
Re-compile all |TexText| objects found in the SVG-document. The
145+
``--id`` and ``--text`` arguments are ignored in that case.
146+
147+
--tex_command TEX_COMMAND
148+
The command used for compilation of the code passed via the ``--text``
149+
argument. Possible values are ``pdflatex``, ``xelatex``, ``lualatex``,
150+
and ``typst``. If this argument is omitted the default (``pdflatex``)
151+
is used.
152+
153+
Examples
154+
========
155+
156+
With showing the GUI
157+
~~~~~~~~~~~~~~~~~~~~
158+
159+
- Take ``empty.svg``, open the GUI, compile the code typed in there and insert
160+
the generated object into the document. Write the result to ``stdout``:
161+
162+
.. code-block:: bash
163+
164+
python __main__.py empty.svg
165+
166+
- From ``nonempty.svg`` take the object the ``id`` attribute of which has the
167+
value ``7`` and in case this is a |TexText| object pass its LaTeX code to the
168+
GUI. After modification of the code, compile it and replace the original
169+
object by the modified one and write the output to ``result.svg``:
170+
171+
.. code-block:: bash
172+
173+
python __main__.py --id 7 --output result.svg nonempty.svg
174+
175+
Without showing the GUI
176+
~~~~~~~~~~~~~~~~~~~~~~~
177+
178+
- Take ``empty.svg``, compile the code ``$x \in \mathbb{R}$`` using the preamble
179+
``my_preamble.tex`` and insert the result as a |TexText| object scaled by
180+
``2.0`` into the document. Write the result into the file ``result.svg``:
181+
182+
.. code-block:: bash
183+
184+
python __main__.py --text "$x \in \mathbb{R}$" --preamble-file "my_preamble.tex" --scale-factor 2.0 --output result.svg empty.svg
185+
186+
- Take ``nonempty.svg``, compile the code ``$x \in \mathbb{R}$`` using the preamble
187+
``my_preamble.tex``. Then, replace the |TexText| object the XML id attribute
188+
of which has the value ``7`` by the compiled result in such a way that the
189+
center of the new object matches the center of the old object. Write the
190+
result into the file ``result.svg``:
191+
192+
.. code-block:: bash
193+
194+
python __main__.py --id 7 --text "$x \in \mathbb{R}$" --preamble-file "my_preamble.tex" --alignment "middle center" --output result.svg empty.svg
195+
196+
- Recompile all |TexText| objects in ``nonempty.svg`` and write the result into
197+
``result.svg``:
198+
199+
.. code-block:: bash
200+
201+
python __main__.py --recompile-all-entries --output result.svg nonempty.svg

0 commit comments

Comments
 (0)