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

Greek symbols in text mode

4 views
Skip to first unread message

XYZ

unread,
Nov 20, 2009, 9:46:33 AM11/20/09
to
I need to type in some Greek letters in text mode. Right now I do it
with a following command
2~$\mu$m % 2 micrometers
but I don't like it as \mu is in italics. How can I change it to be upright?

Thanks,

xyz

Lars Madsen

unread,
Nov 20, 2009, 9:54:30 AM11/20/09
to

don't do it like this, use siunitx for proper unit handling

--

/daleif (remove RTFSIGNATURE from email address)

LaTeX FAQ: http://www.tex.ac.uk/faq
LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal examples, see URL below
http://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxampl
http://www.minimalbeispiel.de/mini-en.html

Joris

unread,
Nov 20, 2009, 9:54:42 AM11/20/09
to

use upgreek

XYZ

unread,
Nov 20, 2009, 10:34:42 AM11/20/09
to
On 2009-11-20 15:54, Lars Madsen wrote:
> XYZ wrote:
>> I need to type in some Greek letters in text mode. Right now I do it
>> with a following command
>> 2~$\mu$m % 2 micrometers
>> but I don't like it as \mu is in italics. How can I change it to be
>> upright?
>>
>> Thanks,
>>
>> xyz
>
> don't do it like this, use siunitx for proper unit handling
>

Thank you! That's what I was looking for.

Theo Markettos

unread,
Nov 21, 2009, 4:20:29 PM11/21/09
to
Lars Madsen <dal...@rtfmsignatureimf.au.dk> wrote:
> don't do it like this, use siunitx for proper unit handling

There's one small problem in that \SI{}{} doesn't work too well in headings
(and tables of contents etc). Especially if they're being converted to PDF
indices using hyperref. Is there a workaround for this, short of just
avoiding siunitx in headings?

Theo

Lars Madsen

unread,
Nov 21, 2009, 4:31:54 PM11/21/09
to

Better idea if you ask the author directly. Not sure if he reads all
entries on ctt, so it might be an idea to send him an email.

What is wrong with them in headings and TOC? I don't see much of a
problem with it (hyperref aside)

/daleif

Joseph Wright

unread,
Nov 21, 2009, 4:40:08 PM11/21/09
to

Well, I do (unless I'm away, and even then try to keep up). I wonder
what is meant by "does not work". You'll notice that there is
deliberately an example in the manual of a unit in a heading:

%\subsection{Why do most of the examples use
% \texorpdfstring{\si{\joule\per\mole\per\kelvin}}{J mol-1 K-1}?}

Note that you have to use \texorpdfstring for things to work with hyperref.
--
Joseph Wright

Philipp Stephani

unread,
Nov 22, 2009, 6:42:09 AM11/22/09
to
Joseph Wright <joseph...@morningstar2.co.uk> writes:
> Note that you have to use \texorpdfstring for things to work with hyperref.

Dou you think it's possible to write variants of \SI and \si that are
purely expandable and whose expansion consists of plain strings? These
variants could then be used for \pdfstringdefDisableCommands.

--
Change “LookInSig” to “tcalveu” to answer by mail.

Joseph Wright

unread,
Nov 22, 2009, 6:48:50 AM11/22/09
to
Philipp Stephani wrote:
> Joseph Wright <joseph...@morningstar2.co.uk> writes:
>> Note that you have to use \texorpdfstring for things to work with hyperref.
>
> Dou you think it's possible to write variants of \SI and \si that are
> purely expandable and whose expansion consists of plain strings? These
> variants could then be used for \pdfstringdefDisableCommands.

Possibly by bailing out of processing things and simply using
more-or-less direct direct output. I'm working on siunitx v2 as I write,
so I might look at it in that context.
--
Joseph Wright

Joseph Wright

unread,
Nov 22, 2009, 8:28:28 AM11/22/09
to

Okay, I have a couple of possible solutions to this. I can either
arrange for

\si{\joule\per\mole}

to turn into

J/mol

or

joule per mole

(You can't have super/subscripts in PDF bookmarks very easily). In
neither is the bookmark going to match the printed output (at least with
the default settings).

Thoughts?
--
Joseph Wright

Theo Markettos

unread,
Nov 25, 2009, 8:26:35 AM11/25/09
to
Joseph Wright <joseph...@morningstar2.co.uk> wrote:
> Well, I do (unless I'm away, and even then try to keep up). I wonder
> what is meant by "does not work". You'll notice that there is
> deliberately an example in the manual of a unit in a heading:
>
> %\subsection{Why do most of the examples use
> % \texorpdfstring{\si{\joule\per\mole\per\kelvin}}{J mol-1 K-1}?}
>
> Note that you have to use \texorpdfstring for things to work with hyperref.

Ah, that's I think what I was missing. Otherwise for:
\section{\SI{1}{\nano\henry}}

I get errors like:

Package hyperref Warning: Token not allowed in a PDFDocEncoded string,
(hyperref) removing `\SI' on input line 13.


Package hyperref Warning: Token not allowed in a PDFDocEncoded string,
(hyperref) removing `\nano' on input line 13.


Package hyperref Warning: Token not allowed in a PDFDocEncoded string,
(hyperref) removing `\henry' on input line 13.

And the contents of \SI don't get typeset at all even if, as in this
example, the output needs no special formatting or non-ASCII characters.

Theo

Joseph Wright

unread,
Nov 25, 2009, 9:31:41 AM11/25/09
to
On Nov 25, 1:26 pm, Theo Markettos <theom+n...@chiark.greenend.org.uk>
wrote:

> And the contents of \SI don't get typeset at all even if, as in this
> example, the output needs no special formatting or non-ASCII characters.
>
> Theo

This is fixed in the experimental version 2 code. It's not so easy to
port back to the current release version. If you want to try out a
snapshot of the new code, it's on my blog (http://www.texdev.net).
--
Joseph Wright

Tobias

unread,
Nov 27, 2009, 7:01:39 PM11/27/09
to
And how can I get the mu symbol that comes with the font? I can
directly enter it as a Unicode symbol in XeTeX.

Joseph Wright

unread,
Nov 28, 2009, 8:55:28 AM11/28/09
to
On 28/11/2009 00:01, Tobias wrote:
> And how can I get the mu symbol that comes with the font? I can
> directly enter it as a Unicode symbol in XeTeX.

Set the mathsmu and textmu options to the appropriate symbol.
--
Joseph Wright

Will Robertson

unread,
Nov 28, 2009, 9:10:42 AM11/28/09
to
On 2009-11-28 10:31:39 +1030, Tobias <tow...@gmail.com> said:

> And how can I get the mu symbol that comes with the font? I can
> directly enter it as a Unicode symbol in XeTeX.

\textmu ?
You'll need the textcomp package in LaTeX or the xunicode package in XeLaTeX.

Will

Tobias

unread,
Nov 29, 2009, 11:47:09 AM11/29/09
to
On Nov 28, 2:55 pm, Joseph Wright <joseph.wri...@morningstar2.co.uk>
wrote:

> Set the mathsmu and textmu options to the appropriate symbol.

Thanks. I looked in the wrong place in the manual.

--Tobias

0 new messages