ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Simple rings with svg
@ 2012-05-10 14:48 Ian Lawrence
  2012-05-10 14:59 ` Aditya Mahajan
  0 siblings, 1 reply; 12+ messages in thread
From: Ian Lawrence @ 2012-05-10 14:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I read on the wiki that now svg is natively supported. Hmm.

I am missing a trick here:

I try

___
\starttext

Hello world
\externalfigure[ChangingField_ILUC.pdf

\stoptext
__

And all goes as expected: I get output with the expected graphic in place

But if I try

___

\starttext

Hello world
\externalfigure[ChangingField_ILUC.svg]

\stoptext

___

I get :

!LuaTeX error: cannot find image file 'm_k_i_v_ChangingField_ILUC.pdf'
 ==> Fatal error occurred, no output PDF file produced!

Is it time to update context? From the date of the wiki revision it
seems not, since I am on ConTeXt  ver: 2011.11.29 23:11 MKIV

FWIW, I cannot find the intermediate file
'm_k_i_v_ChangingField_ILUC.pdf' on my disk either…both graphics files
are in the same location, both exist, both are named correctly….

Thanks

Ian
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Simple rings with svg
  2012-05-10 14:48 Simple rings with svg Ian Lawrence
@ 2012-05-10 14:59 ` Aditya Mahajan
  2012-05-10 15:00   ` Hans Hagen
  2012-05-10 15:22   ` Khaled Hosny
  0 siblings, 2 replies; 12+ messages in thread
From: Aditya Mahajan @ 2012-05-10 14:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 534 bytes --]

On Thu, 10 May 2012, Ian Lawrence wrote:

> I read on the wiki that now svg is natively supported. Hmm.

No. You need to have inkscape installed (and in your PATH) for svg to pdf 
conversion to work.

> FWIW, I cannot find the intermediate file
> 'm_k_i_v_ChangingField_ILUC.pdf' on my disk either…both graphics files
> are in the same location, both exist, both are named correctly….

@Hans, could we change the conversion so that it checks for inkscape and 
gives a more sensible warning if inkscape is absent?

Aditya

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Simple rings with svg
  2012-05-10 14:59 ` Aditya Mahajan
@ 2012-05-10 15:00   ` Hans Hagen
  2012-05-10 15:09     ` Marco
                       ` (2 more replies)
  2012-05-10 15:22   ` Khaled Hosny
  1 sibling, 3 replies; 12+ messages in thread
From: Hans Hagen @ 2012-05-10 15:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 10-5-2012 16:59, Aditya Mahajan wrote:
> On Thu, 10 May 2012, Ian Lawrence wrote:
>
>> I read on the wiki that now svg is natively supported. Hmm.
>
> No. You need to have inkscape installed (and in your PATH) for svg to
> pdf conversion to work.
>
>> FWIW, I cannot find the intermediate file
>> 'm_k_i_v_ChangingField_ILUC.pdf' on my disk either…both graphics files
>> are in the same location, both exist, both are named correctly….
>
> @Hans, could we change the conversion so that it checks for inkscape and
> gives a more sensible warning if inkscape is absent?

so what is a robust check ...


-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Simple rings with svg
  2012-05-10 15:00   ` Hans Hagen
@ 2012-05-10 15:09     ` Marco
  2012-05-10 16:50     ` Aditya Mahajan
  2012-05-10 17:47     ` Peter Münster
  2 siblings, 0 replies; 12+ messages in thread
From: Marco @ 2012-05-10 15:09 UTC (permalink / raw)
  To: ntg-context

On 2012-05-10 Hans Hagen <pragma@wxs.nl> wrote:

> > @Hans, could we change the conversion so that it checks for inkscape and
> > gives a more sensible warning if inkscape is absent?
> 
> so what is a robust check ...

I don't know about robustness, but “which inkscape” seems to be the
candidate from my point of view for POSIX systems. The windows
equivalent would be “WHERE inkscape” according to google (untested).

Marco


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Simple rings with svg
  2012-05-10 14:59 ` Aditya Mahajan
  2012-05-10 15:00   ` Hans Hagen
@ 2012-05-10 15:22   ` Khaled Hosny
  1 sibling, 0 replies; 12+ messages in thread
From: Khaled Hosny @ 2012-05-10 15:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, May 10, 2012 at 10:59:41AM -0400, Aditya Mahajan wrote:
> On Thu, 10 May 2012, Ian Lawrence wrote:
> 
> >I read on the wiki that now svg is natively supported. Hmm.
> 
> No. You need to have inkscape installed (and in your PATH) for svg
> to pdf conversion to work.
> 
> >FWIW, I cannot find the intermediate file
> >'m_k_i_v_ChangingField_ILUC.pdf' on my disk either…both graphics files
> >are in the same location, both exist, both are named correctly….
> 
> @Hans, could we change the conversion so that it checks for inkscape
> and gives a more sensible warning if inkscape is absent?

