Text FormattingDisplaying the content of a variable or length

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
mike1
Posts: 2
Joined: Thu Sep 02, 2010 10:25 am

Displaying the content of a variable or length

Post by mike1 »

Hi All,

How can I display on screen the content (value) of variable or length I've defined?.

For example:
\newlength{\mylength}
\settowidth{\mylength}{\textwidth}

so I want to see what's in \mylength. Does latex also print the units of a length?.

Thanks,
Mike.

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Displaying the content of a variable or length

Post by localghost »

With a TeX primitive.

Code: Select all

\the\mylength

Best regards and welcome to the board
Thorsten
mike1
Posts: 2
Joined: Thu Sep 02, 2010 10:25 am

Re: Displaying the content of a variable or length

Post by mike1 »

Thanks for the prompt reply,
Mike.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Displaying the content of a variable or length

Post by localghost »

So it it seems that you can mark the topic accordingly. In this case I did that for you.
Post Reply