Reputation
26,710
Next tag badge:
91/100 score
19/20 answers
Badges
42 97
Impact
~461k people reached

1h
comment Detect whether running on pdfTeX or Knuth's TeX for conditional include
Then use \ifx\pdfpagewidth\undefined \else ... \fi. This doesn't rely on e-TeX extensions. It will work also with tex executable.
1h
comment Detect whether running on pdfTeX or Knuth's TeX for conditional include
... As your answer shows, testing \pdftexversion is not enough, 'cause xetex. One could use \pdfpagewidth, which currently is defined also by xetex and luatex engines but \numexpr appears safer.
1h
comment Detect whether running on pdfTeX or Knuth's TeX for conditional include
@egreg An answer should be at the level of the question. For all matters and purposes the important thing for normal users is to know if some primitives not available in Knuth's tex are there for use by them. Hence \ifx\numexpr\undefined is sufficiently accurate test for usual contexts. An expert user would not have phrased the question as vaguely as was done by the OP and would not likely be a situation with a format built with -ini but without -etex. (continued)
2h
comment Detect whether running on pdfTeX or Knuth's TeX for conditional include
@ChristianHupfer the problem with the reverted-to old version is that it leaves then control sequence \pdfpagewidth defined with meaning \relax if you run by Knuth's tex. This could fool later tests or force them to act like LaTeX @ifundefined (which does like your old code). The idea with the \begingroup...\endgroup and suitable \expandafter's is to avoid this after-effect. But \ifx\pdfpagewidth\undefined has no such after-effect and works. However it would be falsified if code like your reverted-to old version (now current) was executed earlier (or LaTeX \@ifundefined).
10h
comment Detect whether running on pdfTeX or Knuth's TeX for conditional include
\ifx\numexpr\undefined.
10h
comment Detect whether running on pdfTeX or Knuth's TeX for conditional include
This doesn't work. There is a missing \expandafter. Try with tex and you will get an error. I guess the image was generated before the update. Besides \ifx\pdfpagewidth\undefined works equally well.
1d
comment Arithmetic overflow error using bytefield package while attempting to constrain width
bug report here
1d
comment Arithmetic overflow error using bytefield package while attempting to constrain width
@DavidCarlisle looking quickly graphicx.dtx, \resizebox obtains ratios, then multiplies original lengths on the TeX side. If it kept memory of the user-specified width and/or height, last step of \Gscale@box could set the driver modified box to exactly the user desired TeX dimensions. Ratios #1=\Gscale@x, #2=\Gscale@y would serve the driver only, not the \Gscale@box last step. This would solve the \resizebox{\linewidth}{...}{stuff} constructing a box wider than \linewidth in some cases. Which in turn causes problems in a center environment due to \trivlist usage.
1d
comment Arithmetic overflow error using bytefield package while attempting to constrain width
@DavidCarlisle \setbox0\hbox{\resizebox{\linewidth}{\height}{Hello}} \number\wd0 gives 31699616 (sp) but \number\linewidth returns 31699558 (sp). The former is bigger than the latter, which explains the need for the .9999 in my code above to avoid the vertical extra space. \number\linewidth
1d
comment Arithmetic overflow error using bytefield package while attempting to constrain width
the need for .9999\width sounds like something fishy happening with \resizebox.
1d
revised Arithmetic overflow error using bytefield package while attempting to constrain width
added solution not squeezing the text
1d
revised Arithmetic overflow error using bytefield package while attempting to constrain width
added 2678 characters in body
1d
answered Arithmetic overflow error using bytefield package while attempting to constrain width
2d
comment How can I put a minitoc before a chapter, on the facing page?
of course, I knew. And guilt proved too much. I couldn't resist during the ad break during my tv movie.
2d
comment How can I put a minitoc before a chapter, on the facing page?
too much compliments, I have no other choice but upvoting your answer !
2d
comment How can I put a minitoc before a chapter, on the facing page?
ok, it works. Your solution is the good one for minitoc users. \cleartoevenpage is simply \cleardoublepage with odd<->even. Thus, yes, I guess you may use it. Will consult with my legal advisor though ;-)
2d
comment How can I put a minitoc before a chapter, on the facing page?
doesn't work for me. Can you complete your answer with how it works for you ?
Feb
7
comment command to display time (duration) in human readable form
@Andrew +1 ;-) you have a stray space \xintifLt {#1}{60}{<space>% ... sorry to be such a pain ... cheers, JF
Feb
7
comment How can I put a minitoc before a chapter, on the facing page?
how does it work with more than one chapter ? I tried but did not succeed.
Feb
7
revised How can I put a minitoc before a chapter, on the facing page?
edited tags