6

I want to compile my powerdot presentation twice -- once with, once without notes. I am trying to achieve this using arara with something like:

% arara: latex { set \powerdotmode=slides here }
% arara: latex { set \powerdotmode=slides here }
% arara: dvips
% arara: ps2pdf
% arara: rename { postfix: slides }
% arara: latex { set \powerdotmode=slidesnotes here }
% arara: latex { set \powerdotmode=slidesnotes here }
% arara: dvips
% arara: ps2pdf
% arara: rename { postfix: notes }

\documentclass[mode=present,display=\powerdotmode]{powerdot}

Can this be done at all using latex/arara?

0

1 Answer 1

6

Here are a couple of options to get you started- of course, Paulo might provide better alternatives :)

makepowerdot.yaml

!config
# Make chapter files rule for arara
# author: Chris Hughes
# last edited by: cmh, Dec 2nd 2013
# http://tex.stackexchange.com/questions/148095/using-arara-to-compile-powerdot-twice
# requires arara 3.0+
identifier: makepowerdot
name: MakePowerdot
commands: 
- <arara> latex "\def\powerdotmode{slides}\input{@{file}}" 
- <arara> dvips @{getBasename(file)}.dvi -o @{getBasename(file)}.ps
- <arara> ps2pdf @{getBasename(file)}.ps
- <arara> @{ isWindows( "cmd /c move", "mv" ) } @{getBasename(file)}.pdf @{getBasename(file).concat('SLIDES')}.pdf
- <arara> latex "\def\powerdotmode{slidesnotes}\input{@{file}}" 
- <arara> dvips @{getBasename(file)}.dvi -o @{getBasename(file)}.ps
- <arara> ps2pdf @{getBasename(file)}.ps
- <arara> @{ isWindows( "cmd /c move", "mv" ) } @{getBasename(file)}.pdf @{getBasename(file).concat('NOTES')}.pdf
arguments: []

If you compile the following file with arara then this will give you both

demoSLIDES.pdf
demoNOTES.pdf

demo.tex

% arara: makepowerdot
\documentclass[mode=present,display=\powerdotmode]{powerdot}
\begin{document}
\begin{slide}{a slide}
Contents of the slide.
\end{slide}
\section{first section}
\begin{slide}{another slide}
Contents of the slide.
\end{slide}
\begin{note}{personal note}
The note.
\end{note}
\end{document}

Of course, you might want the choice to produce notes or slides, in which case you might prefer the following modification

makepowerdot.yaml (modified)

!config
# Make chapter files rule for arara
# author: Chris Hughes
# last edited by: cmh, Dec 2nd 2013
# http://tex.stackexchange.com/questions/148095/using-arara-to-compile-powerdot-twice
# requires arara 3.0+
#
# Sample usage
#
# % arara: makepowerdot
# % arara: makepowerdot: {powerdotmode: slides}
# % arara: makepowerdot: {powerdotmode: slidesnotes}
#
identifier: makepowerdot
name: MakePowerdot
commands: 
- <arara> latex "\def\powerdotmode{@{powerdotmode}}\input{@{file}}" 
- <arara> dvips @{getBasename(file)}.dvi -o @{getBasename(file)}.ps
- <arara> ps2pdf @{getBasename(file)}.ps
- <arara> @{ isWindows( "cmd /c move", "mv" ) } @{getBasename(file)}.pdf @{getBasename(file)}@{powerdotmode.toUpperCase()}.pdf
arguments: 
- identifier: powerdotmode
  flag: <arara> @{parameters.powerdotmode}
  default: slides

which can be used as

% arara: makepowerdot

which produces demoSLIDES.pdf (and is the default)

% arara: makepowerdot: {powerdotmode: slides}

which also produces demoSLIDES.pdf, or finally

% arara: makepowerdot: {powerdotmode: slidesnotes}

which produces demoSLIDESNOTES.pdf. Of course, you can use a combination:

% arara: makepowerdot: {powerdotmode: slides}
% arara: makepowerdot: {powerdotmode: slidesnotes}
\documentclass[mode=present,display=\powerdotmode]{powerdot}
\begin{document}
\begin{slide}{a slide}
Contents of the slide.
\end{slide}
\section{first section}
\begin{slide}{another slide}
Contents of the slide.
\end{slide}
\begin{note}{personal note}
The note.
\end{note}
\end{document}
2
  • B-E-A-utiful. This ought to ship with Arara!
    – retorquere
    Commented Dec 3, 2013 at 10:09
  • @HarishKumar thanks, you're very kind :) friflaj I'll open a conversation with Paulo :)
    – cmhughes
    Commented Dec 3, 2013 at 17:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .