Difference between revisions of "T wo T r:twotr"
(TeX without TeX Revised and expanded) |
(Really fix formatting?) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 26: | Line 26: | ||
did on my system: | did on my system: | ||
− | + | <ol> | |
+ | <li> Find the luatex-plain.tex file. On my system (with TeX-Live 2020) | ||
it was at: | it was at: | ||
− | + | <pre> | |
− | + | /usr/local/share/texmf-dist/tex/generic/context/luatex/luatex-plain.tex | |
− | + | </pre> | |
+ | </li> | ||
− | + | <li> If you just build a format file, | |
− | + | <pre> | |
− | + | luatex --ini /usr/local/share/texmf-dist/tex/generic/context/luatex/luatex-plain.tex | |
− | + | </pre> | |
− | |||
− | |||
− | |||
− | |||
− | + | you will probably get warnings about using the "merged" file, and not | |
− | + | the more current and supported files. Delete, move, or rename this | |
− | + | file. On my system I did: | |
− | + | <pre> | |
+ | doas mv /usr/local/share/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua /usr/local/share/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua.bak | ||
+ | </pre> | ||
+ | </li> | ||
− | + | <li> Now, build the format file. | |
− | |||
− | |||
− | + | <pre> | |
+ | luatex --ini /usr/local/share/texmf-dist/tex/generic/context/luatex/luatex-plain.tex | ||
+ | </pre> | ||
+ | </li> | ||
+ | |||
+ | <li> We are almost done. If the resulting format file (luatex-plain.fmt) | ||
is in the current working directory, you can use it with something | is in the current working directory, you can use it with something | ||
like: | like: | ||
− | + | <pre> | |
− | + | luatex --fmt luatex-plain test | |
− | + | </pre> | |
− | + | </li> | |
− | |||
− | + | <li> But, this is too restrictive. | |
− | |||
− | + | <ol> | |
− | + | <li> Create a new executable with the name luatex-plain. Something like: | |
− | |||
− | + | <pre> | |
+ | ln -s `which luatex` /usr/local/bin/luatex-plain | ||
+ | </pre> | ||
+ | </li> | ||
− | + | <li> When you try to invoke it: | |
− | |||
− | |||
− | + | <pre> | |
− | + | luatex-plain test | |
+ | </pre> | ||
− | + | it will fail with a message about failing to find the proper | |
− | + | format file. There should be a line something like: | |
− | |||
− | + | <pre> | |
+ | mktexfmt [INFO]: writing formats under ~/.texlive2020/texmf-var/web2c | ||
+ | </pre> | ||
− | + | so, copy the format file to that location: | |
− | |||
− | |||
− | + | <pre> | |
+ | cp luatex-plain.fmt ~/.texlive2020/texmf-var/web2c/ | ||
+ | </pre> | ||
− | + | now, this should work: | |
− | |||
− | |||
− | + | <pre> | |
+ | luatex-plain test | ||
+ | </pre> | ||
− | + | Finally, run mtxrun to generate a fonts database: <br /> | |
− | |||
− | |||
+ | <pre> | ||
+ | mtxrun --script fonts --reload --simple | ||
+ | </pre> | ||
+ | </li> | ||
+ | </ol> | ||
+ | </ol> | ||
== Contents == | == Contents == | ||
− | + | The most recent files for this project are also available at: | |
[https://github.com/s-dismas/TeX-without-TeX-revised GitHub] | [https://github.com/s-dismas/TeX-without-TeX-revised GitHub] | ||
− | There is a Read Eval Print Loop available for | + | There is a Read Eval Print Loop available for interactive exploring: |
[[T_wo_T_r:repl.lua|repl.lua]] | [[T_wo_T_r:repl.lua|repl.lua]] | ||
Line 142: | Line 150: | ||
within [[T_wo_T_r:test.tex|test.tex]] is: | within [[T_wo_T_r:test.tex|test.tex]] is: | ||
− | [[T_wo_T_r:test.lua|test. | + | [[T_wo_T_r:test.lua|test.lua]] |
The main text file to be typeset is: | The main text file to be typeset is: | ||
− | [[T_wo_T_r:text. | + | [[T_wo_T_r:text.tex|text.tex]] |
It includes the following five files: | It includes the following five files: | ||
− | [[T_wo_T_r:chapter-1. | + | [[T_wo_T_r:chapter-1.tex|chapter 1]] |
− | [[T_wo_T_r:chapter-2. | + | [[T_wo_T_r:chapter-2.tex|chapter 2]] |
− | [[T_wo_T_r:chapter-3. | + | [[T_wo_T_r:chapter-3.tex|chapter 3]] |
− | [[T_wo_T_r:chapter-4. | + | [[T_wo_T_r:chapter-4.tex|chapter 4]] |
− | [[T_wo_T_r:chapter-5. | + | [[T_wo_T_r:chapter-5.tex|chapter 5]] |
Latest revision as of 00:35, 23 February 2021
About[edit]
This is an update and expansion of TeX without TeX --- using TeX's functionality (typesetting, pdf writing) using only Lua code (no \TeX macros).
It is (I believe) an adequate framework for developing a complete type-setting system; although one dedicated to a specific task, rather than a general purpose system such as LaTeX or ConTeXt. It includes a couple of example formatting commands (\Emph and \Bold), titles (\Title), the ability to include other subsidiary text files (\Input) and footnotes (\Footnote). It can be easily adapted and expanded to suit your needs.
I am not much of a programmer, and knew little about TeX and even less about Lua when I started this, so there is undoubtedly much that can be improved. All questions, comments, suggestions, and corrections will be appreciated. You can reach me at "destiny6 <AT> mac <DOT> com".
Pre-requisites[edit]
This system requires the luatex-plain format (from ConTeXt), so that we have access to Open Type Fonts and other goodies. This is what I did on my system:
- Find the luatex-plain.tex file. On my system (with TeX-Live 2020)
it was at:
/usr/local/share/texmf-dist/tex/generic/context/luatex/luatex-plain.tex
- If you just build a format file,
luatex --ini /usr/local/share/texmf-dist/tex/generic/context/luatex/luatex-plain.tex
you will probably get warnings about using the "merged" file, and not the more current and supported files. Delete, move, or rename this file. On my system I did:
doas mv /usr/local/share/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua /usr/local/share/texmf-dist/tex/generic/context/luatex/luatex-fonts-merged.lua.bak
- Now, build the format file.
luatex --ini /usr/local/share/texmf-dist/tex/generic/context/luatex/luatex-plain.tex
- We are almost done. If the resulting format file (luatex-plain.fmt)
is in the current working directory, you can use it with something
like:
luatex --fmt luatex-plain test
- But, this is too restrictive.
- Create a new executable with the name luatex-plain. Something like:
ln -s `which luatex` /usr/local/bin/luatex-plain
- When you try to invoke it:
luatex-plain test
it will fail with a message about failing to find the proper format file. There should be a line something like:
mktexfmt [INFO]: writing formats under ~/.texlive2020/texmf-var/web2c
so, copy the format file to that location:
cp luatex-plain.fmt ~/.texlive2020/texmf-var/web2c/
now, this should work:
luatex-plain test
Finally, run mtxrun to generate a fonts database:
mtxrun --script fonts --reload --simple
- Create a new executable with the name luatex-plain. Something like:
Contents[edit]
The most recent files for this project are also available at: GitHub
There is a Read Eval Print Loop available for interactive exploring:
It can be invoked with repl.repl()
, and either
quit()
or
exit
will exit it. I use Shell Mode in
Emacs, but a simple terminal or similar should also work.
Some utilites are in the file:
The following five files comprise the system:
The license for this software can be seen at:
The TeX file to be compiled by luatex-plain is:
The Lua file executed by
\directlua{dofile "test.lua"}
within test.tex is:
The main text file to be typeset is:
It includes the following five files: