ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Figure Help
@ 2011-11-04  2:58 Kip Warner
  2011-11-04  3:22 ` Pontus Lurcock
  2011-11-04  9:32 ` Hans Hagen
  0 siblings, 2 replies; 12+ messages in thread
From: Kip Warner @ 2011-11-04  2:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 419 bytes --]

Hey list,

Two questions. Is it possible to define / declare a figure with one
command instead of having to do something like...

\useexternalfigure[SomeFigure][Images/Figure.svg]
\externalfigure[SomeFigure][width=2.5cm]

Also, how do I shift the figure right a few centimetres in from the left
side?

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- 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: Figure Help
  2011-11-04  2:58 Figure Help Kip Warner
@ 2011-11-04  3:22 ` Pontus Lurcock
  2011-11-04  9:32 ` Hans Hagen
  1 sibling, 0 replies; 12+ messages in thread
From: Pontus Lurcock @ 2011-11-04  3:22 UTC (permalink / raw)
  To: ntg-context

On Thu 03 Nov 2011, Kip Warner wrote:

> Two questions. Is it possible to define / declare a figure with one
> command instead of having to do something like...
> 
> \useexternalfigure[SomeFigure][Images/Figure.svg]
> \externalfigure[SomeFigure][width=2.5cm]

Sure, \externalfigure[Images/Figure.svg] should do it.

> Also, how do I shift the figure right a few centimetres in from the
> left side?

I guess the most direct way would be

\hskip 3cm \externalfigure[Images/Figure.svg]

but other solutions may be more appropriate depending on your overall
requirements.

HTH,

Pont
___________________________________________________________________________________
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: Figure Help
  2011-11-04  2:58 Figure Help Kip Warner
  2011-11-04  3:22 ` Pontus Lurcock
@ 2011-11-04  9:32 ` Hans Hagen
  2011-11-08  3:26   ` Kip Warner
  2011-11-11  4:18   ` Kip Warner
  1 sibling, 2 replies; 12+ messages in thread
From: Hans Hagen @ 2011-11-04  9:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Kip Warner

On 4-11-2011 03:58, Kip Warner wrote:
> Hey list,
>
> Two questions. Is it possible to define / declare a figure with one
> command instead of having to do something like...
>
> \useexternalfigure[SomeFigure][Images/Figure.svg]
> \externalfigure[SomeFigure][width=2.5cm]


\externalfigure[Images/Figure.svg][width=2.5cm]


-----------------------------------------------------------------
                                           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: Figure Help
  2011-11-04  9:32 ` Hans Hagen
@ 2011-11-08  3:26   ` Kip Warner
  2011-11-08  5:21     ` Pontus Lurcock
  2011-11-08 16:59     ` Willi Egger
  2011-11-11  4:18   ` Kip Warner
  1 sibling, 2 replies; 12+ messages in thread
From: Kip Warner @ 2011-11-08  3:26 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 423 bytes --]

On Fri, 2011-11-04 at 10:32 +0100, Hans Hagen wrote:
> 
> \externalfigure[Images/Figure.svg][width=2.5cm] 

Thanks Hans, but all I see is a grey box with the following in it where
I expected to see the image:

name: dummy
file:
figure:Figure
state: unknown

I've checked the path and it looks correct.

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- 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: Figure Help
  2011-11-08  3:26   ` Kip Warner
@ 2011-11-08  5:21     ` Pontus Lurcock
  2011-11-08 16:59     ` Willi Egger
  1 sibling, 0 replies; 12+ messages in thread
From: Pontus Lurcock @ 2011-11-08  5:21 UTC (permalink / raw)
  To: ntg-context

On Mon 07 Nov 2011, Kip Warner wrote:

> > \externalfigure[Images/Figure.svg][width=2.5cm] 
> 
> Thanks Hans, but all I see is a grey box with the following in it where
> I expected to see the image:
> 
> name: dummy
> file:
> figure:Figure
> state: unknown
> 
> I've checked the path and it looks correct.

See if it works with a PDF file. SVG support is not 100% -- on MkII it
can only be done using Inkscape for preprocessing, and on MkIV support
is ‘via preprocessing and limited’ according to
http://wiki.contextgarden.net/File_Formats .

