From c534836c5cf31728afb592a36ab345f786e06e39 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 6 Apr 2016 21:43:13 +0000 Subject: tex-ini-files (27feb16) git-svn-id: svn://tug.org/texlive/trunk@40270 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/doc/generic/tex-ini-files/README.md | 55 ++++++++++++ .../doc/generic/tex-ini-files/pdftexconfig.dat | 18 ++++ .../tex/generic/tex-ini-files/dvilualatex.ini | 4 + .../tex/generic/tex-ini-files/dviluatex.ini | 4 + .../tex/generic/tex-ini-files/lualatex.ini | 19 +++++ .../tex/generic/tex-ini-files/luatex.ini | 12 +++ .../tex/generic/tex-ini-files/luatexconfig.tex | 68 +++++++++++++++ .../tex/generic/tex-ini-files/pdftexconfig.tex | 40 +++++++++ .../tex/generic/tex-ini-files/xelatex.ini | 17 ++++ .../texmf-dist/tex/generic/tex-ini-files/xetex.ini | 99 ++++++++++++++++++++++ Master/tlpkg/bin/tlpkg-ctan-check | 2 +- Master/tlpkg/libexec/ctan2tds | 1 + Master/tlpkg/tlpsrc/collection-basic.tlpsrc | 1 + Master/tlpkg/tlpsrc/tex-ini-files.tlpsrc | 0 14 files changed, 339 insertions(+), 1 deletion(-) create mode 100644 Master/texmf-dist/doc/generic/tex-ini-files/README.md create mode 100644 Master/texmf-dist/doc/generic/tex-ini-files/pdftexconfig.dat create mode 100644 Master/texmf-dist/tex/generic/tex-ini-files/dvilualatex.ini create mode 100644 Master/texmf-dist/tex/generic/tex-ini-files/dviluatex.ini create mode 100644 Master/texmf-dist/tex/generic/tex-ini-files/lualatex.ini create mode 100644 Master/texmf-dist/tex/generic/tex-ini-files/luatex.ini create mode 100644 Master/texmf-dist/tex/generic/tex-ini-files/luatexconfig.tex create mode 100644 Master/texmf-dist/tex/generic/tex-ini-files/pdftexconfig.tex create mode 100644 Master/texmf-dist/tex/generic/tex-ini-files/xelatex.ini create mode 100644 Master/texmf-dist/tex/generic/tex-ini-files/xetex.ini create mode 100644 Master/tlpkg/tlpsrc/tex-ini-files.tlpsrc (limited to 'Master') diff --git a/Master/texmf-dist/doc/generic/tex-ini-files/README.md b/Master/texmf-dist/doc/generic/tex-ini-files/README.md new file mode 100644 index 00000000000..2807e9b07ee --- /dev/null +++ b/Master/texmf-dist/doc/generic/tex-ini-files/README.md @@ -0,0 +1,55 @@ +# Model TeX format creation files + +This bundle provides a collection of model `.ini` files for +creating TeX formats. These files are commonly used to introduced +distribution-dependent variations in formats. They are also used +to allow existing format source files to be used with newer +engines, for example to adapt the plain e-TeX source file to +work with XeTeX and LuaTeX. + +## Shared configuration + +The file `pdftexconfig.dat` contains common settings for pdfTeX +and LuaTeX, most of which are concerned with direct PDF output. +These settings are given in a key-value format and are named +based on the pdfTeX 1.40 primitives. The values for the settings +themselves is taken from the standard values in TeX Live 2010 +with the paper size set as A4. + +Loading this data in pdfTeX is achieved by `pdftexconfig.tex`, +whereas for LuaTeX the file `luatexconfig.tex` is needed. Both +of these files will load the shared data file and assign the +appropriate primitives. + +The loaders recognise the marker control sequence `\dvimode`. +If this is defined, the loaders will set the format to produce +DVI file, and otherwise will select direct PDF output. The loader +will then undefine `\dvimode`. + +## History + +The use of `.ini` files for building formats has developed over +some time. The initial versions of the files collected here were +taken from TeX Live 2015, and thus carry forward long-standing +behaviours from this system. Initial modifications were made +to allow for significant changes in LuaTeX primitive support +between TeX Live 2015 and TeX Live 2016. + +The files provided here are designed to work with other support +files and engines available from late 2015 onward, in particular: +- pdfTeX v1.40+ +- LuaTeX v0.80+ +- XeTeX v0.99992+ +- LaTeX2e 2015-01-01 onward +- unicode-data v1.0+ + +Major changes: +- 2016-02-27 First version of bundle + +A full history of this bundle is available from +https://github.com/josephwright/tex-ini-files + +## Legal + +The files provided here were originally written by various +authors and are all marked as public domain. diff --git a/Master/texmf-dist/doc/generic/tex-ini-files/pdftexconfig.dat b/Master/texmf-dist/doc/generic/tex-ini-files/pdftexconfig.dat new file mode 100644 index 00000000000..482b32ae4b6 --- /dev/null +++ b/Master/texmf-dist/doc/generic/tex-ini-files/pdftexconfig.dat @@ -0,0 +1,18 @@ +% tex-ini-files 2016-02-27: pdftexconfig.dat + +% Shared configuration for pdfTeX/LuaTeX low-level settings + +% Paper size: dimensions given in absolute terms +pageheight = 297 true mm +pagewidth = 210 true mm + +% Enable PDF 1.5 output and thus more compression +minorversion = 5 +objcompresslevel = 2 + +% Low-level settings unlikely ever to need to change +compresslevel = 9 +decimaldigits = 3 +pkresolution = 600 +horigin = 1 true in +vorigin = 1 true in diff --git a/Master/texmf-dist/tex/generic/tex-ini-files/dvilualatex.ini b/Master/texmf-dist/tex/generic/tex-ini-files/dvilualatex.ini new file mode 100644 index 00000000000..3779819e1e1 --- /dev/null +++ b/Master/texmf-dist/tex/generic/tex-ini-files/dvilualatex.ini @@ -0,0 +1,4 @@ +% tex-ini-files 2016-02-27: dvilualatex.ini + +\let\dvimode\relax +\input lualatex.ini diff --git a/Master/texmf-dist/tex/generic/tex-ini-files/dviluatex.ini b/Master/texmf-dist/tex/generic/tex-ini-files/dviluatex.ini new file mode 100644 index 00000000000..e60ec1eb65f --- /dev/null +++ b/Master/texmf-dist/tex/generic/tex-ini-files/dviluatex.ini @@ -0,0 +1,4 @@ +% tex-ini-files 2016-02-27: dvilualatex.ini + +\let\dvimode\relax +\input luatex.ini diff --git a/Master/texmf-dist/tex/generic/tex-ini-files/lualatex.ini b/Master/texmf-dist/tex/generic/tex-ini-files/lualatex.ini new file mode 100644 index 00000000000..2de7eda514d --- /dev/null +++ b/Master/texmf-dist/tex/generic/tex-ini-files/lualatex.ini @@ -0,0 +1,19 @@ +% tex-ini-files 2016-02-27: lualatex.ini + +% Originally written 2008 by Karl Berry. Public domain. + +\input luatexconfig.tex + +\begingroup + \catcode`\{=1 % + \catcode`\}=2 % + % Set up job name quoting before latex.ltx + % Web2c pdfTeX/XeTeX quote job names containing spaces, but LuaTeX does + % not do this at the engine level. The behaviour can be changed using + % a callback. Originally this code was loaded via lualatexquotejobname.tex + % but that required a hack around latex.ltx: the behaviour has been altered + % to allow the callback route to be used directly. + \global\everyjob{\directlua{require("lualatexquotejobname.lua")}} +\endgroup + +\input latex.ltx diff --git a/Master/texmf-dist/tex/generic/tex-ini-files/luatex.ini b/Master/texmf-dist/tex/generic/tex-ini-files/luatex.ini new file mode 100644 index 00000000000..3da734be83c --- /dev/null +++ b/Master/texmf-dist/tex/generic/tex-ini-files/luatex.ini @@ -0,0 +1,12 @@ +% tex-ini-files 2016-02-27: luatex.ini + +% Karl Berry, originally written 2008. Public domain. +% PDF output by default. + +% Must be done first (as needs to 'tidy up') +\input luatexconfig.tex +% Activate primitives +\input luatexiniconfig.tex +\input load-unicode-data.tex +\input etex.src +\dump diff --git a/Master/texmf-dist/tex/generic/tex-ini-files/luatexconfig.tex b/Master/texmf-dist/tex/generic/tex-ini-files/luatexconfig.tex new file mode 100644 index 00000000000..fa9f81a3b9e --- /dev/null +++ b/Master/texmf-dist/tex/generic/tex-ini-files/luatexconfig.tex @@ -0,0 +1,68 @@ +% tex-ini-files 2016-02-27: luatexconfig.tex + +% Load shared (PDF) settings in LuaTeX + +\begingroup + \catcode`\{=1 % + \catcode`\}=2 % + \catcode`\#=6 % + % Enable one marker primitive and one for the looping + \directlua{ + tex.enableprimitives("", {"pdfvariable", "unless"}) + }% + % From plain.tex + \def\loop#1\repeat{\def\body{#1}\iterate}% + \def\iterate{% + \body + \let\next\iterate + \else + \let\next\relax + \fi + \next + }% + \let\repeat\fi + % The format of the data lines themselves is simple + \ifx\pdfvariable\undefined + \def\parse#1 = #2\relax{% + \directlua{tex.enableprimitives("", {"pdf#1"})}% + \expandafter\global\csname pdf#1\endcsname = #2 % + \expandafter\global\expandafter\let\csname pdf#1\endcsname\undefined + }% + \directlua{tex.enableprimitives("", {"pdfoutput"})}% + \global\pdfoutput = \ifx\dvimode\undefined 1\else 0\fi\relax + \global\let\pdfoutput\undefined + \else + \directlua{ + tex.enableprimitives("", {"pageheight", "pagewidth", "outputmode"}) + }% + \global\outputmode = \ifx\dvimode\undefined 1\else 0\fi\relax + \global\let\outputmode\undefined + \def\parse#1 = #2\relax{% + \expandafter\ifx\csname #1\endcsname\relax + \global\pdfvariable #1 = #2 % + \else + \expandafter\global\csname #1\endcsname = #2 % + \fi + }% + \fi + \def\storedpar{\par}% + % Read the raw data + \openin0=pdftexconfig.dat % + \loop\unless\ifeof0 % + \read0 to \line + \unless\ifx\line\storedpar + \if\relax\line\relax + \else + \expandafter\parse\line\relax + \fi + \fi + \repeat +\endgroup + +% Tidy up primitives and DVI mode marker +\global\let\pageheight\undefined +\global\let\pagewidth\undefined +\global\let\pdfvariable\undefined +\global\let\unless\undefined + +\global\let\dvimode\undefined diff --git a/Master/texmf-dist/tex/generic/tex-ini-files/pdftexconfig.tex b/Master/texmf-dist/tex/generic/tex-ini-files/pdftexconfig.tex new file mode 100644 index 00000000000..6ab04b81193 --- /dev/null +++ b/Master/texmf-dist/tex/generic/tex-ini-files/pdftexconfig.tex @@ -0,0 +1,40 @@ +% tex-ini-files 2016-02-27: pdftexconfig.tex + +% Load shared (PDF) settings in pdfTeX + +% This needs a bit of work to read the file line-by-line +\begingroup + \catcode`\{=1 % + \catcode`\}=2 % + \catcode`\#=6 % + % From plain.tex + \def\loop#1\repeat{\def\body{#1}\iterate}% + \def\iterate{% + \body + \let\next\iterate + \else + \let\next\relax + \fi + \next + }% + \let\repeat\fi + % The format of the data lines themselves is simple + \def\parse#1 = #2\relax{\expandafter\global\csname pdf#1\endcsname = #2 }% + \def\storedpar{\par}% + % Read the raw data + \openin0=pdftexconfig.dat % + \loop\unless\ifeof0 % + \read0 to \line + \unless\ifx\line\storedpar + \if\relax\line\relax + \else + \expandafter\parse\line\relax + \fi + \fi + \repeat +\endgroup + +\global\pdfoutput = \ifx\dvimode\undefined 1\else 0\fi\relax +\global\let\dvimode\undefined + +\endinput diff --git a/Master/texmf-dist/tex/generic/tex-ini-files/xelatex.ini b/Master/texmf-dist/tex/generic/tex-ini-files/xelatex.ini new file mode 100644 index 00000000000..8e34b9c95ee --- /dev/null +++ b/Master/texmf-dist/tex/generic/tex-ini-files/xelatex.ini @@ -0,0 +1,17 @@ +% tex-ini-files 2016-02-27: xelatex.ini + +% Public domain. Originally by Jonathan Kew. + +% Primitives in pdftex and luatex, we'll just use macros here. +% Since we are generating a whatsit, not 100% compatible, +% but hopefully close enough. +% +\begingroup + \catcode`\{=1 % + \catcode`\}=2 % + \catcode`\#=6 % + \protected\gdef\pdfmapfile#1{\special{pdf:mapfile #1}}% + \protected\gdef\pdfmapline#1{\special{pdf:mapline #1}}% +\endgroup + +\input latex.ltx diff --git a/Master/texmf-dist/tex/generic/tex-ini-files/xetex.ini b/Master/texmf-dist/tex/generic/tex-ini-files/xetex.ini new file mode 100644 index 00000000000..15f0fb7b7ea --- /dev/null +++ b/Master/texmf-dist/tex/generic/tex-ini-files/xetex.ini @@ -0,0 +1,99 @@ +% tex-ini-files 2016-02-27: xetex.ini + +% Public domain. Originally by Jonathan Kew. + +%% Disable the \font\preloaded=... entries from plain.tex +%% as XeTeX is primarily intended for use with other fonts +\catcode`\{=1 \catcode`\}=2 \catcode`\#=6 \catcode`\^=7 \catcode`\@=11 + +\scrollmode + +% General Unicode set up +\input load-unicode-data.tex % + +% Classes that have always been defined by the XeTeX format +\input load-unicode-xetex-classes.tex % + +% Let etex.src handle things if eTeX is not enabled! +\ifx\XeTeXinterchartoks\undefined +\else + % basic line-breaking support for CJK etc; override for more sophisticated spacing, + % automatic font changes, etc. + + \gdef\xtxHanGlue{\hskip0pt plus 0.1em\relax} % between ideographs + \gdef\xtxHanSpace{\hskip0.2em plus 0.2em minus 0.1em\relax} % before/after runs of CJK + + \global\XeTeXinterchartoks 0 1 = {\xtxHanSpace} + \global\XeTeXinterchartoks 0 2 = {\xtxHanSpace} + \global\XeTeXinterchartoks 0 3 = {\nobreak\xtxHanSpace} + + \global\XeTeXinterchartoks 1 0 = {\xtxHanSpace} + \global\XeTeXinterchartoks 2 0 = {\nobreak\xtxHanSpace} + \global\XeTeXinterchartoks 3 0 = {\xtxHanSpace} + + \global\XeTeXinterchartoks 1 1 = {\xtxHanGlue} + \global\XeTeXinterchartoks 1 2 = {\xtxHanGlue} + \global\XeTeXinterchartoks 1 3 = {\nobreak\xtxHanGlue} + + \global\XeTeXinterchartoks 2 1 = {\nobreak\xtxHanGlue} + \global\XeTeXinterchartoks 2 2 = {\nobreak\xtxHanGlue} + \global\XeTeXinterchartoks 2 3 = {\xtxHanGlue} + + \global\XeTeXinterchartoks 3 1 = {\xtxHanGlue} + \global\XeTeXinterchartoks 3 2 = {\xtxHanGlue} + \global\XeTeXinterchartoks 3 3 = {\nobreak\xtxHanGlue} +\fi + +\let\s@vef@nt=\font +\let\preloaded=2 +\def\font{\futurelet\next\d@ntpreload} +\def\d@ntpreload{\ifx\next\preloaded + \let\next\sk@pf@nt + \begingroup \catcode`\%=12 \catcode13=12 + \else + \let\next\s@vef@nt + \fi \next} +\lccode1=13 +\lowercase{\def\sk@pf@nt\preloaded=#1^^A{\endgroup}} + +\input etex.src + +% Restore the \font command and undefine other stuff +\catcode`\@=11 +\let\font=\s@vef@nt +\let\d@ntpreload=\und@fined +\let\sk@pf@nt=\und@fined +\let\s@vef@nt=\und@fined + +% +% Allocator for \XeTeXintercharclass values, from Enrico Gregorio +% +\newcount\xe@alloc@intercharclass % allocates intercharclass +\xe@alloc@intercharclass=\thr@@ % from 4 (1,2 and 3 are used by CJK, AFAIK) +\def\xe@alloc@#1#2#3#4#5{\global\advance#1\@ne + \xe@ch@ck#1#4#2% make sure there's still room + \allocationnumber#1% + \global#3#5\allocationnumber + \wlog{\string#5=\string#2\the\allocationnumber}} +\def\xe@ch@ck#1#2#3{% + \ifnum#1<#2\else + \errmessage{No room for a new #3}% + \fi} +\def\newXeTeXintercharclass{% + \xe@alloc@\xe@alloc@intercharclass\XeTeXintercharclass\chardef\@cclv} % At most 254 + +% Primitives in pdfTeX and LuaTeX, we'll just use macros here. +% Since we are generating a whatsit, not 100% compatible, +% but hopefully close enough. +\protected\def\pdfmapfile#1{\special{pdf:mapfile #1}} +\protected\def\pdfmapline#1{\special{pdf:mapline #1}} + +\catcode`\@=12 + +\XeTeXuseglyphmetrics=1 +\XeTeXdashbreakstate=1 + +\errorstopmode + +\dump +\endinput diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 9e4d6248bd0..164dbe1ef2b 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -544,7 +544,7 @@ my @TLP_working = qw( technics ted templates-fenn templates-sommer templatetools tempora tengwarscript tensor termcal termlist termmenu testhyphens teubner - tex-ewd tex-font-errors-cheatsheet tex-gyre tex-gyre-math + tex-ewd tex-font-errors-cheatsheet tex-gyre tex-gyre-math tex-ini-files tex-label tex-overview tex-ps tex-refs tex-virtual-academy-pl tex4ebook texapi texbytopic texcount texdef texdiff texdirflatten texdraw texfot texilikechaps texilikecover diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index 7b9a7e76dac..9978fd13a61 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -1710,6 +1710,7 @@ $standardtex='\.(.bx|code\.tex|cfg|sty|clo|ldf|cls|def|fd|fontspec|cmap|4ht)$'; 'taylor', 'diagrams.tex', 'termmenu', '\.tex', 'tex-ewd', 'dotnot.tex', + 'tex-ini-files','\.(ini|tex)$', 'tex-ps', '\.tex', 'texapi', 'texapi\.tex', 'texdraw', 'tex$|' . $standardtex, diff --git a/Master/tlpkg/tlpsrc/collection-basic.tlpsrc b/Master/tlpkg/tlpsrc/collection-basic.tlpsrc index 4112111d069..e2f44641086 100644 --- a/Master/tlpkg/tlpsrc/collection-basic.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-basic.tlpsrc @@ -36,6 +36,7 @@ depend pdftex depend plain depend tetex depend tex +depend tex-ini-files depend texconfig depend texlive-common depend texlive-docindex diff --git a/Master/tlpkg/tlpsrc/tex-ini-files.tlpsrc b/Master/tlpkg/tlpsrc/tex-ini-files.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d -- cgit v1.2.3