{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
2answers
43 views

Typesetting displayed equivalences and definitions of unequal length

What is the proper way to typeset in LaTeX, in display-mode, a series of equivalences and definitions of unequal lengths of sets ? Consider for this the following code that I used for a series of ...
1
vote
0answers
32 views

Difference between length and number (in the draftwatermark package)

I am using the draftwatermark package. According to the documentation, it is possible to set the horizental position of a watermark with the command \SetWatermarkHorCenter{⟨length⟩}. They say that ...
4
votes
0answers
31 views

standalone package and user-defined macros/lengths

This is my first post on this amazing website, so hi to everybody!! I'd like to know if there is a way to pass some parametrs (macros or lengths) to a standalone file. Here is my MWE: Consider the ...
3
votes
1answer
22 views

use \boxput (fancybox) as reminder: is there a way to change the relative coordinate system to the top of the box?

I use the fancybox's \boxput command to create reminder boxes in my documents. I like the fact about \boxput, that it lets you place a label above the box. This label is placed like a water mark, ...
0
votes
0answers
16 views

subheading of titletoc exceeds dotts and beginning of pagenumber

I am using titletoc like this: \usepackage{titletoc} \newcommand\frontmatterchaptoc{% ...
3
votes
1answer
70 views

Get the width of a picture with Tikz

I 'm trying to make a presentation with beamer and I use Tikz to incorporate pictures at some places in my frames. For some reasons, I would like to fixe the heigth of a picture (contained in a node) ...
4
votes
1answer
47 views

Length operation within a newtcblisting

Consider the following code: \documentclass[10pt,letterpaper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[french]{babel} \usepackage{calc} \usepackage{tikz} ...
1
vote
1answer
61 views

Trim size as fundamental TeX value

What are the fundamental TeX length names, corresponding to trim size and offsets? I already know that \pdfpagewidth and \pdfpageheight will grab enough information to calculate the PDF MediaBox (in ...
0
votes
0answers
43 views

Geometry package: Lengths saved by default. Options for save/load/restore

The geometry package: Package lengths are not saved as lengths. Examples: layoutheight, tmargin The following only affect the complete layout: \savegeometry \loadgeometry \restoregeometry ...
3
votes
1answer
26 views

Computation of size in titlespacing

Consider the following example: \documentclass[11pt,a4paper]{book} \usepackage{lipsum} \usepackage{titlesec} \newlength{\textsize} \makeatletter \setlength{\textsize}{\f@size pt} \makeatother ...
7
votes
2answers
351 views

Length plus minus other length?

Consider the following example: \newlength{\textsize} \makeatletter \setlength{\textsize}{\f@size pt} \makeatother \setlength{\parskip}{12pt plus 1pt} % WORKS \setlength{\parskip}{\textsize plus ...
3
votes
1answer
85 views

How to change length of blue line in moderncv

I am writing my cv using moderncv; I come across to this automatic correction where sentences are split in 2 lines like so: What I would like to do is setting "Birth Date and Place" in the same ...
5
votes
1answer
123 views

Why does changing \baselinestretch not change line spacing?

I have read that line spacing in a LaTeX document is controlled by the \baselinestretch macro, for example here. Setting \baselinestretch in the preamble does in fact change line spacing. When I ...
3
votes
1answer
61 views

Can I define a variable to scale with it several figures?

I have several pictures in my document, using the subfigure environment, the code is the following: \begin{subfigure}[b]{0.22\textwidth} \includegraphics[width=\textwidth]{pictures/...} ...
1
vote
2answers
65 views

How can I print a length of hsize (Horizontal size) in mm (millimeter)? [duplicate]

I am new to VTEX. How can i solve this?? \documentclass{article} \begin{document} \the\hsize \end{document} Output: 345.0 pt but i have to write a macro to calculate hsize in mm example: ...
3
votes
2answers
116 views

How can I print a length in centimeters in VTEX?

\documentclass{article} \begin{document} \newdimen\mylength \mylength=1in \the\mylength \end{document} Output is: 72.27 pt But i want to show output in centimeter using VTeX.
2
votes
1answer
59 views

Set width of tabular column to the width of tabular numerals

Take the following code: \documentclass{article} \usepackage[oldstyle, tabular]{libertine} \usepackage{array} \newlength{\period} \settowidth{\period}{9999--9999} \begin{document} ...
8
votes
1answer
79 views

Is it possible to adjust the “quantization” of allowable skip lengths?

In plain TeX and derivative formats, the concept of stretchable/shrinkable length, AKA a glue or a skip or a rubber length exists, in general defined as <dimen> plus <stretch-dimen> minus ...
2
votes
1answer
55 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
39 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 ...
5
votes
3answers
115 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
57 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
45 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
51 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
78 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
162 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
263 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
164 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
48 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
24 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
319 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
196 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
130 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
192 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
211 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
126 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
177 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
322 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
238 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
128 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
52 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
128 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
64 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
35 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
81 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
71 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
84 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
61 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
167 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
147 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} ...