Skip to main content

Questions tagged [lengths]

{lengths} is for questions dealing with measurements in TeX. If your question is about the spacing between document elements, use {spacing} instead.

Filter by
Sorted by
Tagged with
0 votes
1 answer
67 views

Getting the Maximum Width of a List of Items

I'm trying to write a command to get the maximum width of a (comma separated) list of items, for example \myLengthCommand{lorem,ipsum,lorem ipsum} should return the width of the text "lorem ipsum&...
Dave's user avatar
  • 317
0 votes
2 answers
70 views

compute a scale factor for use in includegraphics

I want to compute a scale factor for use in includegraphics. I want to do this using the declarations from xparse. What I have so far (based mostly on https://tex.stackexchange.com/a/437494/293199): ...
troy's user avatar
  • 89
0 votes
3 answers
116 views

What does a lenght=3pt 2 mean? [closed]

What does it mean if a lenght is set to, for instance, length=3pt 2? I noticed it's not the same as lenght=3.2pt... I'm sorry to ask such a trivial question, but I looked here and there, and I didn't ...
Garulfo's user avatar
  • 193
2 votes
2 answers
74 views

Automating drawing horizontal lines until the end of the page

I have a page filled with text (arbitrary vertical height) and would like to fill the rest of the page with horizontal lines. So far my solution is to manually adjust how many lines are drawn: \...
Marius Hofert's user avatar
1 vote
1 answer
70 views

How to measure the length of the last line? (LuaLaTeX)

I would like to make a command which, like some environments for equations, has a vertical space at the start of it which depends on whether the length of the line in the previous paragraph exceeds a ...
B Legrand's user avatar
  • 433
1 vote
2 answers
64 views

How to decrease the length of the vertical line in the array environment globally?

First a minimal working sample is as follows. \documentclass{amsart} %\delimitershortfall=10pt \delimiterfactor=000 \begin{document} \[ S=\left\{x~ \begin{array}{|l} \frac{m}{n} \end{array} \right\} \]...
M. Logic's user avatar
  • 4,333
1 vote
1 answer
60 views

Drawing a Non-Jagged Grid Outline

I'm trying to create an outline for my TikZ grid with thicker lines, but there doesn't seem to be any correction for the edges, so things get jagged: \documentclass{article} \usepackage{tikz} \begin{...
psygo's user avatar
  • 438
0 votes
1 answer
61 views

Can't seem to be able to draw very small TikZ shapes?

I'm trying to draw small labels fitting circles, or at least proportional to them. But I just can't seem to make them smaller than this for some reason: I get that there might be a physical limit to ...
psygo's user avatar
  • 438
0 votes
1 answer
77 views

`Illegal unit of measure (pt inserted)` despite measurement calculations?

After following the tips in this answer by @JasperHabricht, I'm trying to improve the following macro, but all I get is Illegal unit of measure (pt inserted), despite the measurement calculations ...
psygo's user avatar
  • 438
2 votes
1 answer
75 views

How to do length calculations with based on a `\foreach` array

I'm trying to improve the readability of my \drawHoshis macro by creating variables for the x and y coordinates, besides also running a calculation with a minus inside parentheses (e.g. x * (y - 1)). ...
psygo's user avatar
  • 438
0 votes
0 answers
95 views

Detect if something is a length?

Is there a way in LaTeX to detect if something is a length with a function of the form: \NewDocumentCommand\iflength{m m m}{%CODE HERE%} where: the first parameter is the thing to be tested the ...
Vincent's user avatar
  • 5,327
4 votes
1 answer
195 views

Negative `\widthof` doesn't work?

I am basically reasking the same question as here, which hasn't had any definitive answer even yet. I restate the problem. The MWE \documentclass{book} \usepackage{calc} \begin{document} \hspace{...
Atom's user avatar
  • 665
2 votes
1 answer
32 views

Disabling all rubber in a beamer frame

Situations like the following cause wiggling text: \documentclass{beamer} \begin{document} \begin{frame}[t] \begin{itemize} \itemsep=2.5pt \item<1-> Many ...
Bubaya's user avatar
  • 2,549
1 vote
0 answers
39 views

How to match subfigure height to other subfigure?

I am trying to have two subfigures with significantly different aspect ratios have the same height by calculating the height for one of them then using that height for the other, following the method ...
sandwich's user avatar
0 votes
2 answers
45 views

Make length persistent between subfigures

I am trying to have two subfigures have the same height and have defined a length for this purpose, but the length gets set to zero between them. My understanding is that this is tied to the subfigure ...
sandwich's user avatar
3 votes
3 answers
346 views

Define a control sequence \ic such that ‘\ic c’ puts the italic correction of character c into TeX’s register \dimen0

On page 14 of the book The TeXbook, the exercise 4.3 is Define a control sequence \ic such that ‘\ic c’ puts the italic correction of character c into TeX's register \dimen0. The answer is \def\ic#1{\...
Y. zeng's user avatar
  • 2,105
1 vote
0 answers
155 views

Is there a basic float number type in LaTeX?

I've tried some examples with counters and numbers in LaTeX. I create a counter with \newcounter. I understand that it declares an integer. So if we make like this \newcounter{num} \setcounter{num}{10}...
Vladimir's user avatar
  • 589
6 votes
1 answer
245 views

Would it make sense to use the "plus" and "minus" components of \baselineskip?

According to latexref.xyz: The \baselineskip is a rubber length but also The \baselineskip’s value is reset every time a font change happens and so any direct change to \baselineskip would vanish ...
Keelan's user avatar
  • 5,445
3 votes
1 answer
61 views

Accessing indent length with enumitem

For a package I'm writing, I need to access the actual amount a list item is indented. Here's a minimal example showing what lengths are available to me, but they don't seem to give me what I need. ...
Alan Munn's user avatar
  • 220k
8 votes
2 answers
354 views

Why would I use \dimexpr .. \relax in \setlength?

I read somewhere that you should use \dimexpr ... \relax when defining lengths. Is that really the case? There seems to be no difference between using it or not: \documentclass{article} \newlength{\...
mrCarnivore's user avatar
  • 1,515
0 votes
2 answers
327 views

How to manage rectangles and lengths with TikZ package?

I have been customizing a CV template but having some trouble with the TikZ package; indeed I'm a novice and it's a little bit difficult for me to find the solution by using the official documentation....
g_don's user avatar
  • 809
3 votes
2 answers
147 views

Control the distance between table of contents elements

I want to understand what are the lengths dimension #1 and #2 in the following example. Moreover, is the blue dimension in the picture equals the length of \parskip? How can I control the dimensions #...
tush's user avatar
  • 1,147
1 vote
1 answer
117 views

How to horizontally center an A4 paper inside an A3 paper?

I'd like to embed an A4 paper inside an A3 paper in such a way that the A4 paper be horizontally centered inside the A3 paper. (The relative vertical alignment is immaterial.) I tried to use the ...
Evan Aad's user avatar
  • 11.1k
0 votes
1 answer
74 views

Specifying the Length of a Bclogo without Enclosing It in a Minipage

Consider the code \documentclass[12pt]{book} \usepackage{xcolor} \usepackage[tikz]{bclogo} %\usepackage{lipsum} \definecolor{bulgarianrose}{rgb}{0.28, 0.02, 0.03} \begin{document} \thispagestyle{...
DDS's user avatar
  • 9,768
0 votes
1 answer
29 views

Columns odd vertical alignment in multicol

This code \documentclass[12pt]{article} \usepackage[parfill]{parskip} \usepackage{multicol} \widowpenalties 2 9999 9999 \begin{document} \setlength\baselineskip{4ex plus 2ex minus 2ex} \begin{...
Raphael's user avatar
  • 564
2 votes
1 answer
116 views

Increasing natural height of minipage / fbox

I would like to define an environment encapsulated by a box where I am able to insert unspecified content (text, equations etc.), but where I can increase the natural height of the box. A minimum ...
DavidH's user avatar
  • 79
1 vote
0 answers
202 views

Beamer - Fitting multiline title into a single one

I am trying to adjust a multiline title into a single line. I found the length of the text and check if it is larger than \linewidth or \textwidth. Both dimensions gave larger values than expected. ...
M. Al Jumaily's user avatar
2 votes
2 answers
111 views

expl3 / set length to average charwidth

I have a function that calculates the average character width. The function calculates the width as expected, but I can't use it in setlength. I've tried around and tried solutions I've googled, but I ...
alexBer's user avatar
  • 33
6 votes
3 answers
153 views

Wrong length (or \parbox)

Let's say I want a perfect alignment of these two equations (an OCD I have). The red line is just for comparison: This is my MWE: \documentclass{article} \usepackage {amsmath} \begin{document} \...
Juan Castaño's user avatar
0 votes
1 answer
128 views

How to get precise lengths (e.g., 5 cm) on the screen with tikz, pstricks, evince, and gv?

Let's feed the file mwe.tex containing \documentclass[a4paper]{article} \pagestyle{empty} \usepackage{pstricks,tikz} \begin{document}\noindent \begin{pspicture}(-1,0)(1,5) \psline(0,0)(0,5) \end{...
user avatar
5 votes
1 answer
211 views

Problem with \pagegoal

At the beginning of page, \pagegoal=\maxdimen and therefore \pagegoal-\pagetotal=0pt or sometimes \maxdimen. So I tested for \maxdimen, but got strange results (see MWE). Is there a good way to get ...
John Kormylo's user avatar
  • 81.1k
0 votes
1 answer
94 views

expl3 multiply length by a dimensionless factor

In the following code, i would like to print the value of \baselinestretch * \baselineskip instead of \baselineskip only. I tried with \fp_eval:n but that did not work. \documentclass[a4paper]{article}...
user1850133's user avatar
  • 1,028
2 votes
1 answer
151 views

Conversion of "scaled points" (TeX lengths) to "PDF points"

If I'm not mistaken, sometime within the last two years the conversion factor has changed from 65,536 (2^16) to 65,782. (At least in LuaLaTeX for the lengths in "pdf literals"). Why the ...
keth-tex's user avatar
  • 452
1 vote
1 answer
70 views

Footnote index size and position

Is there a way to drop the footnote index below? I looked away https://www.ctan.org/pkg/footmisc But I didn't find anything there to help me \hangfootparskip \hangfootparindent \footnotemargin \...
Igor Yukhimenko's user avatar
1 vote
1 answer
188 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,886
0 votes
1 answer
78 views

Get the height and depth of Hebrew letters

I have seen here the use of adding and subtracting the height and depth of the letter X and the letter p when defining vertical distances between objects on the document. My document is in Hebrew and ...
tush's user avatar
  • 1,147
5 votes
3 answers
662 views

Are the widths of 𝐿, 𝑌, and 𝑍 in TeX Gyre Termes Math really equal?

It was a surprise to me when feeding lualatex with \documentclass{standalone} \usepackage{unicode-math} \setmathfont{TeX Gyre Termes Math}% or \setmathfont{texgyretermes-math.otf} \begin{document} ...
user avatar
0 votes
1 answer
254 views

How can I use \if to enter a new line automatically when my text is too long?

I have a section in my document where writing space is limited and when there's a text entry that's too long, it does not look great because the points span two lines as shown in the first image below....
inot12's user avatar
  • 3
5 votes
2 answers
118 views

Determine the length of the rest of a math display line for multlined

\documentclass{article} \pagestyle{empty} \usepackage{mathtools} \usepackage{lipsum} \begin{document} \lipsum[1] \[ \text{beginning}\land \begin{multlined}[t][\linewidth] (\text{extremely long ...
user avatar
1 vote
3 answers
164 views

Defining an Em Dash with Length Greater Than the Cabin Default

I have noticed that the length of an em dash is not always uniform, depending upon the font being used. Consider the following code which defines an em dash: \documentclass{book} \usepackage[T1]{...
DDS's user avatar
  • 9,768
0 votes
1 answer
37 views

assign length units after number defined

I have a latex which which does some calculations, but the functions are not available for Lengths. I would like to be able to assign the unit to the output of the math. The following succeeds without ...
cdickstein's user avatar
0 votes
1 answer
57 views

Illegal unit of measure produced by a LaTeX3 function

I used the function \cs_new:Npn\宽度{168/(1+\thecnt)} to compute length, where cnt is a counter and 168 actually is the width of a4paper in millimeters times 0.8. Now \setlength{\tabcolsep}{\宽度 mm}{\...
youthdoo's user avatar
  • 871
3 votes
2 answers
162 views

Difference between \skipeval and \dimeval

What is the difference between \skipeval and \dimeval? They appear to produce the same result, but perhaps \dimeval removes the glue? \rule{\dimeval{ \linewidth plus 1cm minus 1cm - 1cm}}{1pt} a\\ \...
likethevegetable's user avatar
3 votes
1 answer
88 views

Over height dashed line with kpfonts-otf

Consider the following example, when using kpfonts-otf, the vertical dashed line becomes over height: \documentclass{article} \usepackage{kpfonts-otf} \usepackage{arydshln} \begin{document} \[\def\...
Jinwen's user avatar
  • 8,618
2 votes
1 answer
77 views

Variable containing the total horizontal length of a table

I am trying to put a minipage inmediately below a table, the minipage will be scaled X.Y times the total horizontal length of the previous table. Since I have several tables with variable cells' ...
wdsgn's user avatar
  • 311
0 votes
0 answers
28 views

Is there a possibility of writing length or width of measurements in latex as a sum or difference of 2 or more values

I wish to know if there exist a way in latex of writing the length or width of something as a sum or difference of 2 or more measurements e.g \parskip + \baselineskip, and/or \textheight - 5\parskip?
itc's user avatar
  • 655
2 votes
2 answers
170 views

How to get width of parameter in plain TeX?

I am trying to get the width of a macro parameter using \def\getwidthof#1{% \newdimen\myl% \settowidth\myl{#1}% \the\myl% } where \settowidth is defined as \catcode`\@=11 \newbox\@...
btshepard's user avatar
  • 680
1 vote
0 answers
46 views

How to trim (adjust) a coloured box to a text? [duplicate]

I have a coloured box that i use, and it always takes up the whole line no matter the texts length. I would like it to stop with the text. \usepackage[table,xcdraw]{xcolor} \usepackage{tcolorbox} \...
Yafiet Yohannes's user avatar
2 votes
1 answer
138 views

Calculate ratio between lengths/scale

I would like to calculate the the ratio between two lengths in order to automatically get the scale for a map included using the mercatormap package. For instance, I want the map to show 1km in the ...
Ninoett's user avatar
  • 179
1 vote
0 answers
55 views

How to make the flexible space discrete?

When typesetting Eastern Asian materials, positions of characters are normally relatively rigid. But there are unavoidable situations in which flexible spaces are needed, which are typically defined ...
Chih-See Hsie's user avatar

1
2 3 4 5
10