There is also rsvg-convert (from LibRSVG[1]) which can be faster (but in
some corner cases, as accurate as Inkscape).

[1] http://live.gnome.org/LibRsvg

Regards,
 Khaled
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Simple rings with svg
  2012-05-10 15:00   ` Hans Hagen
  2012-05-10 15:09     ` Marco
@ 2012-05-10 16:50     ` Aditya Mahajan
  2012-05-11  7:57       ` Hans Hagen
  2012-05-10 17:47     ` Peter Münster
  2 siblings, 1 reply; 12+ messages in thread
From: Aditya Mahajan @ 2012-05-10 16:50 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1066 bytes --]

On Thu, 10 May 2012, Hans Hagen wrote:

> On 10-5-2012 16:59, Aditya Mahajan wrote:
>> On Thu, 10 May 2012, Ian Lawrence wrote:
>> 
>>> I read on the wiki that now svg is natively supported. Hmm.
>> 
>> No. You need to have inkscape installed (and in your PATH) for svg to
>> pdf conversion to work.
>> 
>>> FWIW, I cannot find the intermediate file
>>> 'm_k_i_v_ChangingField_ILUC.pdf' on my disk either…both graphics files
>>> are in the same location, both exist, both are named correctly….
>> 
>> @Hans, could we change the conversion so that it checks for inkscape and
>> gives a more sensible warning if inkscape is absent?
>
> so what is a robust check ...

How about just implementing the unix which command in lua?

(untested code)

function which(string file)
   local path = os.getenv("PATH")
   local splitter = lpeg.splitat(io.fileseparator)
   local directories = lpeg.match(splitter, path)

   for dir in directories
     if io.exists(file.join(dir,file)) then
       return true
     end
   end

   return false
end

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Simple rings with svg
  2012-05-10 15:00   ` Hans Hagen
  2012-05-10 15:09     ` Marco
  2012-05-10 16:50     ` Aditya Mahajan
@ 2012-05-10 17:47     ` Peter Münster
  2012-05-11  7:53       ` Hans Hagen
  2 siblings, 1 reply; 12+ messages in thread
From: Peter Münster @ 2012-05-10 17:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, May 10 2012, Hans Hagen wrote:

> so what is a robust check ...

Perhaps just the exit code of the inkscape call?

-- 
           Peter
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Simple rings with svg
  2012-05-10 17:47     ` Peter Münster
@ 2012-05-11  7:53       ` Hans Hagen
  0 siblings, 0 replies; 12+ messages in thread
From: Hans Hagen @ 2012-05-11  7:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 10-5-2012 19:47, Peter Münster wrote:
> On Thu, May 10 2012, Hans Hagen wrote:
>
>> so what is a robust check ...
>
> Perhaps just the exit code of the inkscape call?

that's unpredictable (inkscape is just one of the programs that can be 
called)

-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Simple rings with svg
  2012-05-10 16:50     ` Aditya Mahajan
@ 2012-05-11  7:57       ` Hans Hagen
  2012-05-11  9:10         ` Ian Lawrence
  0 siblings, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2012-05-11  7:57 UTC (permalink / raw)
  To: Aditya Mahajan; +Cc: mailing list for ConTeXt users

On 10-5-2012 18:50, Aditya Mahajan wrote:
> On Thu, 10 May 2012, Hans Hagen wrote:
>
>> On 10-5-2012 16:59, Aditya Mahajan wrote:
>>> On Thu, 10 May 2012, Ian Lawrence wrote:
>>>
>>>> I read on the wiki that now svg is natively supported. Hmm.
>>>
>>> No. You need to have inkscape installed (and in your PATH) for svg to
>>> pdf conversion to work.
>>>
>>>> FWIW, I cannot find the intermediate file
>>>> 'm_k_i_v_ChangingField_ILUC.pdf' on my disk either…both graphics files
>>>> are in the same location, both exist, both are named correctly….
>>>
>>> @Hans, could we change the conversion so that it checks for inkscape and
>>> gives a more sensible warning if inkscape is absent?
>>
>> so what is a robust check ...
>
> How about just implementing the unix which command in lua?
>
> (untested code)

Indeed -)

It's more complicated as on windows there can be implicit 'exe', 'cmd', 
'bat' suffixes but some testing shows that a path checker is faster than 
calling which/where so I've added an os.[which|where] to l-os.lua that 
we can use.

I've added a check to the graphic converter code but didn't test (not in 
the mood to rename/remove programs and/or make a test file).

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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Simple rings with svg
  2012-05-11  7:57       ` Hans Hagen
