4

When using \hspace and \vspace, I often run into a decision of which units to use. In many examples I see the use of ex, cm, mm, pt, in, and so on. I also use .1\textwidth or .1\textheight. I wonder if there is a standard unit that makes sense for moving boxes or figures in beamer; I am recently consolidating all of my vertical space units to ex but is this sensible? Is there an equivalent horizontal space unit which corresponds to character width (for a monospace font), for instance?

2
  • 1
    You can use em for horizontal space. See this for more info: tex.stackexchange.com/questions/8260/… ,especially Herbert's last answer and this one tex.stackexchange.com/questions/4239/…
    – percusse
    Commented Sep 30, 2012 at 12:32
  • Some units change depending on the type size. For example, if your \documentclass has a 10pt (11pt) option then 1em will be equal to 10pt (11pt). Some lengths are better expressed relative to the type size, in which case you should use em or ex. Other units are better expressed in absolute units such as cm, m, and even inch.
    – user10274
    Commented Sep 30, 2012 at 12:43

1 Answer 1

7

It depends why you are moving things.

.1\textwidth is a fraction of the page size so changes if you change page size (which is perhaps less likely in beamer than in a journal article class). 5pt is a fixed unit (at some notional size which may not relate to any actual size by the time you have projected your presentation, so it is more or less used the same way as a fraction of \textwidth for positioning things relative to the page in fixed units. cm, in etc are just (in TeX) defined as fixed multiples of pt so they are just for human convenience. If you find cm more convenient than pt use it if not, don't.

ex and em are font related sizes so don't use them for positioning on page as the position will change depending on the font. Use them for things like indents (or defining the size of inter-word-space) or inter-paragraph space where the size determination relates to the content rather than the area into which the content is being typeset.

Traditionally em is used for horizontal units (its name derives from the width of an M) and ex is used for vertical units (its name derives from the height of an x).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .