{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

1
vote
1answer
35 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
298 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
34 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} ...
2
votes
2answers
37 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} ...
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
31 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
94 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: ...
4
votes
2answers
52 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
18 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
67 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 ...
28
votes
1answer
826 views

Using elastic lengths — when do they work?

I was wondering why elastic lengths like \fill seem to work only under certain conditions. For instance if I write A \hspace{\fill} B I get A left aligned, B right aligned as wanted. If however ...
7
votes
1answer
7k views

How do you increase headrule length in fancyhdr?

It's pretty well-known how to increase the headrule width, but how do I increase its length (i.e. let it run into the margin).
1
vote
2answers
40 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 + ...
0
votes
1answer
48 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 ...
1
vote
0answers
41 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): ...
2
votes
1answer
152 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 ...
2
votes
1answer
39 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
106 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
49 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 ...
2
votes
1answer
1k views

How to set scrlttr2 refvpos automatically based on address length

I am creating an letter options (lco) file that I will use for multiple letters. The scrlttr2 class is designed for a fixed placement of the address field, and places the date at a fixed position from ...
4
votes
1answer
60 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: ...
86
votes
3answers
24k views

Get width of a given text as length

Is there a TeX command that returns the width of a given text as length value, so that I can use the result directly as a length argument of another command? I mean, I would like to have a command ...
3
votes
1answer
73 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} ...
3
votes
2answers
1k 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} ...
18
votes
2answers
647 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 ...
0
votes
2answers
71 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
54 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 ...
37
votes
2answers
58k views

What is the difference between \hspace*{\fill} and \hfill?

In the memoir manual on page 183 ,this example is given: \begin{figure} \centering \hspace*{\fill} {ILLUSTRATION 1} \hfill {ILLUSTRATION 2} \hspace*{\fill} \caption{Example float with two ...
5
votes
3answers
175 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
0answers
45 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
55 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
26 views

subheading of titletoc exceeds dotts and beginning of pagenumber

I am using titletoc like this: \usepackage{titletoc} \newcommand\frontmatterchaptoc{% ...
3
votes
1answer
91 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) ...
1
vote
1answer
74 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 ...
4
votes
1answer
76 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} ...
0
votes
0answers
59 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
43 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 ...
8
votes
2answers
597 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
308 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
502 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
139 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
96 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
156 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} ...
8
votes
1answer
89 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
70 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
53 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 ...
9
votes
2answers
379 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 ...
4
votes
3answers
104 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} ...