Fonts & Character SetsModerncv XeTeX: \textit ignored

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
thag1987
Posts: 17
Joined: Sun Jun 14, 2015 11:19 pm

Moderncv XeTeX: \textit ignored

Post by thag1987 »

Code: Select all

\newcommand{\entry}[4]{
	#1&\parbox[t]{7.2cm}{
	\textbf{#2}
	\hfill
	{\footnotesize\color{lightgray} #3}\\
	#4\\}\\}

	  	\entry
		    {2010 - 2014}
		    {Bachelor of Science}
		    {University}
		    {
		      lorem ipsum\\
		      lorem ipsum\\
		      lorem ipsum\\
		      \textit{italic textpart}
		    }
Looks like I can't do additional textformatting, like \textit, \textbf, \emph etc. in the argument. Is there a way to accomplish this without modifying the entry command?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Moderncv XeTeX: \textit ignored

Post by Johannes_B »

Where is that snippet coming from? Please provide a minimal working example, so we can reproduce the behaviour you are describing.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

Moderncv XeTeX: \textit ignored

Post by Stefan Kottwitz »

Looks like a CV class such as moderncv. However, here's nothing to see which could cause this. Perhaps the chosen font version has no italic version.

As Johannes said, if you would post a compilable example (with minimal dummy text), we could help to fix it.

Stefan
LaTeX.org admin
thag1987
Posts: 17
Joined: Sun Jun 14, 2015 11:19 pm

Moderncv XeTeX: \textit ignored

Post by thag1987 »

Code: Select all

\documentclass{article}
\usepackage[utf8]{inputenc}

\newcommand{\entry}[4]{
        #1&\parbox[t]{7.2cm}{
        \textbf{#2}
        \hfill
        {\footnotesize\color{lightgray} #3}\\
        #4\\}\\}

\begin{document}

                \entry
                    {2010 - 2014}
                    {Bachelor of Science}
                    {University}
                    {
                      lorem ipsum\\
                      lorem ipsum\\
                      lorem ipsum\\
                      \textit{italic textpart}
                    }

\end{document}
Sorry for that. I thought this was enough as a sample. But with this snipped it actually compiled fine. Testing it out separately let me find the mistake.

Code: Select all

\setmainfont % font that's been used everywhere where not specifically defined otherwise
[Mapping=tex-text,
BoldFont=HelveticaNeue-Bold.ttf,
ItalicFont=HelveticaNeue-Italic.ttf%<-----------
{HelveticaNeue.ttf}
Forgot to define the font mapping initially.
Post Reply