Questions tagged [unit-of-measure]

Questions about TeX's length units.

Filter by
Sorted by
Tagged with
1 vote
1 answer
124 views

Why does running latex with a4paper or 210 mm × 297 mm followed by dvips result in bounding-box width 596 pt rather than 595 pt?

Various source on the Web (e.g., http://www.prepressure.com/library/paper-size) specify the A4 paper size as 210 mm × 297 mm or 595 pt × 842 pt. Using 1 pt = 25.4 mm / 72, the width 210 mm ≈ 595....
AlMa1r's user avatar
  • 411
-1 votes
2 answers
101 views

Converting from one unit (pt, ex, em, in, bp, dd, pc, mm, cm) to another

I want a command to convert from one unit (pt, ex, em, in, bp, dd, pc, mm, cm) to another. What can I do with l3 ?
Ragonese's user avatar
  • 181
3 votes
2 answers
170 views

Starting a tikz loop at the margin. How do I properly specify the starting position?

I am attempting to encourage the reader to take notes in my book by making extra-wide margins and drawing lines down the outer edge. But I can't seem to get the lines to start in the right place. ...
flazzo's user avatar
  • 133
1 vote
1 answer
49 views

Units when the axis is the log

Not sure if this is the right forum but I saw some similar questions so here goes: I want to plot the log of a positive quantity. What's the best approach to communicate units. For instance if I take ...
R Walser's user avatar
  • 163
3 votes
2 answers
245 views

Default units in expl3

So I have produced code, which I think is kind of a hack, but it seems to work so far in my testing. I have setup a new expl3 function that sets a dimen variable. If the input for the dimen expression ...
User23456234's user avatar
  • 1,860
4 votes
1 answer
277 views

How to configure TikZ's angle radius option (of the angles library) so its default unit of measure conforms to the TikZ picture in which it is used?

I fail to understand what the default unit of measure is for TikZ's angle radius option of the angles TikZ library. By "default unit of measure" I mean the one used when no unit is specified ...
Evan Aad's user avatar
  • 11.1k
0 votes
1 answer
143 views

Illegal Unit of Measure with \textwidth using VS Code Extension

This causes the error: \begin{figure} \includegraphics[width= 0.4/textwidth]{Bilder/Hochsetzsteller.PNG} \end{figure} I'm using the following settings to compile: [{ "resource": xxx&...
pb44's user avatar
  • 11
0 votes
1 answer
88 views

So what's the right way to set the preferred line spacing? Changing default line spacing in Book returns underfull \vbox warnings

Simple task: book-class document, 12pt font size, 6x9 page size. With the default book settings (I don't really know what's the default line spacing in book-class document) the document is typeset ...
tryingout's user avatar
  • 115
1 vote
1 answer
163 views

Change Units in Calculation

Quick question. I'm looking for a way to change the units of a length while performing a calculation. I'm currently using the ragged2e package and trying to adjust \setlength{\RaggedRightRightskip}{...
User23456234's user avatar
  • 1,860
1 vote
1 answer
52 views

Line spacing broken (bottom line falls below the frame or even empty) possibly because of the unit of measure of \vspace and images

Anytime there's an image on page or otherwise not just pure text (which, of course, is spaced by \vspace command) the line spacing gets corrupted. Take a look at MWE below to see. Note how on Page 1 (...
tryingout's user avatar
  • 115
1 vote
1 answer
1k views

Why I can't use \unit command in siunitx?

Most of the time I work with siunitx package I need to specify only units like: "give the answer in psia". For achieving this every time I try with \unit{\watt} (W for example) but it ...
Eduardo Jiménez's user avatar
3 votes
2 answers
352 views

Why \hskip and \hspace* Produce Shifts of Different Measures

I have noticed, for example, that \hskip 20pt and hspace*{20pt} produce horizontal shifts not of the same length. Consider, for instance, \documentclass{book} \usepackage{lipsum} \usepackage{graphicx} ...
DDS's user avatar
  • 8,816
0 votes
1 answer
69 views

How to show more decimal digits with siunitx package? [closed]

I use the following code to write a physical quantity: \SI[]{14.351368}{\deg} The problem is that I get only two decimal digits instead of six. How can I fix this problem?
g_don's user avatar
  • 779
0 votes
1 answer
276 views

How to obtain deg instead ° with siunitx package?

I'm using the following command to write a phisical quantity in my report: \si[per-mode = symbol]{\degree\per\second I obtain: °/s but I want: deg/s. How can I solve this problem?
g_don's user avatar
  • 779
1 vote
1 answer
1k views

Illegal unit of measure (pt inserted) with Tabularx

I am working on a journal paper using the Overleaf website to compile it. \documentclass[runningheads]{llncs} \usepackage{tabularx} \usepackage{multirow} \begin{document} \begin{table}[t] \caption{...
Abdessamad139's user avatar
0 votes
1 answer
479 views

Package calc error`\let ' invalid at this point, probably wrong unit of measure

I'll attach a MWE which replicates the problem \documentclass[a4paper,11pt,oneside,notitlepage,reqno]{book} \usepackage{minted} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[...
Valerio Tirelli's user avatar
4 votes
2 answers
318 views

Computing the area in a polyline?

Hello fellow tikzers. Is there a package/hack to compute the area enclosed in a polyline i.e. for example of something like this \draw (p1) to (p2) to (p3) to cycle; where the points are the vertices....
Maber's user avatar
  • 95
2 votes
1 answer
59 views

Use relative units in the preamble

I use relative units to redefine the subsection as follows: \documentclass[reqno,twoside]{svmult} \makeatletter \@addtoreset{chapter}{part}% reset chapter number when a new part starts \...
X Leo's user avatar
  • 145
1 vote
2 answers
83 views

How can I use the current value of a foreach loop to alter the width of the drawn object?

I'd like to create a Tikz plot where a vector of numbers is used to include a picture. I want the picture to be scaled using the current value, so that the pictures higher on the y-axis are larger ...
Manuel Popp's user avatar
1 vote
1 answer
3k views

Illegal unit of measure (pt inserted) in the table that might be too wide for the page

I want to create following table: \documentclass{article} \usepackage{units} \begin{document} \begin{table*}[t] \small \begin{tabular}{ |l|c|c|c|c|c|c|c|c|c|c| } \hline ...
Josh E.'s user avatar
  • 73
2 votes
2 answers
228 views

How to determine what unit is used?

I'm using a working template containing this line below and am wondering what unit is used? I'd expect at least e.g. 3.18pt to be necessary. \vspace{3.18\baselineskip}
jjk's user avatar
  • 285
2 votes
1 answer
3k views

Illegal unit of measure (pt inserted)?

This block of code is outputting correctly: {\includegraphics[height=4em]{logo.png}} {\bf\textsc{Title}\vspace{0.5em}} {\textsc{\{ \ names \} \hspace{12pt} }} {\includegraphics[height=4em]{...
Ana Coolkid's user avatar
6 votes
2 answers
662 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 ...
Dave's user avatar
  • 3,758
3 votes
3 answers
284 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} \...
R. N's user avatar
  • 1,076
3 votes
1 answer
484 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={...
argentum2f's user avatar
6 votes
1 answer
3k 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 ...
subham soni's user avatar
  • 9,683
3 votes
0 answers
247 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 ...
Luna Razzaghipour's user avatar
2 votes
1 answer
44 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 ...
Jared Lo's user avatar
  • 652
2 votes
3 answers
432 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} \...
Code Doggo's user avatar
3 votes
0 answers
88 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 ...
SRel's user avatar
  • 1,323
1 vote
1 answer
721 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 ...
IdoDaisuke's user avatar
3 votes
1 answer
162 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 ...
Crissov's user avatar
  • 1,866
3 votes
1 answer
976 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{\...
manooooh's user avatar
  • 3,203
0 votes
2 answers
3k 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]{ \...
Shalec's user avatar
  • 295
7 votes
1 answer
2k 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 ...
il mietitore's user avatar
1 vote
2 answers
716 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) ++ (1....
Peter Grill's user avatar
5 votes
1 answer
164 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:...
Crissov's user avatar
  • 1,866
4 votes
1 answer
13k 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 ...
Iuli's user avatar
  • 471
1 vote
0 answers
636 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 ...
kaka's user avatar
  • 546
7 votes
2 answers
1k 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 ...
dedded's user avatar
  • 2,246
20 votes
2 answers
3k 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} sp = 1 ...
Igor Liferenko's user avatar
48 votes
2 answers
4k 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 ...
sampathsris's user avatar
22 votes
1 answer
2k 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: ! ...
beerbajay's user avatar
  • 333
1 vote
0 answers
1k 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 ...
juanuni's user avatar
  • 2,007
23 votes
1 answer
2k 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'?
sergej's user avatar
  • 6,461
5 votes
2 answers
2k 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 ...
Vincent's user avatar
  • 5,257
5 votes
4 answers
228 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 ...
Vochmelka's user avatar
  • 965
15 votes
4 answers
1k 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{...
WillAdams's user avatar
  • 7,187
21 votes
2 answers
6k 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 ...
Lover of Structure's user avatar
31 votes
2 answers
31k 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 ...
Johan_E's user avatar
  • 1,176