{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

6
votes
1answer
221 views

Usage of a saved dimension in another saved dimension in a \pgfdeclareshape command

I have a question about \saveddimen usage inside of a \pgfdeclareshape command. My code is as follows: \documentclass{article} \usepackage{tikz} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ...
4
votes
1answer
502 views

Better alignment for enumitem list

In the following screenshot, the alignment of the 2nd A) and the space between the label of the 2nd list and the fraction have been obtained empirically n: see \hspace*{1.375em} and ...
8
votes
2answers
398 views

How does the enumitem package place the labels?

In the following screenshot, I would like the 1st item A) in the inline mode to be at the same level of indentation of the labels A) to D) in the first list. To do that I would like to know how the ...
4
votes
1answer
215 views

Measure and retain lengths between tabular rows

I need elements in a tabular environment to set some lengths and be able to access these lengths in another row of this same table. But it appears that adding \global in front of \settoheight and ...
21
votes
2answers
22k 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
1answer
305 views

Is it possible to remove length, counter, dim, etc that have been declared?

Let's see the following screenshot taken from an answer of Efficient ways to anonymize a document and the given comment. Is it possible to remove length, counter, dim, etc, that have been declared ...
6
votes
2answers
905 views

medskipamount, default value in article class

What is the default value of medskipamount in the article class? I have not been able to locate this information. Is there some database where default values of various parameters can be accessed?
1
vote
1answer
787 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 ...
17
votes
2answers
2k views

How to preserve the same parskip in minipage

I have following structure: \begin{document} Paragraph1. Paragraph2. \begin{minipage} Some paragraph1. Some paragraph2. \end{minipage} \end{document} How can I make the same spacing between ...
82
votes
2answers
52k views

Lengths and when to use them

There are many lengths in LaTeX. For instance, \enskip, \enspace, \quad, \parskip, \smallskip, ... Some of them are mostly used for vertical spacing, some others are mostly used for horizontal ...
3
votes
1answer
843 views

Multiplying a length by a factor

I am trying to create a package that will use grid typesetting (in the humanities, so not much of a problem) but that should allow the user to freely set the \baselinestretch. I am using the memoir ...
5
votes
2answers
721 views

Add two lengths in raisebox argument, without the calc package

I've seen people use such constructs as \raisebox{-\height+\baselineskip}{...}, which works well using the calcpackage. What equivalent would you use to achieve the same behaviour without the calc ...
4
votes
2answers
761 views

fontsize setting with newcommand and newlength

How do I set a \newcommand so that the field #1, which is calculated to be 1.2*#2 Optional? Something similar to the following commands, but that did not work. \documentclass{article} ...
9
votes
2answers
421 views

How can I globally set pgfmathsetlength?

How can I declare a length via pgfmathsetlength global? The example results in 20pt -- 5pt -- 20pt But I had expected: 20pt -- 5pt -- 5pt \documentclass[10pt]{article} \parindent0pt ...
14
votes
4answers
1k views

Conversion pt to mm or cm

Is there any way how to convert pt to mm or cm in plain TeX?
1
vote
1answer
334 views

Use pgfplots and a custom length to define global width when inputing the plot

I'm trying to set the width for all my plots, that are defined in other files and imported into the main document, using a custom width, \sz. I'm trying to set this length because I want to change it ...
6
votes
1answer
353 views

What does a number followed by “ in” mean?

The TeX syntax highlighter that I use colors all occurrences of a number followed by " in", e.g. 0 in or 32 in in a dangerous bright red, in almost all contexts. Why?
5
votes
1answer
594 views

TikZ, foreach and sum

I'm trying to create a list of rectangles of various sizes, starting at the end of the previous rectangle. I'm using a foreach loop with a TeX length, but I don't get the result I want, and I really ...
2
votes
2answers
1k views

Length parameter for vertical skip space in a math environment?

I learned here that I can use \\[<len>] to explicitly set the vertical skip space between lines, e.g., <len> set to 3ex. I'd like to set <len> to, say, 2-times the normal length in ...
9
votes
2answers
2k views

How to enable use of minus and plus in tex documents?

I see many cls files using plus and minus operators to set lengths. How can I use these operators (or some equivalent macro(s)) to do something like the following? \setlength{\lengtha}{.5\textwidth} ...
3
votes
2answers
514 views

Linewidth resets when using input files

I'm trying to set some figure files in standalone .tex files, and then input them in the main file. Those files looks something like this \ifx \plotwidth \undefined \newlength{\plotwidth} ...
2
votes
3answers
364 views

Make a length negative

I was wondering if there is a way to have a \negate command which makes lengths negative. So you could do things like: \newlength{\negativeabovecaptionskip} ...
7
votes
4answers
854 views

Is there a way of limiting the scope of \newlength?

Is there a way of limiting the scope of \newlength? I'm using the same name in many TikZ picture but each with different value, and I don't want it to live on between the pictures as it's not intended ...
11
votes
1answer
813 views

Why do \setcounter and \addtocounter commands have global effect, while \setlength and \addtolength commands obey the normal scoping rules?

The \setcounter and \addtocounter commands have global effect, while the \setlength and \addtolength commands obey the normal scoping rules. Why were they designed like this? Why are ...
0
votes
1answer
214 views

How should I express my length calculation to minimize rounding errors?

I have an input file as follows. % Test.tex \documentclass{article} \usepackage{pstricks} \psset { linewidth=0.01 } \newcommand\All{0.1} \newcommand\Left{-\All} \newcommand\Right{\All} ...
9
votes
2answers
265 views

Confused with whether or not I have to use \the

I got confused with whether or not I have to use \the. \the in \special{papersize=\the\paperwidth,\the\paperheight} is mandatory. But \the in neither ...
4
votes
1answer
236 views

