Text FormattingRaisebox in Section

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
DeltaCMD
Posts: 1
Joined: Mon Jun 08, 2015 4:12 pm

Raisebox in Section

Post by DeltaCMD »

I got a little Problem here.

I need to use a "#" in a Section Headline.

so i got
\newcommand{\FISs}{FIS\raisebox{2mm}{\tiny\#}}
and i want to put this in a section like
section{\FISs}

But i keek gettig the same Error over and over.
Errorinfo

Code: Select all

! Argument of \@sect has an extra }.<inserted text>\par \section{\FISs}

! Paragraph ended before \@sect was complete.<to be read again>\par \section{\FISs}

! Argument of \@sect has an extra }.<inserted text>\par \section{\FISs}

! Paragraph ended before \@sect was complete.<to be read again>\par \section{\FISs}

! Paragraph ended before \foreignlanguage was complete.<to be read again>\par \newpage

! Extra }, or forgotten \endgroup.<argument> ...idb@x \let \reserved@d =[\def \par }} \newpage

! Extra }, or forgotten \endgroup.<argument> ...db@x \let \reserved@d =[\def \par }} \newpage
I think i requiere some assitance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Raisebox in Section

Post by rais »

DeltaCMD wrote:I need to use a "#" in a Section Headline.

so i got
\newcommand{\FISs}{FIS\raisebox{2mm}{\tiny\#}}
and i want to put this in a section like
section{\FISs}

But i keek gettig the same Error over and over.
Errorinfo

! Argument of \@sect has an extra }.<inserted text>\par \section{\FISs}
your definition of \FISs is fragile and the argument for \section is a moving argument, hence your \FISs breaks apart. Try

Code: Select all

\section{\protect\FISs}
or use \DeclareRobustCommand instead of \newcommand to make it robust in the first place.

KR
Rainer
Post Reply