Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

\renewcommand\section to produce uppercase letters

1,784 views
Skip to first unread message

Donald Arseneau

unread,
Mar 8, 1996, 3:00:00 AM3/8/96
to
In article <4hpmgn$c...@doffen.uninett.no>, jarle...@nina.nina.no (Jarle Tufto) writes...
>How do I redefine the \section commands to produce headings in
>uppercase? I could of cource do \section{BLABLAHHBLAH...}
>but this is not very elegant...

Given that a computer can't apply uppercase reliably, this is by far the
most elegant solution. For example, here is a real title from one of my
papers:

\title{NeMu* CHEMILUMINESCENCE:\\ RADIOLYSIS EFFECTS IN GASES}

It would be incorrect to apply \uppercase indiscriminantly to the
whole text.

It is possible to hack \MakeUppercase{...} into the expected definition of
\@startsection (\@sect), but it is unwise.

Nevertheless, I would like to see braces around the title in \@sect so that
commands that take arguments could easily be used for the `font' declaration.

Donald Arseneau as...@reg.triumf.ca

Jarle Tufto

unread,
Mar 8, 1996, 3:00:00 AM3/8/96
to
Hi,

How do I redefine the \section commands to produce headings in

uppercase? I tried using things like

\renewcommand\section{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\center\normalfont\Large\uppercase}}

but the \uppercase command causes problems (\sc works but is
not what I wan't). Is there something equivalent to \sc that produce
uppercase letter?? I could of cource do

\section{BLABLAHHBLAH...}

but this is not very elegant... Any ideas???

Jarle

David Kastrup

unread,
Mar 10, 1996, 3:00:00 AM3/10/96
to
jarle...@nina.nina.no (Jarle Tufto) wrote:
>How do I redefine the \section commands to produce headings in
>uppercase? I tried using things like
...

>but the \uppercase command causes problems (\sc works but is
>not what I wan't). Is there something equivalent to \sc that produce
>uppercase letter?? I could of cource do
>
>\section{BLABLAHHBLAH...}

The problem with \uppercase is that it works entirely different from
what you'd think. It does not expand any of its arguments, and it is
usually not a good idea to have any of its arguments expanded more
than necessary. You can thus try
\uppercase{\section{Blablahhblah}}, or similar forms. Just make sure
that all letters inside of the \uppercase are properly visible when
\uppercase executes. And, of course, no letters that should not be
uppercased (control sequences don't count) should appear in its
argument (things like \uppercase{\usecounter{page}} will bomb, but not
so if the \usecounter{page} is buried in another macro definition).

There is a new LaTeX2e mechanims called \MakeTextUpper or similar, but
I haven't had any experience with it yet.

--
David Kastrup, Goethestr. 20, D-52064 Aachen Tel: +49-241-72419
Email: d...@pool.informatik.rwth-aachen.de Fax: +49-241-79502

Robin Fairbairns

unread,
Mar 11, 1996, 3:00:00 AM3/11/96
to
In article <udg2bgu...@top1.ma.man.ac.uk>,

David Carlisle <carl...@ma.man.ac.uk> wrote:
>> Nevertheless, I would like to see braces around the title in \@sect
>> so that commands that take arguments could easily be used for the
>> `font' declaration.
>
>A very sensible suggestion....

As one would expect...

>I also agree that uppercasing is a dangerous thing, it messes up maths
>as much as Chemisty... (An uppercase font would help)

Configurable uppercasing is one of the things that Yannis has in
prospect* for Omega. (I've proof-read a paper about it recently, but
I'm not sure whether it was for 16(4), already on discerning people's
desks, or for 17(1) which we're working on now.)

As I read the paper, the uppercasing stuff is available for betatest,
though not necessarily the required OTPs.
--
Robin (Campaign for Real Radio 3) Fairbairns r...@cl.cam.ac.uk
U of Cambridge Computer Lab, Pembroke St, Cambridge CB2 3QG, UK
Home page: http://www.cl.cam.ac.uk/users/rf/robin.html

David Carlisle

unread,
Mar 11, 1996, 3:00:00 AM3/11/96
to Jarle Tufto
In article <4hpmgn$c...@doffen.uninett.no> jarle...@nina.nina.no
(Jarle Tufto) writes:

Hi,

How do I redefine the \section commands to produce headings in
uppercase? I tried using things like

\renewcommand\section{\@startsection {section}{1}{\z@}%


{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\center\normalfont\Large\uppercase}}

but the \uppercase command causes problems (\sc works but is

not what I wan't). Is there something equivalent to \sc that produce
uppercase letter?? I could of cource do


Firstly it is better to use the LaTeX command \MakeUppercase rather
than \uppercase as otherwise things like \oe will not uppercase
correctly.

Secondly that last argument of \@startsection can only take
*declarations* ie things like \bfseries not commands that take
arguments like \textbf.

\uppercase and \MakeUppercase both take arguments.

So...

The `approved way' would be to mimic the chapter comand from report
class and use the slightly lower level \secdef command rather than
\@startcommand, then you can get hold of the argument text as an
argument to pass to \MakeUppercase,

however...

I happened to need this the other day (after I had written a class,
and the spec suddenly changed and needed uppercase:-) so I come up
with the following `elegant piece of coding'...

\def\section{%
\@startsection....{\normalfont\normalsize\bfseries\MIA@up}}
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\MIA@up}
% A bit naughty this. |\@startsection| only allows \emph{declarations}
% that affect the formatting of the title. Uppercasing is not a
% declaration but requires an \emph{argument}. So This command makes
% use of the internal way the heading is formated with a |\par| at the
% end. It is a `declaration' form of |\MakeUppercase| that grabs up to
% the end of the paragraph and passes it as an argument to
% |\MakeUppercase|, and then re-inserts the |\par|.
% \begin{macrocode}
\def\MIA@up{%
\def\@M##1\par{10000 \MakeUppercase{##1}\par}}
% \end{macrocode}
% \end{macro}
%


David Carlisle

unread,
Mar 11, 1996, 3:00:00 AM3/11/96
to Donald Arseneau

> Nevertheless, I would like to see braces around the title in \@sect so that
> commands that take arguments could easily be used for the `font' declaration.

A very sensible suggestion....

I also agree that uppercasing is a dangerous thing, it messes up maths


as much as Chemisty... (An uppercase font would help)

David

0 new messages