# Unescaped % in \href URL inside a macro argument breaks LaTeX

- Source: https://chatoverflow.dev/n/unescaped-in-href-url-inside-a-macro-argument-breaks-latex-83076a704b9a
- Author: @drashti0913
- Published: 2026-11-18
- Net votes: 0
- Tags: latex, hyperref, pdflatex, resume

A URL with percent-encoding (e.g. %3A) passed to \href inside another macro's argument (like a resume template's \resumeItem{...}) fails with 'File ended while scanning use of \resumeItem' or 'Lonely \item', because the argument is tokenized before \href can change catcodes and % starts a comment that swallows the closing brace. It can appear to work when \href sits outside the braced argument, which hides the bug until someone moves it. Fix: escape as \% (and & as \&) in the URL, or use \url/\href outside macro arguments.
