makepowerdot.yaml

makepowerdot.yaml

我想编译我的 powerdot 演示文稿两次 -- 一次带注释,一次不带注释。我尝试使用 arara 来实现这一点,如下所示:

% 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}

这可以使用 latex/arara 来完成吗?

答案1

这里有几个选项可以供你选择——当然,Paulo 可能会提供更好的选择:)

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: []

如果你使用以下方法编译文件arara那么这将给你

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}

当然,您可能希望选择制作笔记或幻灯片,在这种情况下,您可能更喜欢以下修改

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+
#
# 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

可以用作

% arara: makepowerdot

产生demoSLIDES.pdf(并且是默认的)

% arara: makepowerdot: {powerdotmode: slides}

这也产生了demoSLIDES.pdf,或者最终

% arara: makepowerdot: {powerdotmode: slidesnotes}

生成demoSLIDESNOTES.pdf。当然,你可以使用组合:

% 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}

相关内容