Here's a solution that doesn't require the use of additional packages. The new command, \vertiii
, takes one argument; the triple vertical bars resize automatically depending on the size of the argument. For the MWE below, I've actually set the spacing between the vertical bars to be slightly less than what's generated by \[l,r]Vert
-- you can adjust the spacing to suit your taste by changing the value of the argument of the four \kern
commands.
Addendum: I've modified the code -- by inserting curly braces around the entire command -- to allow for the use of the command \vertiii
in subscripts and superscripts as well.
\documentclass{article}
\usepackage{amsmath,amssymb}
\newcommand{\vertiii}[1]{{\left\vert\kern-0.25ex\left\vert\kern-0.25ex\left\vert #1
\right\vert\kern-0.25ex\right\vert\kern-0.25ex\right\vert}}
\begin{document}
$\vertiii{a}$,
$\vertiii{\int_0^1 a(x)\,\mathrm{d}x}$,
$\displaystyle \vertiii{\int_0^1 a(x)\,\mathrm{d}x}_\vertiii{b}$
$\lVert a \rVert$ (for comparison)
$c_\vertiii{d}$, $f^\vertiii{g}$
\end{document}

There is no variable where the size used for \hfill
is used.
Without taking \parindent
into account, for simplicity, your first example is equivalent to saying
\hbox to\hsize{a\hfill b\hfill c\hfill d}
TeX measures the “natural width” of the box as if it had been \hbox{a{}b{}c{}d}
, since the natural width of \hfill
is zero. Then it computes the difference between the requested size and this natural width and divides the excess equally between the three spaces.
If Plain TeX with the standard settings is used, the width of \hbox{abcd}
is 20.5556pt, while \hsize
is 449.19939pt. Thus each space will be 149.73312pt wide. In its internal representation, TeX would have
\hbox(6.94444+0.0)x469.75499, glue set 149.73312fill
.\tenrm a
.\glue 0.0 plus 1.0fill
.\tenrm b
.\glue 0.0 plus 1.0fill
.\tenrm c
.\glue 0.0 plus 1.0fill
.\tenrm d
so the information can be seen, but it's not available at the programming level.
So if you have to use the information, you have to compute it with boxes:
\newdimen\usedhfill
\setbox0=\hbox{a{}b{}c{}d}
\usedhfill=\hsize
\advance\usedhfill by -\wd0
\divide\usedhfill by 3
Note. Why \hbox{a{}b{}c{}d}
and not \hbox{abcd}
? Because in the latter case kerning between letters would take place, which it doesn't when \hbox{a\hfill b\hfill c\hfill d}
is built.
Best Answer
Did you try
\vfill
?Sometimes you need to put in "invisible" objects to get it to work if there is only one thing on the page: