latex3 / hyperref

Hypertext support for LaTeX
164 stars 35 forks source link

Argument of \HyPsd@@ReplaceFi has an extra } #164

Closed LostInDarkMath closed 3 years ago

LostInDarkMath commented 3 years ago

Hi there, I noticed that my old Tex files no longer compile and I hope you can help me. Consider this minimal example with the imports I use:

\documentclass[]{scrreprt}

\usepackage[utf8]{inputenc}           

\usepackage{aligned-overset}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{anyfontsize}
\usepackage{array}
\usepackage[english, ngerman]{babel}
\usepackage{bbm}
\usepackage{csquotes}
    \MakeOuterQuote{"}
\usepackage[
    type={CC},
    modifier={by-nc-sa},
    version={4.0},
]{doclicense}
\usepackage{enumitem}
\usepackage{epigraph}
\usepackage{float}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{lmodern}
\usepackage{makecell}
\usepackage{makeidx}
\usepackage{mathrsfs}
\usepackage{mleftright}
\usepackage{pdflscape}
\usepackage{pgfplots}
    \pgfplotsset{compat=newest}
\usepackage{scrhack}
\usepackage{setspace}
\usepackage{stmaryrd}
\usepackage{tikz}
    \usepackage{tikz-qtree}
    \usetikzlibrary{arrows}
    \usetikzlibrary{automata}
    \usetikzlibrary{babel}
    \usetikzlibrary{calc}
    \usetikzlibrary{cd}
    \usetikzlibrary{fit}
    \usetikzlibrary{matrix}
    \usetikzlibrary{patterns}
    \usetikzlibrary{positioning}
    \usetikzlibrary{shapes.geometric}
\usepackage{xargs}
\usepackage{xcolor}
\usepackage{xfrac}
\usepackage{xparse}
\usepackage{xr}

\usepackage[backref]{hyperref}
\usepackage[boxruled]{algorithm2e}
\usepackage[english, ngerman, capitalise]{cleveref}

\publishers{\url{}}  % if you comment out this line, it works fine

\begin{document}
    Hello world!
\end{document}

This give me the following errors:


! Argument of \HyPsd@@ReplaceFi has an extra }.
<inserted text> 
                \par 
l.65 \end{document}

I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.

Runaway argument?
\\END \fi 
! Paragraph ended before \HyPsd@@ReplaceFi was complete.
<to be read again> 
                   \par 
l.65 \end{document}

I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

Runaway argument?
`\HyPsd@SPACEOPTI `\045%%`\043`\04612`~~~\134
! Paragraph ended before \HyPsd@@ReplaceFi was complete.
<to be read again> 
                   \par 
l.65 \end{document}

I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

! Undefined control sequence.
\HyPsd@Subst ...dafter \HyPsd@@ReplaceFi #3#1\END 
                                                  \fi }
l.65 \end{document}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Runaway argument?
! Paragraph ended before \HyPsd@@ReplaceFi was complete.
<to be read again> 
                   \par 
l.65 \end{document}

I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

! Undefined control sequence.
\HyPsd@Subst ...dafter \HyPsd@@ReplaceFi #3#1\END 
                                                  \fi }
l.65 \end{document}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Runaway argument?
! Paragraph ended before \HyPsd@@ReplaceFi was complete.
<to be read again> 
                   \par 
l.65 \end{document}

I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

! Undefined control sequence.
\HyPsd@Subst ...dafter \HyPsd@@ReplaceFi #3#1\END 
                                                  \fi }
l.65 \end{document}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Runaway argument?
! Paragraph ended before \HyPsd@@ReplaceFi was complete.
<to be read again> 
                   \par 
l.65 \end{document}

I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

! Undefined control sequence.
\HyPsd@Subst ...dafter \HyPsd@@ReplaceFi #3#1\END 
                                                  \fi }
l.65 \end{document}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Runaway argument?
! Paragraph ended before \HyPsd@@ReplaceFi was complete.
<to be read again> 
                   \par 
l.65 \end{document}

I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

! Undefined control sequence.
\HyPsd@Subst ...dafter \HyPsd@@ReplaceFi #3#1\END 
                                                  \fi }
l.65 \end{document}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Runaway argument?
! Paragraph ended before \HyPsd@@ReplaceFi was complete.
<to be read again> 
                   \par 
l.65 \end{document}

I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.

! Undefined control sequence.
\HyPsd@Subst ...dafter \HyPsd@@ReplaceFi #3#1\END 
                                                  \fi }
l.65 \end{document}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

The interesting thing is if I comment out the line \publishers{\url{}} it will work fine. Years ago, this was no problem. Do you have any idea what could be the issue here?

What I tried:

  1. uninstalled MiKTeX and TeXMaker
  2. installed MiKTeX version 20.11, 7609, 64 bit
  3. updated packagaes with MiKTeX
  4. installed TeXMaker 5.0.4 64 bit

Best, Willi

u-fischer commented 3 years ago

An example that loads 30 unrelated packages and libraries isn't a minimal example. Next time remove them please.

Beside this it is a problem of the hyperxmp package which uses the \@publishers command from scrartcl and tries to write it to the metadata. Set the publisher for the metadata separatly:

\documentclass[]{scrartcl}
\usepackage{hyperxmp}
\usepackage{hyperref}
\hypersetup{pdfpublisher=https://github.com/latex3/hyperref}
\publishers{\url{https://github.com/latex3/hyperref}}  % 
\begin{document}
    Hello world!
\end{document}

or use \texorpdfstring:

\publishers{\texorpdfstring{\url{https://github.com/latex3/hyperref}}{something safe}}  % 
LostInDarkMath commented 3 years ago

Thank you very much! It works fine :+1:

I include all this packages in my example because I thought that could be a package conflict.