ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: setupcaptions
Date: Wed, 11 Jul 2012 22:29:39 +0200	[thread overview]
Message-ID: <31B68740-277B-4339-990B-8FC8B8892908@gmail.com> (raw)
In-Reply-To: <417A1BDF-52BD-44F8-98F0-0AC2259B111A@uva.nl>


[-- Attachment #1.1: Type: text/plain, Size: 2362 bytes --]


Am 11.07.2012 um 17:17 schrieb Meer, H. van der:

> I want to make my figure captions both slanted and small, or bold and small,etc.
> The wiki has for setupcaptions:
> 
> headstyle normal, bold, .. , small, ..
> style     normal, bold, .. , small, ..
> 
> I therefore expected to work the following setup:
> 
> \setupcaptions[headstyle={slanted,small},style={bold,small}]
> \starttext
> \placefigure{A dummy figure}{\externalfigure[dummy]}
> Caption test.
> \stoptext
> 
> But no, two seems too much. style={bold} does work and style={small} but style = {bold,small} does not. From the general principles of ConTeXt's parameter handling I would have expected this to work. 
> Of course I could have used style={\bf\switchtobodyfont[small]}, but I would prefer to refrain from low level font commands when possible.
> 
> I am right the setupcaptions should work with combined fontsettings, or is it my mistake?

You misunderstand how named styles work. When you have style key (can be style, textstyle etc.)
for a command you can write “style=\bf” and use the font switch as argument. Another way to set
the font is to use a name, e.g. “style=bold”. The argument in this case is a identifier which is defined as

  \definealternativestyle [\v!bold]                                   [\bf] []

As you can see “bold” is only a synonym for \bf (with the third argument you can specify what should
happen when a command when the identifier is used in a heading, see below for a example.

\definehead[HeadA][section][style=bold]
\definehead[HeadB][section][style=italic]

\starttext

\HeadA{normal \style[style=italic]{italic} normal \style[style=bold]{bold} normal \style[style=\it]{it} normal \style[style=\bf]{bf} normal}

normal \style[style=italic]{italic} normal \style[style=bold]{bold} normal \style[style=\it]{it} normal \style[style=\bf]{bf} normal

\HeadB{normal \style[style=italic]{italic} normal \style[style=bold]{bold} normal \style[style=\it]{it} normal \style[style=\bf]{bf} normal}

normal \style[style=italic]{italic} normal \style[style=bold]{bold} normal \style[style=\it]{it} normal \style[style=\bf]{bf} normal
	 
\stoptext


Having a list as argument for the style key is interesting and you have my vote for this but it would
be more complex and slower than the current mechanism.

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 3330 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2012-07-11 20:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-11 15:17 setupcaptions Meer, H. van der
2012-07-11 20:29 ` Wolfgang Schuster [this message]
2012-07-13 17:26   ` setupcaptions Hans Hagen
  -- strict thread matches above, loose matches on Subject: below --
2006-08-03 13:25 setupcaptions Thomas A. Schmitz
2006-08-03 14:06 ` setupcaptions Taco Hoekwater
2006-08-03 23:02   ` setupcaptions Hans Hagen
2002-06-03  7:44 setupcaptions Jochen Dietrich
2002-06-06 13:43 ` setupcaptions Hans Hagen
2002-06-06 14:07   ` setupcaptions Hans Hagen
1999-05-18  6:19 setupcaptions Matthew Baker
1999-05-18  9:56 ` setupcaptions 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=31B68740-277B-4339-990B-8FC8B8892908@gmail.com \
    --to=schuster.wolfgang@gmail.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).