0

Is there any way to check for what the contents of a box are? I see that there's a way to check if it's void, and what type of box it is, but can you check what's in it?

I'm working on a reflowing scheme for double column paragraphed footnotes, and my approach is to reflow the box every time a footnote is added. This has the side effect of reflowing the hyphens at the end of a hyphenated line. So I'm looking for a way to check if the \lastbox on a line is a hyphen, and remove it if it is.

An MWE could be produced if deemed necessary, but the direct question shouldn't need one.

A Gold Man
  • 1,428
  • Related: https://tex.stackexchange.com/q/146166/10038 – StrongBad Sep 26 '17 at 19:35
  • 1
    No, there isn't a method. By the way, a character such as the hyphen doesn't make a box that can be retrieved by \lastbox. – egreg Sep 26 '17 at 19:48
  • yes if luatex no for classic tex and xetex. – David Carlisle Sep 26 '17 at 20:41
  • As @egreg say, “classic TeXs” (including pdf[e]TeX) provide no means to inspect programmatically, in full generality, the contents of a box register; yet, some kinds of manipulations are possible, even some subtle, and entirely non-obvious, ones. So, it may be the case that your original intent (which you do not describe) isn’t doomed to failure: for example, look at pages 392–399 of The TeXbook (Appendix D, section 7: Paragraphs maneuvers) for inspiration about how to play some really nasty tricks… – GuM Sep 26 '17 at 20:44

0 Answers0