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

learn more… | top users | synonyms

2
votes
1answer
43 views

Why is \glueexpr used in etoolbox's \deflength instead of \dimexpr

Consider the following snippet from etoolbox: \newrobustcmd*{\deflength}[2]{% \ifundef{#1} {\etb@noglobal\etb@err@nolen{#1}}% {#1\glueexpr#2\relax}} Maybe I do not understand the ...
2
votes
1answer
25 views

Resetting \parskip to 0pt “seems” to be ignored by \par

I was revisiting old code and rewriting things in what I thought was a more elegant manner, but I got unexpected results. I have the following code which seems to do exactly what I want it to do ...
4
votes
2answers
59 views

Comparing calculated real numbers

"\ifdimless" can compare two real numbers. But, how can we feed the result of a calculation to this function ? \documentclass[]{article} \usepackage{tikz} \usetikzlibrary{calc} \usepackage{etoolbox} ...
4
votes
3answers
34 views

Multicolumn within tabularx: how to get p{'lengths'} right

I am trying to have the lipsum text fill the two cells to the right of the vertical ruler, without exceeding the table. My code is now: \documentclass[a4paper,11pt]{article} \usepackage{lipsum} ...
1
vote
1answer
34 views

Why are the skip lengths ignored in align?

I created a new command \mathloose that stretches the spacing in an equation by suitably adjusting \thinmuskip \medmuskip and \thickmuskip lengths. The command works just fine in \[ \] and \( \) but ...
2
votes
2answers
44 views

Functions not working well together

I'm developing a interface for setting and changing distance parameters for a package. These distances are stored as strings so that the user can specify them in em and ex units if they want and ...
3
votes
1answer
55 views

Dynamic length variable with argument? (like “\setlength{\foo}[1]{0.5+#1*0.5}”)

Is there a way to define some kind of a length function that takes an argument, sort of a mixture between \newcommand and \setlength? The following example should illustrate what I want. (I'm using a ...
6
votes
1answer
140 views

How can I readjust TikZ's dimension variables to fit mid-document dimension change?

Question How can I readjust TikZ's dimension variables to fit a mid-document dimension change as in this example and using the TikZ drawing from here. Problem TikZ coordinates are not where they ...
5
votes
5answers
240 views

Boxes automatically sized to reach end of line?

I'm setting up a little test, which includes empty boxes for students to write their answers. The boxes start at different places on the page, but I'd like - for neatness - each box to reach to the ...
11
votes
2answers
152 views

Displaying rubber lengths in arbitrary units

Based on this question, I know how to show regular lengths expressed in arbitrary units. However, I need to do the same for rubber lengths (showing the plus and minus) and the printlen package ...
5
votes
2answers
44 views

How to set a distance that rescales with the font [duplicate]

I'm trying to set a distance which is relative to the font size. The problem is that the distance is reused several times in the document, potentially in environments with a different font size. In ...
1
vote
0answers
21 views

Maximum length of last line in paragraph [duplicate]

Is there a LaTeX parameter (e.g., a penalty parameter) or any complex solution that can be setup maximum length of the last line in the all paragraphs throughout the text? Let's say, 2 em horizontal ...
9
votes
2answers
282 views

Centering a slash (not) over a (mathematical) glyph?

My aim is to construct a relational symbol which is graphically equivalent the standard infinity sign (coded by\infty) crossed exactly in the middle of it. Yet I am not able to overcome something. To ...
7
votes
2answers
159 views

Using powers in \dimexpr

The code \documentclass{memoir} \begin{document} \fontsize{\dimexpr 1.2^{3} 10pt}{\dimexpr 1.2^{3} 10pt}\selectfont Hello TeXworld. \end{document} does not work. Why not? EDIT: I need a solution ...
3
votes
1answer
92 views

LaTeX equivalent of \wd [closed]

Please consider the following code: \newsavebox{\mybox} \savebox{\mybox}{some text} \newlength{\widthmybox} \settowidth{\widthmybox}{\usebox{\mybox}} Is \widthmybox then equivalent to \wd\mybox?
6
votes
2answers
150 views

TeX/LaTeX: Macro for getting a length as number

I would like to write a macro getlengthin to get a length or dimen as floating point number in a specified unit. Here is what I have created so far: \documentclass{article} ...
4
votes
1answer
120 views

scrlttr2 location positioning question

I would like to have the text of the variable location to be right aligned with the text of the main body. So I tried to redefine the length lochpos to be the same as refhpos, because the margin on ...
5
votes
1answer
106 views

What's the meaning of the command \number and when to use it? And some confusion about the following code

\setcounter{numofgaps}{\numexpr\number\value{numofboxes}-1} \setlength{\truetextsectionwidth}{\textsectionwidth-\number\value{numofgaps}\gapwidth} The above code is a snippet from the answer of How ...
1
vote
1answer
122 views

Calculating with different types of variables

Is there any way to calculate the height of a node in a tikz pictures and to divide a length by an another length to get a counter and to round it up? If yes where could i read after the subject of ...
2
votes
1answer
158 views

How to solve the Arithmetic overflow problem?

I was making an article and everything was going alright, when suddenly I got an error: The error: Arithmetic overflow. \calc@Acount l.78 ...qwe dqweqwrwf qewrfrQ aRF EFCas drfFR}{62} My article ...
4
votes
1answer
225 views

How to divide two lengths and get a result as an integer?

I have a problem dividing two lenghts and getting a result as an integer. I was trying to use this package: \usepackage[nomessages]{fp} It didn't really work for me. I tried it multiple ways, but it ...
2
votes
1answer
115 views

Measure distance from text to bottom margin

I'm making some boxes for providing answers. The box macro takes the height of the box as an argument. I need to measure the remaining space from the line the box starts at, to the bottom of the page. ...
5
votes
1answer
47 views

Using lengthconvert with siunitx S column

I need to align numbers in a table. The numbers are generated from the \Convert command from the lengthconvert package. I want to use an S column from the siunitx package to align the numbers, but ...
7
votes
2answers
117 views

Why \newlength is not profiled as \newcommand?

While commands are defined and set in one step with \newcommand, lengths need two steps for this: \newlength and then \setlength. Because \newlength{\foo}{1cm} would be easier than ...
2
votes
1answer
55 views

How do I assess the length of text within a pgffor \foreach loop [duplicate]

I would like to be able to write something like the following: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \newlength\aelengtha \newlength\aelengthb \newlength\aelengthc ...
1
vote
0answers
34 views

What are skip values? [duplicate]

On page 5 of the titlesec manual (released on June 14, 2000), it is written that full skip values, including the plus and minus parameters can be abbreviated as * n. The example on page 24-25 (the ...
3
votes
2answers
60 views

How to obtain specific distance between image and caption in beamer?

I'm trying to set the the caption 1pt below the image in a figure in beamer. If I set \abovecaptionskip to 0pt there is still a gap between the image and the caption. This results from the ...
3
votes
1answer
47 views

settowidth in substack

I am aware of Align in Substack, but I am trying another solution and would like to understand why it is not working: \documentclass{article}% \usepackage{amsmath}% \newlength{\mylength}% ...
2
votes
1answer
58 views

Different behavior of setlength and settowidth

In this example, I would expect all "MMM" to be well-aligned to each other. But they aren't: \documentclass{article}% \usepackage{amsmath}% \newcommand{\before}{mmm}% \newcommand{\after}{MMM}% ...
0
votes
0answers
47 views

Overview of page geometry, font sizes etc. of common document classes

Has someone precompiled a tabular or annotated graphical overview of the default lengths etc. of common LaTeX classes (standard, Koma/scr, memoir, beamer …) and put it on the net? I didn’t find any. ...
5
votes
1answer
117 views

How to log the value of a variable?

I am debugging a set of macros. The error seems to come from \vspace*{\dimexpr0.000000cm-\topskip plus 1fill}. How can I log the value of the length? I have tried ...
8
votes
1answer
132 views

What is the correct expression to exactly divide \textheight into n rows?

I want to create a table exactly occupying the whole printed area with no space left. The table consists of 5 rows per page, as follows. \documentclass[table]{article} ...
0
votes
0answers
16 views

Length of horizontal footnote separator [duplicate]

I need to reduce the length of the horizontal line that separates text body from footnotes. I am a beginner, using report document class.
2
votes
1answer
70 views

\settolength issue

I want a horizontal length to have the same length as the word "physique". This is what I have tried: \documentclass{article} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} ...
2
votes
1answer
41 views

Using skip (glue) with pgfmath (truncating plus/minus parts from a glue length)?

Consider the following MWE: \documentclass{article} \usepackage{tikz} \newlength{\tlen} \newlength{\tlenB} \begin{document} \setlength{\tlen}{2cm} \typeout{check 1, tlen is: \the\tlen} ...
18
votes
4answers
508 views

Scaling a glue in TeX

is there a possibility to scale a glue in TeX? Consider the following example: \newskip\foo \newskip\bar \foo=10pt plus 2pt minus 3pt \bar=2.5\foo\relax \showthe\foo \showthe\bar \bye When ...
4
votes
2answers
681 views

Draw parallel lines each one with a fixed length

I am trying to create parallel lines in tikz. Although I can create those lines, I can't seem to be able to control the length of those lines, which I want them to stop in the red box's face. My code ...
9
votes
1answer
95 views

Other methods to determine the page size of an external pdf?

I would like to query the page size of an external PDF in a document. I can box an included PDF and measure the box (with or without actually using the box), as shown in the MWE, but I'm wondering if ...
1
vote
2answers
93 views

Table title to match table body (in terms of length)

I have a table with 4 columns and my title seems to be far bigger than the main body of the table. This does not look quite good. Is there anyway to have the length of those two be the same, or at ...
9
votes
3answers
558 views

A command line Latex calculator?

I often need to check what a length expression like "20pt + 2 cm" would resolve to -- and of course, I'd rather do something quick on the command line / shell / terminal, than typing ...
9
votes
2answers
237 views

Save length with \let command

I want to save \fboxsep length in \oldfboxsep and use it later. The following code doesn't work: \newlength{\oldfboxsep} \let\oldfboxsep\fboxsep % 3pt by default \setlength{\fboxsep}{8pt} ...
19
votes
1answer
447 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
55 views

Free - dereference - release - delete a newdimen length?

Somewhat similar to How to erase/delete a counter, I guess, but for \newdimen... So, consider the MWE: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} ...
7
votes
3answers
355 views

A reusable newlength (no stop/break if length already defined)

Often I have separate .tikz files, which may contain stuff like \newlength{\mytmplen}; and given I'm not very original with names, the same statement ends up in multiple such files. Which turns out to ...
2
votes
2answers
394 views

\leftskip, \linewidth and minipage

I have an environment with a minipageof the length \linewidth-\parindent (using the calc package). When I stick this in a place where \leftskip=\parindent it protrudes in the margin. Shouldn't ...
3
votes
1answer
114 views

Using \textwidth via strip@pt with beamer and the picture environment

OK, I admit I haven't tried my MWE without Beamer. My goal is to use e.g \textwidth with the picture environment, and my overall goal is to include several rectangular portions of an .eps file within ...
3
votes
2answers
76 views

Updating length variable inside longtabu working strangely

I have a table, and I want one column to show a running total on each line, i.e., it has to show the total of the values of another column up to that row. I thought about accumulating the total into a ...
17
votes
2answers
471 views

How to have a precise control on the size of each page?

I would like to produce a pdf document whose pages have various lengths and fixed widths. An easier situation The easiest case would be for instance: the first page has a length of 10cm all the ...
4
votes
1answer
69 views

Is there a pre-defined width that covers the text area and the margin?

Is there a pre-defined width that covers both the text and margin areas? Correct me if I am wrong, but it would basically be equal to \textwidth+\marginparsep+\parginparwidth. Is that provided by ...
1
vote
0answers
30 views

Document length iopart.cls no more than 12 pages? [closed]

I am using iopart.cls to write an article, the problem is when I compile the document the dvi is cut to the twelfth page, how can I do? Please help me!!!