{dimensions} is used for questions addressing issues related with measurements in TeX. This tag can be used with specific tags like {height}, {size}, {units},...

learn more… | top users | synonyms

11
votes
3answers
28k views

set a maximum width and height for an image

I would like to define a maximum height and a maximum width for an image at same time. I suppose there must be a package to do this, but actually I'm unable to find it...
5
votes
1answer
305 views

Is it possible to remove length, counter, dim, etc that have been declared?

Let's see the following screenshot taken from an answer of Efficient ways to anonymize a document and the given comment. Is it possible to remove length, counter, dim, etc, that have been declared ...
28
votes
1answer
5k views

What are the possible dimensions / sizes / units LaTeX understands?

I know there are different ways of expressing sizes or dimensions in LaTeX such as points (pt), inches (in) and ex. As some commands, such as \hspace understand all of them, I would like to have a ...
30
votes
5answers
2k views

Confused with TeX terminology: height, depth, width

The LaTeX reference card states for example \strut box w/ ht and depth of “(”, zero width I came to see text as a two dimensional feature, but I must be missing out on something... (following ...
45
votes
2answers
17k views

No room for a new \dimen

I have this error message: ! No room for a new \dimen . \ch@ck ...\else \errmessage {No room for a new #3} \fi which I can not find a cure for.
20
votes
3answers
1k views

Draw dimension of a line as a decoration in TikZ

Is it possible to define in TikZ a new decoration or something like that, such that it is possible to write something like: \draw[dim={text,above}] (A) -- (B); \draw[dim={text,below}] (C) -- (D); ...
9
votes
1answer
258 views

How to typeset dimensions of a box?

I want to typeset something like this: 3.0 × 3.0 × 0.9 mm How can I do that in LaTeX (using siunitx package)? So far, I have this: \num{3.0} × \num{3.0} × \SI{0.9}{\milli\metre} But probably ...
7
votes
1answer
268 views

Why is there no \mudimendef primitive?

The TeXbook defines in chapter 24 (page 270 in my edition) the notion of <dimen>, <skip>, <mudimen> and <muskip>, the first two being used in horizontal and vertical mode, ...
8
votes
2answers
419 views

TikZ/PGF: Create a saved length as part of a shape definition

When I create a new shape using pgfdeclareshape, I want to be able to store a length for later reference. I might want to do simple arithmetic on this length later on. Here's a basic attempt: ...
0
votes
1answer
214 views

How should I express my length calculation to minimize rounding errors?

I have an input file as follows. % Test.tex \documentclass{article} \usepackage{pstricks} \psset { linewidth=0.01 } \newcommand\All{0.1} \newcommand\Left{-\All} \newcommand\Right{\All} ...
6
votes
1answer
8k views

\colorbox{color}{text} without increasing the height and width of the cell in a table

When using \colorbox{color}{text} to put background color for the text in a table, the text with background color seems to take more space and makes the respective cell higher and wider. Is there a ...
9
votes
1answer
551 views

How does PDF or PDF Viewer define a rounding rule for stroke thickness?

I defined a sequence of line segments of different thickness each as follows. \documentclass{article} \usepackage{multido} \parindent=0sp \begin{document} ...
2
votes
2answers
286 views

What unit should we use when working with (La)TeX and PSTricks to minimize conversion error?

I want to minimize conversion error when working with PSTricks and (La)TeX. The conversion error really affects the accuracy of bounding box, the thickness of LaTeX's \fbox and the thickness of ...
20
votes
2answers
3k views

What are the differences between \newdimen, \newskip and \newlength?

What are the differences between \newdimen, \newskip, and\newlength? When should I use each of them? Please give me a non-trivial example for each case.
2
votes
1answer
50 views

How to suppress units such that they can be passed to viewport key?

How to suppress units in length macros such that they can be passed to viewport. See the following Minimal Not Working Example, \documentclass{article} \usepackage{graphicx} \newsavebox\IBox ...
4
votes
2answers
796 views

Is there a command to convert cm to bp?

I want to convert a length in cm (centimeter) to bp (big point). Is there a command to convert cm to bp?
13
votes
1answer
2k views

Determine height and depth of letters relative to the font size

I would like to scale graphical elements (like images, tikz and tikz-timing diagrams) relative to the font size, so that they have the same height as an normal uppercase letter (i.e. X or M; I noticed ...
3
votes
1answer
172 views

Force stringification of a length

I'm trying to include a background image of the correct size based on the two variables \IApaperheight and \IApaperwidth. To do this, I'm converting the lengths to a rounded text value and ...
5
votes
1answer
310 views

TikZ: How to compare approximate equality of dimensions?

When scaling tikzpicture using option scale, some points that had equal coordinates appear to be shifted a little bit. So the precise comparision \ifdim \y1 = \y2 will not do anymore. I'm aware of ...
39
votes
3answers
4k views

Dimensioning of a technical drawing in TikZ

Is there is an easy way to mark dimensions in a technical drawing with TikZ? Is there a library or something? Edit I am using XeLaTeX. Update I chose Martin's answer because it serves me well ...
12
votes
2answers
4k views

Dimension too large while plotting with pgfplots

I have the following pgfplots code: \begin{tikzpicture} \begin{axis}[domain=-8:2] \foreach \i in {-10,-9.8,...,10} {\addplot+[smooth] {-x/\i+\i};}% \end{axis} \end{tikzpicture} I need several ...
11
votes
1answer
569 views

What is the right way to set a dimension parameter?

In the TeXbook Knuth set parameters for dimensions mostly as follows: \parskip=3pt Other package authors define such parameters without using the equal sign \parskip30pt Many later authors use ...
11
votes
2answers
257 views

What is “dimen” in the documentation for the ifthen package?

In the documentation for the ifthen package, there is a test called \lengthtest which compares two <dimen> parameters with the operators <, > or =. (For other test commands, <dimen> ...
3
votes
2answers
278 views

A problem with the dimension of the pages of a book

I am typesetting a book in mathematics and I have a problem with the dimension of its pages. My publisher wants me to prepare the book in A4 format and also the size of the texts in each pages be ...
6
votes
3answers
818 views

Why are box dimension assignments both local and global?

Consider the following code. \setbox0 \hbox{XXX} \fbox{\copy0} { \setbox0\hbox{ZZZ} {\wd0 0pt} \fbox{\copy0} } \fbox{\box0} This produces three ruled boxes. The two XXXs ...