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.

Filter by
Sorted by
Tagged with
1
vote
1answer
21 views

Context-sensitive length “units” in LaTeX

I would like to include in some macro a separating space that is "context-sensitive" (in the sense that when the macro is called, for example, inside a subscript, the separating space ...
4
votes
2answers
61 views

Normalizing space after stacked characters in LaTeX: Typesetting o͘

I am attempting to typeset the o͘ character in LaTeX by stacking a raised period on top of the letter o. The spacing for the results I've achieved is inconsistent, as you can see in the below ...
2
votes
1answer
18 views

How to use \input inside \setlength?

I'm trying this: \documentclass{article} \usepackage{calc} \newlength{\foo} \newcommand{\zzz}{\input{size.txt}} \setlength{\foo}{2in * \zzz} \usepackage[paperwidth=\foo,paperheight=\foo]{geometry} \...
4
votes
2answers
123 views

Why can't I multiply size by integer in calc?

This is what I'm doing: \documentclass{article} \usepackage{calc} \newlength{\foo} \newcommand{\zzz}{5} \setlength{\foo}{\zzz * 2in} \usepackage[paperwidth=\foo,paperheight=\foo]{geometry} \begin{...
4
votes
1answer
64 views

Why \setlength doesn't work in preamble?

This is what I'm doing: \documentclass{article} \usepackage{calc} \newcommand{\foo}{0} \setlength{\foo}{2in + 3in} \usepackage[paperwidth=\foo,paperheight=\foo]{geometry} \begin{document} Hello, world!...
1
vote
1answer
33 views

How to get the number of a length without the unit?

I am trying to draw a box whose dimensions are related to the size of the page. I can calculate the height and width of the box in \length terms (which include the length unit; e.g., 55.5pt). However ...
2
votes
1answer
23 views

How to recover value of current line spread?

I want to set linespread to a value then go back to the previous value it had. How do I do it? Something like: \let\oldlinespread\linespreadvalue \linespread{1} \printmystuff \linespread{\...
1
vote
2answers
42 views

Command to return both font size class and font size in pt

I am looking for a command to return both the font size class and the font size in pt. The following approach from @Alan Munn as per this SE post prints font-size values for all standard classes: \...
2
votes
0answers
26 views

Measuring maximum height of row within align

Is there a way to extract the maximum height of a row within an align environment? For example, given \begin{align} a &= \frac{1}{2}\\ b &= 0.25 \end{align} I would like to extract the height ...
-1
votes
2answers
14 views

Length of a one line string

In the following TNWE (Tiny Not Working Example), I would like to align the braces on the right by calculating the lenghts of the texts such as to use \kern to fill spaces on right. Maybe blackmagic ...
2
votes
3answers
71 views

witharrows - Problem to use a length given by \settowidth

The following code doesn't use the offset given by \myl. What am I missing ? \documentclass{article} \usepackage{witharrows} \newlength\myl \newcommand\doublearrow[2]{ \settowidth\myl{#1}%plus ...
0
votes
2answers
33 views

Align & match length of \rightarrow and \xrightarrow

In the following example, I want to make \rightarrow be the same length as the \xrightarrow, while aligning the two. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \...
0
votes
1answer
38 views

How can I use “0pt plus 1fil + \baselineskip” as a length?

I'm trying to declare a new section command in KOMA-Script which is formatted exactly like part. According to the user guide the default for beforeskip is 0pt plus 1fil + \baselineskip. Unfortunately ...
1
vote
1answer
46 views

TikZ-matrix over whole textwidth

I try to create a TikZ-matrix like that: where bot rows had the height ca. 3cm. row 2 column 1 is planed as something like a multicolum. But in the first I have problems with the last column of row ...
1
vote
1answer
26 views

Centered text, but at almost equal line lengths

My goal is to typeset a short, centered text in a way that the difference in line lengths is minimal. Or, to put it differently: In a way that the width of the block is minimal without increasing its ...
2
votes
2answers
67 views

Using \setlength inside \mathchoice

I've written some somewhat complex tikz macros which use a length to set their scale. I've realised I want them to have a different scale when used inside display math versus inline math mode, and I ...
0
votes
1answer
28 views

Why is this space being inserted when using \newcommand and \setlength? [duplicate]

I'm trying to debug some \newcommand macros I'm working on, and I've got it down to this minimal example. All it does is define two lengths and then set their values - it doesn't use them for anything....
1
vote
1answer
29 views

\settoheight is slightly shorter than actual height

I am trying to set a length to the height of a heading. I have the following snippet. % heading height \settoheight{\headingh}{\Huge{\textbf{\heading}}} \centering\Huge\textbf{\heading}\rule{0.1mm}{\...
0
votes
1answer
36 views

How to properly halve the inter-line distance in a math block environment

... of amsmath or mathtools? In other words, how to properly halve \jot? Options: \setlength{\jot}{.5\jot\relax} \setlength{\jot}{\dimexpr.5\jot\relax} \setlength{\jot}{\dimexpr\jot*.5\relax} \...
5
votes
3answers
308 views

\somepenalty=10000 vs. \somepenalty 10000 vs. \somepenalty10000

Replacing the equality symbol with a space below or omitting the symbol at all \documentclass{article} \pagestyle{empty} \usepackage{lipsum} \begin{document} \interlinepenalty=10000 % or \...
1
vote
1answer
23 views

align environment multiline equations - starting equality and inequality slightly from left the avoid page cutoff

I am using align environment to write quite huge multiline equations. The following latex source code generates the following screenshot \begin{align} \Bigl\|\sum_{i=1}^{k-1}\phi(s_t^i,a_t^i)[\...
0
votes
1answer
79 views

Chemfig: fixed bond length and vertical alignment

I have two reaction schemes and one is a skeletal representation. I want all of my bonds to be a certain length, so I set the option fixed length = true and atom sep=1.5em. This gives me the above ...
1
vote
1answer
35 views

Relax a command within an environment

A new environment is to be designed which prints some length. The environment is used multiple times in the document, hence the length is calculated more than once, leading to error "command #length# ...
0
votes
0answers
26 views

Curly brace to depict length in TikZ [duplicate]

Can I make long curly braces to depict lengths on a graph like this?
3
votes
1answer
125 views

Powerpoint-like animations with beamer and the animate package

I want to achieve a simple "fly-in"-animation with LaTeX by utilizing the animate-package. My idea was to insert an \hspace with decreasing length-argument. However, there is no animation at all. MWE ...
0
votes
1answer
100 views

Why does \ifdim work here but \if doesn't?

I'm very new to LaTeX, and need to compare a length I've defined with a default value (and set another length accordingly). Consequently, I'm exploring the murky (to me anyway) world of LaTeX ...
4
votes
1answer
80 views

Setspace package changes behavior of \abovedisplayskip

When using the spacing environment from the setspace package, it appears that rubber lengths in \abovedisplayskip and \belowdisplayskip are being ignored. \documentclass{article} \usepackage[nopar]{...
1
vote
1answer
86 views

negative character space (negative version of `\ `)

There is a negative thinspace \! which is a negative version of \,. Is there a negative version of normal character space \ too? I could not find it in: Lengths and when to use them, What commands ...
1
vote
1answer
120 views

Tikz: use latex length for length of path (ditto marks)

I want to draw a ditto line, which is a horizontal line with two small marks in the middle. My first attempt was \dittoLatex which uses a box with characters and rules, but is frankly ugly. My ...
3
votes
1answer
62 views

tikz arithmetic with numbers and lengths

Consider this example: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} \def\starty{3} \def\length{1}; \coordinate(a1) at (1, \starty); \...
1
vote
3answers
102 views

\def, math, and order of operations, expansion?

I have what looks like a simple task but I cannot seem to get it to work. take the following: \def\varlength{1in}%has units \def\varscalar{0.2}%does not have units \raisebox{\varscalar\varlength}[...
4
votes
1answer
58 views

Shortening lengths in LaTeX

I'm trying to create a a bipartite object that has the \textwidth at most, and doesn't overflow from the right, but has the width of the separator given as an argument. I attempted to achieve this ...
2
votes
1answer
49 views

How to put a text over symbols, part 2

Building on How do I put text over symbols? I created a new command : \newcommand{\myequ}[1]{\stackrel{\mathclap{\normalfont\mbox{#1}}}{=}} which gives overwriting : when #1 is too long. Is there a ...
2
votes
1answer
48 views

Why does `settowidth` not work inside `foreach`?

I would expect the first two a to be wide apart on the first line.. \documentclass{report} \usepackage{tikz} \begin{document} \newlength{\mylength} \foreach \i in {dum,iteration} {% \...
5
votes
1answer
157 views

How to Set Lengths (Glue/Skips?, not Dimensions), in LuaTeX?

I am trying to define a length, (not a dimension)—using Lua. But, I am having trouble with the syntax. I think I am supposed to be using the same structures/prototypes as glue_spec in order to still ...
1
vote
1answer
62 views

Problem with lengths and images

I'm trying a simple page with an image in the top of it as a header and an square image centered in the rest of the page. I would like the images to fill the full page width. After trying some ...
0
votes
1answer
35 views

Neat alignment of titlerule, text in tabular, and text in longtable

I'm having some trouble getting things to line up neatly. To be clear, I don't want everything to be the 'same length,' rather, I want it to fit aesthetically so that with multiple sections and ...
4
votes
1answer
120 views

exam: Macros for printing the values of \labelwidth and \labelsep for question/part

How can I print the values of \labelwidth/\labelsep for both questions and parts? \documentclass{exam} \usepackage{verbatim} \renewcommand{\questionshook}{% \setlength{\leftmargin}{0pt}% \...
4
votes
2answers
200 views

How to make the arrow in a chemical formula shorter? (using mhchem)

I'm using mhchem to write a chemical formula, as in the example by clemens (shown below). Is there a way to make the main arrow -> shorter by a fixed value in the second equation? Here's the code: ...
0
votes
2answers
58 views

rule length equal to length of item text paragraph

How can I get the width of the rule equal to the text for each item paragraph ? Any advice ? \documentclass[french,12pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{...
1
vote
1answer
43 views

Ifoddpage statement inside switch case

Continuation of topics tcolorbox: specific width and height settings for odd and even pages and Distance Variable in front or back pages. I'd like to set lengths conditionally based on the expansion ...
1
vote
1answer
57 views

How to do something after @ifnextchar?

In my LaTeX file, I'm using \usepackage{indentfirst}. And there I've defined a command: % ################################################## % % Coding skills % ---------- Usage example ---------- % ...
1
vote
0answers
48 views

calculate the title height and if the title height is above some number then add some space

calculate the title height and if the title height is above some number then add some space. when I use the code get the title, but when I use code like this \settoheight{\heightoftitle}{\vbox{\...
4
votes
0answers
53 views

Alignment of an un-numbered multicolumn tcolorbox listing

Consider the following code: % Preamble \documentclass[letterpaper, 10pt]{article} \usepackage{calc} \usepackage{xcolor} \usepackage{listings} \usepackage{multicol} \usepackage[most]{tcolorbox} \...
7
votes
3answers
592 views

How to get depth and other lengths of a font?

Red line in the output is \baselineskip, the only length in question that I know of. The output image provided here is an edited image in which (red line representing \baselineskip is re-positioned to ...
2
votes
2answers
125 views

Calculate metric length in LaTeX (e.g. for TikZ)

I would like to calculate the length of elements on a LaTeX beamer frame (128mm*96mm) equivalent to those on a PowerPoint slide (254mm*190.5mm), i.e. apply the factor 128/254 to a value given in mm. ...
3
votes
2answers
146 views

Does expl3 have alternative to \settowidth and \settoheight?

How can I substitute following code with expl3 interfaces (that do the same job)? \documentclass[varwidth]{standalone} \begin{document} \newlength\spaceWidth \settowidth{\spaceWidth}{\ } \the\...
2
votes
1answer
65 views

In tikz length measurement from trigonometry and from coordinates differ

I have different measurement of length with trigonometric equation using radius and theta and from coordinates. I want to solve this issue because for further computation I need to have both ...
1
vote
1answer
60 views

Dynamic length name

I want to create something like in object, that saves it's own location in latex. Because I don't know how to create a objec in latex, I want to create a length with seperating name for each object. ...
2
votes
1answer
56 views

How to get the font size parameter passed to the main standard classes?

For complex length manipulation (see here), I would need to get the font size that was passed as an option to the document class: \documentclass[12pt]{article} \newlength{\mainfontsize} \setlength{\...

1
2 3 4 5
8