5

I am writing a CV, using the XeLaTeX template below: https://www.sharelatex.com/templates/cv-or-resume/professional-cv

When I include special characters like č,ž,š, it left blank space in the output PDF.

\documentclass[a4paper,10pt]{article}

%A Few Useful Packages
\usepackage{marvosym}
\usepackage{fontspec}                   %for loading fonts
\usepackage{xunicode,xltxtra,url,parskip}   %other packages for formatting
\RequirePackage{color,graphicx}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[big]{layaureo}              %better formatting of the A4 page
% an alternative to Layaureo can be ** \usepackage{fullpage} **
\usepackage{supertabular}               %for Grades
\usepackage{titlesec}                   %custom \section

%Setup hyperref package, and colours for links
\usepackage{hyperref}
\definecolor{linkcolour}{rgb}{0,0.2,0.6}
\hypersetup{colorlinks,breaklinks,urlcolor=linkcolour, linkcolor=linkcolour}

%FONTS
\defaultfontfeatures{Mapping=tex-text}
%\setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin}
%%% modified for Karol Kozioł for ShareLaTeX use
\setmainfont[
SmallCapsFont = Fontin-SmallCaps.otf,
BoldFont = Fontin-Bold.otf,
ItalicFont = Fontin-Italic.otf
]
{Fontin.otf}
%%%

%CV Sections inspired by: 
%http://stefano.italians.nl/archives/26
\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[\titlerule]
\titlespacing{\section}{0pt}{3pt}{3pt}
%Tweak a bit the top margin
%\addtolength{\voffset}{-1.3cm}

%Italian hyphenation for the word: ''corporations''
\hyphenation{im-pre-se}

%-------------WATERMARK TEST [**not part of a CV**]---------------
\usepackage[absolute]{textpos}

\setlength{\TPHorizModule}{30mm}
\setlength{\TPVertModule}{\TPHorizModule}
\textblockorigin{2mm}{0.65\paperheight}
\setlength{\parindent}{0pt}

I tried to use package

\usepackage{polyglossia}
\setmainlanguage{slovenian}

but I still got blank space.

Any idea what to do?

5
  • 1
    Welcome! What does the console output or log file say? Please provide a complete but minimal example we can use to reproduce the problem.
    – cfr
    Jul 13, 2017 at 12:19
  • 7
    You appear to be using the Fontin font family. Does Fontin provide glyphs for č, ž, and š? The version of this font that's installed on my system (version 001.000, from 2004; admittedly, this may not be the latest version) does not provide such glyphs.
    – Mico
    Jul 13, 2017 at 12:20
  • 1
    I just deleated \setmainfont[ SmallCapsFont = Fontin-SmallCaps.otf, BoldFont = Fontin-Bold.otf, ItalicFont = Fontin-Italic.otf ] {Fontin.otf} and now all special characters work. Jul 13, 2017 at 12:45
  • 1
    @TimotejMrzelj - So, which font are you using instead of Fontin? Just the default font, which would be Latin Modern?
    – Mico
    Jul 13, 2017 at 17:13
  • polyglossia doesn't do anything for font-handling btw
    – Florian
    Nov 11, 2017 at 9:44

2 Answers 2

1

That is (as mentioned in the comments) very probably just a font-issue.

The Fontin I could download here just doesn't have the required glyphs with diacritics from Latin Extended A. The font only contains most of Latin 1 and some odd others.

With most fonts you can leave it to fontspec to find italic and bold styles. On the other hand the above-mentioned version of Fontin (and quite some other fonts available) doesn't use proper naming for its small-caps font, so you need to call this explicitly.

Also the file-extension is usually superfluous and often (at least on my OS) even disruptive.

\setmainfont[
SmallCapsFont = Fontin SmallCaps,
]
{Fontin}

works for me -- for Western alphabets, that is.

-2

Note: For Pdflatex but still load some xelatex packages

Code where disabled your font because I do not have it and added the three first packages there

\documentclass[a4paper,10pt]{article}

% https://tex.stackexchange.com/a/213324/13173
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{newunicodechar}

%A Few Useful Packages
\usepackage{marvosym}
%\usepackage{fontspec}                   %for loading fonts
\usepackage{xunicode,xltxtra,url,parskip}   %other packages for formatting
\RequirePackage{color,graphicx}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[big]{layaureo}              %better formatting of the A4 page
% an alternative to Layaureo can be ** \usepackage{fullpage} **
\usepackage{supertabular}               %for Grades
\usepackage{titlesec}                   %custom \section

%Setup hyperref package, and colours for links
\usepackage{hyperref}
\definecolor{linkcolour}{rgb}{0,0.2,0.6}
\hypersetup{colorlinks,breaklinks,urlcolor=linkcolour, linkcolor=linkcolour}

%FONTS
\defaultfontfeatures{Mapping=tex-text}
%\setmainfont[SmallCapsFont = Fontin SmallCaps]{Fontin}
%%% modified for Karol Kozioł for ShareLaTeX use
%\setmainfont[
%SmallCapsFont = Fontin-SmallCaps.otf,
%BoldFont = Fontin-Bold.otf,
%ItalicFont = Fontin-Italic.otf
%]
%{Fontin.otf}
%%%

%CV Sections inspired by: 
%http://stefano.italians.nl/archives/26
\titleformat{\section}{\Large\scshape\raggedright}{}{0em}{}[\titlerule]
\titlespacing{\section}{0pt}{3pt}{3pt}
%Tweak a bit the top margin
%\addtolength{\voffset}{-1.3cm}

%Italian hyphenation for the word: ''corporations''
\hyphenation{im-pre-se}

%-------------WATERMARK TEST [**not part of a CV**]---------------
\usepackage[absolute]{textpos}

\setlength{\TPHorizModule}{30mm}
\setlength{\TPVertModule}{\TPHorizModule}
\textblockorigin{2mm}{0.65\paperheight}
\setlength{\parindent}{0pt}

\begin{document}

Ž

š,č,ž

\end{document}

Output

enter image description here

2
  • Your answer isn't very good. The OP is using a unicode engine, you are providing an answer for pdflatex and still load packages unsuitable (i.e. for use with xelatex).
    – Johannes_B
    Sep 22, 2017 at 6:37
  • 1
    @Johannes_B Which packages should be removed here for Pdflatex proposal? Nov 11, 2017 at 8:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .