I am debugging a set of macros. The error seems to come from \vspace*{\dimexpr0.000000cm-\topskip plus 1fill}.
How can I log the value of the length?
I have tried \typeout{\dimexpr0.000000cm-\topskip plus 1fill} but it does not work.
I am debugging a set of macros. The error seems to come from \vspace*{\dimexpr0.000000cm-\topskip plus 1fill}.
How can I log the value of the length?
I have tried \typeout{\dimexpr0.000000cm-\topskip plus 1fill} but it does not work.
\dimexpr accepts only rigid lengths; if you pass it a rubber length parameter, it is coerced to a rigid length by suppressing the stretch and shrink components; so you can say
\dimexpr 0pt - \topskip\relax
which is a complicated way to say -1\topskip. However, plus is illegal in \dimexpr. You want
\vspace*{\glueexpr 0pt plus 1fill - \topskip\relax}
Here is an interactive session, notice the error at plus:
> pdflatex
This is pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2014) (preloaded format=pdflatex)
restricted \write18 enabled.
**\relax
entering extended mode
LaTeX2e <2014/05/01>
Babel <3.9l> and hyphenation patterns for 79 languages loaded.
*\showthe\topskip
> 10.0pt.
<*> \showthe\topskip
?
*\showthe\dimexpr0.000000cm-\topskip plus 1fill\relax
> -10.0pt.
<to be read again>
p
<*> \showthe\dimexpr0.000000cm-\topskip p
lus 1fill\relax
? 11
<*> ...dimexpr0.000000cm-\topskip plus 1fill\relax
?
*\showthe\glueexpr0pt plus 1fill - \topskip\relax
> -10.0pt plus 1.0fill.
<*> ...the\glueexpr0pt plus 1fill - \topskip\relax
?
*\stop
No pages of output.
Transcript written on texput.log.
If you want to debug such a \vspace non interactively, use something like
\typeout{***This vertical space will be \the\glueexpr0pt plus 1fill - \topskip\relax}
This will write the glue in the .log file.
vspace? Thanks!
– Colas
Oct 14 '14 at 08:29
\vspace to write something to the log file. But so long as the syntax is correct, why bother?
– egreg
Oct 14 '14 at 08:35
\typeout{\glueexpr 0pt plus 1fill - \topskip\relax} but it prints [...]*geometry* detected driver: pdftex \glueexpr 0pt plus 1fill - \topskip \relax [1{/usr/local/texlive/2013/texmf-var/fonts/map/pdftex/updmap/pdftex.map}][...]. I bother because this code does not what it is supposed to do in some situations.
– Colas
Oct 14 '14 at 08:41
\typeout{\the\glueexpr...\relax}. I used \showthe that's the “non interactive” counterpart of \the.
– egreg
Oct 14 '14 at 09:33
-0.00002pt plus 1.0fill. My problem is that it fills to much space I think.
– Colas
Oct 14 '14 at 09:46
\the\dimexpr...– David Carlisle Oct 13 '14 at 12:05plusafter a skip register, a skip register is a complete glue specification, conversely you can useplusafter a dimen register as that is just the natural width – David Carlisle Oct 13 '14 at 12:06\vspace*{\glueexpr 0pt plus 1fill - \topskip\relax}– egreg Oct 13 '14 at 12:11