TransWikia.com

Is there a reasonably simple way to automatically generate unique tags for definitions, propositions, lemmas, etc.?

TeX - LaTeX Asked by Dat Minh Ha on June 27, 2021

Particularly, I would like to know if there is a way a novice like me can have unique and unchanging tags in a manner similar to the tag system of The Stacks Project automatically assigned to my lemmas and theorems, etc. ? I have had a look at Gerby, but frankly, I did not understand much of it. Also, I should note that I write using Overleaf.

If you’re confused, here is what I mean by "a tag system".

One Answer

Perhaps something like this. (This example uses LuaLaTeX, but the basic approach works the same in any engine.)

documentclass{article}
usepackage{newcomputermodern}
usepackage{amsthm}
usepackage{microtype}
usepackage[bookmarks,
            colorlinks,
            destlabel,
            unicode]{hyperref}

% You would set the PDF title, author, etc. with package options or
% hypersetup.

setmathfont{XITS Math}[
  range = QED,
  Scale = MatchUppercase ]

renewcommandqedsymbol{ensuremath{QED}}

theoremstyle{remark}
newtheorem*{joketheorem}{Russell’s Remark}

title{A Remark By Russell on Vacuous Truths}
date{13 March 2021}

begin{document}
maketitle

begin{abstract}
This paper recounts a clever extemporaneous hyperref[rem:vacuous]{illustration}
by Bertrand Russell of the concept of vacuous truth.
end{abstract}

clearpage

Once, when Bertrand Russell said in a lecture that any proposition whatsoever
follows logically from a false premise, a student asked him, ``If (1 + 1 = 1),
does that prove I'm the Pope?"  Russell replied:

phantomsection % Add an automatically-named link target.
begin{joketheorem}
label{rem:vacuous}
If (1 + 1 = 1), I am the pope.

begin{proof}
I am  one.

The Pope is one.

One and one are one.

Therefore, I and the Pope are one.
end{proof}
end{joketheorem}

end{document}

The abstract links to the theorem in the body of the document, with the relative URL #rem:vacuous. A ref or autoref would also work for a numbered theorem. You can give out an URL like https://some.edu/~someone/papers/russell.pdf#rem:vacuous as well. The destlabel option causes each link destination to be named automatically after the following label.

If you want a perma-link to an official version of the document, you can set the baseurl as a package option or with hypersetup.

Answered by Davislor on June 27, 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