2

Using amsrefs, I want to refer to an answer on mathoverflow. That site has automated amsrefs entry creation option. When I use it, everything goes fine, and the pdf file contains correct link. However when I send the file by gmail and open it in gmail with either Chrome or Firefox (latest build, on Windows 10), there is a problem with that link. If I copy it and paste elsewhere it is correct, but if I click on it, I am taken to a wrong address: instead of https://mathoverflow.net/q/313198 I get https://mathoverflow.net/q/31319 which is an entirely different page.

MWE: produce a pdf from

\documentclass{amsart}

\usepackage{amsrefs}

\begin{document}

$\binom nk$

\begin{biblist}
\bib{E}{misc}{
author={Noam D. Elkies (https://mathoverflow.net/users/14830/noam-d-elkies)},
note={URL: https://mathoverflow.net/q/313198 (version: 2018-10-19)}
}
\end{biblist}
\end{document} 

send it to, say, yourself via gmail and open it from within the gmail pdf viewer.

Let me add that with any other math command that I tried in place of that $\binom nk$ the error disappears.

What can I do?

13
  • 2
    If you want a link in the PDF you should mark it with \url{....} and use hyperref your PDF has no link just some text so you are relying on the pdf reader to make a non-standard guess that something that looks like a link is a link. Mar 1, 2019 at 20:36
  • I'm able to verify this. However, if you download the file and use a dedicated PDF viewer, the links work as expected. This is therefore dependent on the Gmail PDF viewer and not something to do with (La)TeX. Weird though...
    – Werner
    Mar 1, 2019 at 20:47
  • @DavidCarlisle I see, thanks. But is not it strange that this guess is influenced by the presence of $\binom nk$ nearby? Because other kinds of commands (like $\frac nk$ for example) do not cause this error. Mar 1, 2019 at 20:56
  • 1
    If you ask how to construct a latex file which has a link, that's on topic and Ulrike's answer is the answer. If you ask about your browsers (or gmails) heuristics for guessing links in plain text pdf with no link fields, then really that's off topic, the fact that the pdf was made by tex isn't relevant you'd presumably get the same if the pdf was made by word or whatever. Mar 1, 2019 at 21:17
  • 1
    Even more odd is that is a redirected address since mathoverflow.net/q/313198 leads to mathoverflow.net/questions/313191/… HOWEVER back to your issue you could try adding an extra / so it starts https://mathoverflow.net/q/313198/ then if gmail trims it back like this comment box did (hence the quotes) it will still redirect like mathoverflow.net/q/313198 does !!
    – user170109
    Mar 1, 2019 at 22:19

1 Answer 1

4

You should use hyperref and \url if you want real links:

\documentclass{amsart}

\usepackage{amsrefs}
\usepackage{hyperref}
\begin{document}

$\binom nk$

\begin{biblist}
\bib{E}{misc}{
author={Noam D. Elkies (https://mathoverflow.net/users/14830/noam-d-elkies)},
note={URL: \url{https://mathoverflow.net/q/313198} (version: 2018-10-19)}
}
\end{biblist}
\end{document} 

enter image description here

3
  • Yes it works that way, thank you. However let me point out that without that $\binom nk$ it also worked without hyperref and without the \url{...} Mar 1, 2019 at 20:53
  • 1
    Without hyperref the pdf viewer has to guess where links are by looking in the page stream - it is quite possible that this heuristic fails if you add or remove stuff to the page. Mar 1, 2019 at 21:00
  • Oh I see. Would never suspect that such clever heuristics were involved... Mar 1, 2019 at 21:02

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