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

Using \scshape in math mode

868 views
Skip to first unread message

Peter-Frank Spierenburg

unread,
Dec 10, 2003, 8:22:31 PM12/10/03
to
Greetings,

I would like to use \scshape in LaTeX math mode, but my LaTeX complains
that:

! LaTeX Error: Command \scshape invalid in math mode.

Several places on the Internet suggest using \mathsc but I get:

! Undefined control sequence.
\avmatrix -> \left [ \hskip -\arraycolsep \mathsc
\begin {array}{ll}

I'm trying to define my own avmatrix environment which creates
two-column (attribute/value) matrices with all the letters presented in
smallcaps.

Here is my definition (without smallcaps):

\newenvironment{avmatrix}{
\left[
\hskip -\arraycolsep
\begin{array}{ll}
}
{
\end{array}
\hskip -\arraycolsep
\right]
}

and here is an example usage:

$$
\begin{avmatrix}
married & - \\
phone & 3245 \\
name & Jones \\
office & D11 \\
\end{avmatrix}
$$

Any help would be appreciated.

Peter.

Walter Schmidt

unread,
Dec 10, 2003, 9:01:11 PM12/10/03
to
Peter-Frank Spierenburg schrieb:
>
> I would like to use \scshape in LaTeX math mode but my LaTeX complains
>
> ! LaTeX Error: Command \scshape invalid in math mode.

Use \textsc{...} instead!

In general, \text... commands work in math mode, too,
while the corresponding declarations don't.

HTH
Walter

Peter-Frank Spierenburg

unread,
Dec 10, 2003, 10:02:51 PM12/10/03
to

Walter Schmidt wrote:
> Peter-Frank Spierenburg schrieb:
>
>>I would like to use \scshape in LaTeX math mode but my LaTeX complains
>>
>>! LaTeX Error: Command \scshape invalid in math mode.
>
>
> Use \textsc{...} instead!

Tried it. Got the following error message.

! Missing \endgroup inserted.
<inserted text>
\endgroup

Peter.

Herbert Voss

unread,
Dec 11, 2003, 12:55:43 AM12/11/03
to
Peter-Frank Spierenburg wrote:

>>> I would like to use \scshape in LaTeX math mode but my LaTeX complains
>>> ! LaTeX Error: Command \scshape invalid in math mode.
>>
>>
>>
>> Use \textsc{...} instead!
>
>
> Tried it. Got the following error message.

\documentclass{article}
\parindent=0pt
\newenvironment{avmatrix}{%
\begin{center}
\sc $\left[
\hskip -\arraycolsep
\begin{tabular}{ll}
}{%
\end{tabular}
\hskip -\arraycolsep
\right]$%
\end{center}
}
\begin{document}

blah


\begin{avmatrix}
married & - \\
phone & 3245 \\
name & Jones \\
office & D11 \\
\end{avmatrix}

blah
\end{document}

Walter Schmidt

unread,
Dec 11, 2003, 6:46:06 AM12/11/03
to

I've tried it, too, and it worked for me.

Since you did not post an example to reproduce
the above problem, I can only guess that you don't
understand the syntax of the \textsc commands,
which differs from \scshape. It works like this:

\textsc{... some Text ...}

It's a command with an argument, whereas \scshape
is a declaration. Please, consult any LaTeX
introduction!

Walter

Peter-Frank Spierenburg

unread,
Dec 11, 2003, 5:40:56 PM12/11/03
to

Walter Schmidt wrote:
> Peter-Frank Spierenburg schrieb:
>
>>>>I would like to use \scshape in LaTeX math mode but my LaTeX complains
>>>>
>>>>! LaTeX Error: Command \scshape invalid in math mode.
>>>
>>>
>>>Use \textsc{...} instead!
>>
>>Tried it. Got the following error message.
>>
>>! Missing \endgroup inserted.
>><inserted text>
>> \endgroup
>
>
> I've tried it, too, and it worked for me.
>
> Since you did not post an example to reproduce
> the above problem, I can only guess that you don't
> understand the syntax of the \textsc commands,
> which differs from \scshape. It works like this:
>
> \textsc{... some Text ...}

Yes, I understand. But how do I embed that inside an environment
definition? i.e. I want to define my own environment which uses the
small-caps shape. I tried the following:

\newenvironment{avmatrix}{
\left[
\hskip -\arraycolsep

\begin{textsc}


\begin{array}{ll}
}
{
\end{array}

\end{textsc}
\hskip -\arraycolsep
\right]
}

If I replace \begin{textsc} with \textsc{ and the \end{textsc} with a }
I cannot imagine a parser which would be capable of properly parsing
such a mess.

The idea is to be able to change the font declaration in one place (the
environment definition) and have it change everywhere in my document.

Peter.

0 new messages