4

This question is quite general. Nonetheless I believe that it touches upon something fundamental. That said, anyone feel free to improve the question.

LaTeX can be thought of as a complex algorithm that does everything without manual fine-tuning. In most cases, one needs to run LaTeX just twice, which is remarkable given that it is a linear compilation process. However LaTeX's design also leads to the disadvantage that certain types of fine-tuning which conceptually really are best done during a post-compilation phase are not easily done with LaTeX.

An example: say I would like to remove the page numbers of all pages with a figure at the top of the page. (If you can think of a better example, feel free to improve the question.) What are ways in LaTeX to make such post-compilation changes easiest? (The idea is that the user can supply additional data after "compilation proper", and one would then run a post-compiler that does some minor fine-tuning.)

I understand that the right answer wouldn't be "a single LaTeX command". Instead, answers might point to (La)TeX derivatives, constructions or tricks on top of the standard LaTeX engine, or conceptual pointers. (And, yes, of course solving this problem will require one additional compilation pass at the end, either directly by LaTeX or by something else. I suppose one could do the initial compilation phase(s) by "something else" and the final run by LaTeX proper. This is an open question, and creativity is welcome.)

12
  • 1
    Actually, the example you gave would be best done within LaTeX. Only LaTeX knows if the thing at the top of the page is actually a figure, and it should be possible to make LaTeX remove page numbers in this case. Can you think of other examples?
    – krlmlr
    Dec 30, 2012 at 11:26
  • @user946850 Thanks for your comment. 1. This might be true in principle (I don't know how easy this is, though), but it's also an example of something that is very easily done by a user in one quick pass. See also my clarification about user input. 2. There are some styleguides with prescriptions such as "no more than three consecutive line-final hyphens". While I find the prescription a bit weird, it would be nice to have an easy way to modify single pages post-compilation while keeping all other pages the same. Dec 30, 2012 at 11:35
  • @LoverofStructure ... the three hyphens issue might be mathematically intractable - in some cases. Consider a fully stretch page that such a decision will add an extra line. If you have constrained your system for flush bottom pages you need to relax a constraint... or modify the following pages etc. Dec 30, 2012 at 12:01
  • @YiannisLazarides I enjoy this discussion, as it helps us converge towards what might be needed. I think a way for the user to specify first which part of the text he would like to fiddle with (all the rest would have to remain constant during adjustment-compilation) before indicating desired adjustments might be really good. Dec 30, 2012 at 12:12
  • 1
    @LoverofStructure: \thispagestyle{empty} selects an "empty" page style, without page numbers, for the current page -- just as in your example. Guaranteeing the same output is difficult, but it might be possible to write code that checks the visual representation of a page and warns if there are changes. Perhaps the answers to this question help: tex.stackexchange.com/questions/55243/…
    – krlmlr
    Jan 1, 2013 at 8:40

1 Answer 1

6

It is said that George Bernard Shaw would examine galley proofs of his work and recast sentences, or even whole pages, in order to avoid unsightly word breaks, excessive white space caused by justification, and other typographical difficulties. Of course, he was published at a time when typesetters were sent to the block for committing the abominations above.

Neither an automated system nor a manual system can manage to resolve all the aspects and details of a complex creation such as a book. All those beautiful three column or four column publications with a perfect article fitting exactly on one or two pages has been manually edited to add or remove content, adjust images and the like.

Your example, and maybe is a bad one, captures the essence of the problem well. You want to fix the issue after the compilation of the document; but the problem was created by leaving such a presentational decision after the Class Definition stage whereas it should have been included during the Class Definition stage.

Therefore to answer your question what one could do to make such post-compilation adjustments easier is a few simple steps:

  1. Add all the necessary new macros in the Class, pre-amble or your own package, as you discover them.
  2. Any items you might use extensively and maybe you bound to change your mind as to how you present them, create macros for them. As for example you might be writing a book on Maritime History and you may want all the names of the ships in italics, rather create a macro \ship. Same goes for items such as "Dr.~Name", where you may want to adjust so that they don't break along two lines.
  3. Images and floats give a lot of post-compilation issues, as well as lists and tables. use the right settings.
  4. Use the "spiral" technique while writing.

Having said the above there is room for a pre-processor to (All)TeX that can do a bit of automatic correction of common errors, format code blocks (if you writing anything that has to do with coding) and other similar small drudgery type of works. Small scripts in Perl, if you fancy cartoon swearing type syntax or Python if you are a perfectionista can go a long way in making life easier.

3
  • Actually, your answer contains an (in my opinion) good example: fiddling with the column lengths in a multi-column document. It is a very, very common situation for magazine-style publications with many short paragraphs in a 2- or 3-column layout that one wants to shift lines from one column to an adjacent one without wanting to affect page breaks. One solution might be to let the user make date-stamped "correction annotations" that will be ignored upon recompilation (i.e. the user would have to renew the date for them to be reactivated, or similar). Dec 30, 2012 at 11:53
  • But really what's missing is a LaTeX coding infrastructure for this sort of thing. To see whether there is something akin to that is part of why I asked :-) Dec 30, 2012 at 11:58
  • @LoverofStructure Please see my comment on intractability under the original question. Dec 30, 2012 at 12:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .