General ⇒ Define Variable
Define Variable
someone say if it is possible to define a variable in latex and after that to use it in a if instruction?
I can't find information about this..
For example i would like to define a variable called "version" and use it to include a .tex file rather than another .tex file.
Thank you for the help
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Define Variable
Code: Select all
\def\verA{1}
\def\verB{2}
\def\ver{1}
\ifx\ver\verA
%do something for version 1
\fi
\ifx\ver\verB
%do something for version 2
\fi
Cheers,
Tomek
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Define Variable
the comment package provides a simple way with environments for different versions that can be excluded or included.
Stefan