\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.
Part answer to my own question, from Aditya Mahajan on ConTeXt mailing
list (verbatim, but with formatting and links):
Read about TDS (TeX Directory Structure).
You need to put files in $TEXMF/tex/plain/
subdirectory for Plain
format to find it, or in $TEXMF/tex/generic/
subdirectory for all
macro packages (plain, latex, context) to find it.
As experiment, placed eplain's source files in $HOME/texmf/tex/generic/eplain/
. No other copies visible. For a file testdox.tex
, containing \input eplain
, the command
luatex --fmt luatex-plain testdoc.tex
does indeed find eplain.tex
. Executed three of the “generate
” commands:
mktexlsr
context --generate
luatools --generate
And now all of the these command will find the file:
luatools --find-file eplain.tex
mtx-run --locate eplain.tex
kpsewhich eplain.tex
In addition, if others have problems with font locations in ConTeXt, for OTF fonts, using Alegreya* as an example, I
- created the directory: ''$HOME/texmf/fonts/opentype/huerta/alegreya'' and
- copied all the ''*.otf'' files there.
- By running the “
generate
” commands above,
- followed by the font update commands below,
\font\x = <font>
also now works without having to install the fonts in the operating system.
mtxrun --script fonts --update --force
mtxrun --script fonts --update --simple --force
Edit: Path issues solved. Works on Windows as well, just ensure you're happy with the setting of %TEXMFHOME%
, which you can set with a batch file, or permanently in %TEXMF%\tex\texmf\web2c\texmf.cnf
). I run this ctxenv.cmd
file from a Cmd Prompt console before starting to work with ConTeXt's LuaTeX:
@echo off
:: Sets ConTeXt environment for running ConTeXt tools.
:: NB: This includes setting TEXMFHOME and calling
:: .\tex\setuptex.bat. It also add the ''.\utl''
:: directory to your PATH. This file must live in
:: your ConTeXt base directory. It will set %CTX%
:: for convenience.
::
set CTX=%~dp0
set CTX=%CTX:~0,-1%
set PATH=%CTX%\utl;%CTX%\bin;%PATH%
set TEXMFHOME=%CTX%\local
.\tex\setuptex.bat
:: optional: remove the colons in front of these commands:
::mktexlsr
::context --generate
::luatools --generate
As for the TL math fonts setting problem, I'll rephrase as a new question.
*Alegrya: http://www.ctan.org/tex-archive/fonts/alegreya/
Best Answer
Maybe a MetaPost solution: