Alternative width of figures in different documents (problem with modes?)
Hello ConTeXist. I would like use modes alternative to change of image dimensions in different documents (presentation or print version). Compilation in ConTeXt TeXLive 2012 version will compile without error, but without visual effect. Compilation with the standalone version fails. What is problem or eventually. how to solve my problem another way. Thanks Jaroslav Hajtmar Here is my minimal example: \enablemode[presentation] \def\alternativewidth#1#2{ \doifmodeelse{presentation} {width=#1} {width=#2} } \useexternalfigure[COW][cow.pdf][height=5cm, \alternativewidth{3cm}{5cm}] \starttext \input tufte \placefigure[here,force][cowref]{Caption}{\externalfigure[COW]} \input tufte \stoptext
On 2013–02–05 Jaroslav Hajtmar wrote:
I would like use modes alternative to change of image dimensions in different documents (presentation or print version). Compilation in ConTeXt TeXLive 2012 version will compile without error, but without visual effect. Compilation with the standalone version fails. What is problem or eventually. how to solve my problem another way.
How about this: %% \enablemode %% [presentation] \defineexternalfigure [narrow] [width=2cm] \defineexternalfigure [wide] [width=7cm] \doifmodeelse{presentation} {\useexternalfigure[COW][cow][narrow][height=3cm]} {\useexternalfigure[COW][cow][wide] [height=3cm]} \starttext \input tufte \startplacefigure [title=Caption, reference=cowref] \externalfigure [COW] \stopplacefigure \input tufte \stoptext Marco
Am 05.02.2013 um 13:50 schrieb Jaroslav Hajtmar
Hello ConTeXist.
I would like use modes alternative to change of image dimensions in different documents (presentation or print version). Compilation in ConTeXt TeXLive 2012 version will compile without error, but without visual effect. Compilation with the standalone version fails. What is problem or eventually. how to solve my problem another way.
The \doifmodeelse command isn’t expandable and can’t be used in this form.
Thanks Jaroslav Hajtmar
Here is my minimal example:
\enablemode[presentation]
\def\alternativewidth#1#2{ \doifmodeelse{presentation} {width=#1} {width=#2} }
\useexternalfigure[COW][cow.pdf][height=5cm, \alternativewidth{3cm}{5cm}]
\startmode[presentation] \useexternalfigure[COW][cow.pdf][height=5cm,width=3cm] \stopmode \startnotemode[presentation] \useexternalfigure[COW][cow.pdf][height=5cm,width=5cm] \stopnotmode or \startmode[presentation] \definemeasure[alternativewidth][3cm] \stopmode \startnotmode[presentation] \definemeasure[alternativewidth][5cm] \stopnotmode \useexternalfigure[COW][cow.pdf][height=5cm,width=\measure{alternativewidth}] Wolfgang
Thanx Wolfgang. I might have guessed :-). Anyway, thanks for inspiring solutions ... Jaroslav Hajtmar Dne 5.2.2013 14:15, Wolfgang Schuster napsal(a):
Am 05.02.2013 um 13:50 schrieb Jaroslav Hajtmar
: Hello ConTeXist.
I would like use modes alternative to change of image dimensions in different documents (presentation or print version). Compilation in ConTeXt TeXLive 2012 version will compile without error, but without visual effect. Compilation with the standalone version fails. What is problem or eventually. how to solve my problem another way. The \doifmodeelse command isn’t expandable and can’t be used in this form.
Thanks Jaroslav Hajtmar
Here is my minimal example:
\enablemode[presentation]
\def\alternativewidth#1#2{ \doifmodeelse{presentation} {width=#1} {width=#2} }
\useexternalfigure[COW][cow.pdf][height=5cm, \alternativewidth{3cm}{5cm}] \startmode[presentation] \useexternalfigure[COW][cow.pdf][height=5cm,width=3cm] \stopmode
\startnotemode[presentation] \useexternalfigure[COW][cow.pdf][height=5cm,width=5cm] \stopnotmode
or
\startmode[presentation] \definemeasure[alternativewidth][3cm] \stopmode
\startnotmode[presentation] \definemeasure[alternativewidth][5cm] \stopnotmode
\useexternalfigure[COW][cow.pdf][height=5cm,width=\measure{alternativewidth}]
Wolfgang
participants (3)
-
Jaroslav Hajtmar
-
Marco Patzer
-
Wolfgang Schuster