ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Wolfgang Schuster" <schuster.wolfgang@googlemail.com>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: selectively turn off captions
Date: Fri, 30 Nov 2007 14:19:50 +0100	[thread overview]
Message-ID: <115224fb0711300519u56241508ub4781b2791932d72@mail.gmail.com> (raw)
In-Reply-To: <474F3A83.9000804@wxs.nl>

2007/11/29, Hans Hagen <pragma@wxs.nl>:
> Roger Mason wrote:
> > Hi Wolfgang,
> >
> > "Wolfgang Schuster" <schuster.wolfgang@googlemail.com> 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
___________________________________________________________________________________
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://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  parent reply	other threads:[~2007-11-30 13:19 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-29 15:13 Roger Mason
2007-11-29 16:15 ` Wolfgang Schuster
2007-11-29 18:28   ` Roger Mason
2007-11-29 22:17     ` Hans Hagen
2007-11-30  0:34       ` Mojca Miklavec
2007-11-30  8:09         ` Hans Hagen
2007-11-30 12:00       ` Roger Mason
2007-11-30 12:54         ` Hans Hagen
2007-11-30 13:11           ` Roger Mason
2007-11-30 14:23             ` Hans Hagen
2007-12-01 12:35               ` Roger Mason
2007-12-01 13:08                 ` Hans Hagen
2007-12-01 13:15                   ` Roger Mason
2007-12-01 14:05                     ` Jean Magnan de Bornier
2007-12-01 14:44                       ` Peter Münster
2007-12-01 19:00                       ` Roger Mason
2007-12-02  7:51                         ` Opening ConTeXt files in emacs [was : selectively turn off captions] Jean Magnan de Bornier
2007-12-02 16:23                     ` selectively turn off captions Sanjoy Mahajan
2007-11-30 14:27             ` Thomas A. Schmitz
2007-11-30 15:05               ` Roger Mason
2007-11-30 19:04                 ` Idris Samawi Hamid
2007-11-30 22:43                   ` luigi scarso
2007-12-01 11:03                   ` Roger Mason
2007-11-30 13:19       ` Wolfgang Schuster [this message]
2007-11-30 14:24         ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=115224fb0711300519u56241508ub4781b2791932d72@mail.gmail.com \
    --to=schuster.wolfgang@googlemail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).