ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* export images
@ 2015-03-21  2:09 Idris Samawi Hamid ادريس سماوي حامد
  2015-03-21  8:55 ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-03-21  2:09 UTC (permalink / raw)
  To: ntg-context

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

Dear gang,

How do we get images in the export? Here is my sample (also attached):

==============
\setupbackend[export=yes]

\starttext
\startalignment [middle]
\dontleavehmode
\externalfigure[mill.png]
\stopalignment
\stoptext
==============

div output:

==
<div>
    <div class="image" id="image-1"><!--empty--></div>
</div>
==

So it seems that \externalfigure[mill.png] is tagged in the output but the
image itself is ignored. What am I missing here? pdf output is correct; I
copied mill.png from the context sample folder

/tex/texmf-context/tex/context/sample/mill.png

(png too big to attach here)

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523

[-- Attachment #2: mill.tex --]
[-- Type: application/x-tex, Size: 135 bytes --]

[-- Attachment #3: 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] 5+ messages in thread

* Re: export images
  2015-03-21  2:09 export images Idris Samawi Hamid ادريس سماوي حامد
@ 2015-03-21  8:55 ` Wolfgang Schuster
  2015-03-21 11:01   ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2015-03-21  8:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> Am 21.03.2015 um 03:09 schrieb Idris Samawi Hamid ادريس سماوي حامد <ishamid@colostate.edu>:
> 
> Dear gang,
> 
> How do we get images in the export? Here is my sample (also attached):
> 
> ==============
> \setupbackend[export=yes]
> 
> \starttext
> \startalignment [middle]
> \dontleavehmode
> \externalfigure[mill.png]
> \stopalignment
> \stoptext
> ==============
> 
> div output:
> 
> ==
> <div>
>   <div class="image" id="image-1"><!--empty--></div>
> </div>
> ==
> 
> So it seems that \externalfigure[mill.png] is tagged in the output but the
> image itself is ignored. What am I missing here? pdf output is correct; I
> copied mill.png from the context sample folder
> 
> /tex/texmf-context/tex/context/sample/mill.png

Put mill.png in the images folder which should exist in the export folder.

Wolfgang
___________________________________________________________________________________
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] 5+ messages in thread

* Re: export images
  2015-03-21  8:55 ` Wolfgang Schuster
@ 2015-03-21 11:01   ` Idris Samawi Hamid ادريس سماوي حامد
  2015-03-21 12:11     ` Wolfgang Schuster
  0 siblings, 1 reply; 5+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-03-21 11:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, 21 Mar 2015 02:55:08 -0600, Wolfgang Schuster  
<schuster.wolfgang@gmail.com> wrote:

>
>> Am 21.03.2015 um 03:09 schrieb Idris Samawi Hamid ادريس سماوي حامد  
>> <ishamid@colostate.edu>:
>>
>> Dear gang,
>>
>> How do we get images in the export? Here is my sample (also attached):
>>
>> ==============
>> \setupbackend[export=yes]
>>
>> \starttext
>> \startalignment [middle]
>> \dontleavehmode
>> \externalfigure[mill.png]
>> \stopalignment
>> \stoptext
>> ==============
>>
>> div output:
>>
>> ==
>> <div>
>>   <div class="image" id="image-1"><!--empty--></div>
>> </div>
>> ==
>>
>> So it seems that \externalfigure[mill.png] is tagged in the output but  
>> the
>> image itself is ignored. What am I missing here? pdf output is correct;  
>> I
>> copied mill.png from the context sample folder
>>
>> /tex/texmf-context/tex/context/sample/mill.png
>
> Put mill.png in the images folder which should exist in the export  
> folder.

Thanks, Wolfgang!

One more question on this: How can I setup the images so that I don't have  
to toggle, e.g.

\externalfigure[basmalah.png][width=3in]
% \externalfigure[basmalah.pdf][width=3in]

Is there a way to tell the export to use the png option, while telling the  
pdf output to use the pdf? This is important when the image is made from a  
font (no needs scalability in the pdf). Thanks again, Wolfgang, and

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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] 5+ messages in thread

* Re: export images
  2015-03-21 11:01   ` Idris Samawi Hamid ادريس سماوي حامد
@ 2015-03-21 12:11     ` Wolfgang Schuster
  2015-03-21 13:33       ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Schuster @ 2015-03-21 12:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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


> Am 21.03.2015 um 12:01 schrieb Idris Samawi Hamid ادريس سماوي حامد <ishamid@colostate.edu>:
> 
> On Sat, 21 Mar 2015 02:55:08 -0600, Wolfgang Schuster <schuster.wolfgang@gmail.com <mailto:schuster.wolfgang@gmail.com>> wrote:
> 
>> 
>>> Am 21.03.2015 um 03:09 schrieb Idris Samawi Hamid ادريس سماوي حامد <ishamid@colostate.edu>:
>>> 
>>> Dear gang,
>>> 
>>> How do we get images in the export? Here is my sample (also attached):
>>> 
>>> ==============
>>> \setupbackend[export=yes]
>>> 
>>> \starttext
>>> \startalignment [middle]
>>> \dontleavehmode
>>> \externalfigure[mill.png]
>>> \stopalignment
>>> \stoptext
>>> ==============
>>> 
>>> div output:
>>> 
>>> ==
>>> <div>
>>>  <div class="image" id="image-1"><!--empty--></div>
>>> </div>
>>> ==
>>> 
>>> So it seems that \externalfigure[mill.png] is tagged in the output but the
>>> image itself is ignored. What am I missing here? pdf output is correct; I
>>> copied mill.png from the context sample folder
>>> 
>>> /tex/texmf-context/tex/context/sample/mill.png
>> 
>> Put mill.png in the images folder which should exist in the export folder.
> 
> Thanks, Wolfgang!
> 
> One more question on this: How can I setup the images so that I don't have to toggle, e.g.
> 
> \externalfigure[basmalah.png][width=3in]
> % \externalfigure[basmalah.pdf][width=3in]
> 
> Is there a way to tell the export to use the png option, while telling the pdf output to use the pdf? This is important when the image is made from a font (no needs scalability in the pdf).

You can try to use the *export mode to use different images for the XML and PDF output.


The first method is to drop the file extension and tell context to use the PNG files when the export is enabled.

%\setupbackend[export=yes] % uncomment to enable *export mode

\startmode[*export]
  \useexternalfigure[basmalah] [basmalah.png]
\stopmode

% possible but not necessary because ConTeXt prefers images in the PDF format
%
% \startnotmode[*export]
%   \useexternalfigure[basmalah] [basmalah.pdf]
% \stopnotmode

\starttext
\externalfigure[basmalah]
\stoptext


The second method is to specify which image should be used when the export is disabled/enabled.

%\setupbackend[export=yes] % uncomment to enable *export mode

\starttext

\doifmodeelse{*export}
  {\externalfigure[basmalah.png]}
  {\externalfigure[basmalah.pdf]}

\stoptext


The third method is to use two folders for the images in PDF and PNG format.

%\setupbackend[export=yes] % uncomment to enable *export mode

\doifmodeelse[*export]
  {\setupexternalfigures[directory=pngimages]}
  {\setupexternalfigures[directory=pdfimages]}

\starttext
\externalfigure[basmalah]
\stoptext


Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 11752 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] 5+ messages in thread

* Re: export images
  2015-03-21 12:11     ` Wolfgang Schuster
@ 2015-03-21 13:33       ` Idris Samawi Hamid ادريس سماوي حامد
  0 siblings, 0 replies; 5+ messages in thread
From: Idris Samawi Hamid ادريس سماوي حامد @ 2015-03-21 13:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Sat, 21 Mar 2015 06:11:24 -0600, Wolfgang Schuster  
<schuster.wolfgang@gmail.com> wrote:

>
>> Am 21.03.2015 um 12:01 schrieb Idris Samawi Hamid ادريس سماوي حامد  
>> <ishamid@colostate.edu>:
>>
>> On Sat, 21 Mar 2015 02:55:08 -0600, Wolfgang Schuster  
>> <schuster.wolfgang@gmail.com <mailto:schuster.wolfgang@gmail.com>>  
>> wrote:
>>
>>>
>>>> Am 21.03.2015 um 03:09 schrieb Idris Samawi Hamid ادريس سماوي حامد  
>>>> <ishamid@colostate.edu>:
>>>>
>>>> Dear gang,
>>>>
>>>> How do we get images in the export? Here is my sample (also attached):
>>>>
>>>> ==============
>>>> \setupbackend[export=yes]
>>>>
>>>> \starttext
>>>> \startalignment [middle]
>>>> \dontleavehmode
>>>> \externalfigure[mill.png]
>>>> \stopalignment
>>>> \stoptext
>>>> ==============
>>>>
>>>> div output:
>>>>
>>>> ==
>>>> <div>
>>>>  <div class="image" id="image-1"><!--empty--></div>
>>>> </div>
>>>> ==
>>>>
>>>> So it seems that \externalfigure[mill.png] is tagged in the output  
>>>> but the
>>>> image itself is ignored. What am I missing here? pdf output is  
>>>> correct; I
>>>> copied mill.png from the context sample folder
>>>>
>>>> /tex/texmf-context/tex/context/sample/mill.png
>>>
>>> Put mill.png in the images folder which should exist in the export  
>>> folder.
>>
>> Thanks, Wolfgang!
>>
>> One more question on this: How can I setup the images so that I don't  
>> have to toggle, e.g.
>>
>> \externalfigure[basmalah.png][width=3in]
>> % \externalfigure[basmalah.pdf][width=3in]
>>
>> Is there a way to tell the export to use the png option, while telling  
>> the pdf output to use the pdf? This is important when the image is made  
>> from a font (no needs scalability in the pdf).
>
> You can try to use the *export mode to use different images for the XML  
> and PDF output.
>
>
> The first method is to drop the file extension and tell context to use  
> the PNG files when the export is enabled.
>
> %\setupbackend[export=yes] % uncomment to enable *export mode
>
> \startmode[*export]
>   \useexternalfigure[basmalah] [basmalah.png]
> \stopmode
>
> % possible but not necessary because ConTeXt prefers images in the PDF  
> format
> %
> % \startnotmode[*export]
> %   \useexternalfigure[basmalah] [basmalah.pdf]
> % \stopnotmode
>
> \starttext
> \externalfigure[basmalah]
> \stoptext
>
>
> The second method is to specify which image should be used when the  
> export is disabled/enabled.
>
> %\setupbackend[export=yes] % uncomment to enable *export mode
>
> \starttext
>
> \doifmodeelse{*export}
>   {\externalfigure[basmalah.png]}
>   {\externalfigure[basmalah.pdf]}
>
> \stoptext
>
>
> The third method is to use two folders for the images in PDF and PNG  
> format.
>
> %\setupbackend[export=yes] % uncomment to enable *export mode
>
> \doifmodeelse[*export]
>   {\setupexternalfigures[directory=pngimages]}
>   {\setupexternalfigures[directory=pdfimages]}
>
> \starttext
> \externalfigure[basmalah]
> \stoptext

Thank you so much or the wisdom, Wolfgang; very much appreciated!

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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] 5+ messages in thread

end of thread, other threads:[~2015-03-21 13:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-21  2:09 export images Idris Samawi Hamid ادريس سماوي حامد
2015-03-21  8:55 ` Wolfgang Schuster
2015-03-21 11:01   ` Idris Samawi Hamid ادريس سماوي حامد
2015-03-21 12:11     ` Wolfgang Schuster
2015-03-21 13:33       ` Idris Samawi Hamid ادريس سماوي حامد

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