@ 2012-05-11  9:10         ` Ian Lawrence
  2012-05-11  9:31           ` Marco
  0 siblings, 1 reply; 12+ messages in thread
From: Ian Lawrence @ 2012-05-11  9:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Aha,
Well, my contribution will be to adjust the wiki for simple minded
people like me…as I think my solution will be (if I decide for svg) to
batch convert these before launching the context build process.

Thanks to all

On 11 May 2012 08:57, Hans Hagen <pragma@wxs.nl> wrote:
> On 10-5-2012 18:50, Aditya Mahajan wrote:
>>
>> On Thu, 10 May 2012, Hans Hagen wrote:
>>
>>> On 10-5-2012 16:59, Aditya Mahajan wrote:
>>>>
>>>> On Thu, 10 May 2012, Ian Lawrence wrote:
>>>>
>>>>> I read on the wiki that now svg is natively supported. Hmm.
>>>>
>>>>
>>>> No. You need to have inkscape installed (and in your PATH) for svg to
>>>> pdf conversion to work.
>>>>
>>>>> FWIW, I cannot find the intermediate file
>>>>> 'm_k_i_v_ChangingField_ILUC.pdf' on my disk either…both graphics files
>>>>> are in the same location, both exist, both are named correctly….
>>>>
>>>>
>>>> @Hans, could we change the conversion so that it checks for inkscape and
>>>> gives a more sensible warning if inkscape is absent?
>>>
>>>
>>> so what is a robust check ...
>>
>>
>> How about just implementing the unix which command in lua?
>>
>> (untested code)
>
>
> Indeed -)
>
> It's more complicated as on windows there can be implicit 'exe', 'cmd',
> 'bat' suffixes but some testing shows that a path checker is faster than
> calling which/where so I've added an os.[which|where] to l-os.lua that we
> can use.
>
> I've added a check to the graphic converter code but didn't test (not in the
> mood to rename/remove programs and/or make a test file).
>
> 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
> -----------------------------------------------------------------
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to
> the Wiki!
>
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Simple rings with svg
  2012-05-11  9:10         ` Ian Lawrence
@ 2012-05-11  9:31           ` Marco
  2012-05-11  9:36             ` Hans Hagen
  0 siblings, 1 reply; 12+ messages in thread
From: Marco @ 2012-05-11  9:31 UTC (permalink / raw)
  To: ntg-context

On 2012-05-11 Ian Lawrence <physics.rooted@gmail.com> wrote:

> Well, my contribution will be to adjust the wiki

If you think the wiki needs to be updated, just go for it. I don't
know if it's the best place, but the inkscape dependency is
mentioned on the installation page:

http://wiki.contextgarden.net/ConTeXt_Standalone#Dependencies

> for simple minded people like me…as I think my solution will be
> (if I decide for svg) to batch convert these before launching the
> context build process.

Why? That's exactly what context does in the background. There's
generally no need to do it yourself, except if you have SVGs with
fancy effects (e.g. filters) that need a hand-tuned conversion.

Marco


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Simple rings with svg
  2012-05-11  9:31           ` Marco
@ 2012-05-11  9:36             ` Hans Hagen
  0 siblings, 0 replies; 12+ messages in thread
From: Hans Hagen @ 2012-05-11  9:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Marco

On 11-5-2012 11:31, Marco wrote:
> On 2012-05-11 Ian Lawrence<physics.rooted@gmail.com>  wrote:
>
>> Well, my contribution will be to adjust the wiki
>
> If you think the wiki needs to be updated, just go for it. I don't
> know if it's the best place, but the inkscape dependency is
> mentioned on the installation page:
>
> http://wiki.contextgarden.net/ConTeXt_Standalone#Dependencies
>
>> for simple minded people like me…as I think my solution will be
>> (if I decide for svg) to batch convert these before launching the
>> context build process.
>
> Why? That's exactly what context does in the background. There's
> generally no need to do it yourself, except if you have SVGs with
> fancy effects (e.g. filters) that need a hand-tuned conversion.

The context conversion keeps track of changes in the images, so updated 
images will be converted again. If you do the conversion outside of 
context you need to keep track of that yourself.

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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-05-11  9:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-10 14:48 Simple rings with svg Ian Lawrence
2012-05-10 14:59 ` Aditya Mahajan
2012-05-10 15:00   ` Hans Hagen
2012-05-10 15:09     ` Marco
2012-05-10 16:50     ` Aditya Mahajan
2012-05-11  7:57       ` Hans Hagen
2012-05-11  9:10         ` Ian Lawrence
2012-05-11  9:31           ` Marco
2012-05-11  9:36             ` Hans Hagen
2012-05-10 17:47     ` Peter Münster
2012-05-11  7:53       ` Hans Hagen
2012-05-10 15:22   ` Khaled Hosny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).