Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
2  
Just load the calc package and use \linewidth-2ex; you probably mean -2em, though. –  egreg Mar 13 '13 at 12:38
3  
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

1 Answer 1

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

\begin{minipage}{\linewidth-2ex}

Without any package the same can be accomplished by

\begin{minipage}{\dimexpr\linewidth-2ex\relax}

but calc is more powerful.

share|improve this answer

Your Answer

 
discard

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.