Pont
___________________________________________________________________________________
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: Figure Help
  2011-11-08  3:26   ` Kip Warner
  2011-11-08  5:21     ` Pontus Lurcock
@ 2011-11-08 16:59     ` Willi Egger
  2011-11-09 20:58       ` Christian
  1 sibling, 1 reply; 12+ messages in thread
From: Willi Egger @ 2011-11-08 16:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

May be I missed one or the other mail on this topic.
There is indeed support for svg-inclusion in MKIV. In order to be possibly of help I would like you to send a minimal example.

Willi
On 8 Nov 2011, at 04:26, Kip Warner wrote:

> On Fri, 2011-11-04 at 10:32 +0100, Hans Hagen wrote:
>> 
>> \externalfigure[Images/Figure.svg][width=2.5cm] 
> 
> Thanks Hans, but all I see is a grey box with the following in it where
> I expected to see the image:
> 
> name: dummy
> file:
> figure:Figure
> state: unknown
> 
> I've checked the path and it looks correct.
> 
> -- 
> Kip Warner -- Software Engineer
> OpenPGP encrypted/signed mail preferred
> http://www.thevertigo.com
> ___________________________________________________________________________________
> 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: Figure Help
  2011-11-08 16:59     ` Willi Egger
@ 2011-11-09 20:58       ` Christian
  2011-11-09 21:41         ` Aditya Mahajan
  0 siblings, 1 reply; 12+ messages in thread
From: Christian @ 2011-11-09 20:58 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

[-- Attachment #1: Type: text/plain, Size: 677 bytes --]

> May be I missed one or the other mail on this topic.
> There is indeed support for svg-inclusion in MKIV. In order to be possibly of
> help I would like you to send a minimal example.

Since I'm also interested in this and fail to get it working, please allow me to provide such an example. The svg-file is taken of the german Wikipedia-article of the svg file format. It includes fonts, I'm not sure if this causes trouble.

Note: When I include the extension in the filename (testimage.svg) I get "!LuaTeX error: cannot find image file 'm_k_i_v_testimage.pdf'" probably due to some failed conversion stuff. If I omit the .svg, I get a dummy frame in the pdf output.

[-- Attachment #2: minimal-svg.tex --]
[-- Type: application/octet-stream, Size: 118 bytes --]

\starttext
\placefigure[here][figure:svg]{Testin svg-support.}{\externalfigure[testimage.svg][method=svg]}
\stoptext

[-- Attachment #3: testimage.svg --]
[-- Type: image/svg+xml, Size: 7027 bytes --]

[-- Attachment #4: 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: Figure Help
  2011-11-09 20:58       ` Christian
@ 2011-11-09 21:41         ` Aditya Mahajan
  2011-11-09 21:49           ` Christian
  0 siblings, 1 reply; 12+ messages in thread
From: Aditya Mahajan @ 2011-11-09 21:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 9 Nov 2011, Christian wrote:

>> May be I missed one or the other mail on this topic.
>> There is indeed support for svg-inclusion in MKIV. In order to be possibly of
>> help I would like you to send a minimal example.
>
> Note: When I include the extension in the filename (testimage.svg) I get 
> "!LuaTeX error: cannot find image file 'm_k_i_v_testimage.pdf'" probably 
> due to some failed conversion stuff.

Is write18 enables? Do you have inkscape binary in your PATH?

Aditya
___________________________________________________________________________________
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: Figure Help
  2011-11-09 21:41         ` Aditya Mahajan
@ 2011-11-09 21:49           ` Christian
  2011-11-09 22:08             ` Aditya Mahajan
  2011-11-10  8:57             ` Hans Hagen
  0 siblings, 2 replies; 12+ messages in thread
From: Christian @ 2011-11-09 21:49 UTC (permalink / raw)
  To: 'mailing list for ConTeXt users'

