TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on a poster template with a not so easy to reproduce style with nested blocks. To that end, I have to create a minipage whose width depends on \linewidth minus some fixed value. In a nutshell, I want to subtract something in the width specification of the minipage.

How can I express \linewidth "MINUS" 2ex in my template?

share|improve this question
Just load the calc package and use \linewidth-2ex; you probably mean -2em, though. – egreg Mar 13 '13 at 12:38
Or precede it with \dimexpr: \begin{minipage}{\dimexpr\linewidth-2ex} – Andrew Swann Mar 13 '13 at 12:46
@egreg: I didn't know about the calc package. This answers the question (hint). (Note: I did mean 2ex since it is determined by a different vertical margin.) – bitmask Mar 13 '13 at 12:52
up vote 7 down vote accepted

The calc package allows for expressing operations on dimensions in the argument to minipage, \parbox, \setlength and other places.

So, after \usepackage{calc}, you're allowed to say


Without any package the same can be accomplished by


but calc is more powerful.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.