ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* RE: Capitalized headings
@ 2005-05-03 16:56 Ville Voipio
  0 siblings, 0 replies; 5+ messages in thread
From: Ville Voipio @ 2005-05-03 16:56 UTC (permalink / raw)


> However, this is a workaround, another way of attacking it (it can be
> better, too, stylistically, as you can change the font independently):
> \setuphead [title] [textcommand=\uppercase]

And that works, thanks!

---

The bad news is that now I have a lot more questions concerning the
heading formatting.

There are several parameters which can be used:

  style
  textstyle
  textcommand
  numberstyle
  numbercommand

This is how I understand those (please, correct me when I am wrong).
Let us assume we have a chapter heading saying "Chapter 1. Title"
in the following examples:

  style=\bf       -> {\bf Chapter 1.}{\bf Title}
  textstyle=\bf   -> {Chapter 1.}{\bf Title}
  numberstyle=\bf -> {\bf Chapter 1.}{\bf Title}

If I got it right this far, then I think I get these. The relevant
parts of the heading are prepended with the given commands (whatever
they then may be).

But this mechanism does work only with the commands which change the
style from that point onwards (e.g., \it, \tfx). What about the
commands which take the text as a parameter (such as \cap{text})?

And what are textcommand and numbercommand? I tried playing a bit
with them. For example, \it or \bf can be put either as textstyle=\it
or textcommand=\it. On the other hand, the \uppercase can be used
only with textstyle. So, there is a difference as the name suggests
(my initial guess was that the difference is exactly what I ask above,
but doesn't seem to be so).

Where on Earth is \uppercase explained? I tried looking for it in
the manual -- in vain. I found some references to \uppercased which
seems to be another beast.

Thank you for your patience. If the stuff is not explained in
other places, I can Wiki it once I understand it.

- Ville

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

* Re: Capitalized headings
  2005-05-03 21:32 Ville Voipio
@ 2005-05-03 22:58 ` Adam Lindsay
  0 siblings, 0 replies; 5+ messages in thread
From: Adam Lindsay @ 2005-05-03 22:58 UTC (permalink / raw)


Ville Voipio said this at Wed, 4 May 2005 00:32:59 +0300:

>As \uppercase is a plain TeX macro, fixing it is not a good
>choice, especially because it is known to be bad. However,
>if \WORD could be built on \cap but without the font size
>changing, it would work fine. The odd behaviour of \uppercased
>(and the reasons to use it instead of the other choices) remains
>unclear to me.

I'm not entirely sure what's going on here, either, but as you've
observed, the smallcaps mechanism handles these things very robustly. I
was mucking about in this area recently, so here's a hack that hooks into
that mechanism (hopefully without ruining the rest of the smallcaps).
Insert disclaimers here ;)

\unprotected
\def\useallcaps
  {\def\cap@@uppercase{\the\everyuppercase\uppercased}%
   \def\cap@@lowercase{\the\everylowercase\lowercased}%
   \def\cap@@visualize{}}
\protected
\def\CAPITALIZED#1{\bgroup\useallcaps\smallcapped{#1}\egroup}

\CAPITALIZED{abcABCåäöÅÄÖ}

\smallcapped{abcABCåäöÅÄÖ}

\userealcaps
\smallcapped{abcABCåäöÅÄÖ}


This is new stuff to me, so I can't really articulate what's happening at
the moment. The code in core-fnt.tex isn't too tough to follow, though,
if you want to examine further.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept.     atl@comp.lancs.ac.uk
 Lancaster University, InfoLab21        +44(0)1524/510.514
 Lancaster, LA1 4WA, UK             Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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

* RE: Capitalized headings
@ 2005-05-03 21:32 Ville Voipio
  2005-05-03 22:58 ` Adam Lindsay
  0 siblings, 1 reply; 5+ messages in thread
From: Ville Voipio @ 2005-05-03 21:32 UTC (permalink / raw)


> The bad news is that now I have a lot more questions concerning the

It really seems that I do... I played around with the capitalization
commands and got some interesting results.

My test file is (works in live.contextgarden.net if required):

---

\enableregime[il1]
 
\starttext
 
abcABCåäöÅÄÖ
\cap{abcABCåäöÅÄÖ}
\uppercased{abcABCåäöÅÄÖ}
\WORD{abcABCåäöÅÄÖ}
\uppercase{abcABCåäöÅÄÖ}
 
\stoptext
 
---

So, the test string is: abcABC\aumlaut\aring\oumlaut\Aumlaut\Aring\Oumlaut
(just in case it does not display correctly). It gives:

\cap -> ABCABCÅÄÖÅÄÖ (in \tfx size), just as expected
\uppercased -> ABCABCåäöÅÄÖ (ABC's in \tfx, rest untouched)
\WORD -> ABCABCÅÄÖxxx (where xxx's are gibberish)
\uppercase -> ABCABCÅÄÖxxx

The plain TeX \uppercase seems to be known for its nasty behaviour
with anything else than US characters. \WORD seems to be a thin
wrapper around it, so similar behaviour is to be expected.

\uppercased makes interesting things, as it does uppercase the
abc's well but does not touch the accented characters in any
way.

Only \cap seems to do exactly what it should.

---

Things become even stranger, when the regime is switched to
UTF-8. Then \WORD and \uppercase give some errors and refuse
to compile. \uppercased and \cap work as described above.

---

As \uppercase is a plain TeX macro, fixing it is not a good
choice, especially because it is known to be bad. However,
if \WORD could be built on \cap but without the font size
changing, it would work fine. The odd behaviour of \uppercased
(and the reasons to use it instead of the other choices) remains
unclear to me.

- Ville

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

* Re: Capitalized headings
  2005-05-02 17:49 Ville Voipio
@ 2005-05-02 22:53 ` Adam Lindsay
  0 siblings, 0 replies; 5+ messages in thread
From: Adam Lindsay @ 2005-05-02 22:53 UTC (permalink / raw)


Ville Voipio said this at Mon, 2 May 2005 20:49:45 +0300:

>I've been trying to make capitalized (uppercase) 
>headings with little success. I'd like to have
>the titles simply capitalized as with \cap or
>\WORD.
>
>A minimal example:
>
>---
>
>\setuphead[title][style=WORD]
> 
>\starttext
>\title{This is a title}
> 
>The title should be \cap{capitalized} or \WORD{capitalized}.
>
>\stoptext
>
>---
>
>What did a do wrong?

I'm not sure you did do anything wrong: WORD is indeed a legal defined
alternativestyle, but it's not working.

However, this is a workaround, another way of attacking it (it can be
better, too, stylistically, as you can change the font independently):
\setuphead [title] [textcommand=\uppercase]
-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept.     atl@comp.lancs.ac.uk
 Lancaster University, InfoLab21        +44(0)1524/510.514
 Lancaster, LA1 4WA, UK             Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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

* Capitalized headings
@ 2005-05-02 17:49 Ville Voipio
  2005-05-02 22:53 ` Adam Lindsay
  0 siblings, 1 reply; 5+ messages in thread
From: Ville Voipio @ 2005-05-02 17:49 UTC (permalink / raw)


I've been trying to make capitalized (uppercase) 
headings with little success. I'd like to have
the titles simply capitalized as with \cap or
\WORD.

A minimal example:

---

\setuphead[title][style=WORD]
 
\starttext
\title{This is a title}
 
The title should be \cap{capitalized} or \WORD{capitalized}.

\stoptext

---

What should I give as the style? I have tried the 
following:

  style=WORD -> no effect
  style=Caps -> no effect
  style=uppercased -> no effect
  style=CAP -> no effect
  style=Cap -> no effect
  style=cap -> error
  style=kap -> error
  style=smallcaps -> small caps (when the font supports)

It is interesting to get an error message for the 
"style=cap", because this is one of the listed options
in the definition of \setuphead in the manual.

What did a do wrong?

- Ville

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

end of thread, other threads:[~2005-05-03 22:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-03 16:56 Capitalized headings Ville Voipio
  -- strict thread matches above, loose matches on Subject: below --
2005-05-03 21:32 Ville Voipio
2005-05-03 22:58 ` Adam Lindsay
2005-05-02 17:49 Ville Voipio
2005-05-02 22:53 ` Adam Lindsay

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