1

I am trying to make a LaTeX document for maths notes.

I have written the following commands:

\newcommand{\definition}[2]{\textbf{Definition} (#1): #2 \index{#1} \tag{definition_#1}}
\newcommand{\definitionref}[1]{\nameref{#1}}

I would like, whenever the \definition command is used, a tag to be created based on what the defined object is called. For example, \definition{Vector}{blah} should be tagged with definition_Vector.

This does not compile, though. Any suggestions for how I can get this to work?

3
  • Where do you get \tag from? Do you mean \label{ } or \index{ }?
    – MS-SPO
    Commented Jun 10, 2023 at 10:25
  • please show a small complete example and the error you got. _ and \tag are math mode constructs, but your fragment appears entirely text mode and I can not guess how you intend \definition to be used Commented Jun 10, 2023 at 10:33
  • This sounds like something you probably want to use theorem environments for, e.g. amsthm or ntheorem.
    – Gaussler
    Commented Jun 10, 2023 at 12:41

0

You must log in to answer this question.

Browse other questions tagged .