ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* hanging punctuation, but not in captions
@ 2001-09-10  9:33 Eckhart Guthöhrlein
  2001-09-10 21:21 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Eckhart Guthöhrlein @ 2001-09-10  9:33 UTC (permalink / raw)


As I mentioned in an earlier posting, I have enabled hanging punctuation by 
the following lines

\usetypescript[serif,sans,mono][hanging][pure]
\setupalign [hanging]
\definetypeface [modern] [rm] [serif] [computer-modern] [default] 
[handling=pure,encoding=ec]
\definetypeface [modern] [mm] [math]  [computer-modern] [computer-modern] []
\setupbodyfont[ams,modern]

Everything works fine, except for the captions of my figures: no hanging 
punctuation there. Why that, and what to do about it?

Another problem with fonts in captions: if I switch to a different font 
size via

\setupcaptions[headstyle=\tfx\it]

number typeset using \digits do not adapt to the new size, but appear in 
the main bodyfont size. Can this be changed?

I'm using the current beta version.

Eckhart


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: hanging punctuation, but not in captions
  2001-09-10  9:33 hanging punctuation, but not in captions Eckhart Guthöhrlein
@ 2001-09-10 21:21 ` Hans Hagen
  2001-09-11 13:50   ` Eckhart Guthöhrlein
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2001-09-10 21:21 UTC (permalink / raw)
  Cc: ConTeXt mailing list

At 11:33 AM 9/10/2001 +0200, Eckhart Guthöhrlein wrote:
>As I mentioned in an earlier posting, I have enabled hanging punctuation 
>by the following lines
>
>\usetypescript[serif,sans,mono][hanging][pure]
>\setupalign [hanging]
>\definetypeface [modern] [rm] [serif] [computer-modern] [default] 
>[handling=pure,encoding=ec]
>\definetypeface [modern] [mm] [math]  [computer-modern] [computer-modern] []
>\setupbodyfont[ams,modern]
>
>Everything works fine, except for the captions of my figures: no hanging 
>punctuation there. Why that, and what to do about it?

(1) hanging is turned off in general 'reset' situatations, so then you have 
to turn it on
(2) hanging does not work in hboxes and sometimes we use unhboxed hboxes

you can experiment with turning it on inside the caption.

>Another problem with fonts in captions: if I switch to a different font 
>size via

The following should demo what is possible

\starttext

\placefigure{test}{}

\setupcaptions
   [headstyle=\tfx\it]

\placefigure{test}{}

\setupcaptions
   [style=slanted,
    headstyle=boldslanted]

\placefigure{test}{}

\stoptext

So, there is also style

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: hanging punctuation, but not in captions
  2001-09-10 21:21 ` Hans Hagen
@ 2001-09-11 13:50   ` Eckhart Guthöhrlein
  2001-09-11 16:31     ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Eckhart Guthöhrlein @ 2001-09-11 13:50 UTC (permalink / raw)
  Cc: ConTeXt mailing list

At 23:21 10.09.2001 +0200, Hans Hagen wrote:
>At 11:33 AM 9/10/2001 +0200, Eckhart Guthöhrlein wrote:
>>As I mentioned in an earlier posting, I have enabled hanging punctuation 
>>by the following lines
>>
>>\usetypescript[serif,sans,mono][hanging][pure]
>>\setupalign [hanging]
>>\definetypeface [modern] [rm] [serif] [computer-modern] [default] 
>>[handling=pure,encoding=ec]
>>\definetypeface [modern] [mm] [math]  [computer-modern] [computer-modern] []
>>\setupbodyfont[ams,modern]
>>
>>Everything works fine, except for the captions of my figures: no hanging 
>>punctuation there. Why that, and what to do about it?
>
>(1) hanging is turned off in general 'reset' situatations, so then you 
>have to turn it on
>(2) hanging does not work in hboxes and sometimes we use unhboxed hboxes
>
>you can experiment with turning it on inside the caption.

Thank you, a simple \setupalign[hanging] inside the caption is sufficient. 
I encountered some difficulties when I tried to insert it automatically via
\setupcaptions[style={\setupalign[hanging]}]
I got an error message, probably due to expansion.
Finally, I found

\newtoks\HANGTOKS
\HANGTOKS={\setupalign[hanging]}
\setupcaptions[headstyle=\tfx\it,style=\the\HANGTOKS\tfx]

This works fine now. Some other problems resulted from a long forgotton 
\setupbodyfont[11pt] following the first setup command. Now I have 
\setupbodyfont[11pt,ams,modern] - I noticed this because switching font 
size turned off haning, which is fixed by the new order in \setupbodyfont.

