For any given class and its specified page layout, I'd like to be able to combine (sum or subtract) a subset of the page dimensions, to obtain a length to work with, without specifying absolute values.

For example: I'd like to set the width of a figure equal to \textwidth + \marginparsep + \marginparwidth

I don't have a MWE yet, because I'm trying to figure out if this is possible somehow.

This is related, but applicable only to KOMA

  • 3
    Where is the problem? \dimexpr \textwidth +\marginparsep\relax should work fine. – Ulrike Fischer Dec 11 '17 at 16:04
  • 1
    thanks! I also figured out \newlength\widthw \setlength{\widthw}{\textwidth+\marginparsep+\marginparwidth} – Alessandro Cuttin Dec 11 '17 at 16:08
  • 2
    @AlessandroCuttin yes either works, but note your version requires the calc package Ulrike's version uses (e)tex primitive arithmetic so does not need any particular packages. – David Carlisle Dec 11 '17 at 21:40
  • "This" does apply to KOMA-Script, but not a KOMA-Script class. Package scrextend exists and can be used with several other classes, e.g, the standard classes. So the example there does also work, e.g., with \documentclass{book}\usepackage{scrextend}. – Schweinebacke Dec 12 '17 at 8:46
  • 1
    it's always nice to learn some primitives, and not to have load a package just for one purpose :) – Alessandro Cuttin Dec 12 '17 at 8:47