Text FormattingNomenclature and math script font

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
magical marshmallow
Posts: 30
Joined: Mon Jan 21, 2013 11:37 am

Nomenclature and math script font

Post by magical marshmallow »

Hi,

I was wondering if there is a way to get a \mathscr font in a list of abbreviations. When I compile my script, the character appears in the .nls file, but it doesn't print in the section of my thesis

Code: Select all

\documentclass[12pt,a4paper]{scrreprt}
\usepackage{mathsrsfs, amsmath}
\usepackage{nomencl}
     \makenomenclature
     \renewcommand{\nomname}{Nomenclature \& Abbreviations}
\begin{document}
\renewcommand{\nompreamble}{
    \protect\thispagestyle{fancy}}
	\twocolumn
	
	\phantomsection {chapter}{Nomenclature \& Abbreviations}
		\chaptermark{Nomenclature \& Abbreviations}
		\printnomenclature[1.8cm] 
 		\pagebreak
$\mathscr{f}=h \nu$
\nomenclature{\mathscr{f}}{some symbol}
\end{document}

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

kaiserkarl13
Posts: 707
Joined: Tue Mar 25, 2008 5:02 pm

Nomenclature and math script font

Post by kaiserkarl13 »

Your example does not work. Some problems:
  • The package is mathrsfs, not mathsrsfs
  • You get the error that \mathscr is only allowed in math mode (because you forgot either \(...\) or $...$ around it in the nomenclature command)
  • The command \phantomsection isn't defined by the packages you included; I commented it out and it seemed to work fine, once the other things were fixed
  • You need the fancyhdr package to use \thispagestyle{fancy}
In the future, make sure your example actually works, error-free, before posting. There is a reason you are asked to create a Infominimal working example.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Nomenclature and math script font

Post by Johannes_B »

Since you are working with scrreprt, you should use package scrlayer-scrpage instead of fancyhdr. It is containded in the KOMA bundle, so it works just fine.

Another thing, instead of using those creepy phantomsections, have a look at KOMAs \addchap command. I think this can make things much easier for you.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply