LaTeX, MiKTeX, using variables

160 Views Asked by At

I'm still pretty new to TeX and MiKTex but I had a question. I want to be able to access a variable called VERSION that would store the current version number of my document and use that in my TeX document instead of having to hardcode the number each time. Also, I use the TeXworks application in MiKTeX to generate my PDF versions of the documents. Is there a way, using TeXworks to have it also recognize this variable when generating the PDF?

Thanks for any help!

Russ

1

There are 1 best solutions below

2
samcarter_is_at_topanswers.xyz On BEST ANSWER

You could store the version number in a macro and reuse it throughout the document:

\documentclass{article}

\newcommand{\version}{1.3}

\title{test \version}

\begin{document}

\maketitle

The current version \version\ is stable

\end{document}