4

Is it possible to create "automatic hyperlinks" in the sense that each time I write some word (or set of words) an hyperlink is automatically created? For example I would like that each time I write Schrödinger I have an hyperlink to https://en.wikipedia.org/wiki/Erwin_Schr%C3%B6dinger and the text says Schrödinger. The same as in Wikipedia where you have some words (or sets of words) with hyperlinks.

  • 1
    tex (other than luatex) isn't really designed for that, you could just use a text-replace in the editor or (more in the tex style) use \schrodinger and define that to be \href{Schrödinger}{https://en.wikipedia.org/wiki/Erwin_Schr%C3%B6dinger } or whatever. – David Carlisle Aug 25 '18 at 15:17

1 Answers1

1

Run with xelatex or Lualatex

\documentclass{article}
\usepackage{hyperref}
\usepackage{xspace}
\def\Schrödinger{\href{https://en.wikipedia.org/wiki/Erwin_Schrödinger}{Schrödinger}\xspace}
\begin{document}

What \Schrödinger wrote, is important for physics.

\end{document}

enter image description here

  • You could mention that the code you posted works with pdflatex or latex as well as long as you call the macro \Schrodinger (or \Schroedinger or \cat or whatever) – David Carlisle Aug 25 '18 at 16:04
  • sure ... but I used \Schrödinger :-) and the other ways were already mentioned in your comment –  Aug 25 '18 at 17:30