{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

3
votes
1answer
39 views

Fancyhdr sets wrong headheight

I am having some issues with fancyhdr setting my \headheight. The package seems to add too much \headheight. This is my current set up: \documentclass{article} \usepackage[T1]{fontenc} \usepackage[...
1
vote
3answers
55 views

How to convert \textwidth to mm and use the number as a command?

I am trying to convert \textwidth to other units I want and do calculations with the number (without the unit). How does one do this?
3
votes
1answer
30 views

Use temporary length \dimen255, temporary count \count255

This Question is mainly important for package writing: I read in the TeX-Book that \count255 and \dimen255 are traditionally used for temporary. Now the number of registers has risen (see this ...
2
votes
1answer
39 views

Convert count into length

I want to decrease a length by a number (count). I tried some variations with \newlength{\temp} and \addtolength but I got problems there with the minus. I also tried variants with \dimexpr. The ...
1
vote
0answers
12 views

LyX is changing horizontal spacing between words depends on the line's length - it even changes the page margins

I'm writing a paper in Hebrew and the margins of the equations from both sides is just too small, IF the line is long. What I mean that it feels like LaTeX is trying to push too much into 1 line, it ...
4
votes
2answers
106 views

How to use \beamer@frametitle value as an argument to \settowidth

I was customizing a beamer theme that have to be used by many people at my workplace. I want to show an error whenever frame-title takes more than two lines. Please don't ask why title is so long. So ...
1
vote
1answer
38 views

Is there a simple way to create a local length

I want to redefine \textheight and \textwidth inside a \parbox. \textwidth works pretty well so far. But the textheight-part works only with the help of a \newlength. Unfortunately the \newlength will ...
3
votes
1answer
306 views

Why the measurement of vertical distance between two points is wrong?

Please, consider the following (not so minimal) MWE. Why the distance between points named a3 and b3 is not the same as the vertical distance between points a2 and b2 (it is about 30% larger)? From ...
2
votes
2answers
41 views

\foreach and \StrLen

I don´t know how to make a foreach with a StrLen inside it, is it possible? \documentclass[a4paper,12pt,hidelinks]{article} \usepackage[utf8]{inputenc} \usepackage[brazil]{babel} \usepackage[T1]{...
3
votes
2answers
51 views

Why is \setlength ineffective inside a tabular environment?

Why is \setlength ineffective inside a tabular environment? Here is an MWE: \documentclass{article} \newlength{\globallength} \newlength{\locallength} \begin{document} \setlength{\globallength}{10pt}%...
1
vote
0answers
15 views

How to find the length of a remaining line? [duplicate]

I'd like to put some lines on a page where a student can answer a question, and I'd like that line to go from the prompt to the right edge of the text. The most simpleminded and (therefore?) ...
3
votes
2answers
36 views

calc package and global lengths problem in tabularx

The output of the following code is affected whether calc package is included or not: \documentclass{article} \usepackage{tabularx} % \usepackage{calc} \newsavebox{\testbox} \newlength{\testlen} \...
2
votes
3answers
128 views

How to setup a longtable with booktabs and a colored (head) row

I'd like to make a longtable with the first (head) row colored in grey. Since booktabs inserts white space below the \toprule and above the \midrule, i need to insert a colored rule: \newcommand*{\...
4
votes
2answers
55 views

Sort array of words by length

I have a long array of words which I need to show in increasing order of length. I have tried to use the package arraysort and customize a comparator. My simplified code is: \documentclass{article} ...
2
votes
1answer
22 views

Passing length in form of a string instead of measure [duplicate]

I'd like to pass a measure of length in form of a string, i.e. \setlength{string} or \setlength{'string'} instead of \setlength{2.5cm} I seem to remember seeing something like that somewhere ...
3
votes
1answer
84 views

Arithmetic operation between command arguments and latex parameters

I'm defining a new command that places two images one next to the other and I want to add an horizontal space between the two images which corresponds to one third of the space that remains blank. The ...
1
vote
2answers
41 views

How to set a length to the min of two other lengths?

I have declared several lengths in my document: \bottomMargin \topMargin and \initialPaperHeight. Right now, I am doing this \AtEndDocument{% \global\paperheight\dimexpr\pagetotal + \bottomMargin + ...
1
vote
0answers
45 views

geometry's bindingoffset seems to be ignored

The geometry's documentation tells: page 9: "bindingoffset removes a specified space from the lefthand-side of the page for oneside or the inner-side for twoside.", page 10 (caption of Figure 6): "...
0
votes
1answer
58 views

Text overflows into graphics at bottom of page

I want to include graphics on every page after the title page but on the 2nd page the text flows into the graphics and I also loose the page number on that page. Subsequent pages are fine. Here is my ...
2
votes
1answer
41 views

Texts, lines and length

It is possible to set the width of the lines depending to text length (text aab's in MWE). Total length text aab's + line should be an equal. And I need also the "Text inside" on the same height as "...
2
votes
1answer
171 views

dotfill for length of text

I am trying to make some small dotted lines for the signature of different persons, with their printed names just below. I thought it would look great if the width and horizontal placement of the ...
3
votes
1answer
73 views

\columnwidth in cm

I have a silly question - i am using double column style \documentclass[english,a4paper,12pt, openany]{book} When I add a figure I usually put in \columnwidth and just let LaTeX to stretch it to ...
4
votes
1answer
65 views

Automatically calculate width

This is a question to Werner's answer to the question "How to draw arrows between parts of an equation to show the Math Distributive Property (Multiplication)?". Consider the following code: \...
3
votes
1answer
77 views

Converting lengths with lengthconvert and l3fp

The package lengthconvert "uses the modul l3fp to convert the length". But its conversions are totally off the charts: \documentclass{article} \usepackage{lengthconvert} \begin{document} \the\...
3
votes
2answers
2k views

What is the default length of \hrule?

When used without parameters, what varfiable controls the length of \hrule? I.e., how can I change the default length of \hrule, other than adding parameters to each instance -- say, to affect ...
1
vote
1answer
32 views

Is it possible to use mylatex or mylatexformat for documents with preambles almost the same?

I have documents of this form: \documentclass{article} \newlength{\variableLength} \setlength{\variableLength}{xxxx cm} \usepackage{package1} \usepackage{package2} \usepackage{package3} \...
0
votes
2answers
79 views

Accuracy of distance measures in geometry

In the following MWE, I set the distance from the edge of the paper to the body text to be 25mm. \documentclass[a4paper]{article} \usepackage[showframe, paper = a4paper, tmargin = 25mm]{geometry} \...
2
votes
2answers
59 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 ...
2
votes
1answer
190 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
47 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
69 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
32 views

subheading of titletoc exceeds dotts and beginning of pagenumber

I am using titletoc like this: \usepackage{titletoc} \newcommand\frontmatterchaptoc{% \titlecontents{chapter}[1.4em]{\addvspace{3pt}}{\contentslabel{-0.25em}\hspace{2em}}{\hspace*{-1.3em}\...
3
votes
1answer
94 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
83 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} \usepackage{...
1
vote
1answer
77 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
64 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
48 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 \...
9
votes
2answers
660 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 1pt}...
3
votes
1answer
345 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 ...
6
votes
1answer
814 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
188 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/...} \end{...
1
vote
2answers
106 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
164 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
74 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} \begin{tabular}...
8
votes
1answer
93 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
75 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
60 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
192 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
117 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} \...
2
votes
1answer
82 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 ...