Am 01.12.2015 um 20:27 schrieb Rajil Saraswat: > Hello, > > I want the text used in svg images to be rendered using latex. > Inkscape provides instructions at > http://wiki.inkscape.org/wiki/index.php/LaTeX on how to do this with > Lyx. However this uses ERT and one loses the capability of seeing > previews within Lyx. > > Is it possible to modify the SVG convertor with lyx to automatically > carry out the steps given on the inkscape wiki mentioned above? > > Thanks >
Hi Rajil, instead of pasting the code \centering \def\svgwidth{\columnwidth} \input{exampleIFS.pdf_tex} into an ERT you can also just include the your_drawing.pdf_tex file as a child document. I have tested the following successfully: *) Inkscape: save your drawing as PDF with PDF+Latex checked *) Lyx: create a figure float, then inside the float got to Insert > File > Child document... and choose the your_drawing.pdf_tex file. From the pull down choose "Input" (important!) and check the "Show preview" box. Press OK. *) Due to a bug (http://www.lyx.org/trac/ticket/9786) the preview is not rendered immediately. Thus, you have to close and reopen your lyx document to get the preview rendered for the first time. But then, voilĂ , see the screenshot attached. (Note, that I deactivated the mathdesign package as I don't have it installed) The cool thing: you can now change the Inkscape document, save it as PDF+Latex and the preview in Lyx gets updated instantly. To implement the \centering command put your cursor next to the drawing in Lyx, press the right mouse button, choose Paragraph settings... and then Alignment > Center To change the width of the drawing (\def\svgwidth{\columnwidth} scales it to the width of the column) you have three options: *) Edit your_drawing.pdf_tex by putting \def\svgwidth{...} in its first line. Drawback: will be overwritten with the next PDF+Latex export from Inkscape *) put \def\svgwidth{...} in an ERT box just before the drawing (This won't affect the preview) *) Scale it to the desired size in Inkscape For a whole different approach, you should check out the TexText plugin for Inkscape: https://bitbucket.org/pv/textext It renders Latex text/formulas inside Inkscape and converts them to SVG David