TransWikia.com

How to modify the proof-environment

TeX - LaTeX Asked by Jonathan Prieto-Cubides on July 20, 2021

I wonder if it’s possible to make the QED symbol in the proof environment clickable, to redirect to some given website.
Concretely, the syntax would be something like this:

begin{proof}[Sketch of the Proof.][url="..."]
.
.
.
end{proof}

One Answer

Here's one way of doing it with amsthm's proof environment:

documentclass{article}
usepackage{hyperref}  % For links, provides href
usepackage{amsthm}  % For proof environment
usepackage{amssymb}  % For square symbol
begin{document}
begin{proof}
    renewcommand{qedsymbol}{href{https://tex.stackexchange.com/}{(square)}}
    Test
end{proof}
end{document}

You can then create your own environment that is defined in a similar way:

newenvironment{linkproof}[2][]{%
    begin{proof}[#1]
    renewcommand{qedsymbol}{href{#2}{(square)}}
}{%
    end{proof}
    renewcommand{qedsymbol}{(square)}
}

Which is then used as

begin{linkproof}[ABC]{www.google.com}
    Test
end{linkproof}

You could also edit the definition of proof so it has this behaviour as well.

Correct answer by Willoughby on July 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP