skip to main | skip to sidebar

Linux Notes

Monday, January 7, 2008

measure the width of a LaTeX savebox

\settowidth needs \usebox!

\newsavebox{\mybox}
\sbox{\mybox}{hello world!}
\newlength{\myboxlen}
\settowidth{\myboxlen}{\usebox{\mybox}}
\noindent
\rule{\myboxlen}{1pt}\\
\usebox{\mybox}
box size: \the\myboxlen.

advanced computations are possible using the calc package.
Posted by leo at 4:52 AM

2 comments:

jetxee said...

Thank you! Just what I looked for!

January 5, 2009 at 11:25 PM
Unknown said...

Man, you just saved my life!

September 7, 2009 at 6:56 PM

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2012 (1)
    • ►  January (1)
  • ►  2011 (6)
    • ►  October (1)
    • ►  September (1)
    • ►  May (3)
    • ►  March (1)
  • ►  2010 (8)
    • ►  December (2)
    • ►  November (1)
    • ►  October (1)
    • ►  March (3)
    • ►  February (1)
  • ►  2009 (12)
    • ►  December (1)
    • ►  November (1)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  May (1)
    • ►  April (1)
    • ►  February (5)
  • ▼  2008 (30)
    • ►  December (1)
    • ►  November (2)
    • ►  October (6)
    • ►  July (3)
    • ►  June (1)
    • ►  April (4)
    • ►  March (3)
    • ►  February (3)
    • ▼  January (7)
      • redirect stdout to X clipboard
      • PDF Viewer with Text Highlighting
      • create iso image
      • reset printer
      • measure the width of a LaTeX savebox
      • vim C / C++ auto completion
      • rewrapping paragraphs in vim
  • ►  2007 (84)
    • ►  December (3)
    • ►  November (7)
    • ►  October (4)
    • ►  September (70)