# Italic is not working in the given template

I use following template: https://github.com/RUB-NDS/exposee_layout

I added following code at the end of the "Related Work"-Chapter:

\textit{TESTTESTTESTTESTTEST}
{\itshape abcdefgh}
non-italic \emph{should be italic} itshape: {\itshape should be italic}
textit: \textit{should be italic}


None of these resulted in a italic style of my text. I also researched for the warnings that I get:

But really could not find any solution. Maybe someone here is able to help. I use pdflatex for compilation.

Thank you all in advance.

Regards

--------------------UPDATE--------------------

Hello,

first of all thanks for the reply.

The following code is my mwe:

\documentclass[
fontsize=11pt,
paper=a4,
abstract=true,
numbers=noenddot,
listof=totoc,
bibliography=totoc,
open=right,
cleardoublepage=plain,
parskip=half+, % comment this out if you do not want an empty half line between paragraphs, but please read the KomaScript Guide and search for parskip (around page 82): ftp://ftp.dante.de/pub/tex/macros/latex/contrib/koma-script/scrguide.pdf
BCOR=1cm, % Bindekorrektur: Change this accordingly, also read the KomaScript Guide! Make sure you read the guide.
]{scrreprt}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\input{misc/preamble}
\setcounter{tocdepth}{3}  % Inhaltsverzeichnis bis Subsubsection
\setcounter{secnumdepth}{3} % Nummerierung bis Subsubsection

% General stuff
\usepackage{fixltx2e}
\usepackage[utf8]{inputenc} % CHANGE HERE IF NECESSARY
\usepackage[T1]{fontenc}
\usepackage[ngerman, english]{babel} % last language given is used (here: english)
\usepackage{lmodern}
%\usepackage{microtype}
\usepackage{ifpdf}
\usepackage{ifthen}

%%%%%% MACROS %%%%%%
\usepackage{xspace} % Nur dann ein Leerzeichen, wenn das nächste Zeichen kein Satzzeichen ist.
\newcommand{\SecII}{Sec\textsuperscript{2}\xspace}
\newcommand{\SAML}{\acr{SAML}\xspace}
\newcommand{\XML}{\acr{XML}\xspace}

% Set date here
%\day=6 \month=6 \year=2012

% Set name and title
\author{Insert your name here}
\title{Insert title here}
\date{\today}

%%%%%% %%%%%%

% Load packages ...

