Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like to name my (sub-sub-)section "Something something β something." When I try

\subsubsection{Something something $\beta$ something}

it shows up exactly like that: with the dollar signs, unformatted. How do I fix this?

share|improve this question
8  
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. Your example actually compiles successfully in an otherwise empty article document. –  Qrrbrbirlbel Oct 14 '12 at 21:59
3  
Are you trying to get it working with hyperref? –  doncherry Oct 14 '12 at 22:16
    
@doncherry hyperref removes math shift characters (dollar signs) with a warning unless a very ancient version is used. –  Heiko Oberdiek Oct 15 '12 at 13:08
add comment

3 Answers

In the following article the Greek letter β renders properly.

Code

\documentclass{article}

\begin{document}

\section{Section Something $\beta$ something}

\subsection{Subsection Something $\beta$ something}

Something $\beta$ something.

\subsubsection{Subsubsection Something $\beta$ something}

Something $\beta$ something.

\paragraph{Subsubsubsection $\beta$ something}

Something $\beta$ something.

\end{document}

Output

enter image description here

Just to clarify: the example above has no Table of Contents. The same with it.

This code

\documentclass{article}

\begin{document}

\tableofcontents

\section{Section Something $\beta$ something}

\subsection{Subsection Something $\beta$ something}

Something $\beta$ something.

\subsubsection{Subsubsection Something $\beta$ something}

Something $\beta$ something.

\paragraph{Subsubsubsection $\beta$ something}

Something $\beta$ something.

\end{document}

produces

enter image description here

share|improve this answer
add comment

It's hard to tell wether it is that or not without a few more details, but I suspect here that you mean that it does not show up in the pdf menu but shows up nicely in the text.

It is indeed quite a problem to put any foreign mathematical expression in your title as they will be very wrong in the pdf menu.

In order to overcome this issue, I would give you two advice :

  • Avoid putting mathematical expressions in your titles. It is often unnecessary.
  • If you really need to put something special in there, always provide pdf with it's own way of writing it.

Therefore, in this case, I would do :

\subsubsection{\texorpdfstring{Something with $\beta$ in it. }%
                               {Something with beta in it. }}

It's a really non-ideal way of doing things (especially for mathematical equations), but I didn't find any better when I ran into the problem.

share|improve this answer
add comment

Since it seems we've started guessing, I'll add my guess. It follows the general direction as Samuel's, but actually provides a way of getting the beta in the PDF bookmark. As long as you just need linear math characters that you can somehow get in Unicode, you should be fine with this solution. Putting math in section titles doesn't seem to be a problem for the table of contents, as Américo remarked.

\documentclass{article}

\usepackage[utf8]{inputenc}

\usepackage[pdfencoding=auto]{hyperref}

\begin{document}

\tableofcontents

\section{Foo $\beta$}% doesn't work
\section{\texorpdfstring{Foo $\beta$}{Foo}}% doesn't work, but no errorrs
\section{\texorpdfstring{Foo $\beta$}{Foo β}}% ooooooohh :)

\end{document}

output

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.