Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [lengths]

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

2
votes
2answers
168 views

Use “length without unit” as scale parameter

I'd like to have a number variable in Latex to be used for the scale parameter in an includegraphics command (for example, to let all finite state machine pictures be scaled to the same size). This ...
1
vote
3answers
149 views

Setting width of table equal to length of line

In this example \documentclass{article} \usepackage{tabularx} \newlength{\streetlength} \settowidth{\streetlength}{Apple street 16-214, Great City, Big Country} \begin{document} \begin{center} ...
2
votes
0answers
166 views

pgfplots, lengths in axis coordinates

Sorry if it's a FAQ, probably looking for the wrong keywords but couldn't find anything. I have a macro that takes a length parameter to draw a shape. I'd like to call this macro inside a pgfplots ...
3
votes
1answer
73 views

Custom error message for bad length value?

Using LuaLaTeX in texlive2017, but I assume that this would apply generally. Question: Is it possible to set a custom error message, that will be shown when a bad value is used as the argument to a ...
0
votes
1answer
39 views

What is the rubber length of a float in the float package?

I try to place images with a fixed width from the section title. My question somehow is close to this one, though not covered in the response: How do I remove white space before or after the figures ...
2
votes
2answers
315 views

Math operations on lengths

I have a table with three columns and I want the table to be distributed on \textwidth of the page. I tried: \documentclass{article} \usepackage{tabularx} \begin{document} \begin{tabularx}{\...
9
votes
1answer
6k views

How to know the column width of a two column article?

I'm writing an article with 2 columns. If my document is this: \documentclass[10pt,a4paper, twocolumn]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[ left=2.00cm, right=2....
5
votes
1answer
404 views

Arithmetic/calculations with lengths

I want to define a new command to add vertical "padding" before and after the content of a table cell. I'm stealing the idea of using rules/struts from the accepted answer to this question. My ...
4
votes
2answers
381 views

Defining macro \gsetlength as global setlength, reliable?

As is noted in other questions, such as Global scope or permanent length or savebox, the \setlength command does not always have global effect. In many cases, that is desirable. But when the effect ...
0
votes
0answers
38 views

Evaluate combinations of page dimensions [duplicate]

For any given class and its specified page layout, I'd like to be able to combine (sum or subtract) a subset of the page dimensions, to obtain a length to work with, without specifying absolute values....
0
votes
0answers
292 views

How can I change the length of footnote line? [duplicate]

I need to change the length of the horizontal line that separates text body from footnotes. I want length of footnote line is as much as width of footnote text. I can the following codes: \def\...
2
votes
1answer
101 views

\paperwidth too large

Recently a fellow student asked me how to make a table over the entire width of the page. I don't know why he wanted to do that but I thought it should be easy and wrote the following example: \...
4
votes
1answer
121 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 ...
0
votes
1answer
34 views

Cannot give length variable to crop package?

I don't understand why, but the following code fails with the error ! Missing \endcsname inserted. <to be read again> \myStock l.607 \AtBeginDocument {...
1
vote
1answer
44 views

Problem with lengths

I'm trying to insert some space between the label and the form control in hyperref forms. The following example works: \documentclass{scrartcl} \usepackage{calc} \usepackage{hyperref} \newcommand\...
1
vote
0answers
62 views

Adjust longtable length to caption length and vice versa

Is there any way to adjust the longtable length to the caption length and vice versa?
0
votes
3answers
39 views

Is there a way to update a length which has been computed from other lengths?

If I define a length by using others lengths, is there a way to update this length at a later point without giving the definition again? Let's say I define a few lengths as follows \newlength{\Test}\...
2
votes
1answer
300 views

Tabularx inside a tcolorbox: problem with column size and alignment

Consider the following code, derived from this answer and which produces the output shown at the bottom of this post. \documentclass[a4paper, 10pt]{article} \usepackage[margin=2cm]{geometry} \...
4
votes
1answer
2k views

A tcolorbox centered and automatically adjusted to the current text size

Consider the following code: \documentclass[a4paper, 10pt]{article} \usepackage[margin=2cm]{geometry} \usepackage[listings,skins,theorems,breakable]{tcolorbox} \usepackage{lipsum} \usepackage{...
1
vote
0answers
90 views

Exact spacing between lines

Is there a way to get the exact spacing between different parts of a document? I know the question may sound a bit vague, so here's the context in which the question arose. Here there is a code ...
1
vote
2answers
56 views

How can I get all the defined lengths in a document?

I would like to have a big list with all the lengths that have been defined in my document, along with their values. (Specifically, I'm making a baposter poster and I want to remove the header and ...
0
votes
1answer
398 views

How to set \topsep=0pt on the latex standard list implementation inside an environment?

Two attempts which not worked Herein there are 2 examples which did not work. Each attempt has written over it % Not works: \PassOptionsToPackage{brazil,main=english}{babel} \documentclass[10pt,...
4
votes
2answers
527 views

How to calculate the width of a space?

Using the questions: Get width of a given text as length Lengths and when to use them enumitem package and description lists For the inline enumerate: controlling the item spacing Customizing inline ...
1
vote
1answer
396 views

Multiplying command argument by factor

I am trying to use calc to perform a basic multiplication of arguments of a user-defined command, like this: \def\Verdana#1{ \normalfont \fontsize{#1}{#1 * \real{1.2}} \VerdanaFont \selectfont} ...
0
votes
1answer
91 views

Distances in TOC entry of section with mark

I try to customize TOC entry of section via redefining \l@section and defining \@section macros. My purpose was to add different mark (\sectiontitlemark) before section counter in main text as well ...
4
votes
3answers
3k views

Access height of a \parbox

Within a \parbox I can access its width via \linewidth (useful e.g. if I want to place an image as wide as the \parbox). Is there a way of accessing the height of a \parbox when the height is fixed ...
2
votes
2answers
539 views

Make a variable length horizontal rule depending on the text width of the title

I have the following custom environment for examples: \documentclass{article} \usepackage{lipsum} \usepackage{amsmath, mathtools, amsthm} \usepackage{graphicx, xcolor} \usepackage[top=1in, bottom=...
6
votes
2answers
1k views

Divide two lengths

How do I divide two lengths and get a length out? \documentclass{article} \newlength\A \newlength\B \newlength\C \setlength\A{10pt} \setlength\B{5pt} \setlength\C{\dimexpr\A/\B\relax} \begin{document}...
16
votes
5answers
3k views

Push/Pop or save a length/dimension?

Is it possible to push or pop a length like parindent? I want to change it temporarily but reset it soon after. I have a solution but looking for something a little nicer. I'll post it as an answer.
3
votes
2answers
3k 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 ...
14
votes
2answers
6k 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} \...
8
votes
2answers
736 views

Where should 1em be defined - when to use lengths in “em”

The table in the document below looks as expected when using the article document class. With other document classes, the rules dissapear. The reason seems to be that booktabs defines the with of ...
12
votes
1answer
68k views

LaTeX split long table in multiple pages and resize the width

I am trying to find a way to fix the width of my table to the margin of a portrait page (not landscape) while continuing the table in another page since it is very long. I can adjust the width by ...
8
votes
1answer
2k views

How to get width of equation

If I want to know the width of a text I use \settowidth{\MyLength}{bla}. Is there something similar for equations? More specifically I have \begin{align} a & b & c & d\\ c & d &...
8
votes
4answers
2k views

Function determining the length of text, usable where something with internal units (e.g. “em”) is expected

Is there a way to define a function \horizontallengthof returning the length of a piece of text in internal units? I would like to be able to use it anywhere where something of that sort is required, ...
3
votes
3answers
34k views

How to make table spanning textwidth [duplicate]

Consider the following code: \documentclass{article} \usepackage{booktabs,pgf} \begin{document} \pgfmathsetlengthmacro{\ratio}{\the\textwidth/4} \hrulefill \\ \begin{tabular}{@{}llll@{}} \toprule ...
11
votes
1answer
224 views

Measuring align

From what I read it seems that align environments are processed twice: the first time for measuring, the second time for actual typesetting. My question is whether one can get access to these ...
5
votes
1answer
93 views

How do I forward a length from a command into a column specifier?

I'm using longtable where I want vertical bars separating cells, although not for the table headers. I have 8 columns (but show only 3 here as example) and want to re-use the same lengths on the main ...
8
votes
3answers
867 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.
3
votes
1answer
1k views

Adding lengths with the plus and minus syntax

Is it possible to add macro lengths with manually coded numbers or with other macros in a length input, (as opposed to needing to use \addlength)? MWE: See \setlength{\xfootskip}{\xfootheight plus 0....
26
votes
3answers
13k views

How do I control the exact dimension of a picture in LaTeX?

This question is pretty simple: I'd like to have the possibility to get the exact size of a picture in LaTeX with, for example, the macro \the. In fact, I've founded the way \settoheight{} and so on, ...
9
votes
2answers
627 views

Page geometry discrepancies

In the Companion 2nd Edition Table 4.2 shows page geometry values for various font sizes of the letterpaper paper size. These differ sometimes substantially from current values of the standard classes....
9
votes
4answers
412 views

why can't \the be expanded?

\documentclass{article} \begin{document} \tracingmacros=2 \newlength{\len} \setlength{\len}{1cm} we want to write out \verb$\len$ in cm \the\len { oops, answer in pt} \setlength{\len}{0.0352\len} \...
4
votes
1answer
206 views

How to know the line width of enumeration in two column document prior to entering the enumeration?

I want to populate the following lengths just once prior to entering the enumeration (or perhaps prior to entering the document environment) to free me from worrying whether or not the initialization ...
3
votes
2answers
1k views

Changing length of an arrows from a vertex to itself

I'm working with LyX. I would like to change the length of an arrow from a vertex to itself. I would like to make the arrow stretch longer up before returning down to the encircled vertex. The code I ...
12
votes
2answers
561 views

Compute remaining horizontal space in align environment

I use align* often and sometimes it is preferable to add text to the right hand side of an equation instead of using \intertext, or \shortintertext, which tends to interrupt the math flow. This is ...
3
votes
1answer
226 views

Is it at all possible to design a macro that expands to a length? [duplicate]

Possible Duplicate: Get width of a given text as length In an attempt to Compute the x distance between two nodes, the question arose whether it is at all possible to devise A macro that expands ...
10
votes
1answer
698 views

How to compute exact width added by \left. \right

I have defined macros to produce resizable brackets that also work across line breaks. This necessitated the use of and additional set of \left. and \right. which add a bit of horizontal space. Now,...
9
votes
3answers
669 views

Defining a Length that Scales with Fontsize Changes

I noticed a behavior regarding lengths under fonstsize changes, which I'm hoping there is a way to circumvent. Consider this MWE: \documentclass{article} \begin{document} \newlength\mylength \...
35
votes
3answers
2k 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 ...