5

The following forces an error

\href{https://fr.wikipedia.org/wiki/Gouvernement_de_la_République_française}{France} 

replacing or deleting the ç stops the error

Error reported:

! Illegal parameter number in definition of \Hy@tempa.

The preamble includes:

\usepackage[utf8]{inputenc} \usepackage[unicode=true]{hyperref} 

Anyone any suggestions or a workaround?

1

2 Answers 2

7

You need to load the fontenc package with the option T1. (The default is still OT1.) In contrast it shouldn't be necessary to load the inputenc package with the option utf8 unless your LaTeX format isn't fully up to date. (LaTeX formats since 2018-04-01 are OK.)

\documentclass{article} % \usepackage[utf8]{inputenc} % not unless LaTeX format isn't up to date \usepackage[T1]{fontenc} % <-- this one matters \usepackage[spaces,obeyspaces,hyphens]{url} % optional \usepackage[colorlinks]{hyperref} \begin{document} \href{https://fr.wikipedia.org/wiki/Gouvernement_de_la_République_française}{France} \end{document} 
0
1

Wrapping the url in \detokenise{} does the job

\href{\detokenize{https://fr.wikipedia.org/wiki/Gouvernement_de_la_République_française}}{France} 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.