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.

3
votes
0answers
26 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} \...
5
votes
3answers
334 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
76 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
99 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
28 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
19 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
26 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
48 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
111 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
43 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
232 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
18 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{\...
6
votes
1answer
306 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
45 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
57 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
107 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
26 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
121 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
172 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
51 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
154 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
59 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
67 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
55 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
36 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
78 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
18 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
152 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 ...
0
votes
1answer
34 views

Is it possible to have a stretchable \parindent?

I thought that maybe some stretchability in the paragraph indentation may give TeX more freedom and help it at better typesetting some tough paragraphs. However, the following does not work. \...
1
vote
1answer
36 views

How to add an unit to a calculated value properly?

I have some trouble to understand how I ought to handle some values I calculated with fp to use them as length. It is obvious that I have to add an unit to the number to use it, but trying to do so, I ...
1
vote
0answers
45 views

showframe package exceeds few points in right side

My tags are follows: \documentclass{book} \usepackage{lipsum} \usepackage{showframe} \makeatletter \renewcommand\normalsize{% \@setfontsize\normalsize{10.9}{14}% \abovedisplayskip 7\p@ plus2\...
2
votes
1answer
67 views

Printing all predefined variables and or values

So, whenever you begin a document by giving it some class (article, memoir, etc), there are many default lengths and heights being used. What I am looking for is a way to see these without explicitly ...
1
vote
2answers
217 views

Scale images in proportion to textwidth

[I rewrite this post to address the questions posed in the comments.] First I formulate what I want to accomplish as clearly as I can. After that, I explain why I want to do that. My question: How ...
0
votes
1answer
94 views

\hrule length inconsistent

I'm using the tufte-book document class. When I use \hrule, sometimes it extends the text width (which I want), and other times it extends the full page width, apparently randomly. How can I get it ...
1
vote
1answer
71 views

Standalone build command does not capture all length

I am working with standalone sub-file in build mode. I would like to pass lengths from the main file to the sub-file. To do so, according to this answer , I put it in the command used by standalone to ...
2
votes
2answers
147 views

Store result of \ratio calculation for repeated use

I am using pdflatex with the beamer package to create a presentation template that is similar to the PowerPoint template provided by my company. I want the company logo to have the same size in my ...
0
votes
0answers
32 views

How to set white space under figure to specific figure?

I don't want to do this in the preamble to set it for all figures. I want to have this for one specific image / figure. Is this possible? If so, how can I do this? \setlength{\belowcaptionskip}{2ex} ...
0
votes
2answers
121 views

Can't properly calculate column width

Please consider this MWE: \documentclass[11pt, a4paper]{article} \begin{document} \begin{table}[h] \begin{tabular}{|p{40mm}|p{100mm}|} Company & Head Quarters\\ \hline Foo Bar ...
5
votes
2answers
166 views

Measuring List Items in Tasks and Making Changes Accordingly

I made the following list for MCQs using taskspackage. The problem is I need a command that can measure the contents of all the \tasks per question and determine the maximum width among them. And in ...
1
vote
1answer
75 views

Width of minipage inside center environment

So I have three columns of content next to each other, using the minipage syntax, with the width specified in \textwidth, all of this placed in a center environment. Weirdly enough, if I make widths ...
3
votes
1answer
59 views

How align paragraph with labels before resume enumitem list

I have an enumerate list created with enumitem that I interrupt and then resume. Between the last item before the interruption and the first after the resumption, I insert a text paragraph. How can I ...
1
vote
2answers
59 views

Length sign conversion in math mode

I am setting up a document that outputs an equation, with some parts showing or not showing depending on commands i set in a different file. the commands look like this: \newcommand\coefficient{1.25}...
0
votes
1answer
46 views

Moving a TikZ drawn `mdframed` `frametitle` box vertically by a real amount?

Consider the following MWE: \documentclass{article} \usepackage[framemethod=TikZ]{mdframed} % noteboxes, boxes, etc. \usepackage{calc} \newcommand{\definebox}[2]{% \newcounter{#1} \...
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}{\...
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 ...