In Tex Text in Inkscape, I omit \documentclass{article}, \begin{document}, and \end{document}, leaving only \usepackage{mls} in the preamble and \bithe{manju gisun} in the main body. This gives the above error.

UPDATE

Just to clarify what I'm ultimately seeking to do, by any means possible:

I'm trying to reconstruct this page:

Other people seem to use Adobe Indesign for this purpose, a program I don't have access to, as in this example:

@Mårten I have TeX Text v0.4.4 and the pdlatex compiler is called by default, not xelatex. In order to use the latter, changes to the file textext.py (which can be found in \Inkscape\share\extensions) would probably be necessary. Also, have you considered exporting graphics to a PDF with all the text put into a .tex file as opposed to using TeX Text? There are various advantages to the PDF+LaTeX approach.
–
nnunesJan 28 '13 at 3:10

@NunoNunes I should try to change the compiler to xelatex. However, I can't find the file textext.py using locate in the Mac OS terminal. I installed Inkscape through macports; is the file located somewhere else? As for the PDF+LaTeX approach, I have tried it, but it's difficult to get the Manchu text to align properly, since the output will look very different from the command \bithe{TEXT}. What I want to do is to build pages that look like this: db.tt/fwitsmQc (I don't have Adobe Indesign, which people usually use for this kind of stuff, as in: tinyurl.com/b8vy7yg)
–
MårtenJan 28 '13 at 14:49

@Mårten Did you follow these instructions? If yes, you should find textext.py in ~/.inkscape/extensions/ or ~/.inkscape/extensions/textext-0.4.4. I can call the xelatex compiler by modifying line 730 of textext.py, but TeX Text will complain if fontspec is loaded.
–
nnunesJan 28 '13 at 23:53

1 Answer
1

The following answer is a possible workaround (or a poor man's thread-bound Chinese book) using the PDF+LaTeX approach to Inkscape and pdflatex. Some parts of it, if not all, can probably be adapted to xelatex.

One strategy to solve the issue of text alignment in Inkscape is to use zero-width \makebox boxes in combination with \colorbox and \raisebox commands, since the contents of LR (left-right) boxes can be arbitrarily complex [The LaTeX Companion, p. 860].

preamble

The new declarations you need depend on the problem at hand. Although I'm unfamiliar with Mongolian and Manju (and what exactly are the language requirements to recreate a thread-bound Chinese book), I had a look at the montex manual and defined three new commands, \ibox, \icbox and \ipbox.

The first two commands, \ibox and \icbox, are ideally suited for the following montex commands:

\bosoo
\mbosoo
\mobosoo
\mabosoo

The first argument of both commands is optional, whilst the second argument controls horizontal text alignment relative to the object anchor (in Inkscape): [l] makes text stick out to the right; [c] centres it; [r] makes text stick out to the left. The only difference between the two commands is that \ibox lays text below the object anchor, whilst \icbox centres the text vertically relative to it.

\ipbox is better suited for vertical text boxes constructed with \mobox or \mabox. The first argument is optional, and the third argument is used to control vertical alignment of the box about the anchor,

\ipbox{...}{<value>}{...}

where <value> is a fraction of the total box height, so:

<value> = 0 lays text below the anchor

<value> = 0.5 centres text vertically

<value> = 1.0 lays text above the anchor

patch for Inkscape (optional)

The PDF+LaTeX option generates two files with extensions .pdf and .pdf_tex. If you have many files, re-exporting all SVG files to PDF becomes time consuming. Below you'll find a patch for Inkscape (add it to your preamble), so that when you modify one of your SVG files, running pdflatex on your main .tex file will cause Inkscape to re-export that SVG file to PDF automatically.

For the patch to work you'll need to (1) add Inkscape to the search path of your operating system and (2) pass the command line argument -shell-escape (or perhaps --shell-escape) to the pdflatex compiler. The latter depends on your settings: operating system and editor. You'll find instructions for Texmaker (or TeXStudio) here, and for TeXworks (on Windows) here (see step 2).

the Inkscape environment

Here's a screenshot of how I included text objects in Inkscape:

The red circle indicates the anchor position of that text object. The anchor position is controlled in Inkscape by the setting the type of text alignment (left, center, right). It determines the point relative to which text is to be placed by \ibox, etc..

Yellow, dashed lines are auxiliary lines for text alignment (saved to another layer on Inkscape). Anchor of text objects is aligned with these lines.

Font size on Inkscape has no effect on final result.

Ensure Inkscape's bounding box sits tightly around the main frame (it's ok if some text objects stick out of the frame). One way to do it: select the entire drawing except(!) for the text objects, then go to Document Properties, Resize page to content, and click on Resize page to drawing or selection.

For including graphics with the patch, replace \input by \includesvg. For example, if you place a copy of all three Inkscape files in a child folder graphics, then use

\includesvg[graphics/]{cnbook}

End result:

vertical display of CJK characters

The solution is to place \rotateboxinside the argument of \ibox (not the other way around). However, this command was declared with Mongolian and Manju in mind, so you may need to tweak it for other languages. For Chinese characters in the Ming typeface \ibox may look a bit odd, consider:

If you find this strategy useful, it might be easier to include montex commands inside the declarations of \ibox, \icbox and \ipbox. This way you can lay text in Inkscape in a less verbose manner.
–
nnunesJan 29 '13 at 2:28

This is wonderful and exactly what I need. However, I don't quite understand, so I fail to produce it. How do I "(1) add Inkscape to the search path of your operating system and (2) enable --shell-escape"? I tried to use \input instead as you suggested, while deleting the code for the patch from the preamble, but the placement of the Inkscape illustration is almost completely outside the page. Could you please give me a minimal example without the patch so that I can work that part out first, and then work in the patch when I got the simpler version working? Thank you so much!
–
MårtenJan 29 '13 at 4:28

Thank you so much! That works PERFECTLY. Fantastic. However, I hate to say that now I ran into another difficulty: getting the CJK characters to display vertically (as in the picture I'm reconstructing, posted above). I tried to choose vertical text in the box in Inkscape, use \\ after every character inside the \ibox{c}{大\\清\\全\\書}, use \setCJKmainfont[RawFeature={vertical}] for my CJK font (I use xeCJK), and put the text in a \rotatebox{-90}{\ibox{c}{大清全書}}, but none of it worked. Would you know how to do this?
–
MårtenJan 29 '13 at 16:31

Well, first of all I will make sure to thank you when I use these illustrations for a presentation in a Manchu studies seminar in 2 weeks, and later when I eventually publish on this. Again, thank you so much! This will help me for years to come. I've built the page: db.tt/lpA5iWxi
–
MårtenJan 30 '13 at 15:12