WriteTeX

An Inkscape extension: Latex/Tex editor for Inkscape

View project on GitHub

WriteTeX

Logo

An Inkscape extension: Latex/Tex editor for Inkscape, inspired by textext.

This extension uses Inkscape build-in extension system, does not require TK or PyGtk as textext. Live preview feature is supported. You can obtain original TeX source from View Original TeX tab.

Note to users

Theoretically, Inkscape supports import pdf text as path in the lastest version. This extension should be expired. If you still think this plugin is useful, please star this project in the github repository. It helps me to evaluate whether this plugin is needed anymore. Thanks!

理论上讲,新版的Inkscape已经支持将PDF中文字导入为路径,这个插件的功能应该已经过时。如果你仍然觉得这个插件有用,请在项目源代码库star这个项目,这可以帮助我了解这个插件的需求。谢谢!

Installation

Just drop writetex.py and writetex.inx to Inkscape extension folder, which is normally at $inkscapeFolder$/share/extensions. Make sure you have at least one LaTeX command and one PDFtoSVG converter are in your path. The lastest release can be downloaded from here.

Binaries for PDFTOSVG converter

For ease of the users, I also provide unofficial PDFTOSVG binaries for Windows and Mac OSX users.

  • For Windows user, binary version of pdf2svg is provided.
  • For Mac OSX user, binary version of both pstoedit and pdf2svg are provided.
  • For Linux and other OS, pdf2svg or pstoedit usually can be installed from default package manager.

Usage

1. Latex text input

The basic UI is like this:

UI

By default, WriteTeX use XeLatex to convert text to pdf. If you wish to use pdflatex, just change the command in the code. You can use PDF2SVG or PDFtoEDIt to convert PDF to SVG. There are slightly difference in trading SVGs generated by PDF2SVG and PDFtoEDIT.

Normally, WriteTeX trys to keep transform in old and new object. But you can override this behavior by check the Rescale checkbox, which will rescale the object by current scale factor accordingly.

2. Input from file

For long text, you may want to edit it in your TeX editor. You only need to write the body of the text. Paste the path of the file in to the EditBox. If you want to specify preamble file, specify it in the Preamble File EditBox. Then you are good to go.

FromFile

3. View original TeX string

Due to the limitation of Inkscape build-in extension system, I cannot set default TeX Text as the original TeX string. Therefore, we have this bypass function. If you want to edit the original TeX strings, use this function to obtain you original TeX Strings. Then edit the strings. Here is a demo on obtain original TeX strings:

OldTex

From v1.5 on, the text can also be directly written to the current layer:

OldTex

4. Customize latex command

Detailed information can be found in this page.

Additional information

Please refer to my website for more information about me and the extension.