How can I define a macro that does nothing if it is the first item on a page, but does something (e.g. inserts a rule or a space) if it appears elsewhere?
Something along these lines is discussed in section 28.4.5 of TeX by Topic, but I don't understand it well enough to customise it.