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

learn more… | top users | synonyms

2
votes
1answer
20 views

\settolength issue

I want a horizontal length to have the same length as the word "physique". This is what I have tried: \documentclass{article} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} ...
2
votes
1answer
22 views

Using skip (glue) with pgfmath (truncating plus/minus parts from a glue length)?

Consider the following MWE: \documentclass{article} \usepackage{tikz} \newlength{\tlen} \newlength{\tlenB} \begin{document} \setlength{\tlen}{2cm} \typeout{check 1, tlen is: \the\tlen} ...
17
votes
4answers
466 views

Scaling a glue in TeX

is there a possibility to scale a glue in TeX? Consider the following example: \newskip\foo \newskip\bar \foo=10pt plus 2pt minus 3pt \bar=2.5\foo\relax \showthe\foo \showthe\bar \bye When ...
4
votes
2answers
266 views

Draw parallel lines each one with a fixed length

I am trying to create parallel lines in tikz. Although I can create those lines, I can't seem to be able to control the length of those lines, which I want them to stop in the red box's face. My code ...
9
votes
1answer
74 views

Other methods to determine the page size of an external pdf?

I would like to query the page size of an external PDF in a document. I can box an included PDF and measure the box (with or without actually using the box), as shown in the MWE, but I'm wondering if ...
1
vote
2answers
52 views

Table title to match table body (in terms of length)

I have a table with 4 columns and my title seems to be far bigger than the main body of the table. This does not look quite good. Is there anyway to have the length of those two be the same, or at ...
9
votes
3answers
486 views

A command line Latex calculator?

I often need to check what a length expression like "20pt + 2 cm" would resolve to -- and of course, I'd rather do something quick on the command line / shell / terminal, than typing ...
9
votes
2answers
175 views

Save length with \let command

I want to save \fboxsep length in \oldfboxsep and use it later. The following code doesn't work: \newlength{\oldfboxsep} \let\oldfboxsep\fboxsep % 3pt by default \setlength{\fboxsep}{8pt} ...
19
votes
1answer
403 views

Is there an `ex` unit equivalent for the capital 'X' in LaTeX

In LaTeX, the ex unit represents the height of a lowercase 'x' in the current font. Is there a length in LaTeX that represents the height of a capital 'X'?
5
votes
2answers
42 views

Free - dereference - release - delete a newdimen length?

Somewhat similar to How to erase/delete a counter, I guess, but for \newdimen... So, consider the MWE: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} ...
6
votes
3answers
187 views

A reusable newlength (no stop/break if length already defined)

Often I have separate .tikz files, which may contain stuff like \newlength{\mytmplen}; and given I'm not very original with names, the same statement ends up in multiple such files. Which turns out to ...
2
votes
2answers
74 views

\leftskip, \linewidth and minipage

I have an environment with a minipageof the length \linewidth-\parindent (using the calc package). When I stick this in a place where \leftskip=\parindent it protrudes in the margin. Shouldn't ...
3
votes
1answer
55 views

Using \textwidth via strip@pt with beamer and the picture environment

OK, I admit I haven't tried my MWE without Beamer. My goal is to use e.g \textwidth with the picture environment, and my overall goal is to include several rectangular portions of an .eps file within ...
3
votes
2answers
44 views

Updating length variable inside longtabu working strangely

I have a table, and I want one column to show a running total on each line, i.e., it has to show the total of the values of another column up to that row. I thought about accumulating the total into a ...
11
votes
2answers
282 views
+500

How to have a precise control on the size of each page?

I would like to produce a pdf document whose pages have various lengths and fixed widths. An easier situation The easiest case would be for instance: the first page has a length of 10cm all the ...
4
votes
1answer
60 views

Is there a pre-defined width that covers the text area and the margin?

Is there a pre-defined width that covers both the text and margin areas? Correct me if I am wrong, but it would basically be equal to \textwidth+\marginparsep+\parginparwidth. Is that provided by ...
1
vote
0answers
22 views

Document length iopart.cls no more than 12 pages?

I am using iopart.cls to write an article, the problem is when I compile the document the dvi is cut to the twelfth page, how can I do? Please help me!!!
4
votes
2answers
88 views

Set length to the line height of a particular font

How to define new length using : \newlength{...} \setlength{...}{...} and equal to the line height of a particular font (for example \tiny\ttfamily) Note : I want a solution which does not involve ...
2
votes
1answer
181 views

newlfm package missing documented \greettoskipbefore command

While writing a letter using newlfm, I tried using the \greettoskipbefore command from page 8 of the manual and I received an "undefined control sequence" error. Looking at the source, it looks like ...
4
votes
2answers
251 views

Dante Monotype typeface and fractions

I am handling a text which is natively written in a proprietary LaTeX documentclass which implements Dante Monotype fontface. In this text there is a lot of maths and I would say that it works, ...
3
votes
1answer
77 views

Disable \setlength{\parskip}{\baselineskip} on \tableofcontents

I use \setlength{\parskip}{\baselineskip} and it is great. But I want to disable it just for the \tableofcontents. Is it possible?
3
votes
1answer
51 views

To display the lengths in millimeters by default [duplicate]

