Re: [NTG-context] \externalfigure and file size
On Sat, 2012-01-21 at 01:22 +0100, Marco wrote:
On 2012-01-20 Kip Warner
wrote: So what does ConTeXt do when it typesets an \externalfigure? Does it always use inkscape, or only sometimes?
If the image type is supported by the TeX engine (jpeg, png, pdf, mps) it is directly included. SVG files inkscape is called to convert the SVG to PDF. For EPS images ghostscript is used:
strace results:
execve("/usr/bin/gs", ["gs", "-q", "-sDEVICE=pdfwrite", "-dNOPAUSE", "-dNOCACHE", "-dBATCH", "-dAutoRotatePages=/None", "-dPDFSETTINGS=/prepress", "-dEPSCrop", "-sOutputFile=m_k_i_v_graph.pdf", "graph.eps", "-c", "quit"], [/* 55 vars */])
Right, but since the average end user probably won't know that, doesn't that still suggest Inkscape be listed as a dependency? -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On 2012-01-20 Kip Warner
On Sat, 2012-01-21 at 01:22 +0100, Marco wrote:
On 2012-01-20 Kip Warner
wrote: So what does ConTeXt do when it typesets an \externalfigure? Does it always use inkscape, or only sometimes?
If the image type is supported by the TeX engine (jpeg, png, pdf, mps) it is directly included. SVG files inkscape is called to convert the SVG to PDF. For EPS images ghostscript is used:
strace results:
execve("/usr/bin/gs", ["gs", "-q", "-sDEVICE=pdfwrite", "-dNOPAUSE", "-dNOCACHE", "-dBATCH", "-dAutoRotatePages=/None", "-dPDFSETTINGS=/prepress", "-dEPSCrop", "-sOutputFile=m_k_i_v_graph.pdf", "graph.eps", "-c", "quit"], [/* 55 vars */])
Right, but since the average end user probably won't know that, doesn't that still suggest Inkscape be listed as a dependency?
As I mentioned before 99.9% of the system work fine without additional programs. You need inkscape only when you want to include SVG images. Having inkscape as a dependency means a huge bunch of data and disk space (inkscape incl. all dependencies like X,…). However, these external helpers (like ghostscript as well) should be listed as a recommendation or suggestion [not as dependency]). In that case the user is notified that he/she might get a benefit installing these programs. Marco
On 21-1-2012 01:40, Marco wrote:
However, these external helpers (like ghostscript as well) should be listed as a recommendation or suggestion [not as dependency]). In that case the user is notified that he/she might get a benefit installing these programs.
maybe a wiki page is a good start for that ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 2012-01-21 Hans Hagen
On 21-1-2012 01:40, Marco wrote:
However, these external helpers (like ghostscript as well) should be listed as a recommendation or suggestion [not as dependency]). In that case the user is notified that he/she might get a benefit installing these programs.
maybe a wiki page is a good start for that
I added the list you provided in the other post to the Dependency section on the installer page. http://wiki.contextgarden.net/ConTeXt_Standalone#Dependencies Marco
On Sat, 2012-01-21 at 01:55 +0100, Hans Hagen wrote:
maybe a wiki page is a good start for that
Strongly agree. -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On 21-1-2012 01:27, Kip Warner wrote:
On Sat, 2012-01-21 at 01:22 +0100, Marco wrote:
On 2012-01-20 Kip Warner
wrote: So what does ConTeXt do when it typesets an \externalfigure? Does it always use inkscape, or only sometimes?
If the image type is supported by the TeX engine (jpeg, png, pdf, mps) it is directly included. SVG files inkscape is called to convert the SVG to PDF. For EPS images ghostscript is used:
strace results:
execve("/usr/bin/gs", ["gs", "-q", "-sDEVICE=pdfwrite", "-dNOPAUSE", "-dNOCACHE", "-dBATCH", "-dAutoRotatePages=/None", "-dPDFSETTINGS=/prepress", "-dEPSCrop", "-sOutputFile=m_k_i_v_graph.pdf", "graph.eps", "-c", "quit"], [/* 55 vars */])
Right, but since the average end user probably won't know that, doesn't that still suggest Inkscape be listed as a dependency?
no, because not all users use svg (just an not all users use fonts defined in type-* files) and also because inkscape is close to impossible to install without x present which would render context 'unuseable due to a depency not being resolved' (in fact there is then also a dependency on a viewer) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Debian Packages, at least, we can declare, basically, 3 levels of
dependencies, according to
http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
1) Depends - absolute dependency. Or else, packages that is strictly
necessary to works well.
2) Recommends - strong, but not absolute dependency.
3) Suggests - used to declare that one package may be more useful with one
or more others.
So, I think Inkscape would fit well as 'context' Suggests.
--
Wagner Macedo
On 20 January 2012 21:54, Hans Hagen
no, because not all users use svg (just an not all users use fonts defined in type-* files) and also because inkscape is close to impossible to install without x present which would render context 'unuseable due to a depency not being resolved'
On 21-1-2012 04:31, Wagner Macedo wrote:
On Debian Packages, at least, we can declare, basically, 3 levels of dependencies, according to http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
1) Depends - absolute dependency. Or else, packages that is strictly necessary to works well. 2) Recommends - strong, but not absolute dependency. 3) Suggests - used to declare that one package may be more useful with one or more others.
So, I think Inkscape would fit well as 'context' Suggests.
so in fact that would then be a list of programs that are optionally called from within context: ghostscript : for converting ps images to pdf graphicmagick : for converting gif and tif inkscape : for converting svg(z) zint : for providing barcodes curl : for some remote content pstoedit : converts ps to mp outlines maybe I forget a few. (btw, does anyone know if installing x-less inkscape on linux is an option some day) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Sat, 2012-01-21 at 00:31 -0300, Wagner Macedo wrote:
On Debian Packages, at least, we can declare, basically, 3 levels of dependencies, according to http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
1) Depends - absolute dependency. Or else, packages that is strictly necessary to works well. 2) Recommends - strong, but not absolute dependency. 3) Suggests - used to declare that one package may be more useful with one or more others.
So, I think Inkscape would fit well as 'context' Suggests.
-- Wagner Macedo
Copied the package maintainer. -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On Sat, 2012-01-21 at 01:54 +0100, Hans Hagen wrote:
no, because not all users use svg (just an not all users use fonts defined in type-* files) and also because inkscape is close to impossible to install without x present which would render context 'unuseable due to a depency not being resolved'
(in fact there is then also a dependency on a viewer)
If Inkscape isn't installed and the user \externalfigure's an SVG, is an error raised with ConTeXt? -- Kip Warner -- Software Engineer OpenPGP encrypted/signed mail preferred http://www.thevertigo.com
On 2012-01-23 Kip Warner
If Inkscape isn't installed and the user \externalfigure's an SVG, is an error raised with ConTeXt?
Yes and no. An error is raised, but no hint that inkscape is missing. ConTeXt says: !LuaTeX error: cannot find image file 'm_k_i_v_pic.pdf' ==> Fatal error occurred, no output PDF file produced! mtx-context | fatal error: return code: 70 It assumes that the conversion was successful and the converted file is present, that's at least what I read from the error message. A more user friendly error message would be: !LuaTeX error: cannot find inkscape to convert image file 'pic.svg' ==> Fatal error occurred, no output PDF file produced! Marco
On Sat, Jan 21, 2012 at 1:27 AM, Kip Warner
Right, but since the average end user probably won't know that, doesn't that still suggest Inkscape be listed as a dependency?
hm, no.
Suppose this situation: me and you agree on a context beta version and a pdf reader and you send me your tex file with 1) a png/jpeg image or a pdf file as externalfigure. Then my pdf and your pdf must be the same, and on average the reader will show the same result. Otherwise probably is a bug. 2) a swf. Then my pdf and your pdf must be the same, but probably the reader will not show the same result -- basically only acroread is able to show swf inside a pdf, and it depends to the OS and version 3) a svg image. PDF spec. doesn't support SVG, so we must also agree on the same program to convert the svg into a bitmap or vector image, and this is a problem: as you have seen, the conversion require a bit of experience. After all, it's not strange if inkscape 0.40 and 0.48 display the same svg in different way --- and the same for the pdfs. Actually, only an expert user can use inkscape to automatically convert an svg to pdf/png without (appreciable) errors, and this kind of user is also able to install the correct version of inkscape (which is much easier to install under windows then linux,btw). So, if you are creating a svg by tourself, it's better to check that the pdf and png are the same if you want to be sure that your image will be printed/display correctly --- there aren't so many programs that completely support the svg standard. ConTeXt then helps this kind of expert user because they are able "a priori" to understand if a svg image is problematic or not . -- luigi
participants (5)
-
Hans Hagen
-
Kip Warner
-
luigi scarso
-
Marco
-
Wagner Macedo