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
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
On Wed, 1 May 2013 16:16:07 +0200
Sietse Brouwer
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
Am 01.05.2013 um 12:16 schrieb Alan BRASLAU
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
Am 01.05.2013 um 23:02 schrieb Wolfgang Schuster
Am 01.05.2013 um 12:16 schrieb Alan BRASLAU
: 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
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
: 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
___________________________________________________________________________________
Am 04.05.2013 um 13:50 schrieb Alan Bowen
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
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
: 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
___________________________________________________________________________________
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
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.pdfhttp://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 ______________________________**______________________________** _______________________
participants (5)
-
Alan Bowen
-
Alan BRASLAU
-
Sietse Brouwer
-
Thomas A. Schmitz
-
Wolfgang Schuster