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.

4
votes
2answers
384 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
297 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
102 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: \...
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
301 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
91 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
57 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
400 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
528 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
402 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} ...
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 ...
3
votes
1answer
359 views

\setlength{pdfpagewidth}{8.5in} not working in sharelatex

I am writing a paper for AAAI-18, which requires the following commands to be pasted near the top of the document: \setlength{pdfpagewidth}{8.5in} \setlength{pdfpageheight}{11in}\\ Neither of these ...
0
votes
1answer
92 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 ...
2
votes
2answers
545 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=...
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....
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....
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}...
5
votes
2answers
121 views

Splitting bibliography alphabetically: how to vertically align margin note?

Context: Since my bibliography is constituted of 200+ entries, I want to add margin-notes at each new letter to split the bibliography alphabetically. (I.e., print a "B" in the margin next to the ...
0
votes
1answer
70 views

How to parsing a length with skip/rubber/glue? [duplicate]

Others have asked about getting length as a number; the solutions there (using \strip@pt to remove the units, or using \number to convert to an integer number of sp units) work fine for a regular ...
4
votes
2answers
99 views

Wrapping a length

I've cobbled together the \basis macro which sets and gets a hidden/internal length \b@sis. It is meant to work as follows : Calling \basis returns the value of \b@sis Calling \basis{} sets \b@sis to ...
3
votes
0answers
148 views

Can one use the Potrzebie unit system in (La)TeX?

Inspired by a comment to this answer (and some wasted but entertaining time on the internet), I was wondering if somebody has implemented the use of the Potrzebie unit system in (La)TeX, as a tribute ...
3
votes
1answer
2k views

beamer: How to get height for frame content [duplicate]

I want to put a picture in a beamer slide and make it use all the available height of the frame. So I tried: \documentclass{beamer} \usepackage[utf8]{inputenc} \usepackage{graphicx} \begin{document} ...
0
votes
1answer
668 views

Specifying the length of \hline

$\left[\begin{matrix} u(\lambda)\\\hline v(\lambda) \\ \end{matrix}\right]$ $\left[\begin{array}{c} u(\lambda)\\\hline v(\lambda) \\ \end{array}\right]$ In the first code ...
6
votes
1answer
381 views

LuaLaTeX: Calculate length in Lua

I apologize if this a rookie question, but I find it extremely hard to find a solution to my Lua problem using online searches and browsing reference manuals. I would like to calculate a length: ...
2
votes
1answer
86 views

Get pseudo-length value in scrlttr2

I am customizing a scrlttr2 template. I'd like to use some pseudo-length values to define other ones. For example, I defined \@setplength{firstheadhpos}{2.10cm} and I'd like to define the pseudo-...
5
votes
1answer
409 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 ...
2
votes
1answer
78 views

Decrease the length between title and content of resume

\documentclass[11.8pt,a4paper,sans]{moderncv} \usepackage{verbatim} % moderncv themes \moderncvstyle{classic} \moderncvcolor{blue} % character encoding \usepackage[utf8]{inputenc} % ...
2
votes
1answer
67 views

Framed minipage wrong size in PDF [duplicate]

I am trying to make a document containing a box with text that i want to appear a certain exact size when i print it. (Specifically I want to make a nametag that fits exactly inside a slot on my ...
2
votes
1answer
365 views

Change \topsep in a list without packages

Consider this code \documentclass{article} \usepackage{lipsum} \begin{document} \setlength{\topsep}{3\baselineskip} %\setlength{\partopsep}{3\baselineskip} \hrulefill \begin{enumerate} \itemsep=...
7
votes
4answers
252 views

How to link 2 lengths

I would really like to create a length \bar that defaults to having the same as the length \foo even if \foo gets changed, but I would also like the user to be able to set \bar to be whatever length ...
3
votes
1answer
76 views

TikZ: Using current length inside scope environment

Following this answer: Drawing on an image with TikZ, I'm using \begin{tikzpicture} \node[anchor=south west,inner sep=0] (image) at (0,0) {\includegraphics[width=0.9\textwidth]{some_image.jpg}}; ...
3
votes
1answer
176 views

Remove stretch and shrink (glue) from existing length

Suppose I have a length \mylength, defined to be \setlength{\mylength}{5pt plus 1pt minus 2pt} I'd like to make \mylength a fixed length, but keep the default length. In this example, I'd like \...
1
vote
2answers
69 views

How to determine the partial heights of a font

I want to determine the heights of a font. \f@size gives me the total height of the line. This should be top line to bottom line. How can I determine the length between top and 2 (fat) and the length ...
7
votes
1answer
133 views

Notation for lengths

I've noticed that when you set length, you can not only write \setlength{X}{3.14cm} but \setlength{X}{=3.14cm} as well. It looks like there is not any difference between those notations but I'd like ...
1
vote
1answer
69 views

Stacking lengths and pop them off

I have an outstanding post about a TiKZ underliner (which has a bounty running for the TikZ 'pro' who find the solution). The only thing I need to solve is to add an xshifter of \@totalleftmargin to ...
4
votes
2answers
750 views

Draw a line under a figure that match the figure lentgh

I am using a line under a figure to make it more aesthetic. I am having a problem with matching the line length with the figure length. Here's a MWE. \documentclass{article} \usepackage[utf8]{...
7
votes
1answer
137 views

create spacing command that eliminates extra spaces after

After a \section command, there is the same amount of space regardless of what follows. An itemize environment does not add extra space. How can I achieve the same behavior after a custom environment?...
28
votes
3answers
1k views

Make my infinite squares math-proof

I created a command that makes a square of text in ever-decreasing sizes to create the effect of infinite decrease. But if I increase the starting width, or change the scale factor, TeX has an ...
3
votes
1answer
182 views

using \textheight and \baselineskip in scrartcl

I want to tell nomencl to print all items on a single page. If I use \documentclass{article} my code to let LaTeX compute the right length for nomitemsep itself works fine. But if I use \...
2
votes
1answer
46 views

How can i keep image sizes, defined by x\textwidth, after change of the textwidth?

i set up all image sizes by x\textwidth. Unfortunately i have to turn in the paper with another textwidth. Is there a possibility to keep the image sizes exactly like they are right now?
5
votes
1answer
144 views

If I need to set width to text width, how can I restore it later?

What is the syntax for storing some width in order to change it temporarily and then restore to the original? Example: %save length here \setlength\somewidth{\textwidth} some text \begin{...
1
vote
1answer
73 views

Difference of lengths

This should be a very basic problem, but I can't find it anywhere: \documentclass[tikz,border=1pt]{standalone} \usepackage{fp} \usetikzlibrary{fixedpointarithmetic} \newlength{\radiustai} \...
5
votes
1answer
1k views

em, ex, en? Which length units are font size dependent?

Length can be specified as 3em, or 3.5ex. What is required to make 4en also valid? Are there any other font related length units?
1
vote
1answer
150 views

changing \itemsep only at top level of list environment

I'm not a LaTeX programmer, but I have to deal with this bit. I have a class file defining a questionlist environmet. This is a list environment which can be nested. I want the \itemsep to be set ...
4
votes
1answer
5k views

How to set the radius of rounded corners relatively to default unit

Background: When I draw a tikzpicture, I use only the default units (i.e. I do not specify any unit, as in \draw (0,0) -- (1,1);). Issue: When no unit is given in the [rounded corners = <value>]...