6

It seems that the symbol # on the \url inside \footnote is producing an error when pdf is compiled. This is reproduced by the MWE below.

\documentclass[12pt,twoside]{report}
\usepackage{booktabs}
\usepackage[headheight=18pt,a4paper, width=150mm, top=25mm, bottom=25mm, bindingoffset=6mm, headsep=18pt]{geometry}
\usepackage[spanish,es-noquoting]{babel}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage[hyphens]{url}
\renewcommand{\thefootnote}{\alph{footnote}}
\usepackage{csquotes} 
\usepackage[numbers, super]{natbib}
\usepackage{notoccite}
\usepackage[version=3]{mhchem}
\usepackage{chemmacros}
\chemsetup{
  formula = chemformula ,
  modules = all
}
\usepackage{hyperref}


\begin{document}
 \footnote{\url{https://chemicalize.com/#/calculation}} 
\end{document}

output:

! Illegal parameter number in definition of \Hy@tempa.
<to be read again>
/
l.20 ...rl{https://chemicalize.com/#/calculation}}
You meant to type ## instead of #, right?
Or maybe a } was forgotten somewhere earlier, and things
are all screwed up? I'm going to assume that you meant ##.
! Illegal parameter number in definition of \Hy@tempa.
<to be read again>

I search similar posts about # but couldn't find anything. Any help?

5

Define the url before the footnote with \urldef:

\documentclass[12pt,twoside]{report}
\usepackage{hyperref}

\begin{document}
\urldef\urlchem\url{https://chemicalize.com/#/calculation}

\footnote{\urlchem}
\end{document}

enter image description here

  • sorry, but if you include mhchem in preamble, this doesn't work. it seems, that mhchem is not compatible with url. tested with recent miktex. – Zarko Oct 6 '17 at 9:25
  • @Zarko: Works fine for me even with mhchem. (At least I get not error). Can you show your log-file? – Ulrike Fischer Oct 6 '17 at 9:29
  • log file: ! LaTeX error: "kernel/property-unknown" ! The key property '.value_required:' is unknown. ! See the LaTeX3 documentation for further information. ! For immediate help type H <return>. – Zarko Oct 6 '17 at 9:34
  • @Zarko Sounds like an outdated expl3. Did you run updates as user and as admin? (Edit: no, .value_required:n is the new code, .value_required: is old, so some package is probably outdated). – Ulrike Fischer Oct 6 '17 at 9:41
  • i use my pc as administrator. so far i didn't need to upgrade my miktex as user, it was sufficient as administrator. i should have recent expl3. – Zarko Oct 6 '17 at 9:53
2

I had a similar problem with Overleaf and an easy workaround was escaping the "#" with "\".

See example:

\footnote{Some constrains apply, see \url{https://developers.google.com/analytics/devguides/reporting/realtime/v3/devguide\#constraints}}.

Your Answer

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