[texhax] Flagging when a \parindent falls at top of page (UNIV: Plain XeTeX)

David Carlisle d.p.carlisle at gmail.com
Thu Aug 25 18:04:27 CEST 2016

if you are using pdftex rather than classic tex you can use \pdfsavepos
then write \pdflastxpos and ypos in \everyjob and complain if the saved
coordinates match the position of the first line of the page and parindent.


On 25 August 2016 at 15:41, Philip Taylor <P.Taylor at rhul.ac.uk> wrote:

> In a book on which I am currently working, and following the example I
> established in earlier books, I have adopted the convention of "minimal
> indentation" -- \parindent is suppressed whenever it adds nothing
> significant (IMHO) to the page.  So, for example \parindent is suppressed
> (a) after full-width inserts, (b) at the start of a paragraph that
> commences at the same level as the top line of an part-width insert floated
> left, and so on.  And, in particular, \parindent is (manually) suppressed
> at the top of a new page.  Now, it is (relatively) easy to detect when
> \parindent suppression occurs in the *wrong* place (i.e., when a manually
> inserted \noindent does *not* end up at the top of a page, using TeX's
> intrinsic top-of-page discard behaviour w.r.t. leaders) [1], but I have not
> yet found a way to detect when (automatic) paragraph indentation occurs
> (wrongly) at the top of a page.  Any suggestions as to how to accomplish
> this will be gratefully received.  Note that I am not attempting the
> impossible -- I know that without a multi-pass approach, or the use of an
> adjunct programming language such as that offered by LuaTeX,  I cannot
> automatically /suppress/ paragraph indentation at top of page :  I merely
> want to be warned (either in the log file, or even in the PDF itself) if
> such paragraph indentation has in fact occurred.
> [1]
> \newbox \errorbox
> \setbox \errorbox = \leftline {+++ NOT AT TOP OF PAGE +++}
> \def \errormsgbox {\copy \errorbox}
> \def \assert #1%
>   {%
>      \endgraf \leaders \errormsgbox \vskip 2 \ht \errorbox \relax
>      \noindent \ignorespaces
>    }
> % Usage :  \assert {newpage}
> --
> Philip Taylor
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/texhax/attachments/20160825/05d342bf/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Signature.jpg
Type: image/jpeg
Size: 12104 bytes
Desc: not available
URL: <http://tug.org/pipermail/texhax/attachments/20160825/05d342bf/attachment-0001.jpg>

More information about the texhax mailing list