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
22 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
25 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
75 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
59 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 ...
3
votes
1answer
53 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]{...
0
votes
1answer
55 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
101 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
50 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
66 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
54 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
36 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
47 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
117 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
51 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
32 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
102 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
100 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
33 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
34 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
51 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
42 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
47 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
512 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
98 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
125 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
48 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
37 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
53 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{\...
2
votes
1answer
61 views

What units are \pgfphysicalheight and \pgfphysicalwidth defined in?

I often use \pgfphysicalheight and \pgfphysicalwidth from the pgfpages package to define sizes dynamically based on the dimensions of my page (which vary). For example, here's a "dynamic" vertical ...
3
votes
2answers
153 views

How to properly capture return value of a command?

I have a problem with capturing returned value of my command. Here is my preamble with command definition: \documentclass[convert={density=300,size=800x600,outext=.png}]{standalone} \usepackage[utf8]...
1
vote
1answer
126 views

How to make inductors larger?

I'm having a problem trying to make my cute inductors larger. I found a way of making them bigger with the /tikz/circuitikz/bipoles/length but that scales the entire inductor. I just want it to be ...
3
votes
3answers
250 views

How can I separate the number from the unit in argument?

Let us say that I have a function, in which I give a number plus a unit. I would like to get only the number, is it possible ? Here is a MWE: \documentclass{article} \usepackage[utf8]{inputenc} \...
0
votes
0answers
22 views

Measure the remainder of a page if it has a title and inserting that into a dynamic command

Okay, so I'm currently writing a report (in the article class) which has a section full of chemical spectra. I figured that two spectra per page is a good number, so I write \RequirePackage{calc} \...
15
votes
4answers
2k views

7.0pt ≠ x⋅10.0pt for all x

Consider the following input: \documentclass{article} \begin{document} \newlength{\smallertopskip} \setlength{\smallertopskip}{.700004577636718749999999999999999999999999999999\topskip} \newlength{\...
7
votes
1answer
367 views

Exact Fraction of a length

I want to place some elements on my page for which I need to calculate their size. For my example lets say three of those elements should exactly occupy a \linewidth when put side by side without ...
1
vote
1answer
61 views

Set length parameter based on KOMA \ifthispageodd

Background I'm using scrrept and titlesec (changing from titlesec to pure koma is on my todo list) any I've redefined \chapter to be a full page affair. The issue is when I'm using twosided. ...
2
votes
2answers
73 views

Explicit artihmetic functions as alternative to calc

Is there a way to perform compile time arithmetic with explicit functions that respect dimensions? Here is a strawman example of arithmetic functions: \mul{4}{7} % expands to 28 \mul{4}{...
3
votes
2answers
690 views

Actual table column width is unequal with set number

I want to create a table with fixed column lengths like this: \documentclass[a4paper,12pt]{article} \begin{document} \begin{tabular}{|p{1cm}|p{2cm}|p{3cm}|} \hline 1 cm & 2 cm & 3 ...
0
votes
1answer
31 views

Format issues in longtable (left alignment of cells plus different cell lenght)

I got a longtable with rows containing more or less information. I want to achieve a left alignment because of justification errors plus different lengths in row size (horizontally). My current ...
8
votes
1answer
164 views

How to negate a rubber length?

Mathematically, if you negate the points from the interval [2,5] pointwise, you'd get the interval [-5,-2]. Having said that, I'd expect that if you negate 3pt plus2pt minus1pt, you'd get -3pt ...
3
votes
1answer
251 views

What is the difference between assignment, \setlength and \renewcommand when changing a variable?

I want to set the \extrarowheight to 0.5ex. I find the following three ways are all applicable. \extrarowheight = 0.5ex \setlength{\extrarowheight}{0.5ex} \renewcommand{\extrarowheight}{0.5ex} Just ...
2
votes
1answer
79 views

Newenvironment - find the length of input

I am trying to define a new environment where the input text is placed inside a minipage, which has width equal to the length of the input text (something like a variable width box). What I would ...
2
votes
1answer
257 views

Custom \Rightarrow and \Leftrightarrow

Is there any way to shorten the double equal horizontal lines so they do not cross the arrow tips? Also, if I can get rid of the white space between two horizontal lines, it would be perfect. My MWE:...
1
vote
1answer
62 views

Lengths not as specified

As part of an inventory tool I wanted to print the contents of my part-boxes with PDFLaTex, using the code below. \documentclass[8pt,a4paper]{article} \usepackage[ngerman]{babel} \usepackage[utf8]{...
4
votes
2answers
91 views

Can I make a flexible page length?

In my document, I have many large unbreakable boxes. Sometimes, the text will take up most of the page before a box that is a little too big to still fit. Consequently, I am often manually using \...
0
votes
1answer
109 views

text justification/comments filling the space left from equation - flalign and paragraph mode

I have equations in a flalign environment and comments that may need to be multi-liner. \parbox seems fine except I can't tell it to automatically stretch in order to fill the space from the right-end ...
3
votes
1answer
43 views

Printed length in Layouts package inaccurate?

From the layouts package manual (page 3 and 4): The textwidth is \printinunitsof{pt}\prntlen{\textwidth} which is also \printinunitsof{in}\prntlen{\textwidth} or \printinunitsof{mm}\prntlen{\...
3
votes
1answer
135 views

get width and height of character in the power

I want to create a "minus-sign" in a superscript of a letter in math mode using \rule{width}{height} to get control over the look of it. In principle, I get something to my liking, but I fail to make ...
1
vote
2answers
23 views

“Missing number, treated as zero” when returning length from function

This MWE fails when I return a length and some string (I noticed it when I tried to debug some TikZ macros I wrote). \documentclass{scrartcl} \usepackage{etoolbox} \newlength{\mylength} \setlength{\...
5
votes
3answers
165 views

What is the correct calculation to span some columns?

I want to create a column spanning 5 columns with m column specifier. It seems my calculation \multicolumn{5}{m{5\temp}|}{\hrulefill} is wrong as the rule does not occupy the left space. What is the ...

1 2 3 4 5 8