0

My goal is to write something like this within a LaTex document:

\section{Introduction}
\makemarksummary{section{Introduction}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua\mymark{Elephants}. 
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris 
nisi ut aliquip exea commodo consequat\mymark{Ducks}. 

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum 
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident\mymark{Leopards}, sunt in culpa qui officia deserunt mollit 
anim id est laborum.

And have it render something like this:

1 Introduction

Elephants - Ducks - Leopards

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Additional things I'd like to do include:

  • Remove duplicates in the makemarksummary (so if I have two \mymark{Elephants}, only one instance is displayed)

  • Be able to sort the order of the mymarks within makemarksummary

  • Also include a second argument in mymark so I can display the content of that as a marginpar

This question is tagged with "labels" because I had to tag something, but I am not talking about marking specific objects (such as a \section), but rather points within text (more like \marginpar or \footnote). Additionally, sorry if this is a duplicate question - it feels like some existing command or package must do this already, but I can't work out how to articulate it well enough to search for it.

  • 1
    Welcome to TeX.SX! Where should the information about the tag/label names be taken from in your \makemarksummary command? – siracusa Oct 23 at 11:22
  • 1
    You need to write the information to an external file (e.g. the .aux) and have it read back in on the next run. I can't honestly see why you'd want to do this - it is hard to think of a use case, so I don't know that I'd expect somebody else to have invented this particular wheel already. – cfr Oct 24 at 3:14
  • @siracusa - from all the \mymarks from the \marksummary until the next \marksummary OR within the section containing the \marksummary (either works for me) – Peter Mabbott Oct 30 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.