Code document and simpleslides and create in one go the document with simpleslides added
Is there an easy way to write a Context document and also code simpleslides in the same document so that the simpleslides are automatically added to the document as for example an appendix? Ie one tex document with Context code, perhaps with some \input and something like a two-pass job. I was thinking if the simpleslides could be saved as a number of png images and then with the recurse add them to the document with placefigure. Jeroen
Am 31.07.2021 um 15:27 schrieb Jeroen via ntg-context
: Is there an easy way to write a Context document and also code simpleslides in the same document so that the simpleslides are automatically added to the document as for example an appendix? Ie one tex document with Context code, perhaps with some \input and something like a two-pass job. I was thinking if the simpleslides could be saved as a number of png images and then with the recurse add them to the document with placefigure.
Why via PNG? And why recurse? You can include PDFs. Try \copypages or \filterpages. Hraban
On 7/31/21 3:27 PM, Jeroen via ntg-context wrote:
Is there an easy way to write a Context document and also code simpleslides in the same document so that the simpleslides are automatically added to the document as for example an appendix? Ie one tex document with Context code, perhaps with some \input and something like a two-pass job. Hi Jeroen,
not sure this might help you (I’m not sure you intend a single source file, in addition to a single PDF document), but here you have: \startbuffer[slides] \setuppapersize[CD] \setupbodyfont[60pt] \starttext \dorecurse{25} {\startmakeup[standard][pagestate=start, style={\ss\bf}, align=center] Slide \pagenumber \stopmakeup} \stoptext \stopbuffer \savebuffer[list=slides, file=\jobname_slides.tex, prefix=no] \starttext \startbodymatter \dorecurse{25}{\input zapf\par} \typesetfile[\jobname_slides.tex][--purgeall][object=no, width=0pt] \stopbodymatter \startappendices \getfiguredimensions[\jobname_slides.pdf] \dorecurse{\noffigurepages} {\startTEXpage \externalfigure[\jobname_slides.pdf][page=\recurselevel] \stopTEXpage} \stopappendices \stoptext BTW, I cannot get simpleslides working with LMTX.
I was thinking if the simpleslides could be saved as a number of png images and then with the recurse add them to the document with placefigure. \externalfigure is your friend here and there is no need to convert the slides to PNG (see above).
Just in case it may help, Pablo -- http://www.ousia.tk
On 7/31/21 4:06 PM, Pablo Rodriguez via ntg-context wrote:
BTW, I cannot get simpleslides working with LMTX.
I had to make some slight adjustments but have been to lazy to upload a new and improved version. One reason being that I can't remember my username and password for the modules section of the garden... I'll have to ask Taco to reset it for me. Thomas
I worked around it, instead of simpleslides just use larger fonts to with regular pages \startbuffer[slides] \setuptolerance[ horizontal, tolerant, stretch] \setuppapersize[ A4,landscape] \setuplayout[ width=middle, backspace=35mm, cutspace=35mm, height=middle, topspace=5mm, bottomspace=20mm] \setuppagenumbering[ location={footer,center}] \setuphead [section] [page={yes}] \usetypescript[pagella] \setupbodyfont[pagella,18pt] \setupbodyfontenvironment[ 28pt][ % For body d=36pt, % For title a=12pt, % For author & date ] \setuptype[style=medium] \setuptyping[typing][bodyfont=16pt] \setupwhitespace[medium] \setbreakpoints[compound] \setuphead[chapter][style=\bfd] \setuphead[section][style=\bfc] \setuphead[subsection][style=\bfb] \setuphead[subsubsection][style=\bf] \setupitemize[autointro] % prevent orphan list intro \setupitemize[indentnext=no] \starttext \startsection[title={MySlideTitle},ref={myref1}] Body text \startitemize \item Item 1 \item Item 2 \stopitemize \stopsection \startsection[title={MySlideTitle},ref={myref2}] Body text \stopsection \stoptext\starttext text \stoptext \stopbuffer \savebuffer[list=slides, file=\jobname_slides.tex, prefix=no] \starttext \startbodymatter \dorecurse{25}{\input zapf\par} \typesetfile[\jobname_slides.tex][--purgeall][object=no, width=0pt] \stopbodymatter \startappendices \getfiguredimensions[\jobname_slides.pdf] \dorecurse{\noffigurepages} {\startTEXpage \externalfigure[\jobname_slides.pdf][page=\recurselevel] \stopTEXpage} \stopappendices \stoptext Op za 31 jul. 2021 om 16:22 schreef Thomas A. Schmitz via ntg-context < ntg-context@ntg.nl>:
On 7/31/21 4:06 PM, Pablo Rodriguez via ntg-context wrote:
BTW, I cannot get simpleslides working with LMTX.
I had to make some slight adjustments but have been to lazy to upload a new and improved version. One reason being that I can't remember my username and password for the modules section of the garden... I'll have to ask Taco to reset it for me.
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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net
___________________________________________________________________________________
On 7/31/2021 10:23 PM, Jeroen via ntg-context wrote:
I worked around it, instead of simpleslides just use larger fonts to with regular pages Tne next version will have this (easy cheap extension):
\definesavebuffer[slide] \startslide % styling \stopslide \starttext \startslide \starttext \stopslide \startslide slide 1 \stopslide text 1 \par \startslide slide 2 \stopslide text 2 \par \startslide slide 3 \stopslide text 3 \par \startslide \stoptext \stopslide \stoptext after that you have a file <jobname>-slide.tex that has the slides that you can process (or include in a wrapper): % styling \starttext slide 1 slide 2 slide 3 \stoptext Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen via ntg-context schrieb am 01.08.2021 um 13:56:
On 7/31/2021 10:23 PM, Jeroen via ntg-context wrote:
I worked around it, instead of simpleslides just use larger fonts to with regular pages Tne next version will have this (easy cheap extension):
[...]
after that you have a file <jobname>-slide.tex that has the slides that you can process (or include in a wrapper):
Is there a way to set a folder for \typesetfile where I can put files similar to \setupexternalfigure[directory=...] or \usepath[...] At the moment I can use \typesetfile only when the processed file is in the same folder as the main tex file. It would be nicer to have a sub folder (e.g. examples) where I can put the files and \typesetfile creates the pdf in this folder to prevent clutter in the main folder. Wolfgang
On 8/1/2021 3:02 PM, Wolfgang Schuster wrote:
Hans Hagen via ntg-context schrieb am 01.08.2021 um 13:56:
On 7/31/2021 10:23 PM, Jeroen via ntg-context wrote:
I worked around it, instead of simpleslides just use larger fonts to with regular pages Tne next version will have this (easy cheap extension):
[...]
after that you have a file <jobname>-slide.tex that has the slides that you can process (or include in a wrapper):
Is there a way to set a folder for \typesetfile where I can put files similar to
\setupexternalfigure[directory=...]
or
\usepath[...]
At the moment I can use \typesetfile only when the processed file is in the same folder as the main tex file. It would be nicer to have a sub folder (e.g. examples) where I can put the files and \typesetfile creates the pdf in this folder to prevent clutter in the main folder. i;ll add support for 'directory'
\definesavebuffer[slide] \setupsavebuffer[slide][directory=tempdir] ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
On 7/31/21 10:23 PM, Jeroen via ntg-context wrote:
[...] \savebuffer[list=slides, file=\jobname_slides.tex, prefix=no]
Sorry, Jeroen, this was my fault. A simpler approach to the command above reads: \savebuffer[list=slides, file=slides.tex] But then you have to invoke the file as \typesetfile[\jobname-slides.tex][--purgeall][object=no, width=0pt] and the output file would read: \getfiguredimensions[\jobname-slides.pdf] \dorecurse{\noffigurepages} {\startTEXpage \externalfigure[\jobname-slides.pdf][page=\recurselevel] \stopTEXpage} I mean, you get hyphen instead of underscore. I hope it may help, Pablo -- http://www.ousia.tk
One final question on this one. As per latest comments this works great, but is there a way so the presentation pages in the appendix are made-up landscape as they are now, but are rotated 90 degrees so they are created in the pdf document as the first two pages.
\startbuffer[slides] \setuptolerance[ horizontal, tolerant, stretch] \setuppapersize[ A4,landscape] \setuplayout[ width=middle, backspace=35mm, cutspace=35mm, height=middle, topspace=5mm, bottomspace=20mm] \setuppagenumbering[ location={footer,center}] \setuphead [section] [page={yes}] \usetypescript[pagella] \setupbodyfont[pagella,18pt] \setupbodyfontenvironment[ 28pt][ % For body d=36pt, % For title a=12pt, % For author & date ] \setuptype[style=medium] \setuptyping[typing][bodyfont=16pt] \setupwhitespace[medium] \setbreakpoints[compound] \setuphead[chapter][style=\bfd] \setuphead[section][style=\bfc] \setuphead[subsection][style=\bfb] \setuphead[subsubsection][style=\bf] \setupitemize[autointro] % prevent orphan list intro \setupitemize[indentnext=no] \starttext \startsection[title={MySlideTitle},ref={myref1}] Body text \startitemize \item Item 1 \item Item 2 \stopitemize \stopsection \startsection[title={MySlideTitle},ref={myref2}] Body text \startitemize \item Item 1 \item Item 2 \stopitemize \stopsection \stoptext\starttext text \stoptext \stopbuffer \savebuffer[list=slides, file=slides.tex] \starttext \startbodymatter \dorecurse{10}{\input zapf\par} \typesetfile[\jobname-slides.tex][--purgeall][object=no, width=0pt] \stopbodymatter \startappendices \getfiguredimensions[\jobname-slides.pdf] \dorecurse{\noffigurepages} {\startTEXpage \externalfigure[\jobname-slides.pdf][page=\recurselevel] \stopTEXpage} \stopappendices \stoptext
On 7/31/21 3:27 PM, Jeroen via ntg-context wrote:
Is there an easy way to write a Context document and also code simpleslides in the same document so that the simpleslides are automatically added to the document as for example an appendix? Ie one tex document with Context code, perhaps with some \input and something like a two-pass job. I was thinking if the simpleslides could be saved as a number of png images and then with the recurse add them to the document with placefigure.
"Easy" is an ambiguous term... I can tell you how I do this (I use xml, but with a bit of code, this can be adapted to TeX documents): I have the code for the slides and my own comments in the same documents; I pass a --mode to the compilation to filter and select content. When I have my presentation as a file "presentation.pdf," I save it and then have the slides included automatically via a counter, like this: function xml.functions.combined_slide(t) i = i + 1 local textwidth = tex.dimen.textwidth context.page() context.framed( { width=number.todimen(textwidth), frame="off", align="middle", height="10cm" }, function() context.externalfigure( { "presentation.pdf" }, { page=i, width="13cm" } ) end ) context.blank { "line" } end So, as others have said: no need to convert to png. Setting up a workflow takes some time and thought, but once it's in place, it works very well; I have now used my xml-based workflow for 12 years or so, for all my university lectures and talks. Thomas
participants (6)
-
Hans Hagen
-
Henning Hraban Ramm
-
Jeroen
-
Pablo Rodriguez
-
Thomas A. Schmitz
-
Wolfgang Schuster