>>Another problem with fonts in captions: if I switch to a different font 
>>size via
>
>The following should demo what is possible
>

[...]

>So, there is also style

Ooops, sorry... But still, I have this example file:

\setupcaptions[headstyle=\tfxx\it,style=\tfxx]
\starttext
    \placefigure{The same bla bla \digits 1000 times and
       then again: $x\times y$.}
       {\framed{How nice!}}
     And shouldn't the next formula be {\tfxx at least $10^x$ times}
     smaller? Well, it isn't!
\stoptext

Math mode does not adapt to the current font size. This is not limited to 
captions, so is this a known problem? For the \digits, the code you sent to 
Marco (Re: Questions/Comments) helps by avoiding math mode.

Thank you,

Eckhart


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: hanging punctuation, but not in captions
  2001-09-11 13:50   ` Eckhart Guthöhrlein
@ 2001-09-11 16:31     ` Hans Hagen
  2001-09-11 19:02       ` Eckhart Guthöhrlein
  0 siblings, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2001-09-11 16:31 UTC (permalink / raw)
  Cc: ConTeXt mailing list

At 03:50 PM 9/11/2001 +0200, Eckhart Guthöhrlein wrote:

>Finally, I found
>
>\newtoks\HANGTOKS
>\HANGTOKS={\setupalign[hanging]}
>\setupcaptions[headstyle=\tfx\it,style=\the\HANGTOKS\tfx]

i wonder why \setupcaptions[align=hanging] does not work.

instead of toks:

   \unexpanded\def\HANGTOKS{...}

is also an options since \unexpanded commands are ignores in comparisons / 
checks

>This works fine now. Some other problems resulted from a long forgotton 
>\setupbodyfont[11pt] following the first setup command. Now I have 
>\setupbodyfont[11pt,ams,modern] - I noticed this because switching font 
>size turned off haning, which is fixed by the new order in \setupbodyfont.

this has to do with the fact that fonts get associated lrprtotcodes which 
happens at definition time

\   And shouldn't the next formula be {\tfxx at least $10^x$ times}
>     smaller? Well, it isn't!

\tfxx is a rather hard coded text switch, use \small instead which is a 
body font switch that switches them all [these things are a matter of speed 
trade offs]

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: hanging punctuation, but not in captions
  2001-09-11 16:31     ` Hans Hagen
@ 2001-09-11 19:02       ` Eckhart Guthöhrlein
  0 siblings, 0 replies; 5+ messages in thread
From: Eckhart Guthöhrlein @ 2001-09-11 19:02 UTC (permalink / raw)
  Cc: ConTeXt mailing list

At 18:31 11.09.2001 +0200, Hans Hagen wrote:
>At 03:50 PM 9/11/2001 +0200, Eckhart Guthöhrlein wrote:
>
>>Finally, I found
>>
>>\newtoks\HANGTOKS
>>\HANGTOKS={\setupalign[hanging]}
>>\setupcaptions[headstyle=\tfx\it,style=\the\HANGTOKS\tfx]
>
>i wonder why \setupcaptions[align=hanging] does not work.

Well, I tried this too, it didn't work, but if even you wonder...

>instead of toks:
>
>   \unexpanded\def\HANGTOKS{...}

This is nice. Hope to have more time to look at context internals soon...

 > [...]
>\  And shouldn't the next formula be {\tfxx at least $10^x$ times}
>>     smaller? Well, it isn't!
>
>\tfxx is a rather hard coded text switch, use \small instead which is a 
>body font switch that switches them all [these things are a matter of 
>speed trade offs]

But then have a look at this:

\starttext
    Here comes {\tfx small text with $B\cdot I\cdot G$ math}.\crlf
    And this is {\small small text with $B\cdot I\cdot G$ math, too}.\crlf
    But this math {\switchtobodyfont[small]can not be called $B\cdot I\cdot 
G$ any more}!
\stoptext

So, I can't see any difference between \tfx and \small in this example. But 
\switchtobodyfont[small] will do it for me - so thank you for your help.

Greetings,

Eckhart


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-09-11 19:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-10  9:33 hanging punctuation, but not in captions Eckhart Guthöhrlein
2001-09-10 21:21 ` Hans Hagen
2001-09-11 13:50   ` Eckhart Guthöhrlein
2001-09-11 16:31     ` Hans Hagen
2001-09-11 19:02       ` Eckhart Guthöhrlein

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).