7

my problem is the following, when I use UTF-8 in meta data is not working

\documentclass[10pt,a4paper]{article}
\usepackage[slovene]{babel}
\usepackage[utf8]{inputenc}


%Meta data
\pdfinfo{ 
/Author (Č ŽĆŠĐ) 
/Title (Č ŽĆŠĐ) 
/Keywords (Latex;Č;Ž;Ć;Š;Đ) }

\begin{document}

test utf-8 žćč

\end{document}

example of output (meta data)

enter image description here

Why can not parse it Š,Č,Ž,Đ in meta data?

  • 2
    you are using pdftex which knows nothing about Unicode, so the inputenc package takes your utf8 input and arranges to convert it to internal classic tex commands that pdftex does understand, but for pdf info data you need to either pass the unicode string straight through or convert the latex internal form back to unicode. Simplest is to use hyperef which is set up to do these translations. – David Carlisle Dec 15 '13 at 0:51
10

enter image description here

In addition to getting latex to write the strings as unicode you need to set up the pdf to use unicode metadata rather than the original PDF string encoding Without the uniocde option, Hyperref can do most of the characters but warns

Package hyperref Warning: Composite letter `\textasciicaron+C'
(hyperref)                not defined in PD1 encoding,
(hyperref)                removing `\textasciicaron' on input line 11.

with unicode=true all characters are translated.

\documentclass[10pt,a4paper]{article}
\usepackage[slovene]{babel}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}

%Meta data
\hypersetup{
unicode=true,
pdfauthor=Č ŽĆŠĐ,
pdftitle=Č ŽĆŠĐ,
pdfkeywords={Latex;Č;Ž;Ć;Š;Đ}
}

\begin{document}

test utf-8 žćč

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.