The creation of 2e is rather long ago so this is all a bit hazy, but the reasons as I remember them have been the following:
- LaTeX 2.09 had no class/package/option concept. Options to a
\documentstyle
have been external files with the extension .sty
.
- For LaTeX2e we wanted a structured approach for classes/packages and their options.
- This structure was for package and class writers not for users and we decided that we make the commands for this part CamelCase, e.g.,
\RequirePackage
- This layer contains more commands, for example,
\RequirePackageWithOptions
which have no quivalent on the user level.
Now the LaTeX2.09 situation was rather a mess at this time, with a good number of incompatible extensions and one of the goal for 2e was to consolidate the situation. For this it was extremely important to the 2e concepts would not be used on top of LaTeX2.09 as that would have resulted in yet another incompatible flavor. Instead LaTeX2e was supposed (and actually did fairly well) allow to run old documents in compatibility mode.
But then, no new features on the document level should be available!
Under the hood LaTeX2e would and should be able to use its new feature nevertheless since old stuff got reimplemented (using the package mechanism, for example) and that should work for packages that have been around for 2.09 as style options.
So the decision was made to only offer LaTeX2e extensions on the user level for documents that started out with \documentclass
but prevent them for old document starting with \documentstyle
. Therefore \usepackage
is not available unless you have a \documentclass
command and the way to ensure this is to wait until you see one :-). On the other hand, \documenstyle{article}
would internally now load the 2e article.cls
thus all the class and package commands like \RequirePackage
had to be available even then. So the fact that you can load a package before \documentclass
with \RequirePackage
is not so much because that was deemed very useful or important (though there are a couple of situations where this is true) but because it had to be available for both compatibility and native mode.
So in summary the two commands exists
- because we wanted a clear separation between class/package designer layer
- and the ability to not offer new functionality in compatibility mode
Of course, neither goal is enforced since nothing prevents a user to use \RequirePackage
on an old document starting with \documentstyle
. But on the whole it worked well. Class/package commands are something you do not find in user documents (normally) and the decision to not allow new 2e features to be used in compatibility mode has been in my opinion one of the key factors that 2e got adopted fairly soon.
\insert
is a TeX primitive not a plain TeX command.
If you go
\insert\boxregister{
.... vertical mode material ...
}
then two things happen, the vertical mode material is saved away and an insert node is placed in the current list.
If the current list is a horizontal list in a paragraph the node "migrates" to the surrounding vertical list.
Any insert nodes that end up being inside a box are essentially lost.
Insert nodes that end up on the main vertical list affect the page breaker in several ways.
depending on \count\boxregister
and \skip\footins
the output routine leaves space for the inserts when chopping off the page.
Inside the output routine \box\boxregister
contains the contents of the insertion boxes u to a maximum of \dimen\boxregister
. Any additional inserts are held over on to the next page (and the last insert on the page may be split if it doesn't fit (and is splittable)
so in your example the output routine will be handed \box\paragraphednote
which will be a vbox with a sequence of hboxes. the output routine is responsible for adding (or not) those boxes to the page before it is shipped out, it could unbox the contents or process them in any way or it could decide not to make any inserts on the page being shipped out and re-insert them into the material returned to the main vertical list.
You probably need to add an actual runnable example showing any problem. The code you link to is rather long to take in by eye but as far as I can see the intention is that teh boxing is only temporary and the \removehboxes
macro is invoked to unbox and re-package the notes.
You say that \hbox
prevents line breaking but that does not appear to be the intention of the code.
Best Answer
The
\usepackage
macro is part of LaTeX, not part of plain TeX, and this is why you get an undefined control sequence error here. You will need to\input
the appropriate files