Graphics, Figures & Tables ⇒ how to assign a value to a variable
how to assign a value to a variable
I am a newbe in Latex and I'm wondering how to assign a value to a variable. This could then be useful to give every figure a constant figure width, for example. This is what I am trying to do
\newcommand{\figurewidth}{0.9\textwidth}
% and then later, in the figure enviroment
\begin{figure}
\includegraphics[width=\figurewidth]{dog}
\end{figure}
unfortunately integers do not work with \newcommand. How to do this?
Steven
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
how to assign a value to a variable
See LaTeX lengths.