All my length are in millimetres and the command \the\mylength outputs a length in points. Idem with the \layout from the package layout. How can I display all theses lengths in millimetres (more ...
11
votes
2answers
261 views

Define and set length in one command

Sorry this might be a very simple question, I am trying to cleanup a style file, and would like to write a command that basically runs the following code: ...
5
votes
1answer
150 views

A pgf plot problem

I'm new to pgfplot and I have a pgfplot problem. figure 1 :As you can see the line is going through the number '2'. How can i fix it? figure 2: Also can i fix the line length, going through 2, ...
10
votes
2answers
163 views

Convert from physical dimensions to axis cs coordinate values

In answering PGFPlots: Howto draw a label at a zero of a function?, I got stuck on converting a length in pt to the actual coordinate value in the axis cs system. Here I only need the x value, but ...
1
vote
1answer
91 views

Effect of adding plus and minus to \includegraphics

I have a document with a lot of pictures. The exact scale of the pictures isn't all that important. Is it possible to allow the pictures a little bit of "stretch" to help squeeze everything together? ...
2
votes
0answers
40 views

Is there an TikZ command to provide the height and width of the picture? [duplicate]

I've found the following How can I compute the distance between two coordinates in TikZ?. So, I know how to find the size of a TikZ picture as follows: \documentclass{article} ...
3
votes
1answer
77 views

How to get the available space for an image

I want to design a figure (in a external graphics editor, e.g, Illustrator) to exactly fit (without scaling!) the whole available space on an empty page of my document minus the caption of the figure. ...
11
votes
3answers
632 views

Why is a 10bp picture environment not 10bp?

Example: \documentclass{article} \begin{document} \newlength{\picwidth} \setlength{\unitlength}{1bp} \settowidth{\picwidth}{\begin{picture}(10,10)\end{picture}} \typeout{width: \the\picwidth} ...
2
votes
1answer
198 views

Local scoping of textfloatsep

I was wondering if you can set the scope of \textfloatsep locally. I have found an old thread on Google groups, which points out that you couldn't. Has that changed by now? So what I want to do is ...
1
vote
1answer
85 views

Set a length that will adopt tikz's global lengths

I am trying to draw a rather simple tikz picture that consists of some very acurately defined levels. My code is \documentclass{article} \usepackage{tikz} \usetikzlibrary{plotmarks} ...
4
votes
1answer
90 views

Distinction between number and dimension in tikz key-value interface

When declaring shapes, I usually define the desired shape width with: minimum width = <number> <measure units> However, sometimes, I calculate calculate the shape's width separately. In ...
4
votes
2answers
134 views

How to calculate a new length?

What I want to do is calculate the actual size between the edge of the paper, and my header. \evenmarginsize and \oddmarginsize do not do this. \settowidth{\msize}{((\paperwidth - \textwidth)/2)} ...
6
votes
3answers
92 views

A version of \smash that interpolates between the true height/depth and the text-height/depth of the current line

I have a paragraph of text that includes a "deep" math symbol, one that dips below the ordinary bottom of the text a little. Originally I had nothing below that symbol; it was near the end of the ...
1
vote
2answers
52 views

Why is the width in nwu-lecture-style not working? [closed]

It seems that the code in nwu-lecture-style: \insertshortauthor[width=2cm-2pt,center,respectlinebreaks]\par% is not working? I tried: \insertshortauthor[width=2cm minus ...
10
votes
1answer
95 views

How to set a box to a rubber length width

Problem I'm trying to create fancy section heading using titlesec. I need to put the section name into a \parbox to have line breaks. I want the parbox to extend to the far right margin, but I don't ...
3
votes
1answer
271 views

Settting PGFplots axis environment options by means of \newcommand and {\newlength,\setlength}

Because I often use the same options for multiple axes in my LaTeX documents, I use the following code to simplify my life. \documentclass{article} \usepackage{pgfplots} ...
9
votes
1answer
155 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 ...
2
votes
3answers
812 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 ...
4
votes
1answer
93 views

Writing to and extracting from aux not working?

Consider the following MWE: \documentclass{article} \newlength{\templen} \makeatletter \AtEndDocument{% \immediate\write\@auxout{\noexpand\setlength{\noexpand\templen}{150pt}}} \makeatother ...
5
votes
1answer
123 views

How do I access the width of text from the preamble?

I've got some macros that I want to set up in my preamble. The problem is that they need to know what the width of a typical line of text will be in the document. If I do something like, %% ...
2
votes
1answer
89 views

Conditional use of multicol

I'm using the multicol package to get two columns, but sometimes the contents is too wide in a particular column and I was wondering if there is a way to first make sure the contents will fit ...
2
votes
0answers
22 views

Behavior of \global when used with xifthen package [duplicate]

I'm trying to calculate the sum of some numbers in my document. I want to allow non-integer values, so I'm using lengths, which works just fine. In my document it's often necessary to specify the ...
5
votes
2answers
254 views

Measuring line length, using \hfill to justify text, wrapping and right justifying if space too small

I am a lecturer and have an issue when compiling test and exam questions. The questions will be in an enumerate environment and look something like this, where the marks shown in brackets are right ...
7
votes
3answers
249 views

Vertically center image with text midpoint

I want to vertically align the center of an image with the vertical center of the text on the same line using \raisebox. Using a macro is a must since it will be used many times (and multiple times on ...
7
votes
1answer
129 views

Decrease length of underscore character in normal text (gender_gap)

I use the underscore character _ in normal text mode (not typewriter). However, it is quite long. How can I decrease its length so that it is shorter? I followed the Tex FAQ on how to typeset an ...
10
votes
4answers
263 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} ...
25
votes
1answer
362 views

Using elastic lengths — when do they work?

I was wondering why elastic lengths like \fill seem to work only under certain conditions. For instance if I write A \hspace{\fill} B I get A left aligned, B right aligned as wanted. If however ...
3
votes
1answer
111 views

Limitations associated with getting length as number

I am representing actual object dimensions with scaled down graphics which capture the relative proportions of the objects (for instance, imagine a simple set of three or four line segments). I would ...
8
votes
3answers
180 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 ...