[Tex/LaTex] How to express \begin{minipage}{\linewidth-2ex}

minipagewidth

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?

Best Answer

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.