Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [unit-of-measure]

Questions about TeX's length units.

5
votes
2answers
90 views

TikZ: Advantage of position values attached with a unit?

Regarding TikZ-images: When should I type positioning values attached with a unit (e.g. \draw (0cm, 0cm)...) and when should I type them without a unit (e.g. simply \draw (0, 0)...)? Minimum Working ...
3
votes
3answers
230 views

How can I separate the number from the unit in argument?

Let us say that I have a function, in which I give a number plus a unit. I would like to get only the number, is it possible ? Here is a MWE: \documentclass{article} \usepackage[utf8]{inputenc} \...
2
votes
1answer
56 views

Illegal unit of measure px when clipping in xelatex (but not pdflatex)

When I compile my document with pdflatex (on Ubuntu) it works fine. I was switching to xelatex for some other issues, but now the following code will no longer compile: \includegraphics[clip, trim={...
3
votes
1answer
109 views

Coordinates unit in pt although default is cm in TikZ

As we know that in TikZ, if unit is not mentioned in the coordinate in TikZ, it takes cm by default. When I extract the coordinates, I was expecting the unit as cm. But TikZ shows the unit in the ...
2
votes
0answers
36 views

bp (PostScript point) pica?

A few months ago I noticed while inspecting some of my LaTeX-generated PDFs that the font sizes used were not what I had specified. I went to check the source file, but all my font sizes were just how ...
2
votes
1answer
26 views

Layout package modifies float figure behavior

I have been working in a document where I need to load the layout package in the preamble and then my document also includes several figures with sub figures in each. The sub figures are identified by ...
2
votes
3answers
122 views

Adding width of text to node coordinate?

I am currently trying to position some text in the center of a square drawn in a tikzpicture, like so: However, I am having a bit of trouble. Take the following example: \documentclass{article} \...
2
votes
0answers
54 views

What unit-of-measure for distances or other aspects (width, height,..) should be used inside Tikz? [closed]

I was wondering if it is just a question of someones own opionion or is there a clear superior way of using unit-of-measure such as pt, px, cm, ex, ... when drawing a picture or setting the ...
1
vote
1answer
228 views

Baseline in TikZ default unit of length

Lately, I have been using the baseline argument in TikZ pictures, but I couldn't figure out what was the default unit of length. I know that the cm is the default unit for TikZ package, but it doesn't ...
3
votes
1answer
76 views

Metric Didot point and Cicero

A while ago I found out that there are two hardly known units available at least in pdftex: nd and nc for a Didot point of 0.375 mm as exactly as TeX can represent it in sp and the corresponding ...
2
votes
1answer
107 views

How should I use the fbox command correctly to avoid producing a Bad Box message?

I come from this link and the response that is given is very good. I have this MWE: \documentclass[11pt]{article} \usepackage{amsmath} \usepackage{amssymb} \begin{document} \vspace{5mm} \fbox{\...
0
votes
2answers
792 views

Measuring the height of a box

Solution in Edit 3. It works well, but seems to need an optimization. :) MWE: \documentclass{scrartcl} \usepackage{calc} \usepackage{mathptmx} \usepackage{anyfontsize} \newcommand{\Title}[1]{ \...
7
votes
1answer
528 views

What unit of measurement is \widthof using

For various purposes I need to know the width of a given text. The easiest way to do this is to use the \widthof{} command from the calc package. Issue is that I can't understand what unit of ...
1
vote
2answers
168 views

Shift by ex units in 3d tikz

In 2D coordinates (red image), I can use ex units to shift a node: \path (1,0) ++ (1.0ex,0) node {$x$}; But, when attempting to do the same thing with 3D coordinates (blue image), \path (1,0,0) ++ (...
5
votes
1answer
107 views

Is 1238pt = 1157dd an exact definition for the Didot point in Tex?

After having read the answers to What are the various units (ex, em, in, pt, bp, dd, pc) expressed in mm? and some related questions, I’ve realized that one of my basic assumptions about Tex was wrong:...
1
vote
1answer
2k views

The shortcuts for measurement units: cm and dm

I have to write a math book and I'm using often the following measurement units: centimeter (cm), decimeter (dm). Can you provide me the shortcut which will output cm and dm. For meter(m) I've found ...
0
votes
0answers
217 views

eps figure fitting not exactly inside the \textwidth

There is a *.eps figure of size exactly 6.5inch by 6.5inch (no white borders). This figure needs to be placed exactly inside the document, which has a \textwidth = 6.5". Logically the *.eps should ...
6
votes
2answers
239 views

How to print various type-related metrics

In the answer by @Johan_E to Which measurement units should one use in LaTeX?, there are useful charts showing the size, in points, of 1em, the width of an M, 1ex, and the height of an x. How can I ...
17
votes
2answers
1k views

What value TeX uses as its minimal unit

TeX uses scaled point as its minimal unit. At least it's said so in the TeXbook: TeX represents all dimensions internally as an integer multiple of the tiny units called sp. 65536 sp = 2^{16} ...
41
votes
2answers
2k views

Why does a TeX point differ from a Desktop Publishing point?

From this answer to Why does PDFLaTeX and XeLaTeX generates 11.955 font size for 12pt documentclass option?, I found out that PDF and TeX have different ideas about the size of the point (pt). A TeX ...
22
votes
1answer
841 views

mathtools with mu = Illegal unit?

I'm trying to change medmuskip while using mathtools: \documentclass{article} \usepackage{mathtools} \setlength{\medmuskip}{0mu} \begin{document} \end{document} But this results in an error: ! ...
1
vote
0answers
356 views

What are the unit of measurement in Tikz? [duplicate]

I want to know what are the units of measurement (of length) in tikz are available. I know that pt, in, mm like units are available , but what more are allowed in tikz? I work sometimes with qss ...
20
votes
1answer
968 views

Is there an `ex` unit equivalent for the capital 'X' in LaTeX

In LaTeX, the ex unit represents the height of a lowercase 'x' in the current font. Is there a length in LaTeX that represents the height of a capital 'X'?
5
votes
2answers
770 views

Set length to the line height of a particular font

How to define new length using : \newlength{...} \setlength{...}{...} and equal to the line height of a particular font (for example \tiny\ttfamily) Note : I want a solution which does not involve ...
5
votes
4answers
212 views

Cutting corners - how to delete 1 pt (0.3515 mm) or so

There is no way to reformulate the sentence. When I for example delete the letter "i" within the sentence, I'm good, everything fits perfectly. So I was thinking about cutting the corners of blank ...
15
votes
3answers
475 views

How to print a length accurately and with user-controlled rounding?

Tried the printlen package, but it seems to not understand what 2.5in means: \documentclass{minimal} \usepackage{printlen} \uselengthunit{in} \begin{document} \newlength{\advertwidth} \setlength{...
18
votes
2answers
4k views

How do I convert pt/in/cm/mm to em/ex as they are defined at a given point in the document?

I am using various macros that I have fine-tuned with units like pt and cm. I use those macros normally in certain places (say, in main body text or in footnote text). To properly generalize those ...
25
votes
2answers
13k views

Where do the values of 1em and 1ex come from?

In my answer to “Which measurement units should one use in LaTeX?” I explore the values of 1em and 1ex for different fonts using both TFM fonts and the font mechanisms of XeLaTeX that uses non-TFM ...
9
votes
2answers
2k views

Which unit of measurement for textwidth?

Which unit of measurement should I use to specify \textwidth? I used to specify \textheight in cm but read in some doc that one should always use multiples of \baselineskip. Indeed, the output ...
17
votes
3answers
9k views

Nominal values for \parindent and other paragraph metrics

In memoir, when I run \documentclass{memoir} \begin{document} \showthe\parindent \end{document} I get: 17.62482 pt My questions are : Why that value? This number seems to capture something with ...
2
votes
3answers
660 views

How to add a unit to a command argument?

Currently I set up a box of given length #1 and width #2 like this: \newcommand{\mybox}[2]{ This is a box of #1 by #2 centimeters: \framebox{\hbox to #1cm {\vbox to #2cm}} } % Usage: \mybox{5}{...
68
votes
2answers
20k 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 ...
15
votes
4answers
4k views

Conversion pt to mm or cm

Is there any way how to convert pt to mm or cm in plain TeX?
15
votes
1answer
1k views

Measuring the distance from text to the top of the page

How can I obtain a measurement from the baseline of any line of text in a document to top of the body of text on a page?
27
votes
3answers
32k views

Setting a document in MS Word-12pt (12bp)

Warning If you're looking for advice how to make your document look like it's been written in Word, this is most likely not the question you're looking for. This question is mostly of theoretical ...
12
votes
1answer
857 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} \multido{\dx=0sp+1000sp}{100}{\rule{0.01\...
2
votes
2answers
429 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 ...
16
votes
2answers
2k views

Globally redefining 1 pt to 1/72 in (PostScript point) and other similar changes

Introduction TeX point (1 pt in TeX) equals 1/72.27 in (= 2540/7227 mm ≈ 0.35145980351 mm). Quoting part of Traditional American point system section from Wikipedia's Point (typography) entry: In ...
2
votes
2answers
8k views

Latex commands for a specific page format [closed]

I am writing a report for which my University has given the following guidelines (Clearly, it was intended for use with Microsoft Windows). Project reports should be typed only on one side of the ...
190
votes
8answers
106k views

What are the various units (ex, em, in, pt, bp, dd, pc) expressed in mm?

How can one determine the length of the different units (measured 1ex, 1em, 1in, 1pt, 1bp, 1dd, 1pc) in mm?
142
votes
3answers
37k views

Which measurement units should one use in LaTeX?

There are various measurement units that one can use (such as pt, mm, in, em, ex etc.) for specifying lengths and heights. For font-based units (em and ex) the actual spacing will vary slightly ...