Length needs backslash but counter does not, why?

\documentclass{minimal} \parindent=0sp \newlength{\Length} \setlength{\Length}{1in} \newcounter{Count} \setcounter{Count}{10} \begin{document} \the\Length \theCount \end{document} Length needs ...
9
votes
1answer
551 views

How does PDF or PDF Viewer define a rounding rule for stroke thickness?

I defined a sequence of line segments of different thickness each as follows. \documentclass{article} \usepackage{multido} \parindent=0sp \begin{document} ...
3
votes
1answer
2k views

A new paragraph followed by a big skip

Here is the code I am using to place a heading with a line above and below the text, from this post. \newcommand{\rheading}[1] { \par \bigskip \hrule height 1pt \kern 5pt \hbox to ...
20
votes
2answers
3k views

What are the differences between \newdimen, \newskip and \newlength?

What are the differences between \newdimen, \newskip, and\newlength? When should I use each of them? Please give me a non-trivial example for each case.
4
votes
2answers
796 views

Is there a command to convert cm to bp?

I want to convert a length in cm (centimeter) to bp (big point). Is there a command to convert cm to bp?
21
votes
2answers
649 views

Which is better: a dimension or a macro?

When messing around with TikZ/PGF then I frequently find myself wanting to store a length for later use. By "length" here, I mean the word in its non-TeX meaning. As I'm doing stuff in TikZ/PGF then ...
51
votes
3answers
12k 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 ...
28
votes
3answers
711 views

Is there a picture showing all the lengths used in lists?

I want to adjust the length parameters in a list (happens to be to make it more condensed, but that's not relevant). I do this infrequently enough that I don't remember all the lengths that are ...
11
votes
3answers
538 views

Measure the length of the lowercase alphabet

In the memoir manual speaks about measuring the length of the lowercase alphabet in order to decide the numbers of characters per line. Can this be done with LaTeX?
163
votes
4answers
48k views

Difference between \textwidth, \linewidth and \hsize

The three lengths \textwidth, \linewidth and \hsize seem to all hold the width of the current line. At least I never saw some real difference between \textwidth and \linewidth in my code. Both seem to ...
3
votes
2answers
743 views

How to convert number to length?

I'm trying to generate a "word cloud" by using \mboxes with random spaces around words. In the code below I've removed stuff that change the font size, and I've replaced \mboxes by \frameboxes for ...
12
votes
2answers
968 views

Where is the left-hand margin?

I'm working on the TikZ-from-TeX-SX package, specifically developing the code for putting equation numbering at places within a tikzpicture environment. To do this, I need to know where the text ...
19
votes
2answers
3k views

What is the difference between \def and \newlength?

I wrote the following LaTeX documents. \documentclass[11pt]{book} \newlength{\mywidth} \newlength{\myheight} \setlength{\mywidth}{85mm} \setlength{\myheight}{112mm} \newcommand{\setpagesize}[2]{% ...
10
votes
2answers
4k views

Getting length as number?

I have probably formulated the question wrong, as I don't know the Tex internals - but this is what I mean; consider this example: \newcommand{\myNum}{2} \newlength{\myLength} ...
7
votes
4answers
1k views

A macro that expands to the length of its argument

If I want to anonymise a paper I've written for review, I don't just want to delete my name from the author field. I want to replace my name with a rule as tall as a capital letter and as long as my ...
12
votes
1answer
2k views

Tikz - move/reposition arrow decorations (arrowhead length/size)

I'm trying to build a 'dimension line' macro for Tikz: \documentclass{article} % note: with \documentclass{minimal}, this example fails with: % ! Undefined control sequence. % ...
4
votes
2answers
1k views

Calculate maximum of lengths

How can I calculate a maximum of lengths? I am aware of pgfmath's function max(x_1,x_2,...) \documentclass[a4paper,draft]{article} \usepackage{tikz} \pgfmathparse{max(3,4)} \begin{document} ...
15
votes
3answers
2k views

Why doesn't \settoheight of \parbox work?

Consider the following code: \documentclass[a4paper]{letter} \usepackage{calc} \usepackage{printlen} \newsavebox{\foobox} \newlength{\fooboxheight} \savebox{\foobox}{ ...
9
votes
2answers
3k views

What is the difference between \fboxsep=1cm and \setlength{\fboxsep}{1cm}?

Question has been written above.
7
votes
3answers
406 views

How to detect the length of the tallest letter and that of the deepest letter of the current font size?

My idea is to redefine the \strut to be as short as possible. It means the length of strut is the sum of the tallest letter length and the deepest letter length.
5
votes
1answer
290 views

How to pass the value of \mylength to the “trim” option of \includepdf of pdfpages.sty?

This problem is related to my previous problem about pdf trimming. Here is the minimal code: \documentclass{article} \usepackage{pdfpages} ...
9
votes
3answers
401 views

Making register declarations local, Undefining a register (count, toks, etc.)

Is it possible to make \newcount, \newtoks, etc. respect grouping, so that, e.g., \newcount\temp\temp=2{\newcount\temp\temp=1}\showthe\temp gives 2 (instead of 0)? Relatedly, is it possible to ...
8
votes
1answer
3k views

Minimum length for \xrightarrow

I want to place text over arrows. The obvious choice is to use the amsmath command \xrightarrow{#1} However, sometimes the text above may be a single digit: %Example 1 \xrightarrow{1} other times ...
3
votes
1answer
1k views

Trouble setting a length [closed]

I'm starting with LaTeX, and there are things that puzzle me. I'm trying to set a length that's the \textwidth minus (let's say for example) two inches. In the preamble, I wrote: \newlength{\bplen} ...