8

I have a new laptop and installed Ubuntu 14.04 including TeX Live. A LaTeX file which worked well under Ubuntu 12.04 now gives error "Illegal parameter number in definition of \Hy@temp" when calling latex at every \citeads command (but not for pdflatex). The file is example.tex at http://www.staff.science.uu.nl/~rutte101/Report_recipe.html and is a decades-old latex primer, more recently expanded with bibtex cite macros that turn in-text citations into web browser openers for the astronomy literature database at NASA. These macros were contributed and are recommended by the journal Astronomy & Astrophysics. The errors are non-fatal (answering with "s" produces the proper example.dvi result).

Has something changed in hyperref? Is there a mistake in the citeads macros in that file?

MWE:

\documentclass{article}
\usepackage{natbib}
\usepackage{twoopt}
\usepackage{hyperref}

\makeatletter
\newcommandtwoopt{\citetads}[3][][]{%
  \href{http://adsabs.harvard.edu/abs/#3}{%
    \def\hyper@linkstart##1##2{}%
    \let\hyper@linkend\@empty%
    \citet[#1][#2]{#3}%
  }
}
\makeatother

\begin{document}
  \citetads{1981ApJ...247L..97M}
\end{document}

February 27 2019: solved by linuxss privately with

\makeatletter \protected\def\sppresslink{\def\hyper@linkstart##1##2{}\let\hyper@linkend@empty} \newcommandtwoopt{\citeads}[3][][]{ \href{http://adsabs.harvard.edu/abs/#3} {\sppresslink \citealp[#1][#2]{#3}}} \makeatother

I don't know how to format the above into proper line breaks.

closed as off-topic by egreg, user31729, ChrisS, Guido, Claudio Fiandrino Jun 11 '14 at 11:32

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Welcome to TeX.SX! I get the same error compiling the file with TeX Live 2010, 2011, 2012, 2013 and also with the development version of 2014; even after enabling the two breakurl lines. – egreg Apr 27 '14 at 12:23
  • 4
    This question appears to be off-topic because it is about a non reproducible problem – egreg Jun 11 '14 at 10:59
  • @egreg: In your first comment your reproduced it. I think the MWE above constructed by Heiko Oberdiek should reproducibly give the same error unless a latex wrapper calls /nonstopmode. I still hope for a guru to solve this problem. – Rob Rutten Jun 14 '14 at 8:44
  • 7
    I am a bit(?) late to the party. However, If there's a # anywhere in the URL, escape it. Like so \# – abyshukla Aug 18 '17 at 10:16
  • @manucpp Thanks for that! Came here from a Google search having the same problem, and your suggestion fixed it. – duckmayr Jan 27 at 12:38
2

The following fix inserting \nonstopmode and \errorstopmode works by having latex not stop at an error within \citeads, but this will make latex also not stop at a serious error in a citation. I would rather have a recoding of the macro in the above MWE to not get the "Illegal parameter number in definition of \Hy@temp." warning. So help is still welcome!

(apology: I don't know how to format the following properly; the stackexchange entry window undoes the newlines and spacings, so I added a newline per line)

\makeatletter
 \newcommandtwoopt{\citetads}[3][][]{%
  \nonstopmode%
  \href{http://adsabs.harvard.edu/abs/#3}{\def\hyper@linkstart##1##2{}%
    \let\hyper@linkend\@empty\citet[#1][#2]{#3}}%
  \errorstopmode}
\makeatother
0

When I compiled your MWE, I get the following result as output (Windows Machine with TeXLive 2013 installed from iso image): enter image description here enter image description here

Now, I feel there is problem with the installation of TeXLive. If you have installed it from the terminal, then make sure is the command sudo apt-get install texlive-full rather than simply sudo apt-get install texlive or sudo apt-get install texlive-base. Second, If it is from the iso, then the only way I feel should be updation. Try to update all the packages (if you can)(the command is tlmgr update all) else the packages natbib, twoopt and hyperref. This should solve the problem. The commands are :
tlmgr update self (requires sometimes. Better if it is done i.e Updating the TeXLive Manager before updating the packages). Then tlmgr update --package name--. That should do it.

  • Thanks for your attention! I ran sudo apt-get install texlive-full. It added two GB (which is a concern, this modern solid-state disk is not the size I was used to). No change, the same error. – Rob Rutten Apr 30 '14 at 18:53
  • Try to update the package hyperref, tlmgr update hyperref – subham soni May 1 '14 at 3:05
  • Tried tlmgr update hyperref: (running on Debian, switching to user mode!) cannot setup TLPDB in /home/rutten/texmf at /usr/bin/tlmgr line 5336.tlmgr so I googled and found and ran: tlmgr init-usertree and then tlmgr update hyperref and got (running on Debian, switching to user mode!) /usr/bin/tlmgr: Initialization failed (in setup_unix_one) /usr/bin/tlmgr: could not find a usable xzdec. /usr/bin/tlmgr: Please install xzdec and try again. Couldn't set up the necessary programs. Installation of packages is not supported. Please report to texlive@tug.org. tlmgr: exiting unsuccessfully (status 1). – Rob Rutten May 1 '14 at 14:29
  • Apology for very bad layout above. This form doesn't let me type Emacs-style and restricted the length to the above. It throws me out when I type a return... No idea what mini-Markdown means. – Rob Rutten May 1 '14 at 14:49
  • The "linkendempty" was caused by not copying the \makeatletter and \makeatother into the MWE (by Heiko Oberdiek). And @egreg: Ubuntu 12.04 seems to have used tex-live of 2009; so I guess – Rob Rutten May 5 '14 at 13:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.