10

This question is quite related to Penalty-enhanced approach to float placement, but here I am focusing on the situation for LaTeX3.

The LaTeX2e float placement algorithm does not look backward because of performance/complexity constraints at the time it was originally written.

Is a backward-looking approach planned for LaTeX3, and if so, will penalties be used to encourage a float's placement near adjacent text in the source file?

1 Answer 1

11

The current best idea of what a float placement algorithm could look like is the xor (extended output routine) package. That's been worked on off or on since before I joined the project in 1992, although it's not really compatible with LaTeX2e (or LaTeX2.09), It only really makes sense to introduce a new output routine as part of a new format since it is an pervasive change affecting all processing of every page of the document however you can read its surrounding documentation for the basic ideas

https://github.com/latex3/latex3/tree/develop/xpackages/xor

Note that the xpackages versions of the code are designed to be run as packages in latex2e, but in the case of xor you can only really do this for test documents it is not likely to be compatible (or stable enough) to be used with real documents and so we don't encourage its general use, unlike stable packages like xparse.

7
  • Not sure this directly addresses the question! BTW, when you say 'not really compatible with LaTeX2e' perhaps you should explain you mean 'not usable with real documents without change_ rather than 'cannot be loaded on top of LaTeX2e'. Commented Jan 31, 2015 at 8:58
  • I might also link to the more 'user friendly' GitHub interface to the code: github.com/latex3/svn-mirror/tree/master/xpackages/xor Commented Jan 31, 2015 at 9:00
  • 1
    @JosephWright People should beware the friendly exterior: the code will still bite the unwary:-) Commented Jan 31, 2015 at 9:02
  • Thanks David, but as Joseph hinted: can you address if a backward-looking approach is planned/being considered for LaTeX3 and if penalties will interact with the float placement algorithm? I think this would be an interesting feature if it could be done: users could for example set the penalties based on their preferences/requirements (with sensible defaults set, of course); such as: a float deferred more than 4 pages is "more bad" than a widow or orphan line at that spot, and other variations. Commented Jan 31, 2015 at 12:38
  • 1
    @PaulGessler I don't think penalties are related really. As for looking back you can't really do that in tex however as with cross references you can use an auxiliary file to pass information from a previous run. One thing we experimented with was a simple external text file that recorded which page each float went to, and if you wanted to change the outcome just edit the file to say float x must end up on page 26 rather than 28 and then the output routine would force that to happen (or give an error if it couldn't) Commented Jan 31, 2015 at 12:42

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.