Hello, I'm making progress in using modes - thanks again for the help so far that was given in the "switching to Context" thread. I have followed Thomas Schmitz' practex article and have set up modes for presentation and manuscript. I am using external figures on most of the slides. In presentation mode there is no need for figure captions (the slide heading and my waffling will suffice). In manuscript mode I'd like to have captions to the figures. I know I can disable captions with {none} for each individual figure, but can I do this _just_ for the presentation? I have looked up \setupcaptions but there does not seem to be a "none" option that could be used for this purpose. Thanks, Roger
2007/11/29, Roger Mason
Hello,
I'm making progress in using modes - thanks again for the help so far that was given in the "switching to Context" thread.
I have followed Thomas Schmitz' practex article and have set up modes for presentation and manuscript. I am using external figures on most of the slides. In presentation mode there is no need for figure captions (the slide heading and my waffling will suffice). In manuscript mode I'd like to have captions to the figures. I know I can disable captions with {none} for each individual figure, but can I do this _just_ for the presentation? I have looked up \setupcaptions but there does not seem to be a "none" option that could be used for this purpose.
Thanks,
Roger
\setupfloat[figure][default=none] Wolfgang
Roger Mason wrote:
Hi Wolfgang,
"Wolfgang Schuster"
writes: \setupfloat[figure][default=none]
Thanks, but that did not work. The only thing that seems to work is to put {none} for the caption. However, that means I'm not going to have captions in the manuscript version either.
well, we can misuse the number= key ..... % patch, goes in cont-new.tex \unprotect \def\presetfloatvariables#1#2#3#4% {\doifcommonelse {#2} {\v!left,\v!right,\v!inner,\v!outer,% \v!inleft,\v!inright,\v!inmargin,% \v!backspace,\v!cutspace,% \v!innermargin,\v!outermargin,\v!inneredge,\v!outeredge,% \v!leftmargin,\v!leftedge,\v!rightmargin,\v!rightedge} {\global\parfloattrue} {\global\parfloatfalse}% \ifinsidecolumns \global\parfloatfalse \fi \global\sidefloatshift\zeropoint \global\sidefloatmaximum\zeropoint \global\chardef\sidefloatmethod\floatparameter\c!sidemethod \global\chardef\textfloatmethod\floatparameter\c!textmethod \global\chardef\sidefloatalign\zerocount \globallet\floatrotation\!!zerocount \calculatefloatskips \ifparfloat \processaction [\floatparameter\c!sidealign] [\v!height=>\global\chardef\sidefloatalign\plusone,% \v!line=>\global\chardef\sidefloatalign\plustwo,% (***) \v!depth=>\global\chardef\sidefloatalign\plusthree,% \v!grid=>\global\chardef\sidefloatalign4,% \v!halfline=>\global\chardef\sidefloatalign5]% % todo (test first): \doifinset\v!lokaal{#2}{\chardef\sidefloatalign\zerocount}% \ifcase\sidefloatalign\relax % todo: optie v!lokaal => \else \doifinset\v!height {#2}{\global\chardef\sidefloatalign\plusone}% \doifinset\v!line {#2}{\global\chardef\sidefloatalign\plustwo}% \doifinset\v!depth {#2}{\global\chardef\sidefloatalign\plusthree}% \doifinset\v!grid {#2}{\global\chardef\sidefloatalign4}% \doifinset\v!halfline{#2}{\global\chardef\sidefloatalign5}% meant for 'none' \fi \doifinset\v!high{#2}{\global\sidefloattopskip \zeropoint}% \doifinset\v!low {#2}{\global\sidefloatbottomskip\zeropoint}% \doifinset\v!fit {#2} {\global\sidefloattopskip \zeropoint \global\sidefloatbottomskip\zeropoint \global\floatsideskip \zeropoint}% \else \processallactionsinset [#2] [ 90=>\globallet\floatrotation\commalistelement,% 180=>\globallet\floatrotation\commalistelement,% 270=>\globallet\floatrotation\commalistelement]% \fi \doifinsetelse\v!nonumber{#2} {\global\nofloatnumbertrue} {\doifelse{\floatcaptionparameter\c!number}\v!yes {\global\nofloatnumberfalse} {\global\nofloatnumbertrue}}% \ConvertToConstant\doifelse{#4}{} {\global\emptyfloatcaptiontrue} {\global\emptyfloatcaptionfalse}% \doifinsetelse\v!none{#2} {\global\nofloatcaptiontrue} {\ConvertToConstant\doifelse{#4}\v!none {\global\nofloatcaptiontrue} {\global\nofloatcaptionfalse}}% \doif{\floatcaptionparameter\c!number}\v!none {\global\nofloatcaptiontrue}% \ifemptyfloatcaption \ifnofloatnumber \global\nofloatcaptiontrue \fi \fi} \protect \starttext \placefigure{}{} \setupcaptions[number=none] \placefigure{}{} \stoptext (I'll add that to the core, but only if you wikify it) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Mojca Miklavec wrote:
On Nov 29, 2007 11:17 PM, Hans Hagen wrote:
(I'll add that to the core, but only if you wikify it)
Nice new strategy :)
yes, and the next one will be: "but only if you send mojca a redesign for the wiki" -) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hello Hans,
Hans Hagen
Roger Mason wrote: well, we can misuse the number= key .....
% patch, goes in cont-new.tex
I'm sorry to trouble you but... I applied the patch. When I try to compile my file it fails like this: ! Undefined control sequence. \presetfloatvariables ...atmethod \floatparameter \c!sidemethod \global \cha... \docompletefloat ...loatvariables {#1}{#4}{#2}{#6} \bgroup \setnaturalfloatdi... <argument> ...tion of sapphire deposits.}\nextbox \else \docompletefloat {fi... \secondoftwoarguments #1#2->#2 \xdocompletefloat ...at ,#4}{#5}{#6}\nextbox \fi } \else \docompletefloat {#1... \dodowithnextbox ...ibution of sapphire deposits.} \doifnotinset \v!text {sap... l.114 ...re[Sapphire_world_map][width=\textwidth]} The offending lines from my file: \placefigure [sapphiremap][Sapphire_world_map] {Distribution of sapphire deposits.} {\externalfigure[Sapphire_world_map][width=\textwidth]} % line 114 Am I calling \placefigure wrongly? Thanks very much for your help. Roger
Roger Mason wrote:
Hello Hans,
Hans Hagen
writes: Roger Mason wrote: well, we can misuse the number= key .....
% patch, goes in cont-new.tex
I'm sorry to trouble you but...
I applied the patch. When I try to compile my file it fails like this:
! Undefined control sequence. \presetfloatvariables ...atmethod \floatparameter
then you run an old context and have to wait till the next current (soon, when the luatex beta is out) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Roger Mason wrote:
Hans Hagen
writes: then you run an old context and have to wait till the next current (soon, when the luatex beta is out)
is it not possible to update to the current context? I'm running 3.0_p1 (on a Gentoo linux box so I'm acustomed to compiling from source).
you can try the current beta Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hello all,
Hans Hagen
you can try the current beta
It did not work with my updated version: texexec --version TeXExec | version 6.2.0 - 1997-2006 - PRAGMA ADE/POD ctxtools --contexttools CtxTools | version 1.3.3 - 2004/2006 - PRAGMA ADE/POD figures : dimensions of Sapphire_world_map are determined externally (./main.ctx.tuo)) ! Incomplete \iffalse; all text was ignored after line 161. <inserted text> \fi <*> main.ctx.tex emergencyend ? Is this version still too old? Thanks, Roger
Roger Mason wrote:
Hello all,
Hans Hagen
writes: you can try the current beta
It did not work with my updated version:
texexec --version TeXExec | version 6.2.0 - 1997-2006 - PRAGMA ADE/POD
ctxtools --contexttools CtxTools | version 1.3.3 - 2004/2006 - PRAGMA ADE/POD
figures : dimensions of Sapphire_world_map are determined externally (./main.ctx.tuo))
where does that name come from ... ctx is reserved for context job control files Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen
(./main.ctx.tuo))
where does that name come from ... ctx is reserved for context job control files
The file name being compiled is main.ctx.tex. I'm using the dual extension .ctx.tex as a way of telling my editor (emacs) to invoke the context mode of AUCTeX when I load a file with that extension. Roger
Le 01 décembre à 14:15:24 Roger Mason
On Sat, Dec 01, 2007 at 03:05:33PM +0100, Jean Magnan de Bornier wrote:
Le 01 décembre à 14:15:24 Roger Mason
écrit notamment: | The file name being compiled is main.ctx.tex. I'm using the dual | extension .ctx.tex as a way of telling my editor (emacs) to invoke the | context mode of AUCTeX when I load a file with that extension.
Well, AucTeX does recognize a LaTeX file from a ConTeXt file; no need for that!
It seems to me, only if there is a "\starttext" in the file. For files without "\starttext" you can put these lines at the end: %%% Local Variables: %%% mode: context %%% End: I don't need that no more, since I use '(TeX-default-mode (quote context-mode)) Cheers, Peter -- http://pmrb.free.fr/contact/
Hello Jean & Peter,
Jean Magnan de Bornier
Well, AucTeX does recognize a LaTeX file from a ConTeXt file; no need for that!
I did it like that because I have (setq-default TeX-master nil) in my .emacs so it asks then inserts the local variables that Peter mentioned. Having emacs recognise a context file by \starttext is fine except when you open a new file. This is drifting off topic but, if you have any tweaks to make AUCTeX work better with context than it does out of the box then I'd be glad to hear about them. Roger
Le 01 décembre à 20:00:59 Roger Mason
| Jean Magnan de Bornier
| > Well, AucTeX does recognize a LaTeX file from a ConTeXt file; no need for that!
| I did it like that because I have (setq-default TeX-master nil) in my | .emacs so it asks then inserts the local variables that Peter | mentioned. Having emacs recognise a context file by \starttext is | fine except when you open a new file.
| This is drifting off topic but, if you have any tweaks to make AUCTeX | work better with context than it does out of the box then I'd be glad | to hear about them.
Well, not specific to AucTeX, you could use one of emacs' template modes to create new tex files, specifying the needed lines in the template. http://www.emacswiki.org/cgi-bin/emacs-en/TemplatesMode (I use template.el to choose e.g. from several styles to write letters, and I like it). On the other hand, AucTeX maintainers might be willing to develop something specific for opening context files... cheers, -- Jean
I'm using the dual extension .ctx.tex as a way of telling my editor (emacs) to invoke the context mode of AUCTeX when I load a file with that extension.
Auctex automatically recognizes plain tex vs latex vs context files by the first few lines in the file. The main time when that method does not work is when starting a new file. Since almost every tex file I make these days is a ConTeXt file, I set the default for that case by using this .emacs line: (setq TeX-default-mode 'context-mode) -Sanjoy `Not all who wander are lost' (J.R.R. Tolkien)
On Nov 30, 2007, at 2:11 PM, Roger Mason wrote:
is it not possible to update to the current context? I'm running 3.0_p1 (on a Gentoo linux box so I'm acustomed to compiling from source).
Gentoo version numbers are not something that many people around here will know. I assume that 3.0_p1 refers to gentoo's tetex ebuild. This is ancient, tetex has been unmaintained for almost two years (and gentoo should be ashamed that they still haven't gotten around to making texlive the default). Of course it's possible to upgrade, but you will run into trouble: you'll need to compile a newer version of pdftex and install that. The gentoo tex setup is quite complex, and finding out why it is still using some old config file etc. is a royal pain. I tried it for a while and in the end got fed up with it and installed texlive from the iso image (see http://wiki.contextgarden.net/TeX-live) . But if you want to give it a shot, there's a wiki page about it; some info may be slightly updated, but most of it should work as described: http://wiki.contextgarden.net/Linux_Installation#Updating_Gentoo_Linux Thomas
Hi Thomas,
"Thomas A. Schmitz"
Gentoo version numbers are not something that many people around here will know. I assume that 3.0_p1 refers to gentoo's tetex ebuild. This is ancient, tetex has been unmaintained for almost two years (and gentoo should be ashamed that they still haven't gotten around to making texlive the default). Of course it's possible to upgrade, but you will run into trouble: you'll need to compile a newer version of pdftex and install that. The gentoo tex setup is quite complex, and finding out why it is still using some old config file etc. is a royal pain. I tried it for a while and in the end got fed up with it and installed texlive from the iso image (see http://wiki.contextgarden.net/TeX-live) . But if you want to give it a shot, there's a wiki page about it; some info may be slightly updated, but most of it should work as described: http://wiki.contextgarden.net/Linux_Installation#Updating_Gentoo_Linux
This is what I have: TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005 texexec : TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005 texutil : TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004 tex : pdfeTeX, 3.141592-1.30.5-2.2 (Web2C 7.5.5) context : ver: 2005.01.31 cont-en : ver: 2005.01.31 fmt: 2007.11.29 mes: english I think there is now a texlive ebuild that is marked "testing". Maybe I should try that first. I have a package built for teTeX so i can revert if disaster strikes. Cheers, Roger
On Fri, 30 Nov 2007 08:05:14 -0700, Roger Mason
TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005
texexec : TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005 texutil : TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004 tex : pdfeTeX, 3.141592-1.30.5-2.2 (Web2C 7.5.5) context : ver: 2005.01.31 cont-en : ver: 2005.01.31 fmt: 2007.11.29 mes: english
The Middle Ages, almost BC in ConTeXt time... Must update, I'd start with a fresh, clean TeX if I were you. Best Idris -- Professor Idris Samawi Hamid, Editor-in-Chief International Journal of Shi`i Studies Department of Philosophy Colorado State University Fort Collins, CO 80523
TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005
texexec : TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005 texutil : TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004 tex : pdfeTeX, 3.141592-1.30.5-2.2 (Web2C 7.5.5) context : ver: 2005.01.31 cont-en : ver: 2005.01.31 fmt: 2007.11.29 mes: english
The Middle Ages, almost BC in ConTeXt time...
Must update, I'd start with a fresh, clean TeX if I were you. It depends. Actually this configuration can produce a good pdf, in the sense that can be read by Adobe Reader 5.0 and following . Maybe a complety separete tree (pdftex1.4+ConTeXt) can be a solution.
-- luigi ... it's new . it's powerful . it's luatex . http://www.luatex.org
2007/11/29, Hans Hagen
Roger Mason wrote:
Hi Wolfgang,
"Wolfgang Schuster"
writes: \setupfloat[figure][default=none]
Thanks, but that did not work. The only thing that seems to work is to put {none} for the caption. However, that means I'm not going to have captions in the manuscript version either.
well, we can misuse the number= key .....
% patch, goes in cont-new.tex
\unprotect
\def\presetfloatvariables#1#2#3#4% {\doifcommonelse {#2} {\v!left,\v!right,\v!inner,\v!outer,% \v!inleft,\v!inright,\v!inmargin,% \v!backspace,\v!cutspace,% \v!innermargin,\v!outermargin,\v!inneredge,\v!outeredge,% \v!leftmargin,\v!leftedge,\v!rightmargin,\v!rightedge} {\global\parfloattrue} {\global\parfloatfalse}% \ifinsidecolumns \global\parfloatfalse \fi \global\sidefloatshift\zeropoint \global\sidefloatmaximum\zeropoint \global\chardef\sidefloatmethod\floatparameter\c!sidemethod \global\chardef\textfloatmethod\floatparameter\c!textmethod \global\chardef\sidefloatalign\zerocount \globallet\floatrotation\!!zerocount \calculatefloatskips \ifparfloat \processaction [\floatparameter\c!sidealign] [\v!height=>\global\chardef\sidefloatalign\plusone,% \v!line=>\global\chardef\sidefloatalign\plustwo,% (***) \v!depth=>\global\chardef\sidefloatalign\plusthree,% \v!grid=>\global\chardef\sidefloatalign4,% \v!halfline=>\global\chardef\sidefloatalign5]% % todo (test first): \doifinset\v!lokaal{#2}{\chardef\sidefloatalign\zerocount}% \ifcase\sidefloatalign\relax % todo: optie v!lokaal => \else \doifinset\v!height {#2}{\global\chardef\sidefloatalign\plusone}% \doifinset\v!line {#2}{\global\chardef\sidefloatalign\plustwo}% \doifinset\v!depth {#2}{\global\chardef\sidefloatalign\plusthree}% \doifinset\v!grid {#2}{\global\chardef\sidefloatalign4}% \doifinset\v!halfline{#2}{\global\chardef\sidefloatalign5}% meant for 'none' \fi \doifinset\v!high{#2}{\global\sidefloattopskip \zeropoint}% \doifinset\v!low {#2}{\global\sidefloatbottomskip\zeropoint}% \doifinset\v!fit {#2} {\global\sidefloattopskip \zeropoint \global\sidefloatbottomskip\zeropoint \global\floatsideskip \zeropoint}% \else \processallactionsinset [#2] [ 90=>\globallet\floatrotation\commalistelement,% 180=>\globallet\floatrotation\commalistelement,% 270=>\globallet\floatrotation\commalistelement]% \fi \doifinsetelse\v!nonumber{#2} {\global\nofloatnumbertrue} {\doifelse{\floatcaptionparameter\c!number}\v!yes {\global\nofloatnumberfalse} {\global\nofloatnumbertrue}}% \ConvertToConstant\doifelse{#4}{} {\global\emptyfloatcaptiontrue} {\global\emptyfloatcaptionfalse}% \doifinsetelse\v!none{#2} {\global\nofloatcaptiontrue} {\ConvertToConstant\doifelse{#4}\v!none {\global\nofloatcaptiontrue} {\global\nofloatcaptionfalse}}% \doif{\floatcaptionparameter\c!number}\v!none {\global\nofloatcaptiontrue}% \ifemptyfloatcaption \ifnofloatnumber \global\nofloatcaptiontrue \fi \fi}
\protect
\starttext
\placefigure{}{}
\setupcaptions[number=none]
\placefigure{}{}
\stoptext
(I'll add that to the core, but only if you wikify it)
and what is the difference in the output compared with my solution, the following works for me and I have no caption in the second figure. \starttext \placefigure{bla}{} \setupfloat[figure][default=none] \placefigure{bla}{} \stoptext Wolfgang
Wolfgang Schuster wrote:
and what is the difference in the output compared with my solution, the following works for me and I have no caption in the second figure.
\starttext
\placefigure{bla}{}
\setupfloat[figure][default=none]
\placefigure{bla}{}
\stoptext
in your case explicit placement keys override the default ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (10)
-
Hans Hagen
-
Idris Samawi Hamid
-
Jean Magnan de Bornier
-
luigi scarso
-
Mojca Miklavec
-
Peter Münster
-
Roger Mason
-
Sanjoy Mahajan
-
Thomas A. Schmitz
-
Wolfgang Schuster