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
  • 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. Aug 25, 2018 at 15:17

1 Answer 1

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

2
  • 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) Aug 25, 2018 at 16:04
  • sure ... but I used \Schrödinger :-) and the other ways were already mentioned in your comment
    – user2478
    Aug 25, 2018 at 17:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .