I have a rather big project where I need multiple packages at the same time. I have problems in using "german umlaute" (äöü) and other special characters in \href links.
Here is what I have:
\documentclass[12pt,a4paper]{article}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{xcolor}
\usepackage{soulutf8}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{eurosym}
\usepackage[hidelinks,pdfencoding=auto]{hyperref}
\geometry{
left=20mm,
top=15mm,
right=20mm,
bottom=15mm
}
\pagenumbering{gobble}
\setlength\parindent{0pt}
\newcommand{\cfbox}[2]{%
\colorlet{currentcolor}{.}%
{\color{#1}%
\fbox{\color{currentcolor}#2}
}%
}
\definecolor{COLOR_CON}{RGB}{255,0,0}
\definecolor{COLOR_DEF}{RGB}{0,255,0}
\begin{document}
\Large
\setul{0.5ex}{0.3ex}
\setulcolor{COLOR_DEF} % mit rot unterstrichen
\section*{§ 1 Beginn der Rechtsfähigkeit}
Die \href{<ref.> Ä ä Ö ö Ü ü § \& € </ref.>}{\ul{Link with Ä ä Ö ö underlined}}.
Die \href{<ref.> ä Ä ö Ö ü Ü § \& € </ref.>}{\cfbox{COLOR_CON}{Link with Ä ä Ö ö and text superscript in a box\textsuperscript{S1}}}.
\end{document}
I get an "TeX capacity exceeded" error. Or even if I remove all except one special character, it won't be displayed right.
I am using pdflatex for compiling. (Miktex 2.9 on Windows)
EDIT:
To be more clear, what my question is. How can I use those characters in both, the actual link (which is no http link) and the pdf document. As I already noted, if I remove the
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
the characters are correctly interpreted by my reader (texStudio). However those characters are not visible in the actual PDF document.
I can write something like \"a to get an ä in the output. Is there a way to avoid replacing all this manually, with a replacer function or something similar ?
\href? – Johannes_B Feb 25 '18 at 08:10<ref.> Ä ä Ö ö Ü ü § \& € </ref.>link names? – Feb 25 '18 at 08:15\href. If you want internal document links, you should not use\href, but\hypertarget and\hyperlinkas well as the regular\ref` etc. commands. But as it stands it is not clear to which object you want to refer to – Feb 25 '18 at 08:30\usepackage[utf8]{inputenc}for example, the characters work in the link, but not displayed on the pdf right. Even the € would work. – Maxi Feb 25 '18 at 08:39