Re: Inkscape /LyX integration (working!)
Le 06/09/2016 à 05:48, Vermeer Martin a écrit : Pavel thanks! Attached the changes you proposed (though still to HEAD). Yes, the Inkscape bug is known upstream. Fixing seems to be a bit tricky as it is due to a change in the Cairo library, aimed at enabling the output of "layers", transparent or not, covering or covered by text strings. But of course Inkscape should know itself how many PDF pages it is outputting... Someone please push if this passes muster Hi Martin, I have rebased your patches against master and it works. One thing I have noticed is that the preview provided by the external inset does not update when one changes the surrounding text. For instance the preview can fail because of a missing package and it will not update after correcting the preamble, or it will not reflect the surrounding font. In practice it works much better to wrap the ExternalInset in a preview inset, which takes the surroundings into account for updating the preview. Also, is it possible to enable the resizing options from the dialog? Do you want me to commit the patches? Guillaume
RE: Inkscape /LyX integration (working!)
Pavel thanks! Attached the changes you proposed (though still to HEAD). Yes, the Inkscape bug is known upstream. Fixing seems to be a bit tricky as it is due to a change in the Cairo library, aimed at enabling the output of "layers", transparent or not, covering or covered by text strings. But of course Inkscape should know itself how many PDF pages it is outputting... Someone please push if this passes muster Martin From: Pavel Sanda [sa...@lyx.org] Sent: Monday, September 05, 2016 9:35 PM To: Vermeer Martin Cc: lyx-devel@lists.lyx.org; Jean-Marc Lasgouttes Subject: Re: Inkscape /LyX integration (working!) Vermeer Martin wrote: > From ed2997e78e5015cb4eff2a988c729fd1f1cde216 Mon Sep 17 00:00:00 2001 > From: Martin Vermeer <mverm...@aalto.fi> > Date: Sat, 3 Sep 2016 17:17:45 +0300 > Subject: [PATCH] Initial commit of Inkscape SVG LaTeX + PDF support > > Based on Daniel Groger's work of five years ago, with minor changes > > diff --git a/lib/Makefile.am b/lib/Makefile.am > index 1da5b97..99d9fe4 100644 > --- a/lib/Makefile.am > +++ b/lib/Makefile.am > @@ -2316,6 +2316,8 @@ dist_scripts_DATA += \ > scripts/fen2ascii.py \ > scripts/fig2pdftex.py \ > scripts/fig2pstex.py \ > + scripts/svg2pdftex.py \ > + scripts/svg2pstex.py \ > scripts/fig_copy.py \ > scripts/html2latexwrapper.py \ > scripts/include_bib.py \ Shouldn't workaround.png be part of some makefile as well? Also item in RELEASE-NOTES about new template could be added. > diff --git a/lib/doc/EmbeddedObjects.lyx b/lib/doc/EmbeddedObjects.lyx > index 713eab1..eb10ca3 100644 > --- a/lib/doc/EmbeddedObjects.lyx > +++ b/lib/doc/EmbeddedObjects.lyx > @@ -1,5 +1,5 @@ > -#LyX 2.2 created this file. For more info see http://www.lyx.org/ > -\lyxformat 508 > +#LyX 2.3 created this file. For more info see http://www.lyx.org/ > +\lyxformat 512 > \begin_document > \begin_header > \save_transient_properties true I believe 2.x version + CT tracking is currently encouraged for documentation improvements even in master unless you directly use new feature. > +figure This experimental template supports images created with the program > + > +\begin_inset CommandInset href > +LatexCommand href > +name "Inkscape" > +target "https://fi.wikipedia.org/wiki/Inkscape; This url should have been en not fi I guess. > +++ b/lib/external_templates > @@ -290,6 +290,48 @@ Template XFig > TemplateEnd > > > +Template Inkscape > + GuiName "Inkscape figure" > + HelpText > + An Inkscape figure. I would put here small note that this template allows the text font inside .svg look like the latex font around. > + This template should work flawlessly with Inkscape 0.48. > + For Inkscape 0.91, there is a bug in the LaTeX + PDF output > + which makes a workaround necessary, see Embedded Objects manual. Is this bug known to Inkscape devs, i.e. is this going to be fixed in forthcoming versions? Apart from those I would say go and commit. Pavel From ed2997e78e5015cb4eff2a988c729fd1f1cde216 Mon Sep 17 00:00:00 2001 From: Martin Vermeer <mverm...@aalto.fi> Date: Sat, 3 Sep 2016 17:17:45 +0300 Subject: [PATCH 01/10] Initial commit of Inkscape SVG LaTeX + PDF support Based on Daniel Groger's work of five years ago, with minor changes http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg169820.html This extends the support for Xfig LaTeX + PDF to a more modern and actively developed vector graphics editor. Embedded Objects manual updated, also to include a workaround for an Inkscape 0.91 bug. --- lib/Makefile.am | 2 + lib/configure.py| 6 ++- lib/doc/EmbeddedObjects.lyx | 117 +++- lib/doc/workaround.png | Bin 0 -> 17450 bytes lib/external_templates | 42 lib/scripts/svg2pdftex.py | 57 + lib/scripts/svg2pstex.py| 49 +++ 7 files changed, 269 insertions(+), 4 deletions(-) create mode 100644 lib/doc/workaround.png create mode 100644 lib/scripts/svg2pdftex.py create mode 100644 lib/scripts/svg2pstex.py diff --git a/lib/Makefile.am b/lib/Makefile.am index 1da5b97..99d9fe4 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -2316,6 +2316,8 @@ dist_scripts_DATA += \ scripts/fen2ascii.py \ scripts/fig2pdftex.py \ scripts/fig2pstex.py \ + scripts/svg2pdftex.py \ + scripts/svg2pstex.py \ scripts/fig_copy.py \ scripts/html2latexwrapper.py \ scripts/include_bib.py \ diff --git a/lib/configure.py b/lib/configure.py index d3d1c31..e2f43d3 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -711,9 +711,9 @@ def checkFormatEntries(dtl_tools): \Format jlyx cjklyx "CJK LyX 1.4
Re: Inkscape /LyX integration (working!)
Vermeer Martin wrote: > From ed2997e78e5015cb4eff2a988c729fd1f1cde216 Mon Sep 17 00:00:00 2001 > From: Martin Vermeer> Date: Sat, 3 Sep 2016 17:17:45 +0300 > Subject: [PATCH] Initial commit of Inkscape SVG LaTeX + PDF support > > Based on Daniel Groger's work of five years ago, with minor changes > > diff --git a/lib/Makefile.am b/lib/Makefile.am > index 1da5b97..99d9fe4 100644 > --- a/lib/Makefile.am > +++ b/lib/Makefile.am > @@ -2316,6 +2316,8 @@ dist_scripts_DATA += \ > scripts/fen2ascii.py \ > scripts/fig2pdftex.py \ > scripts/fig2pstex.py \ > + scripts/svg2pdftex.py \ > + scripts/svg2pstex.py \ > scripts/fig_copy.py \ > scripts/html2latexwrapper.py \ > scripts/include_bib.py \ Shouldn't workaround.png be part of some makefile as well? Also item in RELEASE-NOTES about new template could be added. > diff --git a/lib/doc/EmbeddedObjects.lyx b/lib/doc/EmbeddedObjects.lyx > index 713eab1..eb10ca3 100644 > --- a/lib/doc/EmbeddedObjects.lyx > +++ b/lib/doc/EmbeddedObjects.lyx > @@ -1,5 +1,5 @@ > -#LyX 2.2 created this file. For more info see http://www.lyx.org/ > -\lyxformat 508 > +#LyX 2.3 created this file. For more info see http://www.lyx.org/ > +\lyxformat 512 > \begin_document > \begin_header > \save_transient_properties true I believe 2.x version + CT tracking is currently encouraged for documentation improvements even in master unless you directly use new feature. > +figure This experimental template supports images created with the program > + > +\begin_inset CommandInset href > +LatexCommand href > +name "Inkscape" > +target "https://fi.wikipedia.org/wiki/Inkscape; This url should have been en not fi I guess. > +++ b/lib/external_templates > @@ -290,6 +290,48 @@ Template XFig > TemplateEnd > > > +Template Inkscape > + GuiName "Inkscape figure" > + HelpText > + An Inkscape figure. I would put here small note that this template allows the text font inside .svg look like the latex font around. > + This template should work flawlessly with Inkscape 0.48. > + For Inkscape 0.91, there is a bug in the LaTeX + PDF output > + which makes a workaround necessary, see Embedded Objects manual. Is this bug known to Inkscape devs, i.e. is this going to be fixed in forthcoming versions? Apart from those I would say go and commit. Pavel
RE: Inkscape /LyX integration (working!)
Attached a git patch for your consideration ;-) Martin From: Pavel Sanda [sa...@lyx.org] Sent: Thursday, September 01, 2016 10:41 PM To: Jean-Marc Lasgouttes Cc: lyx-devel@lists.lyx.org; Vermeer Martin Subject: Re: Inkscape /LyX integration (working!) Jean-Marc Lasgouttes wrote: > Of course, I can give you git access :) +1 Pavel From ed2997e78e5015cb4eff2a988c729fd1f1cde216 Mon Sep 17 00:00:00 2001 From: Martin Vermeer <mverm...@aalto.fi> Date: Sat, 3 Sep 2016 17:17:45 +0300 Subject: [PATCH] Initial commit of Inkscape SVG LaTeX + PDF support Based on Daniel Groger's work of five years ago, with minor changes http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg169820.html This extends the support for Xfig LaTeX + PDF to a more modern and actively developed vector graphics editor. Embedded Objects manual updated, also to include a workaround for an Inkscape 0.91 bug. --- lib/Makefile.am | 2 + lib/configure.py| 6 ++- lib/doc/EmbeddedObjects.lyx | 117 +++- lib/doc/workaround.png | Bin 0 -> 17450 bytes lib/external_templates | 42 lib/scripts/svg2pdftex.py | 57 + lib/scripts/svg2pstex.py| 49 +++ 7 files changed, 269 insertions(+), 4 deletions(-) create mode 100644 lib/doc/workaround.png create mode 100644 lib/scripts/svg2pdftex.py create mode 100644 lib/scripts/svg2pstex.py diff --git a/lib/Makefile.am b/lib/Makefile.am index 1da5b97..99d9fe4 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -2316,6 +2316,8 @@ dist_scripts_DATA += \ scripts/fen2ascii.py \ scripts/fig2pdftex.py \ scripts/fig2pstex.py \ + scripts/svg2pdftex.py \ + scripts/svg2pstex.py \ scripts/fig_copy.py \ scripts/html2latexwrapper.py \ scripts/include_bib.py \ diff --git a/lib/configure.py b/lib/configure.py index d3d1c31..e2f43d3 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -711,9 +711,9 @@ def checkFormatEntries(dtl_tools): \Format jlyx cjklyx "CJK LyX 1.4.x (euc-jp)" "" "" "" "document" "" \Format klyx cjklyx "CJK LyX 1.4.x (euc-kr)" "" "" "" "document" "" \Format lyxpreview lyxpreview "LyX Preview" "" "" "" "" "" -\Format pdftex pdftex_t PDFTEX"" "" "" "" "" +\Format pdftex "pdftex_t, pdf_tex" PDFTEX"" "" "" "" "" \Format program"" Program"" "" "" "" "" -\Format pstex pstex_t PSTEX "" "" "" "" "" +\Format pstex "pstex_t, ps_tex" PSTEX "" "" "" "" "" \Format wmfwmf"Windows Metafile" "" "" "" "vector" "image/x-wmf" \Format emfemf"Enhanced Metafile" "" "" "" "vector" "image/x-emf" \Format wordhtml "html, htm" "HTML (MS Word)""" "" "" "document" "" @@ -933,6 +933,8 @@ def checkConverterEntries(): \converter figppm"fig2dev -L ppm $$i $$o" "" \converter figsvg"fig2dev -L svg $$i $$o" "" \converter figpng"fig2dev -L png $$i $$o" "" +\converter svgpdftex "python -tt $$s/scripts/svg2pdftex.py $$i $$o" "" +\converter svgpstex "python -tt $$s/scripts/svg2pstex.py $$i $$o" "" \converter figpdftex "python -tt $$s/scripts/fig2pdftex.py $$i $$o" "" \converter figpstex "python -tt $$s/scripts/fig2pstex.py $$i $$o" ""''') # diff --git a/lib/doc/EmbeddedObjects.lyx b/lib/doc/EmbeddedObjects.lyx index 713eab1..eb10ca3 100644 --- a/lib/doc/EmbeddedObjects.lyx +++ b/lib/doc/EmbeddedObjects.lyx @@ -1,5 +1,5 @@ -#LyX 2.2 created this file. For more info see http://www.lyx.org/ -\lyxformat 508 +#LyX 2.3 created this file. For more info see http://www.lyx.org/ +\lyxformat 512 \begin_document \begin_header \save_transient_properties true @@ -171,6 +171,7 @@ graphicboxes \font_osf false \font_sf_scale 100 100 \font_tt_scale 100 100 +\use_microtype false \graphics default \default_output_format pdf2 \output_sync 0 @@ -38609,6 +38610,118 @@ target "http://en.wikipedia.org/wiki/Xfig; . \end_layout +\begin_layout Description +Inkscape +\begin_inset space ~
RE: Inkscape /LyX integration (working!)
Actually git access to a personal working branch only... would be enough. I cloned the lyx git and got it working, only for qt4 though Martin From: Pavel Sanda [sa...@lyx.org] Sent: Thursday, September 01, 2016 10:41 PM To: Jean-Marc Lasgouttes Cc: lyx-devel@lists.lyx.org; Vermeer Martin Subject: Re: Inkscape /LyX integration (working!) Jean-Marc Lasgouttes wrote: > Of course, I can give you git access :) +1 Pavel
Re: Inkscape /LyX integration (working!)
Jean-Marc Lasgouttes wrote: > Of course, I can give you git access :) +1 Pavel
Re: Inkscape /LyX integration (working!)
Le 01/09/2016 à 07:40, Vermeer Martin a écrit : Only to the old SVN I suppose, not git. I'm not even subscribed to this list any more... If you can prepare a proper commit, we'll push it. Of course, I can give you git access :) JMarc
RE: Inkscape /LyX integration (working!)
Only to the old SVN I suppose, not git. I'm not even subscribed to this list any more... Martin From: Pavel Sanda [sa...@lyx.org] Sent: Thursday, September 01, 2016 1:37 AM To: Vermeer Martin Cc: lyx-devel@lists.lyx.org Subject: Re: Inkscape /LyX integration (working!) Vermeer Martin wrote: > What racoon said. > > It makes the difference between "good enough" and "great" :-) Well if it makes difference for you then why not. Just try to explain in the description of template how it's different from normal svg import. Do you still have commit rights? Pavel
Re: Inkscape /LyX integration (working!)
Vermeer Martin wrote: > What racoon said. > > It makes the difference between "good enough" and "great" :-) Well if it makes difference for you then why not. Just try to explain in the description of template how it's different from normal svg import. Do you still have commit rights? Pavel
Re: Inkscape /LyX integration (working!)
Le 19/08/2016 à 19:19, Vermeer Martin a écrit : Just noticed that a similar, more extensive and probably allround better project was completed back in 2011 by one Daniel Groger... great minds think alike! http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg169820.html But why is this not in the tree already? Sound very interesting. Is anybody ready to help writing the documentation? Also, does the instant preview inset work with it?
Re: Inkscape /LyX integration (working!)
Den 20. aug. 2016 01:35, skrev racoon: If understood correctly, the point is that svg inserted in the "normal" way doesn't replaces all text with the (surrounding) document font. At least the replacement seems to be the case in the attached PDF file and what is the main idea in the link http://tug.ctan.org/tex-archive/info/svg-inkscape/InkscapePDFLaTeX.pdf. Yes, this is an important feature. Figure fonts that follow the document font(s) effortlessly, and with LaTeX math capability. this is one of the important reasons for using xfig & tikz - another such format is very good to have. Figures with their own font, fonts that scale with the figure and so don't match anything, or (worst of all) pixellated fonts; it looks unprofessional or half-done. Helge Hafting
Re: Inkscape /LyX integration (working!)
What racoon said. It makes the difference between "good enough" and "great" :-) BTW I installed Daniel Groger's stuff and it seems to work flawlessly also with LyX 2.1.4. http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg169820.html Martin
Re: Inkscape /LyX integration (working!)
On 20.08.2016 00:34, Pavel Sanda wrote: Vermeer Martin wrote: Just noticed that a similar, more extensive and probably allround better project was completed back in 2011 by one Daniel Groger... great minds think alike! http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg169820.html But why is this not in the tree already? What is exactly the point of having external template for inkscape when you can already insert .svg figure in the same way as any other picture through insert->graphics? If understood correctly, the point is that svg inserted in the "normal" way doesn't replaces all text with the (surrounding) document font. At least the replacement seems to be the case in the attached PDF file and what is the main idea in the link http://tug.ctan.org/tex-archive/info/svg-inkscape/InkscapePDFLaTeX.pdf. Using the method explained there, I used to export files manually that from Inkscape. So this step won't be necessary then anymore, right? Daniel
Re: Inkscape /LyX integration (working!)
Vermeer Martin wrote: > > Just noticed that a similar, more extensive and probably allround better > project was completed back in 2011 by one Daniel Groger... great minds think > alike! > > http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg169820.html > > But why is this not in the tree already? What is exactly the point of having external template for inkscape when you can already insert .svg figure in the same way as any other picture through insert->graphics? Pavel
RE: Inkscape /LyX integration (working!)
Just noticed that a similar, more extensive and probably allround better project was completed back in 2011 by one Daniel Groger... great minds think alike! http://www.mail-archive.com/lyx-devel%40lists.lyx.org/msg169820.html But why is this not in the tree already? Martin
Re: Inkscape /LyX integration (working!)
Nice work! One thing I'd ask you to look into --- work out how the Scribus folks get CMYK pdfs out of Inkscape, and include thusly, so that black is not defined as RGB, so that when separated to CMYK it will appear on all plates William On Fri, Aug 19, 2016 at 10:03 AM, Vermeer Martinwrote: > Dear developers, > > I have been looking at the possibility to use Inkscape as my integrated > vector graphics / diagrams editor for LyX, in the same way that I am now > using XFig. Xfig is a fine program, but getting really old. I expect that > within a few years it will fall off the map. Up till now it has been > maintained, sort of, but the user base is probably not large. > > Writing an external template for Inkscape turned out to be the work of one > afternoon, and getting it to run wasn't too hard either, copying and > pasting from the XFig template. See attached. I had much use from this doc: > > http://tug.ctan.org/tex-archive/info/svg-inkscape/InkscapePDFLaTeX.pdf > > Then you have to add file format and converter info, see attached. And a > test document. > > One thing I like about Inkscape vs. XFig is, that it automatically adapts > also the font _size_ to the surrounding text. You can freely rescale the > graphics, the figure text will come out correctly size after LaTeX > compilation. If you really want a text label in non-standard size, just add > \Large in front... > > Importing .fig figures into Inkscape works seamlessly... but dollar signs > around math disappear and have to be added by hand. Perhaps there is a > solution to this, but I haven't looked. > > I hope this can be included in a future LyX version. > > Best regards, > > Martin