> >> May be I missed one or the other mail on this topic.
> >> There is indeed support for svg-inclusion in MKIV. In order to be
> >> possibly of help I would like you to send a minimal example.
> >
> > Note: When I include the extension in the filename (testimage.svg) I
> > get "!LuaTeX error: cannot find image file 'm_k_i_v_testimage.pdf'"
> > probably due to some failed conversion stuff.
> 
> Is write18 enables? Do you have inkscape binary in your PATH?

Well, no and no. And the way I see it, proper svg support should not need a prior conversion to pdf done by an entirely different program.
If I wanted that, I can as well save it as pdf or convert it myself. 

I knew about the detour via inkscape, but I hoped for native support.

So I guess svg is not supported then?

___________________________________________________________________________________
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: Figure Help
  2011-11-09 21:49           ` Christian
@ 2011-11-09 22:08             ` Aditya Mahajan
  2011-11-10  8:57             ` Hans Hagen
  1 sibling, 0 replies; 12+ messages in thread
From: Aditya Mahajan @ 2011-11-09 22:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> I knew about the detour via inkscape, but I hoped for native support.
>
> So I guess svg is not supported then?

The current implmentation (at least when I looked at it 3 months back) 
called inkscape to convert svg to pdf. IIRC, it is possible to configure 
which program is used to do the conversion, but there is no native 
support. The main reason is that there is no native support in pdftex or 
luatex binaries.

Support for svg can be added in two ways, either linking an svg library 
with the luatex binary or writing an svg to pdf converted in lua.
___________________________________________________________________________________
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: Figure Help
  2011-11-09 21:49           ` Christian
  2011-11-09 22:08             ` Aditya Mahajan
@ 2011-11-10  8:57             ` Hans Hagen
  1 sibling, 0 replies; 12+ messages in thread
From: Hans Hagen @ 2011-11-10  8:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 9-11-2011 22:49, Christian wrote:
>>>> May be I missed one or the other mail on this topic.
>>>> There is indeed support for svg-inclusion in MKIV. In order to be
>>>> possibly of help I would like you to send a minimal example.
>>>
>>> Note: When I include the extension in the filename (testimage.svg) I
>>> get "!LuaTeX error: cannot find image file 'm_k_i_v_testimage.pdf'"
>>> probably due to some failed conversion stuff.
>>
>> Is write18 enables? Do you have inkscape binary in your PATH?
>
> Well, no and no. And the way I see it, proper svg support should not need a prior conversion to pdf done by an entirely different program.
> If I wanted that, I can as well save it as pdf or convert it myself.
>
> I knew about the detour via inkscape, but I hoped for native support.
>
> So I guess svg is not supported then?

no, and it would be a typical example of adding something to the engine 
that's bigger than the engine itself which is definitely not on our 
agenda (the leaner the meaner)

also, converting svg runtime and doing that each run is pretty 
inefficient; the mkiv runtime conversion only converts (using inkscape) 
when the file has changed and including a pdf file is pretty fast

(the same is true for png files: the pfd format supports png compression 
which is not the same as embedding png so for some variants it's better 
to convert beforehand so that inclusion is faster)

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: Figure Help
  2011-11-04  9:32 ` Hans Hagen
  2011-11-08  3:26   ` Kip Warner
@ 2011-11-11  4:18   ` Kip Warner
  1 sibling, 0 replies; 12+ messages in thread
From: Kip Warner @ 2011-11-11  4:18 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 269 bytes --]

Hey Hans. I think I figured out why it wasn't displaying properly. I was
putting the figure alias where \externalfigure was expecting the path to
the figure.

-- 
Kip Warner -- Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- 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

end of thread, other threads:[~2011-11-11  4:18 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-04  2:58 Figure Help Kip Warner
2011-11-04  3:22 ` Pontus Lurcock
2011-11-04  9:32 ` Hans Hagen
2011-11-08  3:26   ` Kip Warner
2011-11-08  5:21     ` Pontus Lurcock
2011-11-08 16:59     ` Willi Egger
2011-11-09 20:58       ` Christian
2011-11-09 21:41         ` Aditya Mahajan
2011-11-09 21:49           ` Christian
2011-11-09 22:08             ` Aditya Mahajan
2011-11-10  8:57             ` Hans Hagen
2011-11-11  4:18   ` Kip Warner

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).