% Corporate Design
\usepackage{eso-pic}
\usepackage{color}
% Comment out if the RUB fonts are installed
%\usepackage{rubfonts2009}
\newcommand{\setrubfontnormal}[1]{\fontfamily{rubscala}\fontsize{#1}{1}\selectfont}
\newcommand{\setrubfontextra}[1]{\fontfamily{rubflama}\fontsize{#1}{1}\selectfont}
\definecolor{rubgreen}{cmyk}{0.5,0,1,0}
\definecolor{rubblue}{cmyk}{1,0.5,0,0.6}

%Ganttchart
\usepackage{pgfgantt}

% Figures
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{placeins}

% Tables
\usepackage{booktabs}
\usepackage{marvosym}
\usepackage{multirow}

% Math stuff and units
\usepackage{latexsym,amsmath, amssymb, amsfonts, upgreek}
\usepackage{siunitx}
\newcommand{\mathup}{\mathrm}

% Glossary
\usepackage[nonumberlist, acronym, toc]{glossaries}
\makeglossaries

% Enable quotes by \enquote{}
\usepackage[babel,english=american, german=quotes]{csquotes}

% Necessary for frontpage, allows to create automata and fancy graphics
\usepackage{tikz}

% Protocols and bytefields
\usepackage{protocol}
\usepackage{bytefield}

% Source code listings
\newcommand{\code}[1]{\texttt{#1}}
\definecolor{colIdentifier}{rgb}{0,0,0}
\definecolor{colKeys}{rgb}{0,0,1}
\definecolor{colString}{rgb}{0,0.6,0}

\usepackage{caption}
\usepackage{listings}
\lstset{%
float=hbp,%
basicstyle=\ttfamily\scriptsize, %
identifierstyle=\color{colIdentifier}, %
keywordstyle=\color{colKeys}, %
stringstyle=\color{colString}, %
columns=flexible, %
tabsize=2, %
aboveskip={1.5\baselineskip}, %
frame=single, %
extendedchars=true, %
showspaces=false, %
showstringspaces=false, %
numberstyle=\tiny, %
breaklines=true, %
backgroundcolor=, %
breakautoindent=true, %
captionpos=b%
}

% Algorithms
\usepackage[ruled, vlined, linesnumbered,algochapter,algo2e]{algorithm2e}

% Format page foot and header
\usepackage{scrpage2}
\automark[section]{chapter}

%% use some standards for mathematical expressions:
\newcommand{\red}{{\rm red}}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}
% \newtheorem{definition}[theorem]{Definition}
\newtheorem{algorithm}[theorem]{Algorithm}
\newenvironment{example}{\begin{quote}{\bf Example:}}{\end{quote}}

% BIBTEX, http://merkel.zoneo.net/Latex/natbib.php
% if you uncomment this block, you'll get an english bibliography with alphanumerical references
%\usepackage{bibgerm} % u. a. statt et al
\usepackage[square,numbers]{natbib} % eckige klammern, natbib-package
% \setbibpreamble{{\large Seitenzahlen, auf denen ein Eintrag referenziert wird, werden am Ende eines jeden Eintrags angegeben.}\newline} % Wegen der pagebackref-Option des hyperref-Packets, wird vielen nicht direkt klar was das soll http://projekte.dante.de/DanteFAQ/Verzeichnisse#16

% gray definition boxes, that whay you'll find them in the text
\newenvironment{definition}[1][]{
\begin{sthm}[#1]
}{\end{sthm}}

% experimental
%\usepackage{scrhack}

% DO NOT LOAD ANY OF YOUR PACKAGES BEYOND THIS PACKAGE

\makeatletter
\AtBeginDocument{
\hypersetup{
pdftitle = {\@title},
pdfauthor = {\@author},
pdfsubject={\@title},
pdfkeywords={SAML, add more}, % CHANGE HERE
%    unicode={true},
}
}
\makeatother

% Use the same counter for tables and figures
\makeatletter
\AtBeginDocument{
\let\c@table\c@figure
\let\c@lstlisting\c@table
\let\c@algocf\c@lstlisting
}
\makeatother

\ifpdf
\hypersetup{linktocpage=false}  % false=links are section names, true=links are page numbers, IMPORTANT: in dvi2ps mode, 'true' is required!
\else
\hypersetup{linktocpage=true}       % false=links are section names, true=links are page numbers, IMPORTANT: in dvi2ps mode, 'true' is required!
\usepackage[hyphenbreaks]{breakurl}
\fi

%Customizing GanttChart
\definecolor{barblue}{RGB}{153,204,254}
\definecolor{groupblue}{RGB}{51,102,254}
\renewcommand\sfdefault{phv}
\renewcommand\mddefault{mc}
\renewcommand\bfdefault{bc}
\sffamily
\ganttset
{%
y unit chart=0.6cm,
canvas/.append style={fill=none, draw=black!35, line width=.5pt},
hgrid={*1{draw=black!35, line width=.1pt}},
hgrid style/.style={draw=black!35,line width=.1pt},
vgrid={*1{draw=black!35, line width=.1pt}},
today rule/.style={draw=black!64,dash pattern=on 3.5pt off 4.5pt,line width=1.5pt},
today label font=\small\bfseries,
title/.style={draw=none, fill=none},
title label font=\bfseries\footnotesize,
title label node/.append style={below=7pt},
progress label text={\pgfmathprintnumber[precision=0, verbatim]{#1}\%},
include title in canvas=false,
bar label font=\mdseries\small\color{black!70},
bar label node/.append style={left=0cm},
bar/.append style={draw=none, fill=black!63},
bar incomplete/.append style={fill=barblue},
bar progress label font=\mdseries\footnotesize\color{black!70},
bar height=.8,
bar top shift=0.1,
group top shift=0.1,
group incomplete/.append style={fill=groupblue},
group left shift=0,
group right shift=0,
group height=.8,
group peaks tip position=0,
group label node/.append style={left=.6cm},
group progress label font=\bfseries\small,
link label node/.append style={below left=-2pt and 0pt}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% here your document starts
\begin{document}

%% switch to roman paginating for the acknowledgements, table of contents etc.
\pagenumbering{roman} % uncomment this if you like it

%% title page --- made out of expressions defined above
This is the front page

\pagenumbering{arabic} %switches to arabic numbers for the rest of the text
\setcounter{page}{1}

These are other pages

\textit{TESTTESTTESTTESTTEST}
{\itshape abcdefgh}
non-italic \emph{should be italic} itshape: {\itshape should be italic}
textit: \textit{should be italic}

\pagestyle{scrplain} % turn off headers and footers

%\KOMAoptions{open=any} % Plaziert Kapitel auch auf linken Seiten

%% generate bibliography with bibtex, the bibfile here is "paper.bib"
\flushbottom
%\bibliographystyle{plainnat}
%\bibliography{literature/literature}

\end{document}


--------------------UPDATE TWO--------------------

I just recognized that italic works as soon as I delete the section

\ganttset{[...]}


at the end of my mwe. That is the solution but I would be interested to know why this is happening? Is there someone who could explain this?

Thanks

• Could you please post a complete MWE, so we can see what packages you’re loading? We can’t tell what’s wrong without one. – Davislor Oct 16 at 17:04
• Hi, I updated my post. Hope it helps to understand the problem. – 1ittle_6ird Oct 16 at 19:13

Thanks for the code. In the future, you’ll be better off removing every part of the preamble that you can, while still demonstrating the bug, and also make sure it compiles (so it’s a Minimal, Working Example.) This helps both you and us: you actually found the location of the bug yourself by removing different parts of your preamble. Also, there’s a \usepackage{protocol} package in there that’s not in TeX Live, but which you must have on your own system. This means we can’t test the same code you’re running, and something that works for us might not for you.

The problem is actually with these lines before \ganttset:

\renewcommand\sfdefault{phv}
\renewcommand\mddefault{mc}
\renewcommand\bfdefault{bc}


This attempts to set the sans-serif font to use the condensed version of some old version of Helvetica that you probably don’t actually have, but whoever wrote that template back in the day did. It does this by telling LaTeX to use the condensed series of all fonts. Because none of the fonts you’re actually using have a medium condensed (mc) or bold condensed (bc) series, all font-selection commands break.

If you check the error messages in your .log file, you’ll probably see a couple about how it could not find {T1}{lmr}{mc}{it}, and substituted {T1}{lmr}{m}{n} instead.

Delete those commands. If you really do want to use a clone of Helvetica instead of Latin Modern Sans, didn’t just copy and paste that code by mistake, you can add \usepackage{tgheros} after \usepackage{lmodern}.

There are a few other bits of obsolete code that jumped out at me. \usepackage{scrpage2} should be \usepackage{scrlayer-scrpage}. The \red command should be defined as \textnormal{red} instead of {\rm red}, and you should probably define Example: as a remark, or failing that, {\normalfont\bfseries Example:} instead of using \bf. You have a \sffamily command in your preamble, but if you really want to use the sans-serif font as your main font, you should instead \renewcommand{\familydefault}{\sfdefault} or load a font package that supports [sfdefault].

The larger problem here is that you seem to be copying a bunch of old code from someone else’s document that you don’t really need or want. I would suggest you try commenting out as much of that as you can that doesn’t actually cause any bugs.