ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* TEXpage filename
@ 2013-05-01 10:16 Alan BRASLAU
  2013-05-01 14:16 ` Sietse Brouwer
  2013-05-01 21:02 ` Wolfgang Schuster
  0 siblings, 2 replies; 10+ messages in thread
From: Alan BRASLAU @ 2013-05-01 10:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello,

In the production of (scientific) articles for journal submissions,
one is often expected to supply the figures as separate files.

One workflow can be through the use of \startTEXpage\stopTEXpage
followed by an external extraction of single pdf pages to separate
files.

However, is it possible or would it be possible to directly output to a
named file, as in:
	\startTEXpage{figure1.pdf}
	\stopTEXpage
or perhaps
	\startTEXpage [file=figure1.pdf]
	\stopTEXpage
? (I could not find an answer looking at the source.)

One could then (optionally) reinclude the figure in a review copy of
the full text through the use of \externalfigure [figure1]

Alan
___________________________________________________________________________________
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] 10+ messages in thread

* Re: TEXpage filename
  2013-05-01 10:16 TEXpage filename Alan BRASLAU
@ 2013-05-01 14:16 ` Sietse Brouwer
  2013-05-01 21:11   ` Alan BRASLAU
  2013-05-01 21:02 ` Wolfgang Schuster
  1 sibling, 1 reply; 10+ messages in thread
From: Sietse Brouwer @ 2013-05-01 14:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Alan wrote:
> In the production of (scientific) articles for
> journal submissions, one is often expected to
> supply the figures as separate files.
>
> One workflow can be through the use of \startTEXpage\stopTEXpage
> followed by an external extraction of single pdf pages to separate
> files.

It might be easier to place the figure code in a separate file, with
some conditional code:
* if the figure file is being compiled directly, execute a
\startTEXpage ... \stopTEXpage at start and end
* if the figure file is not the compilation target, i.e. it is being
\input, skip the \startTEXpage and just include the figure code.

The MWE below *ought* to work, but it doesn't, and I can't get it
debugged. Perhaps \doifinputfileelse and \input don't play well
together? Assistance welcome!

Cheers,
Sietse

%%%% mwe-mode-text.tex

% 2013-05-01
\doifinputfileelse{mwe-mode-text.tex}{
    \startTEXpage
    This is standalone compilation: \jobname
}{\relax}

\placefigure[][fig:cow]
   {This is a cow}
   {\externalfigure[cow]}

\doifinputfileelse{mwe-mode-text.tex}{
    \stopTEXpage
}{\relax}


%%%% mwe-mode-text-parent.tex

\setuppapersize[A6]
\starttext

\section{Hello hello}

\input mwe-mode-text

\jobname

\stoptext
___________________________________________________________________________________
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] 10+ messages in thread

* Re: TEXpage filename
  2013-05-01 10:16 TEXpage filename Alan BRASLAU
  2013-05-01 14:16 ` Sietse Brouwer
@ 2013-05-01 21:02 ` Wolfgang Schuster
  2013-05-02  6:44   ` Wolfgang Schuster
  1 sibling, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2013-05-01 21:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 01.05.2013 um 12:16 schrieb Alan BRASLAU <alan.braslau@cea.fr>:

> Hello,
> 
> In the production of (scientific) articles for journal submissions,
> one is often expected to supply the figures as separate files.
> 
> One workflow can be through the use of \startTEXpage\stopTEXpage
> followed by an external extraction of single pdf pages to separate
> files.
> 
> However, is it possible or would it be possible to directly output to a
> named file, as in:
> 	\startTEXpage{figure1.pdf}
> 	\stopTEXpage
> or perhaps
> 	\startTEXpage [file=figure1.pdf]
> 	\stopTEXpage
> ? (I could not find an answer looking at the source.)
> 
> One could then (optionally) reinclude the figure in a review copy of
> the full text through the use of \externalfigure [figure1]

You can put each graphic in a separate document and tell context to
create a pdf with the \typesetfile command.

Creating a new environment which does all of this itself isn’t hard
because most of the stuff which is needed can be seen in the example
below.

% the external file

\startbuffer[figure-1]
\startTEXpage
\blackrule[width=4cm,height=4cm,color=blue]
\stopTEXpage
\stopbuffer

\savebuffer[list=figure-1,file=figure-1.tex,prefix=no]

% process the external file at runtime

\starttext
\placefigure{External file}{\typesetfile[figure-1]}
\stoptext

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] 10+ messages in thread

* Re: TEXpage filename
  2013-05-01 14:16 ` Sietse Brouwer
@ 2013-05-01 21:11   ` Alan BRASLAU
  0 siblings, 0 replies; 10+ messages in thread
From: Alan BRASLAU @ 2013-05-01 21:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Wed, 1 May 2013 16:16:07 +0200
Sietse Brouwer <sbbrouwer@gmail.com> wrote:

> Alan wrote:
> > In the production of (scientific) articles for
> > journal submissions, one is often expected to
> > supply the figures as separate files.
> >
> > One workflow can be through the use of \startTEXpage\stopTEXpage
> > followed by an external extraction of single pdf pages to separate
> > files.  
> 
> It might be easier to place the figure code in a separate file

This is one workflow that I classically use: as separate product in a
project. However, I was exploring how to include the figure (or table,
etc.) code in the standard product file with separate TEXpage output
streams.

Alan
___________________________________________________________________________________
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] 10+ messages in thread

* Re: TEXpage filename
  2013-05-01 21:02 ` Wolfgang Schuster
@ 2013-05-02  6:44   ` Wolfgang Schuster
  2013-05-04 11:50     ` Alan Bowen
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2013-05-02  6:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 01.05.2013 um 23:02 schrieb Wolfgang Schuster <schuster.wolfgang@gmail.com>:

> 
> Am 01.05.2013 um 12:16 schrieb Alan BRASLAU <alan.braslau@cea.fr>:
> 
>> Hello,
>> 
>> In the production of (scientific) articles for journal submissions,
>> one is often expected to supply the figures as separate files.
>> 
>> One workflow can be through the use of \startTEXpage\stopTEXpage
>> followed by an external extraction of single pdf pages to separate
>> files.
>> 
>> However, is it possible or would it be possible to directly output to a
>> named file, as in:
>> 	\startTEXpage{figure1.pdf}
>> 	\stopTEXpage
>> or perhaps
>> 	\startTEXpage [file=figure1.pdf]
>> 	\stopTEXpage
>> ? (I could not find an answer looking at the source.)
>> 
>> One could then (optionally) reinclude the figure in a review copy of
>> the full text through the use of \externalfigure [figure1]
> 
> You can put each graphic in a separate document and tell context to
> create a pdf with the \typesetfile command.

\startbuffer[extract:before]
  \startTEXpage
\stopbuffer

\startbuffer[extract:after]
  \stopTEXpage
\stopbuffer

\def\startextract
  {\dosingleempty\dostartextract}

\def\dostartextract[#1]%
  {\edef\extractfilename{#1}%
   \grabbufferdata[extract:content][startextract][stopextract]}

\def\stopextract
  {\doifsomething\extractfilename
     {\savebuffer[list={extract:before,extract:content,extract:after},file=\extractfilename.tex,prefix=no]%
      \typesetfile[\extractfilename][]}}

\starttext

\startplacefigure[title={External file}]
  \startextract[extract-1]
  \blackrule[width=4cm,height=4cm,color=orange]
  \stopextract
\stopplacefigure

\stoptext

> Creating a new environment which does all of this itself isn’t hard
> because most of the stuff which is needed can be seen in the example
> below.
> 
> % the external file
> 
> \startbuffer[figure-1]
> \startTEXpage
> \blackrule[width=4cm,height=4cm,color=blue]
> \stopTEXpage
> \stopbuffer
> 
> \savebuffer[list=figure-1,file=figure-1.tex,prefix=no]
> 
> % process the external file at runtime
> 
> \starttext
> \placefigure{External file}{\typesetfile[figure-1]}

The second argument for \typesetfile is needed to get this working:

\placefigure{External file}{\typesetfile[figure-1][]}

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] 10+ messages in thread

* Re: TEXpage filename
  2013-05-02  6:44   ` Wolfgang Schuster
@ 2013-05-04 11:50     ` Alan Bowen
  2013-05-04 16:00       ` Wolfgang Schuster
  0 siblings, 1 reply; 10+ messages in thread
From: Alan Bowen @ 2013-05-04 11:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Wolfgang—

Can this be extended so as to allow the extraction of the individual
component files (as PDFs with their component names) when processing a
product file?

Alan



On Thu, May 2, 2013 at 2:44 AM, Wolfgang Schuster <
schuster.wolfgang@gmail.com> wrote:

>
> Am 01.05.2013 um 23:02 schrieb Wolfgang Schuster <
> schuster.wolfgang@gmail.com>:
>
> >
> > Am 01.05.2013 um 12:16 schrieb Alan BRASLAU <alan.braslau@cea.fr>:
> >
> >> Hello,
> >>
> >> In the production of (scientific) articles for journal submissions,
> >> one is often expected to supply the figures as separate files.
> >>
> >> One workflow can be through the use of \startTEXpage\stopTEXpage
> >> followed by an external extraction of single pdf pages to separate
> >> files.
> >>
> >> However, is it possible or would it be possible to directly output to a
> >> named file, as in:
> >>      \startTEXpage{figure1.pdf}
> >>      \stopTEXpage
> >> or perhaps
> >>      \startTEXpage [file=figure1.pdf]
> >>      \stopTEXpage
> >> ? (I could not find an answer looking at the source.)
> >>
> >> One could then (optionally) reinclude the figure in a review copy of
> >> the full text through the use of \externalfigure [figure1]
> >
> > You can put each graphic in a separate document and tell context to
> > create a pdf with the \typesetfile command.
>
> \startbuffer[extract:before]
>   \startTEXpage
> \stopbuffer
>
> \startbuffer[extract:after]
>   \stopTEXpage
> \stopbuffer
>
> \def\startextract
>   {\dosingleempty\dostartextract}
>
> \def\dostartextract[#1]%
>   {\edef\extractfilename{#1}%
>    \grabbufferdata[extract:content][startextract][stopextract]}
>
> \def\stopextract
>   {\doifsomething\extractfilename
>
>  {\savebuffer[list={extract:before,extract:content,extract:after},file=\extractfilename.tex,prefix=no]%
>       \typesetfile[\extractfilename][]}}
>
> \starttext
>
> \startplacefigure[title={External file}]
>   \startextract[extract-1]
>   \blackrule[width=4cm,height=4cm,color=orange]
>   \stopextract
> \stopplacefigure
>
> \stoptext
>
> > Creating a new environment which does all of this itself isn’t hard
> > because most of the stuff which is needed can be seen in the example
> > below.
> >
> > % the external file
> >
> > \startbuffer[figure-1]
> > \startTEXpage
> > \blackrule[width=4cm,height=4cm,color=blue]
> > \stopTEXpage
> > \stopbuffer
> >
> > \savebuffer[list=figure-1,file=figure-1.tex,prefix=no]
> >
> > % process the external file at runtime
> >
> > \starttext
> > \placefigure{External file}{\typesetfile[figure-1]}
>
> The second argument for \typesetfile is needed to get this working:
>
> \placefigure{External file}{\typesetfile[figure-1][]}
>
> 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
>
> ___________________________________________________________________________________
>

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

* Re: TEXpage filename
  2013-05-04 11:50     ` Alan Bowen
@ 2013-05-04 16:00       ` Wolfgang Schuster
  2013-05-05 12:27         ` Alan Bowen
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfgang Schuster @ 2013-05-04 16:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 04.05.2013 um 13:50 schrieb Alan Bowen <bowenalan03@gmail.com>:

> Wolfgang—
> 
> Can this be extended so as to allow the extraction of the individual component files (as PDFs with their component names) when processing a product file?

There is no need for such a feature because you can process individual component files without problem, you have to add only a reference to the project or environment at the begin of each component.

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] 10+ messages in thread

* Re: TEXpage filename
  2013-05-04 16:00       ` Wolfgang Schuster
@ 2013-05-05 12:27         ` Alan Bowen
  2013-05-05 12:39           ` Thomas A. Schmitz
  0 siblings, 1 reply; 10+ messages in thread
From: Alan Bowen @ 2013-05-05 12:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Wolfgang: OK—but a clarification. Yes, that will give me the individual
component files, but not with the page numbers etc that they would have
when they are compiled as part of the product. What I am interested in is
the extraction of component files during the compilation of a larger
product file—in effect, I am trying to see a way to generate offprints
without having to dismantle a PDF file (the product) manually.

I suspect now that this is actually a new thread and apologize.

Alan


On Sat, May 4, 2013 at 12:00 PM, Wolfgang Schuster <
schuster.wolfgang@gmail.com> wrote:

>
> Am 04.05.2013 um 13:50 schrieb Alan Bowen <bowenalan03@gmail.com>:
>
> > Wolfgang—
> >
> > Can this be extended so as to allow the extraction of the individual
> component files (as PDFs with their component names) when processing a
> product file?
>
> There is no need for such a feature because you can process individual
> component files without problem, you have to add only a reference to the
> project or environment at the begin of each component.
>
> 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
>
> ___________________________________________________________________________________
>

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

* Re: TEXpage filename
  2013-05-05 12:27         ` Alan Bowen
@ 2013-05-05 12:39           ` Thomas A. Schmitz
  2013-05-08 12:00             ` Alan Bowen
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas A. Schmitz @ 2013-05-05 12:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 05/05/2013 02:27 PM, Alan Bowen wrote:
> Wolfgang: OK—but a clarification. Yes, that will give me the individual
> component files, but not with the page numbers etc that they would have
> when they are compiled as part of the product.

http://pragma-ade.com/general/magazines/mag-1103.pdf

HTH

Thomas
___________________________________________________________________________________
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] 10+ messages in thread

* Re: TEXpage filename
  2013-05-05 12:39           ` Thomas A. Schmitz
@ 2013-05-08 12:00             ` Alan Bowen
  0 siblings, 0 replies; 10+ messages in thread
From: Alan Bowen @ 2013-05-08 12:00 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Thanks, Thomas. This is good to have for many purposes. But, for the task
of generating PDFs of components that are part of a larger product, the
problem of cross-references is but one of several issues—especially if one
wants ConTeXt to do most (if not all)  of the work.

Alan


On Sun, May 5, 2013 at 8:39 AM, Thomas A. Schmitz <
thomas.schmitz@uni-bonn.de> wrote:

> On 05/05/2013 02:27 PM, Alan Bowen wrote:
>
>> Wolfgang: OK—but a clarification. Yes, that will give me the individual
>> component files, but not with the page numbers etc that they would have
>> when they are compiled as part of the product.
>>
>
> http://pragma-ade.com/general/**magazines/mag-1103.pdf<http://pragma-ade.com/general/magazines/mag-1103.pdf>
>
> HTH
>
> Thomas
>
> ______________________________**______________________________**
> _______________________
> 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 <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/<http://foundry.supelec.fr/projects/contextrev/>
> wiki     : http://contextgarden.net
> ______________________________**______________________________**
> _______________________
>

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

end of thread, other threads:[~2013-05-08 12:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-01 10:16 TEXpage filename Alan BRASLAU
2013-05-01 14:16 ` Sietse Brouwer
2013-05-01 21:11   ` Alan BRASLAU
2013-05-01 21:02 ` Wolfgang Schuster
2013-05-02  6:44   ` Wolfgang Schuster
2013-05-04 11:50     ` Alan Bowen
2013-05-04 16:00       ` Wolfgang Schuster
2013-05-05 12:27         ` Alan Bowen
2013-05-05 12:39           ` Thomas A. Schmitz
2013-05-08 12:00             ` Alan Bowen

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