Generaluser defined variable

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
vivelafete
Posts: 11
Joined: Fri Nov 27, 2009 12:38 pm

user defined variable

Post by vivelafete »

it is possible to do something like:

\new_length{width_p3_table1_col1}{1234cm}

and then use the variable later in a table like p{width_p3_table1_col1}.

Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: user defined variable

Post by frabjous »

The syntax is:

\newlength{\width_p3_table1_col1}
\setlength{\width_p3_table1_col1}{1234cm}

and then:

p{\width_p3_table1_col1}
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Re: user defined variable

Post by phi »

Beware: underscores and digits are not allowed in control sequence names.
Post Reply