I am writing a college course outline. It contains both a table with an overview of the dates and topics and a more extended outline of the specific topics later in the text. Ideally, I would like to input the dates into the table and have other places in the text echo the dates, so I don't have to make the changes in multiple places. I'm sure this is possible, I just don't know how.

  • 3
    If you say \def\dateColumbus{1492}, then wherever in the document you use \dateColumbus{}, the text 1492 will appear. – Steven B. Segletes Sep 16 '16 at 9:50

Using xparse, you could do something like this. Note that this uses the new and experimental(but stable) syntax from the LaTeX3-team. It is meant for class- and package-developers, so it follows a very different syntax than LaTeX and TeX. The same code could ofcourse be made in TeX also.

Here, you get info by writing \vars{name}, where name would produce your name.

You could of course use just a regular \newcommand{\myname}{John Doe} and you would have a variable by calling \myname. It depends on what kind of syntax you want.


enter image description here




    \str_case_x:nn {\str_foldcase:n {#1}}
      {name}{John\ Doe}
          Foo & Bar \\
          \vars{name} & \vars{phone}\\


My name is \vars{name}.

  \caption{My info}

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.