summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-04-19 03:03:47 +0000
committerNorbert Preining <norbert@preining.info>2023-04-19 03:03:47 +0000
commit10bb4d468226c290e5e87e3fa367dc6fd2dcb84b (patch)
tree0e3fae0643d2bed385e6b758a246aaa2edf61133 /macros
parent80e82c6cd5fb165fa720a1ce3a25f357ea11b9fc (diff)
CTAN sync 202304190303
Diffstat (limited to 'macros')
-rw-r--r--macros/context/contrib/context-calendar-examples/README.md16
-rw-r--r--macros/context/contrib/context-calendar-examples/VERSION2
-rw-r--r--macros/context/contrib/context-calendar-examples/doc/context/third/calendar-examples/calendar-examples.md4
-rw-r--r--macros/context/contrib/context-calendar-examples/doc/context/third/calendar-examples/t-intervalcalendar-module-doc.pdfbin103780 -> 0 bytes
-rw-r--r--macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A5-day_per_page.tex199
-rw-r--r--macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A6-1week_per_2pages.tex202
-rw-r--r--macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Menu-calendar.tex165
-rw-r--r--macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Photocalendar.tex71
-rw-r--r--macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Sundata-calendar.tex640
-rw-r--r--macros/context/contrib/context-collatingmarks/README.md17
-rw-r--r--macros/context/contrib/context-collatingmarks/VERSION2
-rw-r--r--macros/context/contrib/context-collatingmarks/doc/context/third/collating-marks/README.md26
-rw-r--r--macros/context/contrib/context-collatingmarks/doc/context/third/collating-marks/t-collatingmarks-module-doc.pdfbin140658 -> 140294 bytes
-rw-r--r--macros/context/contrib/context-collatingmarks/tex/context/third/collating-marks/t-collatingmarks.tex (renamed from macros/context/contrib/context-collatingmarks/tex/context/third/collationg-marks/t-collatingmarks.tex)23
-rw-r--r--macros/context/contrib/context-interval-calendar/README.md8
-rw-r--r--macros/context/contrib/context-interval-calendar/VERSION2
-rw-r--r--macros/context/contrib/context-interval-calendar/doc/context/third/interval-calendar/t-intervalcalendar-module-doc.pdfbin103780 -> 104207 bytes
-rw-r--r--macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/Interval-calendar.tex61
-rw-r--r--macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/t-intervalcalendar.tex4
-rw-r--r--macros/context/contrib/context-pocketdiary/README.md12
-rw-r--r--macros/context/contrib/context-pocketdiary/VERSION2
-rw-r--r--macros/context/contrib/context-pocketdiary/doc/context/third/pocketdiary/README.md20
-rw-r--r--macros/context/contrib/context-pocketdiary/doc/context/third/pocketdiary/t-pocketdiary-module-doc.pdfbin221337 -> 221130 bytes
-rw-r--r--macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Moonphase/moons-MP.tex13
-rw-r--r--macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Moonphase/t-moonphase.lua2
-rw-r--r--macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/PocketDiary.tex102
-rw-r--r--macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Solar/sun-MP.tex13
-rw-r--r--macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Solar/t-solar.lua2
-rw-r--r--macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-calendar.lua2
-rw-r--r--macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-pocketdiary.lua4
-rw-r--r--macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-pocketdiary.tex8
-rw-r--r--macros/latex/contrib/lettrine/README.md26
-rw-r--r--macros/latex/contrib/lettrine/contrib.dtx376
-rw-r--r--macros/latex/contrib/lettrine/contrib.ins59
-rw-r--r--macros/latex/contrib/lettrine/contrib/optfile.cfl28
-rw-r--r--macros/latex/contrib/lettrine/contrib/pacl.cfl84
-rw-r--r--macros/latex/contrib/lettrine/contrib/padl.cfl85
-rw-r--r--macros/latex/contrib/lettrine/contrib/pzc2.cfl45
-rw-r--r--macros/latex/contrib/lettrine/contrib/pzc3.cfl45
-rw-r--r--macros/latex/contrib/lettrine/doc/lettrine-demo-de.pdfbin57736 -> 128266 bytes
-rw-r--r--macros/latex/contrib/lettrine/doc/lettrine-demo-fr.pdfbin62638 -> 139142 bytes
-rw-r--r--macros/latex/contrib/lettrine/doc/lettrine-demo-lua.pdfbin73141 -> 74184 bytes
-rw-r--r--macros/latex/contrib/lettrine/doc/lettrine.pdfbin97444 -> 122711 bytes
-rw-r--r--macros/latex/contrib/lettrine/lettrine-2022-09-25.sty302
-rw-r--r--macros/latex/contrib/lettrine/lettrine.dtx494
-rw-r--r--macros/latex/contrib/lettrine/lettrine.ins84
-rw-r--r--macros/latex/contrib/pagecolor/README13
-rw-r--r--macros/latex/contrib/pagecolor/pagecolor-crop-example.pdfbin101140 -> 101137 bytes
-rw-r--r--macros/latex/contrib/pagecolor/pagecolor-example.pdfbin93660 -> 93660 bytes
-rw-r--r--macros/latex/contrib/pagecolor/pagecolor.dtx247
-rw-r--r--macros/latex/contrib/pagecolor/pagecolor.pdfbin341917 -> 342199 bytes
-rw-r--r--macros/latex/contrib/prettytok/DEPENDS.txt1
-rw-r--r--macros/latex/contrib/prettytok/README7
-rwxr-xr-xmacros/latex/contrib/prettytok/prettytok-decode-8bit.py12
-rw-r--r--macros/latex/contrib/prettytok/prettytok-test.tex17
-rw-r--r--macros/latex/contrib/prettytok/prettytok.lua198
-rw-r--r--macros/latex/contrib/prettytok/prettytok.pdfbin369580 -> 485548 bytes
-rw-r--r--macros/latex/contrib/prettytok/prettytok.sty378
-rw-r--r--macros/latex/contrib/prettytok/prettytok.tex409
-rw-r--r--macros/latex/contrib/prettytok/prettytok_template.html76
-rw-r--r--macros/latex/contrib/se2thesis/CHANGELOG.md25
-rw-r--r--macros/latex/contrib/se2thesis/se2colors.dtx2
-rw-r--r--macros/latex/contrib/se2thesis/se2fonts.dtx2
-rw-r--r--macros/latex/contrib/se2thesis/se2packages.dtx788
-rw-r--r--macros/latex/contrib/se2thesis/se2thesis-master-thesis-example.pdfbin1101240 -> 1101208 bytes
-rw-r--r--macros/latex/contrib/se2thesis/se2thesis-master-thesis-example.tex40
-rw-r--r--macros/latex/contrib/se2thesis/se2thesis.dtx339
-rw-r--r--macros/latex/contrib/se2thesis/se2thesis.ins10
-rw-r--r--macros/latex/contrib/se2thesis/se2thesis.pdfbin345472 -> 382546 bytes
-rw-r--r--macros/latex/contrib/se2thesis/se2thesis.tex1
-rw-r--r--macros/latex/contrib/se2thesis/test.pdfbin23939 -> 1102663 bytes
-rw-r--r--macros/latex/contrib/se2thesis/test.tex167
-rw-r--r--macros/latex/required/babel/base/README.md32
-rw-r--r--macros/latex/required/babel/base/babel.dtx129
-rw-r--r--macros/latex/required/babel/base/babel.ins2
-rw-r--r--macros/latex/required/babel/base/babel.pdfbin911845 -> 912577 bytes
-rw-r--r--macros/latex/required/babel/base/bbcompat.dtx2
77 files changed, 3820 insertions, 2327 deletions
diff --git a/macros/context/contrib/context-calendar-examples/README.md b/macros/context/contrib/context-calendar-examples/README.md
new file mode 100644
index 0000000000..bd90a4df06
--- /dev/null
+++ b/macros/context/contrib/context-calendar-examples/README.md
@@ -0,0 +1,16 @@
+## A Collection of Calendars
+
+# Intro
+There is a module called t-pocektdiary which contains numerous calculations for day, week, month and year tables. The module also comes with the possibility to calculate sunrise and sunset data as well as moon-cycle data.
+
+This collection of calendars shows the the mechanisms implemented in the PocketDiary module can also be used outside of its structures.
+
+# The examples
+- Planner in the format A5 with 1 day per page
+- Planner in the format A5 or A6 with 1 week on two facing pages
+- Planner for menus
+- Photo calendar
+
+# Author
+Willi Egger
+License Public Domain \ No newline at end of file
diff --git a/macros/context/contrib/context-calendar-examples/VERSION b/macros/context/contrib/context-calendar-examples/VERSION
index 345ab1ba1e..faab976b2f 100644
--- a/macros/context/contrib/context-calendar-examples/VERSION
+++ b/macros/context/contrib/context-calendar-examples/VERSION
@@ -1 +1 @@
-2023.04.14 \ No newline at end of file
+2023.04.15
diff --git a/macros/context/contrib/context-calendar-examples/doc/context/third/calendar-examples/calendar-examples.md b/macros/context/contrib/context-calendar-examples/doc/context/third/calendar-examples/calendar-examples.md
index d250ea54c7..a14e407ad2 100644
--- a/macros/context/contrib/context-calendar-examples/doc/context/third/calendar-examples/calendar-examples.md
+++ b/macros/context/contrib/context-calendar-examples/doc/context/third/calendar-examples/calendar-examples.md
@@ -30,9 +30,9 @@ Each day shows the day-number and the name of the day. Christian holidays are ma
## Photocalendar.tex
-The Phorocalendar is made-up on A4 paper. It contains a title page with one picture, followed by 12 pages each reserved for one month. On each of those pages there is a picture and at the bottom a month-table is placed. Centered above the table the month's name and the year is typeset. This example is set-up such, that one can only put either landscape or portrait pictures.
+The Phoro calendar is made-up on A4 paper. It contains a title page with one picture, followed by 12 pages each reserved for one month. On each of those pages there is a picture and at the bottom a month-table is placed. Centered above the table the month's name and the year is typeset. This example is set-up such, that one can only put either landscape or portrait pictures.
## Sundata-calendar.tex
-This calendar puts the moon- and sun-data per day in a table. It is arranged as a A6-booklet consisting out of two sections. Sewn together and set into a cover this gives a handy brochure to keep track of moon-cycle and the dayly sunrise, sunset and day-light hours.
+This calendar puts the moon- and sun-data per day in a table. It is arranged as a A6-booklet consisting out of two sections. Sewn together and set into a cover this gives a handy brochure to keep track of moon-cycle and the daily sunrise, sunset and day-light hours.
diff --git a/macros/context/contrib/context-calendar-examples/doc/context/third/calendar-examples/t-intervalcalendar-module-doc.pdf b/macros/context/contrib/context-calendar-examples/doc/context/third/calendar-examples/t-intervalcalendar-module-doc.pdf
deleted file mode 100644
index a97245c510..0000000000
--- a/macros/context/contrib/context-calendar-examples/doc/context/third/calendar-examples/t-intervalcalendar-module-doc.pdf
+++ /dev/null
Binary files differ
diff --git a/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A5-day_per_page.tex b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A5-day_per_page.tex
index 6dd5c69843..44d48f6cf8 100644
--- a/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A5-day_per_page.tex
+++ b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A5-day_per_page.tex
@@ -1,46 +1,42 @@
-% Context file
-% Filename: A5-day_per_page.tex
-%
-% 14-01-2023
-% Created by Willi Egger, w.egger@boede.nl
-% This document is in the Public Domain.
-
-% This is an example of how to use the PocketDiary-module outside the built-in
-% structure of a PocketDiary.
-% In order to use this example you need to have the PocketDiary-module
-% installed from:
-% https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=132
-% If you want collating marks placed on the outermost sheet of a section,
-% then you need to install also the Collatingmarks-module from:
-% https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=129
-% The used imposition scheme is contained in the \CONTEXT\ distro.
-
-% This is an example how to prepare a calendar, where each page contains one
-% day. On the left side there is a time-schedule starting at 06:00 ending
-% at 22:00. The header contains left the month and right the year. Below the
-% header there is a table showing left the day and the short dayname followed by
-% the week number and the day number of the year. If the day in question is a
-% Christian holiday, then the name of it is stated in the center.
-% To the right astronomical data
-% are shown: Lunar days/moon phase, sun rise, sun set and light hours.
-% In order to have complete section at the end of the calendar a number of
-% pages with lines are added.
+%D \module
+%D [ file=t-calendar-examples.tex
+%D version=2023.04.15,
+%D title=Calendar examples based on PocketDiary,
+%D subtitle=A5 format 1 day per page calendar,
+%D author=W. Egger,
+%D date=\currentdate,
+%D copyright=W. Egger,
+%D license=Public Domain]
+
+%D This is an example of how to use the PocketDiary-module outside the built-in
+%D structure of a PocketDiary.
+%D In order to use this example you need to have the PocketDiary-module
+%D installed from:
+%D https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=132
+%D If you want collating marks placed on the outermost sheet of a section,
+%D then you need to install also the Collatingmarks-module from:
+%D https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=129
+%D The used imposition scheme is contained in the \CONTEXT\ distro.
+
+%D This is an example how to prepare a calendar, where each page contains one
+%D day. On the left side there is a time-schedule starting at 06:00 ending
+%D at 22:00. The header contains left the month and right the year. Below the
+%D header there is a table showing left the day and the short dayname followed
+%D by
+%D the weeknumber and the daynumber of the year. If the day in question is a
+%D Chrstian holiday, then the name of it is stated in the center.
+%D To the right astronomical data
+%D are shown: Lunar days/moonphase, sun rise, sun set and light hours.
+%D In order to have complete sections a number of pages with lines are added.
\usemodule[pocketdiary]
\usemodule[collatingmarks][Collatingmarks=yes]
-% define the different modes to enable the international interface:
+%D Setup the language to be used: EN,DE,NL,FR,IT,ES
-\definemode[English,Dutch,German,French,Italian,Spanish][keep]
+\mainlanguage[en]
-\enablemode[English]
-% \enablemode[German]
-% \enablemode[Dutch]
-% \enablemode[Italian]
-% \enablemode[French]
-% \enablemode[Spanish]
-
-% The variable sets for the PocketDiary module:
+%D The variable sets for the PocketDiary module:
\setvariables
[PocketDiary]
@@ -62,16 +58,16 @@
[Separatorline=blue,
Gridline={s=.75}]
-\setvariables
+\setvariables %Koziegłowy 52.467860 16.981240
[PocketDiaryGeoPosition]
[lat=52.467860,
lon=16.981240,
timezoneoffset=1,
- continent=EU] % EU, US or empty for no Daylight Saving Time (DST)
+ continent=US] % EU, US or empty for no Daylight Saving Time (DST)
\setvariables
[PocketDiaryAddress]
- [Familyname=YourFamilyName,
+ [Familyname={\bf YourFamilyName},
Forename=YourName,
Street=YourStreet and Number,
Zipcode=YourPostalCode,
@@ -88,34 +84,15 @@
\addfeature[f:Tabular]
-\startmode[English]
- \mainlanguage[en]
-\stopmode
-
-\startmode[German]
- \mainlanguage[de]
-\stopmode
-
-\startmode[French]
- \mainlanguage[fr]
-\stopmode
-
-\startmode[Italian]
- \mainlanguage[it]
-\stopmode
-
-\startmode[Spanish]
- \mainlanguage[es]
-\stopmode
-
-% The document is double sided printed, the page number will be set in the \setupfootertexts:
+%D The document is double sided printed, the page number will be set in the
+%D \setupfootertexts:
\setuppagenumbering[alternative=doublesided,location=]
\setuppapersize[A5][A4,landscape]
% \setuppapersize[A5][A5]
-% Adapt the page layout to the size of the page:
+%D Adapt the page layout to the size of the page:
\setuplayout
[topspace=.6cm,
@@ -129,72 +106,74 @@
width=middle,
location=middle]
-% Enable the imposition: 2 pages recto and verso using 4 sheets of A4 for forming one section
+%D Enable the imposition: 2 pages recto and verso using 4 sheets of A4 for forming one section
\setuparranging[2*2*4]
-% Setup of the Collating marks module:
+
+%D Setup of the Collating marks module:
\setupMPvariables % for collatingmarks
[pages=8, % pages per sheet of paper doublesided
sheets=2, % sheets of paper used per section
horpageshift=-0.5mm]
+
% \showframe
-% Let Lua do the work:
+%D Let Lua do the work:
\startluacode
local report = logs.reporter("Calendar-1-day-per-page")
-
+
function thirddata.diary.year_of_monthtables(
- year,lat,lon,timeoffset,continent)
-
+ year,lat,lon,timeoffset,continent)
+
report("Working in function: diary.year_of_monthtables")
for i = 1,12 do
local monthname = string.lower(os.date
("%B",os.time{year=year,month=i,day=1}))
-
+
thirddata.diary.header_text(monthname,year)
thirddata.diary.monthblock(i,year,lat,lon,timeoffset,continent)
end
end
-
+
function thirddata.diary.monthblock(month,year,lat,lon,timeoffset,continent)
-
+
report("Working in function diary.monthblock")
-
+
local nofdays = 1
-
+
local monthname = thirddata.calendar.select_nameofmonth(month,year)
- local yeardays = thirddata.calendar.isleapyear(year)
-
+ local yeardays = thirddata.calendar.isleapyear(year)
+
if month == 2 and yeardays == 366 then
nofdays = thirddata.calendar.nofdays_month(month,year) + 1
else
nofdays = thirddata.calendar.nofdays_month(month,year)
end
-
+
--report("Number of days in month: %s", nofdays)
-
+
for i = 1,nofdays do
local ordinalday = thirddata.calendar.ordinalday(i,month,year)
local weeknumber = thirddata.calendar.weeknumber(i,month,year)
- local dayname = string.lower(os.date ("%a",os.time{day=i,month=month,year=year}))
+ local dayname = string.lower(os.date ("%a",os.time{day=i,month=month,year=year}))
local holiday = thirddata.calendar.checkchristianfeast(i,month,year)
local moondata = thirddata.moonphase.lunardays(year,month,i)
- local dst_start,dst_stop = thirddata.diary.DST(year,continent)
+ local dst_start,dst_stop = thirddata.diary.DST(year,continent)
local sunrise,sunset,lighthours =
thirddata.srss.sundata(
- i,month,year,lat,lon,timeoffset,dst_start,dst_stop)
+ i,month,year,lat,lon,timeoffset,dst_start,dst_stop)
- if holiday ~= "" then
- report("Holiday: %s", holiday)
- report("Day number: %s", i)
- end
+ if holiday ~= "" then
+ report("Holiday: %s", holiday)
+ report("Day number: %s", i)
+ end
context.bTABLE({setups="table:dayblock"})
context.bTR()
@@ -203,8 +182,8 @@
context.NC()
context("\\bf")
--report("Daynumber: %s Month %s", i,month)
- if dayname == "sun" or holiday ~= "" and holiday ~= "ashw" then
- local dnu = i
+ if dayname == "sun" or holiday ~= "" and holiday ~= "ashw"
+ then local dnu = i
local dna = dayname
context.color({"red"},
function() context(dnu) end) --day number
@@ -297,19 +276,24 @@
return true
end
})
- end
-
+ end
+
\stopluacode
+%D Setup the tab;e for the day page
+
\startsetups[table:dayblock]
\setupTABLE[each][each][frame=off]
\setupTABLE[r][each][offset=0pt,loffset=3pt,roffset=3pt,align=lohi]
\setupTABLE[c][1][width=0.35\textwidth,align=lohi]
\setupTABLE[c][2][style={\switchtobodyfont[6pt]},width=0.65\textwidth] \stopsetups
+%D Define the macro for invoking the lua calculations
+
\define[5]\Yearofmonthtables{%
\ctxlua{thirddata.diary.year_of_monthtables(#1,#2,#3,#4,#5)}}
+%D Create a buffer containing the contents of the variables to be used
\startbuffer[Yearofmonthtables]
\Yearofmonthtables %Year,lat,lon,timeoffset,continent
@@ -320,7 +304,7 @@
{"\getvariable{PocketDiaryGeoPosition}{continent}"}
\stopbuffer
-% Create a time-table as a background to the page
+%D Create a time-table in \METAFUN\ as a background to the page
\startreusableMPgraphic{Time-Lines}
numeric w; w:= OverlaytWidth;
@@ -328,7 +312,7 @@
numeric t;
path p,q;
p := unitsquare xscaled OverlayWidth yscaled (OverlayHeight-2cm);
-
+
q:= llcorner p -- lrcorner p;
draw q withpen pencircle scaled .5pt
withcolor \MPcolor{Grid};
@@ -336,14 +320,15 @@
draw q shifted (0,i*h) withpen pencircle scaled .5pt
withcolor \MPcolor{Grid};
t := 24 - 1 - i ;
- label.top(textext(""& decimal t & ":00"),point 0 of q)
- shifted (15pt,((i-1)*h)+1pt);
+ label.top(textext(""& decimal t & ":00"),point 0 of q) shifted (15pt,((i-1)*h)+1pt);
endfor;
\stopreusableMPgraphic
+%D Make the timetable available as a background on the page
+
\defineoverlay[Textbackground][\reuseMPgraphic{Time-Lines}]
-% Implement international interface:
+%D Implement international interface:
\setuplabeltext[en][title=Title]
\setuplabeltext[nl][title=Titel]
\setuplabeltext[de][title=Titel]
@@ -372,10 +357,12 @@
\setuplabeltext[it][compilation=Dato di compilazione]
\setuplabeltext[es][compilation=Fecha de compilación]
-% Setup the TeX side of the document:
+%D Setup the TeX side of the document:
\starttext
+%D Create the title pages
+
\startstandardmakeup[page=yes,doublesided=no]
\strut
\startalignment [middle]
@@ -400,28 +387,40 @@
\stoptabulate
\stopstandardmakeup
- \getbuffer[Lost-Returnto]
+%D Load the Lost-Returnto template
+ \getbuffer[Lost-Returnto]
+
\setupbackgrounds[text][background=]
-
+
\setupbackgrounds[text][background=Textbackground]
+%D Insert all day pages
+
\getbuffer[Yearofmonthtables]
-
+
\setupbackgrounds[text][background=]
+%D Add a year table with all months
+
\getbuffer[Yearcurrentplan]
-
+
\setupheadertexts[\bfa \getvariable{PocketDiary}{Yearnext}]
+%D Insert a year table with all months of the following year
+
\getbuffer[Yearnextplan]
+
+%D Add some todo-lists
\dorecurse
{3}
{\getbuffer[Todo]}
-
+
+%D Add notes pages
+
\dorecurse
{10}
{\getbuffer[Lines]}
-
+
\stoptext
diff --git a/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A6-1week_per_2pages.tex b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A6-1week_per_2pages.tex
index 6432824f46..eaee939c4c 100644
--- a/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A6-1week_per_2pages.tex
+++ b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A6-1week_per_2pages.tex
@@ -1,56 +1,65 @@
-% Context file
-% Filename: A6-1week_per_2pages.tex
-%
-% 14-01-2023
-% Created by Willi Egger, w.egger@boede.nl
-% This document is in the Public Domain.
-
-% This is an example of how to use the PocketDiary-module outside the built-in
-% structure of a PocketDiary.
-% In order to use this example you need to have the PocketDiary-module
-% installed from:
-% https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=132
-% If you want collating marks placed on the outermost sheet of a section,
-% then you need to install also the Collatingmarks-module from:
-% https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=129
-% The used imposition scheme is contained in the \CONTEXT\ distro.
-
-% This is an example how to prepare a calendar, where two facing pages carry
-% one week as a table. Saturday and Sunday are placed together in one row.
-% The header contains the month name to the left and the week number and the
-% year to the right.
-% The footer contains three fields. The first contains the job-name, the center
-% field shows the page number, the right field is not filled. -- However
-% this can easily be changed in the variable set "PocketDiaryFooter".
-% Each row of the week-table shows top left the day number followed by the short
-% name of the day. Next to this the ordinal day number of the year is typeset.
-% If the day in question is a Christian holiday, then its name is placed next
-% to the general information.
-% This example supports 6 languages i.e. English, German, Dutch, French,
-% Italian and Spanish. The respective interface is activated by enabling the
-% respective mode
-% The original idea was to have an A6 calendar, where 4 pages are print on the
-% A4 paper. This is activated by enabling the mode "A6". By activating the mode
-% "A5" the calendar is prepared A5 sized on a A4 landscape paper.
-% Because there are astronomical data concerning the sun rise, sun set times it
-% is necessary to fill in the correct geo-positional data in the variable set "PocketDiaryGeoPosition".
+%D \module
+%D [ file=t-calendar-examples.tex,
+%D version=2023.04.15,
+%D title=Calendar examples based on PocketDiary,
+%D subtitle=A5/A6 format, 1 week per 2 facing pages,
+%D author=W. Egger,
+%D date=\currentdate,
+%D copyright=W. Egger,
+%D license=Public Domain]
+
+%D This is an example of how to use the PocketDiary-module outside the built-in
+%D structure of a PocketDiary.
+%D In order to use this example you need to have the PocketDiary-module
+%D installed from:
+%D https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=132
+%D If you want collating marks placed on the outermost sheet of a section,
+%D then you need to install also the Collatingmarks-module from:
+%D https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=129
+%D The used imposition scheme is contained in the \CONTEXT\ distro.
+
+%D This is an example how to prepare a calendar, where two facing pages carry
+%D one week as a table. Saturday and Sunday are placed together in one row.
+%D The header contains the month name to the left and the week number and the
+%D year to the right.
+%D The footer contains three fields. The first contains the job-name, the center
+%D field shows the page number, the right field is not filled. -- However
+%D this can easily be changed in the variable set "PocketDiaryFooter".
+%D Each row of the week-table shows top left the day number followed by the short
+%D name of the day. Next to this the ordinal day number of the year is typeset.
+%D If the day in question is a Christian holiday, then its name is placed next
+%D to the general information.
+%D This example supports 6 languages i.e. English, German, Dutch, French,
+%D Italian and Spanish. The respective interface is activated by enabling the
+%D respective mode
+%D The original idea was to have an A6 calendar, where 4 pages are print on the
+%D A4 paper. This is activated by enabling the mode "A6". By activating the mode
+%D "A5" the calendar is prepared A5 sized on a A4 landscape paper.
+%D Because there are astronomical data concerning the sun rise, sun set times it
+%D is necessary to fill in the correct geo-positional data in the variable set
+%D "PocketDiaryGeoPosition".
+
+%D Load the PocketDiary module
\usemodule[pocketdiary]
+
+%D Load the Collating marks module
+
\usemodule[collatingmarks][Collatingmarks=yes]
-\definemode[English,Dutch,German,French,Italian,Spanish,Polish][keep]
+%D Define the modes for the different formats
+
\definemode[A5,A6][keep]
-\enablemode[English]
-% \enablemode[German]
-% \enablemode[Dutch]
-% \enablemode[Italian]
-% \enablemode[French]
-% \enablemode[Spanish]
-% \enalbemode[Polish]
+%D Enable the desired format of the calendar
+
+\enablemode[A5]
-\enablemode[A6]
-%\enablemode[A5]
+%D Set the interface language which includes EN,DE,NL,FR,IT,ES
+
+\mainlanguage[en]
+
+%D Setup the variable sets for the PocketDiary module
\setvariables
[PocketDiary]
@@ -90,32 +99,17 @@
Mobile=YourMobilePhoneNumber,
E-mail=YourEmail@YourProvider,
Web=YourWWW]
-
+
+%D Setup the desired font to be used
+
\setupbodyfont[ibmplex,ss,10pt]
\definefontfeature[f:Tabular][tnum=yes]
\addfeature[f:Tabular]
-\startmode[English]
- \mainlanguage[en]
-\stopmode
-
-\startmode[German]
- \mainlanguage[de]
-\stopmode
-
-\startmode[French]
- \mainlanguage[fr]
-\stopmode
-
-\startmode[Italian]
- \mainlanguage[it]
-\stopmode
-
-\startmode[Spanish]
- \mainlanguage[es]
-\stopmode
+%D Make the document doublesided, switch off the page numbering. The latter
+%D is done in the PocketDiary footer setup
\setuppagenumbering[alternative=doublesided,location=]
@@ -132,6 +126,8 @@
location=middle,
marking=on]
+%D Elaborate the definitions for the A6 format
+
\startmode[A6]
\definepapersize[Agenda][width=100mm,height=140mm]
@@ -156,6 +152,8 @@
horpageshift=-0.5mm]
\stopmode
+%D Elaborate the definition for the A5 format
+
\startmode[A5]
\definepapersize[Agenda][width=148mm,height=210mm]
@@ -170,7 +168,7 @@
horpageshift=0mm]
\stopmode
-% Let Lua the main work:
+%D Let Lua the main work:
\startluacode
@@ -187,30 +185,28 @@
report("Working in function: diary.year_of_weektables")
--- for calendarmonth = 1,12 do
-
- for calendarmonth = 1,12 do
+ for calendarmonth = 1,12 do
--for calendarmonth = 1,12 do
- thirddata.diary.monthblock
- (calendarmonth,year,lat,lon,timeoffset,continent)
+ thirddata.diary.monthblock
+ (calendarmonth,year,lat,lon,timeoffset,continent)
end
end
function thirddata.diary.monthblock(month,year,
lat,lon,timeoffset,continent)
-
+
report("Working in function diary.monthblock: %s", month)
-
+
local c = thirddata.calendar.month(month,year) --returns number of weeks in a given month
local wkf = thirddata.calendar.weeknumber(1,month,year) --weeknumber of 1st day of a given month
-
- report("First week in month %s of year %s is %s",month,year,wkf)
-
+
+ report("First week in month %s of year %s is %s",month,year,wkf)
+
local wkl = wkf + c - 1 -- last week of a given month based on wkf and c, is wrong for January
-
+
report("Weeks in the selected month: %s", c)
report("First week of month: %s", wkf)
-
+
if month == 1 and wkf > 51 then
--report("Calculating in week number %s", wkf)
@@ -218,32 +214,32 @@
thirddata.diary.setup_header_texts(wkf,month,calcyear)
thirddata.diary.thisweek(wkf,month,year,lat,lon,timeoffset,continent)
-
- report("Week %s - Year %s",wkf,year)
-
+
+ report("Week %s - Year %s",wkf,year)
+
--year = year + 1
wkf = 1
wkl = wkf + c - 2
-
+
for i = wkf, wkl do
thirddata.diary.setup_header_texts(i,month,year)
thirddata.diary.thisweek(i,month,year,lat,lon,timeoffset,continent)
- end
+ end
else
for i = wkf, wkl do
-
+
report("Calculating in week number %s", i)
-
+
thirddata.diary.setup_header_texts(i,month,year)
thirddata.diary.thisweek(i,month,year,
lat,lon,timeoffset,continent)
end
end
end
-
-
+
+
function thirddata.diary.setup_header_texts(week,month,year)
-
+
local monthname = string.lower(os.date
("%B",os.time{year=year,month=month,day=1}))
@@ -282,6 +278,8 @@
\stopluacode
+%D Setup the table for the week calendar
+
\startsetups[table:week]
\setupTABLE[split=yes]
\setupTABLE[each][each][frame=on]
@@ -296,8 +294,11 @@
\setupTABLE[c][2][width=0.5\textwidth]
\stopsetups
+%D Define the macro for invoking the calculations
+
\define[5]\Yearofweektables{\ctxlua{thirddata.diary.year_of_weektables(#1,#2,#3,#4,#5)}}
+%D Create a buffer containing all variables for the calculations
\startbuffer[Yearofweektables]
\Yearofweektables %Year,lat,lon,timeoffset,continent
@@ -308,8 +309,12 @@
{"\getvariable{PocketDiaryGeoPosition}{continent}"}
\stopbuffer
+%D Setup the \TEX\ side of the document
+
\starttext
+%D Establish the content for the title pages
+
\startstandardmakeup[page=yes,doublesided=no]
\strut
\godown[.3\textheight]
@@ -353,19 +358,30 @@
\stoptabulate
\stopstandardmakeup
+%D Insert a page with lost-return-to information (PocketDiary
+%D template)
+
\getbuffer[Lost-Returnto]
+%D Add a year table with all months
+
\getbuffer[Yearcurrentplan]
\setupheadertexts[\bfa \getvariable{PocketDiary}{Yearnext}+1]
+%D Add a year table of the next year with all months
+
\getbuffer[Yearnextplan]
\setupheadertexts[]
-
+
+%D Insert all weektables by loading the buffer
+
\getbuffer[Yearofweektables]
- % \dorecurse
- % {4}
- % {\getbuffer[Lines]}
+%D Add pages for notes
+\dorecurse
+ {4}
+ {\getbuffer[Lines]}
+
\stoptext \ No newline at end of file
diff --git a/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Menu-calendar.tex b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Menu-calendar.tex
index 135994f9d8..23ae3f7017 100644
--- a/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Menu-calendar.tex
+++ b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Menu-calendar.tex
@@ -1,62 +1,72 @@
-% Context file
-% Filename: Menu-calender.tex
-%
-% 14-01-2023
-% Created by Willi Egger w.egger@boede.nl
-% This file is in the Public Domain
-
-% This is an example of how to use the PocketDiary-module outside the built-in
-% structure of a PocketDiary.
-% In order to use this example you need to have the PocketDiary-module
-% installed from:
-% https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=132
-% If you want collating marks placed on the outermost sheet of a section,
-% then you need to install also the Collatingmarks-module from:
-% https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=129
-% The used imposition scheme is contained in the \CONTEXT\ distro.
+%D \module
+%D [ file=t-calendar-examples.tex
+%D version=2023.04.15
+%D title=Calendar examples based on PocketDiary
+%D subtitle=Menu calendar,
+%D author=W. Egger,
+%D date=\currentdate
+%D copyright=W. Egger
+%D license=Public Domain
+
+
+%D This is an example of how to use the PocketDiary-module outside the built-in
+%D structure of a PocketDiary.
+%D In order to use this example you need to have the PocketDiary-module
+%D installed from:
+%D https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=132
+%D
+%D If you want collating marks placed on the outermost sheet of a section,
+%D then you need to install also the Collatingmarks-module from:
+%D https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=129
+%D The used imposition scheme is contained in the \CONTEXT\ distribution.
+
+%D Load the PocketDiary module
\usemodule[pocketdiary]
+
+%D Load the Collating marks module
+
\usemodule[collatingmarks][Collatingmarks=yes]
-% Choose your font
+%% Choose and setup the desired font
\setupbodyfont[ibmplex,ss,10pt]
-% Add a path to the picture placed on page 3:
+%D Add a path to the picture placed on page 3:
\setupexternalfigures
- [directory=/Users/willi/Documents/TEXdata
- /Koken/Grossmutters-Guetzli-Rezepte/]
+ [directory=/Path-to-the-picture/]
-% Choose the main language it determines the interface:
+%D Choose the main language which determines the interface:
\mainlanguage[en]
-% This document will be doublesided, the pagenumber will be placed in the footer by means of \setupfootertexts:
+%D This document will be doublesided, the pagenumber will be placed in the
+%D footer by means of \type{\setupfootertexts}:
+
\setuppagenumbering[alternative=doublesided,location=]
-% The calendar has a pagesize of A6 and with the imposition 4 pages recto and verso are placed on a A4. Two sheets of A4 form one section:
+%D The calendar has a pagesize of A6 and with the imposition 4 pages recto and
+%D verso are placed on a A4. Two sheets of A4 form one section:
+
+%D Setup paper size and map it on the size of the print paper
-%\setuppapersize[A6][A4]
-\setuppapersize[A5][A4,landscape]
+\setuppapersize[A6][A4]
-% \setuparranging[2*4*2]
-%\setuparranging[2*2*4]
-\setuparranging[2SIDE]
+%D Invoke the arranging of the pages
-% The module Collating marks needs appropriate information:
+\setuparranging[2*4*2]
+
+%D Setup the appropriate information for the collating marks module:
-% \setupMPvariables
-% [pages=8, % pages per sheet of paper doublesided
-% sheets=2, % sheets of paper used per section
-% horpageshift=0mm]
\setupMPvariables
- [pages=4, % pages per sheet of paper doublesided
- sheets=4, % sheets of paper used per section
+ [pages=8, % pages per sheet of paper doublesided
+ sheets=2, % sheets of paper used per section
horpageshift=0mm]
-% Adapt the layout of the page to the size of the page:
+%D Adapt the layout of the page to the size of the page:
+
\setuplayout
[topspace=.6cm,
backspace=.6cm,
@@ -69,7 +79,7 @@
width=middle,
location=middle]
-% Variable sets from the PocketDiary module to be set:
+%D Setup the variable sets from the PocketDiary module to be set:
\setvariables
[PocketDiary]
@@ -86,7 +96,8 @@
[Separatorline=blue,
Gridline={s=.75}]
-% The data are presented in table form. The setup of the table:
+%D The data are presented in table form. The setup of the table is
+%D as follows:
\startsetups table:week
\setupTABLE[split=yes]
@@ -96,34 +107,41 @@
\setupTABLE[r][2,3,5,6,8,9,11,12,14,15,17,18,20,21][bottomframe=on]
\stopsetups
-% There are currently 6 interfaces supported:
+%D There are currently 6 interfaces supported: EN,DE,NL,FR,IT,ES
+%D Create some label texts for each language
+
+%D English interface
-% English interface
\setuplabeltext[en][menu=Menu]
\setuplabeltext[en][comment=Comment]
-% German interface
+%D German interface
+
\setuplabeltext[de][menu=Menü]
\setuplabeltext[de][comment=Kommentar]
-% French interface
+%D French interface
+
\setuplabeltext[fr][menu=Menu]
\setuplabeltext[fr][comment=Commentaire]
-% Dutch interface
+%D Dutch interface
+
\setuplabeltext[nl][menu=Menu]
\setuplabeltext[nl][comment=Commentaar]
-% Italian interface
+%D Italian interface
+
\setuplabeltext[it][menu=Menu]
\setuplabeltext[it][comment=Commento]
-% Spanish interface
+%D Spanish interface
+
\setuplabeltext[es][menu=Menú]
\setuplabeltext[es][comment=Comentario]
-% The lua code performing all the magic:
+%D Let lua perform all the magic:
\startluacode
@@ -133,8 +151,8 @@
local stamp = mondaytimestamp
local year = year
local week = w
- local daynumber,dayname,monthname,holiday
-
+ local daynumber,dayname,monthname,holiday
+
local day = stamp + 1 * 24 * 60 * 60
report("Working in function: thirddata.calendar.menuweektable")
@@ -144,9 +162,9 @@
--report("Month: %s Week: %s", monthname,week)
thirddata.calendar.myheadertext(monthname,week)
-
+
context.bTABLE({setups="table:week"})
-
+
for i = 1,7 do
local day = stamp + i * 24 * 60 * 60
@@ -159,16 +177,16 @@
if holiday ~= "" then
report("Holiday (before table row): %s", holiday)
- report("Day number (before table row): %s", daynumber)
+ report("Day number (before table row): %s", daynumber)
report("Day name (before table row): %s",dayname)
- end
-
+ end
+
context.bTR()
context.bTD({style="bfa"})
if dayname == "sun" or holiday ~= "" and f ~= "ashw" then
- local dnu = daynumber
- local dna = dayname
+ local dnu = daynumber
+ local dna = dayname
context.color({"red"},function() context(dnu) end)
context("~")
context.color({"red"},function() context.labeltext(dna) end)
@@ -198,9 +216,9 @@
end
function thirddata.calendar.myheadertext(monthname,week)
-
- report("Working in function myheadertext")
-
+
+ report("Working in function myheadertext")
+
context.setupheadertexts{
function()
context("\\bgroup\\bfa")
@@ -216,8 +234,8 @@
function thirddata.calendar.week(weeknumber,year)
local w = weeknumber
- local year = year
- local month = thirddata.calendar.select_month(1,w,year)
+ local year = year
+ local month = thirddata.calendar.select_month(1,w,year)
local mondaytimestamp = thirddata.calendar.weekcalendar(w,month,year)
report("Working in function: thirddata.calendar.week")
@@ -228,15 +246,19 @@
\stopluacode
-% We need a macro to call the lua-code: this macro has two parameters week number and year
+%D We need a macro to call the lua-code: this macro has two parameters
+%D week number and year
\define[2]\MenuWeektable{\ctxlua{thirddata.calendar.week(#1,#2)}}
% \showframe
-% The setup of the document at the TeX-side:
+%D The setup of the document at the TeX-side:
\starttext
+
+%D Add a title page
+
\startstandardmakeup[page=yes,doublsided=yes]
\strut
\godown[.3\textheight]
@@ -248,11 +270,13 @@
\vfil
\stopstandardmakeup
+%D Add a picture on page 3
+
\setupheadertexts[][]
-
- \strut\vfil
- \startplacefigure
+ \strut\vfil
+
+ \startplacefigure
[number=,
title=,
location=middle]
@@ -263,20 +287,27 @@
\page
+%D Call the footer text setups
+
\setups{Footertext}
-
+
+%D Place the week tables for the indicated year
+
\dorecurse{52}
{\setvariables
[PocketDiary]
[Week=\recurselevel]
\MenuWeektable{\recurselevel}{\getvariable{PocketDiary}{Year}}\page}
-
+
\page
+%D Add some empty pages for notes
+
\setupheadertexts[\bf \labeltext{notes}]
\dorecurse
{3}
{\strut\page}
+
\stoptext
diff --git a/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Photocalendar.tex b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Photocalendar.tex
index f55b954e14..59185f3840 100644
--- a/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Photocalendar.tex
+++ b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Photocalendar.tex
@@ -1,16 +1,26 @@
-% Context file
-% Filename: Photocalendar.tex
-%
-% 14-01-2023
-% Created by Willi Egger, w.egger@boede.nl
-% This file is in the Public Domain
-
-% Mind you that Thomas Schmitz put on the \CONTEXT -wiki a lua-script, which
-% creates a tex-file which can be compiled with \CONTEXT\ already back in 2007
-% for the preparation of a photo-calendar.
-% The nice thing about it is, that it uses a small number of formulae. Nice is,
-% that it also uses the Sohael Babwani formulae. See:
-% https://wiki.contextgarden.net/Calendar_script
+%D \module
+%D [ file=t-calendar-examples.tex
+%D version=2023.04.14
+%D title=Calendar examples based on PocketDiary
+%D subtitle=Photo calendar,
+%D author=W. Egger,
+%D date=\currentdate
+%D copyright=W. Egger
+%D license=Public Domain
+
+%D Mind you that Thomas Schmitz put on the \CONTEXT -wiki a lua-script, which
+%D creates a tex-file which can be compiled with \CONTEXT\ already back in 2007
+%D for the preparation of a photo-calendar.
+%D The nice thing about it is, that it uses a small number of formulae. Nice is,
+%D that it also uses the Sohael Babwani formulae. See:
+%D https://wiki.contextgarden.net/Calendar_script
+
+%D This eaxmple creates a photo calender. It has a front page with a photo and
+%D the year. The following pages have a photo at the top and at the bottom a
+%D month table. On top of the month table there is the month name and the year.
+%D This photo calendar is based on the PocketDiary.
+
+%D Load the PocketDiary module
% This example file creates a photo calendar based on the PocketDiary-module.
% In order to use this example you need to have the PocketDiary-module
@@ -26,15 +36,24 @@
% the title page.
% This file supports 6 languages, which are selected through the \mainlanguage[]
+%D Load the PockeDiary module
\usemodule[pocketdiary]
+%D Choose and setup the font to be used
+
\setupbodyfont[ibmplex,ss,12pt]
+%D Switch off the page numbering
+
\setuppagenumbering[location=]
+%D Setup the paper size
+
\setuppapersize[A4,portrait][A4,portrait]
+%D Adjust the layout of the page
+
\setuplayout
[topspace=20mm,
backspace=8.6mm,
@@ -43,10 +62,10 @@
height=middle,
width=middle]
-% Supported languages: en, de, nl, fr, it, es
+%% Supported languages: EN,DE,NL,FR,IT,ES
\mainlanguage[en]
-% Where to find the calendar pictures
+%D Setup the path where to find the calendar pictures
\setupexternalfigures
[directory=./MyPhotoDirectory]
@@ -103,19 +122,21 @@
[13]
[M.jpg]
-% Setup the variables for the Pocket diary, only year is used for the title page and the variable passed to Lua.
+%D Setup the variables for the Pocket diary, only year is used for the
+%D calculations.
\setvariables
[PocketDiary]
[Year=2023]
-
-% Let the header and the footer be empty:
+
+%D Let the header and the footer be empty:
\setupheadertexts[][]
\setupfootertexts[][]
-% Add the international interfaces:
+%D Add some label texts for the international interfaces:
+
\setuplabeltext[en][fotocal={Photo Calendar}]
\setuplabeltext[nl][fotocal=Fotokalender]
\setuplabeltext[de][fotocal=Fotokalender]
@@ -123,7 +144,7 @@
\setuplabeltext[it][fotocal={Calendario fotografico}]
\setuplabeltext[es][fotocal={Calendario fotográfico}]
-% Lua is performing the magic:
+%D Let lua is perform the magic:
\startluacode
local report = logs.reporter("Photo calendar")
@@ -159,7 +180,7 @@
end
\stopluacode
-% The setup of the table with the day numbers:
+% Setup of the month table
\startsetups table:month
\setupTABLE[c]
@@ -171,15 +192,17 @@
\setupTABLE[c][7][foregroundcolor=red]
\stopsetups
-% We need a simple macro with one parameter to call the lua-code:
+%D Define the macro for calling lua
\define[1]\Photocalendarpages
{\ctxlua{thirddata.calendar.Photo_calendar_page(#1)}}
-% Layout of the TeX part of the calendar:
+%D Setup the \TEX\ side of the document
\starttext
+%D Add a title page
+
\startstandardmakeup[page=yes,doublesided=yes]
\startplacefigure
[location=middle,
@@ -190,6 +213,8 @@
\midaligned{\bfc \labeltext{fotocal}~\getvariable{PocketDiary}{Year}}
\stopstandardmakeup
+%D Call the defined macro
+
\Photocalendarpages{\getvariable{PocketDiary}{Year}}
\stoptext
diff --git a/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Sundata-calendar.tex b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Sundata-calendar.tex
index 99865d70c0..81c97e537e 100644
--- a/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Sundata-calendar.tex
+++ b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Sundata-calendar.tex
@@ -1,305 +1,280 @@
-% Context file
-% Filename: Sundata-calendar.tex
-%
-% 13-07-2022
-% Copyright (c) 2022 BOEDE. All rights reserved.
-%
-% \nopdfcompression
-% \enabletrackers[context.trace]
-% \enabletrackers[system.jobfiles]
+%D \module
+%D [ file=t-calendar-examples.tex,
+%D version=2023.04.15,
+%D title=Calendar examples based on PocketDiary,
+%D subtitle=Sun and moon data calendar,
+%D author=W. Egger,
+%D date=\currentdate,
+%D copyright=W. Egger,
+%D license=Public Domain]
+
+%D This examples creates a small calendar, containing the sunrise and
+%D sunset time as well as the lunar days for each day of a given year.
+
+%D In order to create this calendar the PocketDiary module must be installed
+%D on the computer
+
+%D For placing collating marks on the outside of the sections, the
+%D Collating Marks module is required.
+
+%D Load the PocketDiary module
\usemodule[pocketdiary]
+
+%D Load the Collating Marks module
+
\usemodule[collatingmarks][Collatingmarks=yes]
-% \definemode[English,Dutch,German,French,Italian,Spanish][keep]
+%D Setup the main language. This determines the interface to be used
+
+\mainlanguage[en]
+
-\mainlanguage[es]
-% \enablemode[English]
-% \enablemode[German]
-% \enablemode[Dutch]
-% \enablemode[Italian]
-% \enablemode[French]
-% \enablemode[Spanish]
+% Setup of the variable sets for the PocketDiary module
\setvariables
- [PocketDiary]
- [Year=2023,
- Week=1,
- Day=1,
- Month=1,
- Nextyear=no,
- Place=Kozeigłowy,
+ [PocketDiary]
+ [Year=2023,
+ Week=1,
+ Day=1,
+ Month=1,
+ Nextyear=no,
+ Place=Koziegłowy,
Country=PL]
-%{Ośrodek szkoleniowo \crlf wypoczynkowy Uniwersytetu Mikołaja Kopernika \crlf Bacho\TEX},
\setvariables
- [PocketDiaryFooter]
- [Lefttext={\jobname .pdf},
- Centertext=\pagenumber,
- Righttext=]
+ [PocketDiaryFooter]
+ [Lefttext={\jobname .pdf},
+ Centertext=\pagenumber,
+ Righttext=]
\setvariables
- [PocketDiaryColors]
- [Separatorline=blue,
- Gridline={s=.75}]
+ [PocketDiaryColors]
+ [Separatorline=blue,
+ Gridline={s=.75}]
\setvariables
- [PocketDiaryGeoPosition]
- [lat=52.464588,
+ [PocketDiaryGeoPosition]
+ [lat=52.464588,
lon=16.981689,
timezoneoffset=1,
continent=EU] %EU, US or empty for no DST
-% lat=51.63682, %Sambeek Maasstraat 2A (Google Maps)
-% lon=5.96655, %Sambeek, Maasstraat 2A (Google Maps)
-% lat=53.287540, %Bachotek lake head
-% lon=19.475584 %Bachotek lake head
-
- %Koziegłowy
- % lat = 52.467860
- % lon= 16.981240
-
-% Czerwonak
-% lat": 52.464588
-% lon": 16.981689
-
- % Hasselt
- % lat = 52.5921425
- % lon = 6.0962685,
+%D Choose and setup the desired font to be used
\setupbodyfont[ibmplex,ss,10pt]
-% \usetypescriptfile[type-seravek]
-% \usetypescript[Seravek]
-% \setupbodyfont[Seravek,ss,10pt]
-
-% % Modes for the international interface
-%
-% \startmode[English]
-% \mainlanguage[en]
-% \setuplabeltext[en][week=Wk.~]
-% \stopmode
-%
-% \startmode[Dutch]
-% \mainlanguage[nl]
-% \stopmode
-%
-% \startmode[German]
-% \mainlanguage[de]
-% \setuplabeltext[de][week=Wo.~]
-% \stopmode
-%
-% \startmode[French]
-% \mainlanguage[fr]
-% \stopmdode
-%
-% \startmode[Italian]
-% \mainlanguage[it]
-% \stopmode
-%
-% \startmode[Spanish]
-% \mainlanguage[es]
-% \stopmode
+
+%D Make the document doublesided and switch off automatic page number placement
\setuppagenumbering[alternative=doublesided,location=]
-%\setuppapersize[A6][A4]
-% \setuppapersize[A6][A6]
-\setuppapersize[A6][A5,landscape]
+%D Setup paper size
+
+\setuppapersize[A6][A4]
+
+%D Setup the layout of the page
\setuplayout
- [topspace=.6cm,
- backspace=.6cm,
- header=2\bodyfontsize,
- headerdistance=.5\bodyfontsize,
- footer=1.2\bodyfontsize,
- footerdistance=.5\bodyfontsize,
- margin=0pt,
- height=middle,
- width=88mm,
- location=middle]
-
-%\setuparranging[2*4*2]
-\setuparranging[2SIDE]
+ [topspace=.6cm,
+ backspace=.6cm,
+ header=2\bodyfontsize,
+ headerdistance=.5\bodyfontsize,
+ footer=1.2\bodyfontsize,
+ footerdistance=.5\bodyfontsize,
+ margin=0pt,
+ height=middle,
+ width=88mm,
+ location=middle]
+
+
+%D Setup page arrangement
+
+\setuparranging[2*4*2]
+
+% Setup the variables for the Collating Marks module
\setupMPvariables % for collatingmarks
[pages=8, % pages per sheet of paper doublesided
sheets=2, % sheets of paper used per section
horpageshift=0mm]
-
-
+
+%D Let lua do the calculations
+
\startluacode
local report = logs.reporter("Sundata calendar")
function thirddata.diary.year_of_monthtables(
year,lat,lon,timeoffset,continent)
-
- report("Working in function: diary.year_of_monthtables")
-
- local dst_start,dst_stop = thirddata.diary.DST(year,continent)
-
- report("DST start: %s, DST stop: %s",dst_start,dst_stop)
-
--- for i= 1,12 do
- for i= 4,4 do
- local monthname = string.lower(os.date
- ("%B",os.time{year=year,month=i,day=1}))
-
- context.setupheadertexts(
- {
- function()
- context("\\bf")
- context.labeltext(monthname)
- return true
- end
- },
- {
- function()
- context(year)
- return true
- end
- },
- {
- function()
- context("\\bf")
- context.labeltext(monthname)
- return true
- end
- },
- {
- function()
- context(year)
- return true
- end
- })
-
- thirddata.diary.monthblock(i,year,lat,lon,timeoffset,dst_start,dst_stop)
- end
+
+ report("Working in function: diary.year_of_monthtables")
+
+ local dst_start,dst_stop = thirddata.diary.DST(year,continent)
+
+ report("DST start: %s, DST stop: %s",dst_start,dst_stop)
+
+-- for i= 1,12 do
+ for i= 4,4 do
+ local monthname = string.lower(os.date
+ ("%B",os.time{year=year,month=i,day=1}))
+
+ context.setupheadertexts(
+ {
+ function()
+ context("\\bf")
+ context.labeltext(monthname)
+ return true
+ end
+ },
+ {
+ function()
+ context(year)
+ return true
+ end
+ },
+ {
+ function()
+ context("\\bf")
+ context.labeltext(monthname)
+ return true
+ end
+ },
+ {
+ function()
+ context(year)
+ return true
+ end
+ })
+
+ thirddata.diary.monthblock(i,year,lat,lon,timeoffset,dst_start,dst_stop)
+ end
end
function thirddata.diary.monthblock(
month,year,lat,lon,timeoffset,dst_start,dst_stop)
-
- report("Working in function diary.monthblock")
-
- local c = thirddata.calendar.month(month,year) --returns number of weeks in a given month
- local wkf = thirddata.calendar.weeknumber(1,month,year)
-
- --report("Weeks in the selected month: %s", c)
- --report("Week number : %s", wkf)
-
- local nofdays = 1
-
- if month == 2 and thirddata.calendar.isleapyear(year) ~= 365 then
- nofdays = thirddata.calendar.nofdays_month(month,year) + 1
- else
- nofdays = thirddata.calendar.nofdays_month(month,year)
- end
-
- report("Number of days in month: %s", nofdays)
-
- local wkl = thirddata.calendar.weeknumber(nofdays,month,year)
-
- local monthname = thirddata.calendar.select_nameofmonth(month,year)
+
+ report("Working in function diary.monthblock")
+
+ local c = thirddata.calendar.month(month,year) --returns number of weeks in a given month
+ local wkf = thirddata.calendar.weeknumber(1,month,year)
+
+ --report("Weeks in the selected month: %s", c)
+ --report("Week number : %s", wkf)
+
+ local nofdays = 1
+
+ if month == 2 and thirddata.calendar.isleapyear(year) ~= 365 then
+ nofdays = thirddata.calendar.nofdays_month(month,year) + 1
+ else
+ nofdays = thirddata.calendar.nofdays_month(month,year)
+ end
+
+ report("Number of days in month: %s", nofdays)
+
+ local wkl = thirddata.calendar.weeknumber(nofdays,month,year)
+
+ local monthname = thirddata.calendar.select_nameofmonth(month,year)
context.bTABLE({setups="table:monthblock"})
-
- for i = 1,nofdays do
-
- local ordinalday = thirddata.calendar.ordinalday(i,month,year)
- local weeknumber = thirddata.calendar.weeknumber(i,month,year)
+
+ for i = 1,nofdays do
+
+ local ordinalday = thirddata.calendar.ordinalday(i,month,year)
+ local weeknumber = thirddata.calendar.weeknumber(i,month,year)
local holiday = thirddata.calendar.checkchristianfeast(i,month,year)
- local moondata = thirddata.moonphase.lunardays(year,month,i)
- local sunrise,sunset,lighthours =
- thirddata.srss.sundata(
- i,month,year,lat,lon,timeoffset,dst_start,dst_stop)
-
- context.bTR()
- context.bTD()
-
- local dayname = string.lower(os.date
- ("%a",os.time{day=i,month=month,year=year}))
-
- --report("Dayname: %s",dayname)
- context.starttabulate{"|lw(0.1\\textwidth)|lw(0.06\\textwidth)|l|"}
- context.NC()
- if dayname == "sun" or holiday ~= "" and holiday ~= "asw" then
- local dnu = i
- local dna = dayname
+ local moondata = thirddata.moonphase.lunardays(year,month,i)
+ local sunrise,sunset,lighthours =
+ thirddata.srss.sundata(
+ i,month,year,lat,lon,timeoffset,dst_start,dst_stop)
+
+ context.bTR()
+ context.bTD()
+
+ local dayname = string.lower(os.date
+ ("%a",os.time{day=i,month=month,year=year}))
+
+ --report("Dayname: %s",dayname)
+ context.starttabulate{"|lw(0.1\\textwidth)|lw(0.06\\textwidth)|l|"}
+ context.NC()
+ if dayname == "sun" or holiday ~= "" and holiday ~= "asw" then
+ local dnu = i
+ local dna = dayname
+ context.color({"red"},
+ function() context(dnu) end) --day number
+ context("~")
context.color({"red"},
- function() context(dnu) end) --day number
- context("~")
- context.color({"red"},
- function() context.labeltext(dna) end)--dayname
- else
- context(i) --day
- context("~")
- context.labeltext(dayname) --dayname
- end
- context.NC()
- context.switchtobodyfont{"6pt"}
- context.labeltext("week")
- context(": ")
- context(weeknumber)
- context.NC()
- context.switchtobodyfont{"6pt"}
- context.labeltext("day")
- context(": ")
- context(ordinalday)
- context.NC()
- context.NR()
- context.stoptabulate()
- context.eTD()
- context.bTD()
- context.starttabulate{"|lw(0.2\\textwidth)|l|l|l|l|"}
- context.NC()
- if holiday == "" then
- context.strut()
- context.NC()
- context.NC()
- context.NC()
- context.NC()
- else
- context.labeltext(holiday)
- context.NC()
- context.NC()
- context.NC()
- context.NC()
- end
- context.NR()
- context.NC()
- if tonumber(moondata) then
- context.labeltext("moondays")
- else
- context.labeltext("moon")
- end
- context(":~")
- context(moondata)
- context.NC()
- --context.labeltext("sunrise")
- context("\\SunA[background=Sunrise]{}")
- context("\\quad :~")
- context(sunrise)
- context.NC()
- context("\\SunA[background=Sunset]{}")
- context("\\quad :~")
- context(sunset)
- context.NC()
- context("\\SunB[background=Light]{}")
- context("~:~")
- context(lighthours)
- context.NC()
- context.NR()
- context.stoptabulate()
- context.eTD()
- context.eTR()
- end
+ function() context.labeltext(dna) end)--dayname
+ else
+ context(i) --day
+ context("~")
+ context.labeltext(dayname) --dayname
+ end
+ context.NC()
+ context.switchtobodyfont{"6pt"}
+ context.labeltext("week")
+ context(": ")
+ context(weeknumber)
+ context.NC()
+ context.switchtobodyfont{"6pt"}
+ context.labeltext("day")
+ context(": ")
+ context(ordinalday)
+ context.NC()
+ context.NR()
+ context.stoptabulate()
+ context.eTD()
+ context.bTD()
+ context.starttabulate{"|lw(0.2\\textwidth)|l|l|l|l|"}
+ context.NC()
+ if holiday == "" then
+ context.strut()
+ context.NC()
+ context.NC()
+ context.NC()
+ context.NC()
+ else
+ context.labeltext(holiday)
+ context.NC()
+ context.NC()
+ context.NC()
+ context.NC()
+ end
+ context.NR()
+ context.NC()
+ if tonumber(moondata) then
+ context.labeltext("moondays")
+ else
+ context.labeltext("moon")
+ end
+ context(":~")
+ context(moondata)
+ context.NC()
+ --context.labeltext("sunrise")
+ context("\\SunA[background=Sunrise]{}")
+ context("\\quad :~")
+ context(sunrise)
+ context.NC()
+ context("\\SunA[background=Sunset]{}")
+ context("\\quad :~")
+ context(sunset)
+ context.NC()
+ context("\\SunB[background=Light]{}")
+ context("~:~")
+ context(lighthours)
+ context.NC()
+ context.NR()
+ context.stoptabulate()
+ context.eTD()
+ context.eTR()
+ end
context.eTABLE()
context.page()
end
-\stopluacode
+\stopluacode
+
+%D Setup the table for the months
\startsetups[table:monthblock]
\setupTABLE[split=yes]
@@ -308,8 +283,12 @@ end
\setupTABLE[c][1][width=0.35\textwidth,align=lohi]
\setupTABLE[c][2][style={\switchtobodyfont[6pt]},width=0.65\textwidth] \stopsetups
+%D Define the macro to call lua
+
\define[5]\Yearofmonthtables{\ctxlua{thirddata.diary.year_of_monthtables(#1,#2,#3,#4,#5)}}
+%D Create a buffer containing all required variables for the calculations
+
\startbuffer[Yearofmonthtables]
\Yearofmonthtables %Year,lat,lon,timeoffset,dst_start,dst_stop
{\getvariable{PocketDiary}{Year}}
@@ -319,7 +298,11 @@ end
{"\getvariable{PocketDiaryGeoPosition}{continent}"}
\stopbuffer
-% Implement international interface:
+%D Setup label texts for the different interfaces
+
+\setuplabeltext[en][week=Wk.~]
+\setuplabeltext[de][week=Wo.~]
+
\setuplabeltext[en][title=Title]
\setuplabeltext[nl][title=Titel]
\setuplabeltext[de][title=Titel]
@@ -348,102 +331,109 @@ end
\setuplabeltext[it][compilation=Dato di compilazione]
\setuplabeltext[es][compilation=Fecha de compilación]
+%D Setup the document at the \TEX\ side
\starttext
+%D Add a title page
+
\startstandardmakeup[page=yes,doublesided=no]
\strut
\startalignment [middle]
\godown[.3\textheight]
- \startmode[**en]
+ \startmode[**en]
{\bfc \labeltext{sunstar}- and \labeltext{moon}-\labeltext{calendar}}
- \stopmode
- \startmode[**nl]
+ \stopmode
+ \startmode[**nl]
{\bfc \labeltext{sunstar}- en \labeltext{moon}-\labeltext{calendar}}
- \stopmode
- \startmode[**de]
- {\bfc \labeltext{sunstar}n- und \labeltext{moon}-\labeltext{calendar} }
- \stopmode
- \startmode[**fr]
+ \stopmode
+ \startmode[**de]
+ {\bfc \labeltext{sunstar}n- und \labeltext{moon}-\labeltext{calendar} }
+ \stopmode
+ \startmode[**fr]
{\bfc \labeltext{calendar} du \labeltext{sunstar} et de la \labeltext{moon}}
- \stopmode
- \startmode[**it]
+ \stopmode
+ \startmode[**it]
{\bfc \labeltext{calendar} di \labeltext{sunstar} e della \labeltext{moon}}
- \stopmode
- \startmode[**es]
+ \stopmode
+ \startmode[**es]
{\labeltext{calendar} del \labeltext{sunstar} y la
- \labeltext{moon}}
- \stopmode
- \blank
- {\bfb \getvariable{PocketDiary}{Place}}
+ \labeltext{moon}}
+ \stopmode
+ \blank
+ {\bfb \getvariable{PocketDiary}{Place}}
\vfill
{\tfa \getvariable{PocketDiary}{Year}}
\stopalignment
\vfil
\stopstandardmakeup
+%D Add an editorial and info page
+
\startstandardmakeup[page=yes,doublesided=no]
\starttabulate[|l|p|]
- \NC \labeltext{title}
- \EQ
- \startmode[**en]
+ \NC \labeltext{title}
+ \EQ
+ \startmode[**en]
{\labeltext{sunstar}- and \labeltext{moon}-\labeltext{calendar}}
- \stopmode
- \startmode[**nl]
+ \stopmode
+ \startmode[**nl]
{\labeltext{sunstar}- en \labeltext{moon}-\labeltext{calendar}}
- \stopmode
- \startmode[**de]
- {\labeltext{sunstar}n- und \labeltext{moon}-\labeltext{calendar} }
- \stopmode
- \startmode[**fr]
+ \stopmode
+ \startmode[**de]
+ {\labeltext{sunstar}n- und \labeltext{moon}-\labeltext{calendar} }
+ \stopmode
+ \startmode[**fr]
{\labeltext{calendar} du \labeltext{sunstar} et de la
- \labeltext{moon}}
- \stopmode
- \startmode[**it]]
+ \labeltext{moon}}
+ \stopmode
+ \startmode[**it]]
{\labeltext{calendar} di \labeltext{sunstar} e della
- \labeltext{moon}}
- \stopmode
- \startmode[**es]
+ \labeltext{moon}}
+ \stopmode
+ \startmode[**es]
{\labeltext{calendar} del \labeltext{sunstar} y la
- \labeltext{moon}}
- \stopmode
- \NC\NR
- \NC \labeltext{author}
- \EQ \getvariable{PocketDiaryAddress}{Forename}~
- \getvariable{PocketDiaryAddress}{Familyname} \NC\NR
- \NC \labeltext{typography} \EQ \CONTEXT\ with \LUAMETATEX \NC\NR
- \NC \labeltext[compilation] \EQ \currentdate \NC\NR
- \stoptabulate
- \vfil
- \startmode[**en]
- This calendar is generated for \getvariable{PocketDiary}{Place},
- \getvariable{PocketDiary}{Country}
- \stopmode
- \startmode[**de]
- Dieser Kalender ist berechnet für \getvariable{PocketDiary}{Place},
- \getvariable{PocketDiary}{Country}
- \stopmode
- \startmode[**nl]
- Deze kalender is opgemaakt voor \getvariable{PocketDiary}{Place},
- \getvariable{PocketDiary}{Country}
- \stopmode
- \startmode[**fr]
- Ce calendrier est fait pour \getvariable{PocketDiary}{Place},
- \getvariable{PocketDiary}{Country}
- \stopmode
- \startmode[**it]
- Questo calendario è prodotto per \getvariable{PocketDiary}{Place},
- \getvariable{PocketDiary}{Country}
- \stopmode
- \startmode[**es]
- Este calendario está calculado para \getvariable{PocketDiary}{Place},
- \getvariable{PocketDiary}{Country}
- \stopmode
- \starttabulate[|l|r|]
- \NC Longitude \EQ \getvariable{PocketDiaryGeoPosition}{lon} \NC\NR
- \NC Latitude \EQ \getvariable{PocketDiaryGeoPosition}{lat} \NC\NR
- \stoptabulate
+ \labeltext{moon}}
+ \stopmode
+ \NC\NR
+ \NC \labeltext{author}
+ \EQ \getvariable{PocketDiaryAddress}{Forename}~
+ \getvariable{PocketDiaryAddress}{Familyname} \NC\NR
+ \NC \labeltext{typography} \EQ \CONTEXT\ with \LUAMETATEX \NC\NR
+ \NC \labeltext[compilation] \EQ \currentdate \NC\NR
+ \stoptabulate
+ \vfil
+ \startmode[**en]
+ This calendar is generated for \getvariable{PocketDiary}{Place},
+ \getvariable{PocketDiary}{Country}
+ \stopmode
+ \startmode[**de]
+ Dieser Kalender ist berechnet für \getvariable{PocketDiary}{Place},
+ \getvariable{PocketDiary}{Country}
+ \stopmode
+ \startmode[**nl]
+ Deze kalender is opgemaakt voor \getvariable{PocketDiary}{Place},
+ \getvariable{PocketDiary}{Country}
+ \stopmode
+ \startmode[**fr]
+ Ce calendrier est fait pour \getvariable{PocketDiary}{Place},
+ \getvariable{PocketDiary}{Country}
+ \stopmode
+ \startmode[**it]
+ Questo calendario è prodotto per \getvariable{PocketDiary}{Place},
+ \getvariable{PocketDiary}{Country}
+ \stopmode
+ \startmode[**es]
+ Este calendario está calculado para \getvariable{PocketDiary}{Place},
+ \getvariable{PocketDiary}{Country}
+ \stopmode
+ \starttabulate[|l|r|]
+ \NC Longitude \EQ \getvariable{PocketDiaryGeoPosition}{lon} \NC\NR
+ \NC Latitude \EQ \getvariable{PocketDiaryGeoPosition}{lat} \NC\NR
+ \stoptabulate
\stopstandardmakeup
-
+
+%D Call the buffer for creating the contents of the calendar
+
\getbuffer[Yearofmonthtables]
\stoptext \ No newline at end of file
diff --git a/macros/context/contrib/context-collatingmarks/README.md b/macros/context/contrib/context-collatingmarks/README.md
new file mode 100644
index 0000000000..bbdd0eff82
--- /dev/null
+++ b/macros/context/contrib/context-collatingmarks/README.md
@@ -0,0 +1,17 @@
+# Module: Collating Marks
+
+## Editorial
+
+Author = W. Egger
+Version = 2023.04.15
+License = Public Domain
+
+## Introduction
+
+Collating marks are small black rules placed on the spine of printed sections. On each section the mark is moved by the length of the black rule. When the book is assembled on the spine appears a stair like pattern. Continuity of this pattern insures that the book is ordered in the correct sequence of sections.
+
+## Description
+
+The module is used in connection with arranging pages for folding to form sections.
+
+Depending on the arranging scheme used the module must be set up accordingly in the set of MetaPost variables. \ No newline at end of file
diff --git a/macros/context/contrib/context-collatingmarks/VERSION b/macros/context/contrib/context-collatingmarks/VERSION
index bcdfbcd1bb..faab976b2f 100644
--- a/macros/context/contrib/context-collatingmarks/VERSION
+++ b/macros/context/contrib/context-collatingmarks/VERSION
@@ -1 +1 @@
-2023.03.23 \ No newline at end of file
+2023.04.15
diff --git a/macros/context/contrib/context-collatingmarks/doc/context/third/collating-marks/README.md b/macros/context/contrib/context-collatingmarks/doc/context/third/collating-marks/README.md
index f35f92a89e..b953b7761f 100644
--- a/macros/context/contrib/context-collatingmarks/doc/context/third/collating-marks/README.md
+++ b/macros/context/contrib/context-collatingmarks/doc/context/third/collating-marks/README.md
@@ -1,21 +1,31 @@
-## Collting Marks
+# Module: Collating Marks
-# Introduction
-Collating marks are small black rules placed on printed sections. On each section the mark is moved by the length of the black rule. When the book is assembled on the spine appears a stair like pattern. Continuity of this pattern insures that the book is ordered in the correct sequence of sections.
+## Editorial
+
+Author = W. Egger
+Version = 2023.04.15
+License = Public Domain
+
+## Introduction
+
+Collating marks are small black rules placed on the spine of printed sections. On each section the mark is moved by the length of the black rule. When the book is assembled on the spine appears a stair like pattern. Continuity of this pattern insures that the book is ordered in the correct sequence of sections.
+
+## Usage
-# Usage
The module is used in connection with arranging pages for folding to form sections.
Depending on the arranging scheme used the module must be set up accordingly in the set of MetaPost variables.
-Example:
+### Example:
+
+Example setup for the collating marks:
\usemodule[collatingmarks][Collatingmarks=yes]
\setupMPvariables
[pages=8, % pages per sheet of paper doublesided
sheets=2, % sheets of paper used per section
- horpageshift=0mm, % used for correction if horizontal page-shifting is used
+ horpageshift=0.5mm, % used for correction if horizontal page-shifting is used
frenchdoors=false,
wickel=false]
@@ -23,7 +33,7 @@ This setup is used for the arranging scheme \setuparranging[2*4*2] which indicat
The shift parameter is used to adjust the position of the collating mark centered on the spine. This is specially important when a horizontal shift-list is used for arranging!
-Exanmple:
+Example setup for horizontal page shifting:
\definepageshift
[hor]
@@ -33,4 +43,4 @@ Exanmple:
\setuppageshift[paper][hor] %paper= arrange only, horizontal only
-\setuparranging[2*2*4]
+\setuparranging[2*4*2]
diff --git a/macros/context/contrib/context-collatingmarks/doc/context/third/collating-marks/t-collatingmarks-module-doc.pdf b/macros/context/contrib/context-collatingmarks/doc/context/third/collating-marks/t-collatingmarks-module-doc.pdf
index 1dd95ed6c6..52bf0eed68 100644
--- a/macros/context/contrib/context-collatingmarks/doc/context/third/collating-marks/t-collatingmarks-module-doc.pdf
+++ b/macros/context/contrib/context-collatingmarks/doc/context/third/collating-marks/t-collatingmarks-module-doc.pdf
Binary files differ
diff --git a/macros/context/contrib/context-collatingmarks/tex/context/third/collationg-marks/t-collatingmarks.tex b/macros/context/contrib/context-collatingmarks/tex/context/third/collating-marks/t-collatingmarks.tex
index 5b340243a5..c0f13da3d0 100644
--- a/macros/context/contrib/context-collatingmarks/tex/context/third/collationg-marks/t-collatingmarks.tex
+++ b/macros/context/contrib/context-collatingmarks/tex/context/third/collating-marks/t-collatingmarks.tex
@@ -1,7 +1,7 @@
%D \module
%D [ file=t-collatingmarks,
-%D version=\currentdate,
-%D title=\CONTEXT\ User Module,
+%D version=2023.04.15,
+%D title=Collating Marks \CONTEXT\ User Module,
%D subtitle=Environment for collating marks,
%D author={W. Egger},
%D date=\currentdate,
@@ -14,11 +14,11 @@
\startmodule[collatingmarks]
-\writestatus{loading}{Context Module for collating marks}
+\writestatus{loading}{Context Module for Collating Marks}
%D\enablemode[demo]
-%D \subject{Introduction}
+%D \startsubject[title={Introduction}]
%D
%D This code is based on the work of Thomas A. Schmitz, who created the module for
%D different crop marks.
@@ -28,8 +28,9 @@
%D according to the number of the section. After collating the book it becomes
%D easy tho check whether the sequence of the sections is correct. One should
%D see a \quotation{stair case} on the spine of the book.
+%D \stopsubject
%D
-%D \subject{Using the module}
+%D \startsubject[title={Using the module}]
%D
%D If the collating marks should be placed, then the system should be setup with
%D \type{\setupMPvariables[pages=8,sheets=2,shift=0mm,frenchdoors=false,wickel=false]} Note that the
@@ -48,16 +49,12 @@
%D (boolean).
%D For preparing a section with parallelfolding/letterfolding/Wickelfalz the
%D MPvariable \quotation{wickel} must be set to true (boolean).
-%D
-%D Be aware that the use of collating marks in MKII causes a lot of calls to
-%D Metapost, resulting in very long compilation times.
-%D So better use MKIV where Metapost is included as a
-%D library. In this case the time overhead is absolutely minimal.
-%D
-%D \section{Vocabulary}
+%D\stopsubject
+
+%D \startsubject[title={Vocabulary}]
%D
%D EN: Collating mark, DE: Kollationiermarke, NL: collationeerblokje
-%D
+%D \stopsubject
\unprotect
diff --git a/macros/context/contrib/context-interval-calendar/README.md b/macros/context/contrib/context-interval-calendar/README.md
new file mode 100644
index 0000000000..297e05a2db
--- /dev/null
+++ b/macros/context/contrib/context-interval-calendar/README.md
@@ -0,0 +1,8 @@
+## Interval driven lists
+
+# Intro
+This module provides a possibility to create lists which are based on date-intervals e.g. keeping track of an observation which must be done every third day.
+
+# Author
+Willi Egger
+License Public Domain \ No newline at end of file
diff --git a/macros/context/contrib/context-interval-calendar/VERSION b/macros/context/contrib/context-interval-calendar/VERSION
index 48d81a803c..faab976b2f 100644
--- a/macros/context/contrib/context-interval-calendar/VERSION
+++ b/macros/context/contrib/context-interval-calendar/VERSION
@@ -1 +1 @@
-2022-08-13 \ No newline at end of file
+2023.04.15
diff --git a/macros/context/contrib/context-interval-calendar/doc/context/third/interval-calendar/t-intervalcalendar-module-doc.pdf b/macros/context/contrib/context-interval-calendar/doc/context/third/interval-calendar/t-intervalcalendar-module-doc.pdf
index a97245c510..0cd7b0db0d 100644
--- a/macros/context/contrib/context-interval-calendar/doc/context/third/interval-calendar/t-intervalcalendar-module-doc.pdf
+++ b/macros/context/contrib/context-interval-calendar/doc/context/third/interval-calendar/t-intervalcalendar-module-doc.pdf
Binary files differ
diff --git a/macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/Interval-calendar.tex b/macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/Interval-calendar.tex
index e5da11f8f0..36feee934f 100644
--- a/macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/Interval-calendar.tex
+++ b/macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/Interval-calendar.tex
@@ -1,17 +1,41 @@
-% Context file
-% Filename: Interval-calendar.tex
-%
-% 13-08-2022
-% Copyright (c) 2022 Willi Egger. All rights reserved.
+%D \module
+%D [ file=t-interval-calendar.tex,
+%D version=2023.04.15,
+%D title=Date interval driven lists,
+%D subtitle=User file for the interval calendar,
+%D author=W. Egger,
+%D date=\currentdate,
+%D copyright=W. Egger,
+%D license=Public Domain]
+
+
+%D This module enables you to create lists which are based on date-intervals.
+%D Dat intervals are given in days. There is no limit to the length of the
+%D lists. The module creates tables based on variable sets. The number of
+%D columns and the names of the header cells can freely be setup.
+
+%D There are different predefined intervals which are contained in modes
+%D Define the modes
% \enablemode[weekly]
-% \enablemode[twoweekly]
-\enablemode[monthly]
+\enablemode[twoweekly]
+%\enablemode[monthly]
+
+%D Load the module
\usemodule[intervalcalendar]
+%D Choose the main language. This sets the interface. Supported
+%D interfaces are EN,NL,DE
+
\mainlanguage[en]
+%D Choose and setup the desired font
+
+\setupbodyfont[ibmplex,rm,12pt]
+
+%D Write setups for the table layout
+
\startsetups table:interval_check
\setupTABLE[split=repeat]
\setupTABLE[r][each][height=12mm,align=lohi]
@@ -21,24 +45,27 @@
\setupTABLE[c][5][width=0.3\textwidth]
\stopsetups
-% Columnheads
+%D Define label texts for the column heads
+
\setuplabeltext[en][c1=Datum]
\setuplabeltext[en][c2=Gas]
\setuplabeltext[en][c3=Electricity]
\setuplabeltext[en][c4=Water]
\setuplabeltext[en][c5=Observation]
-
+%D Build the document
\starttext
- \startmode[weekly]
- \Checklist{"2022-8-10"}{"2022-9-30"}{5}{7} % startdate,enddate,columns,interval
- \stopmode
- \startmode[twoweekly]
- \Checklist{"2022/9/10"}{"2023/01/31"}{5}{14} % startdate,enddate,columns,interval
- \stopmode
- \startmode[monthly]
+ \startmode[weekly]
+ \Checklist{"2022-8-10"}{"2022-9-30"}{5}{7} % startdate,enddate,columns,interval
+ \stopmode
+
+ \startmode[twoweekly]
+ \Checklist{"2022/9/10"}{"2023/01/31"}{5}{14} % startdate,enddate,columns,interval
+ \stopmode
+
+ \startmode[monthly]
\Checklist{"2022/8/10"}{"2023/05/31"}{5}{30} % startdate,enddate,columns,interval
- \stopmode
+ \stopmode
\stoptext \ No newline at end of file
diff --git a/macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/t-intervalcalendar.tex b/macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/t-intervalcalendar.tex
index 4d1c38cac1..b55e545224 100644
--- a/macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/t-intervalcalendar.tex
+++ b/macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/t-intervalcalendar.tex
@@ -1,7 +1,7 @@
%D \module
%D [ file=t-interval-calender,
-%D version=2022.08.13,
-%D title=\CONTEXT\ User Module,
+%D version=2023.04.15,
+%D title=Interval calendar \CONTEXT\ User Module,
%D subtitle=Interval Calendar,
%D author=Willi Egger,
%D date=\currentdate,
diff --git a/macros/context/contrib/context-pocketdiary/README.md b/macros/context/contrib/context-pocketdiary/README.md
new file mode 100644
index 0000000000..f89e5ff70d
--- /dev/null
+++ b/macros/context/contrib/context-pocketdiary/README.md
@@ -0,0 +1,12 @@
+## PocketDiary module
+
+# Description
+On the interenet there is a site where one can compose a so called PocketMod. This is based on 8 pages placed on a single sheet of paper, printed singlesided. The paper can then be folded into a booklet in such a way, that only printed pages are visible.
+
+The PocketDiary module implements the 8 pages on a A4 landscape sheet of paper. As the original there are different predefined possibilities to fill the 8 pages. First there are day, weekend, week, month and year tables. One can have not only the actual week, month, year, it is possible to have those a the following week. -- Beyond the calendars there are also a couple of templates for notes, todo, contacts and lost-return-to.
+
+Additionally the module can calculate sunrise and sunset times as well as calculate the moon-cylce.
+
+# Author
+W. Egger
+License: Everything is in the Public Domain except the algorithms contained in the solar data calculations (t-solar.lua) which license is: CCO "http://creativecommons.org/about/cc0" \ No newline at end of file
diff --git a/macros/context/contrib/context-pocketdiary/VERSION b/macros/context/contrib/context-pocketdiary/VERSION
index 97060b2f65..faab976b2f 100644
--- a/macros/context/contrib/context-pocketdiary/VERSION
+++ b/macros/context/contrib/context-pocketdiary/VERSION
@@ -1 +1 @@
-2023.03.17 \ No newline at end of file
+2023.04.15
diff --git a/macros/context/contrib/context-pocketdiary/doc/context/third/pocketdiary/README.md b/macros/context/contrib/context-pocketdiary/doc/context/third/pocketdiary/README.md
index f26c09d48f..d7d6c333a6 100644
--- a/macros/context/contrib/context-pocketdiary/doc/context/third/pocketdiary/README.md
+++ b/macros/context/contrib/context-pocketdiary/doc/context/third/pocketdiary/README.md
@@ -1,12 +1,13 @@
-Modulename : t-pocketdiary
+# Modulename : t-pocketdiary
+
+## Editorial
+
Author : Willi Egger
License : Public Domain
-Version : 2.5
-Release date: March 2023
+Version : 2023-04-15
-Description
------------
+## Description
For those who are in need of a personal organizer this module offers a flexible solution based on a single sided printed A4. The pocket diary can be folded in such a way, that it forms a small booklet where only the printed pages are visible (see documentation).
@@ -17,8 +18,7 @@ Please refer to the documentation for further options.
This module is a overhauled version of the previous module. It is built for the use with MKIV and LUAMETATEX (LMTX). In addition to the first version it is also calculating moon cycle and the sunrise and sunset time.
-Usage
------
+## Usage
Create a file e.g. PocketDiary.tex
@@ -87,10 +87,12 @@ Create a file e.g. PocketDiary.tex
[lat=Latitude of your place,
lon=Longitude of your place,
timeoffset=Timezone (positive to the East, negative to the West from UTC),
- continent=EU]
+ continent=EU] % US, empty for no Daylight Saving Time (DST)
% Do the typesetting
\starttext
\setuparranging[1*8] % this can be uncommented in t-pocketdiary.tex
\getbuffer[Pocketdiary]
-\stoptext \ No newline at end of file
+\stoptext
+
+
diff --git a/macros/context/contrib/context-pocketdiary/doc/context/third/pocketdiary/t-pocketdiary-module-doc.pdf b/macros/context/contrib/context-pocketdiary/doc/context/third/pocketdiary/t-pocketdiary-module-doc.pdf
index de63406602..542bfe8a76 100644
--- a/macros/context/contrib/context-pocketdiary/doc/context/third/pocketdiary/t-pocketdiary-module-doc.pdf
+++ b/macros/context/contrib/context-pocketdiary/doc/context/third/pocketdiary/t-pocketdiary-module-doc.pdf
Binary files differ
diff --git a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Moonphase/moons-MP.tex b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Moonphase/moons-MP.tex
index a515e6db64..f5817bd2eb 100644
--- a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Moonphase/moons-MP.tex
+++ b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Moonphase/moons-MP.tex
@@ -1,6 +1,13 @@
-% Metafun
-% filename: moons.tex
-% Boede 2021
+%D \module
+%D [ file=t-pocketdiary,
+%D version=2023-04-15,
+%D title=PocketDiary \CONTEXT\ User Module,
+%D subtitle=Moon pictogrammes,
+%D author=Willi Egger,
+%D date=\currentdate,
+%D copyright=Willi Egger,
+%D email=w.egger@boede.nl,
+%D license=Public Domain]
% \setupbodyfont[plex,ss,14pt]
diff --git a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Moonphase/t-moonphase.lua b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Moonphase/t-moonphase.lua
index 70d644e3b7..2c6e5c3ba8 100644
--- a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Moonphase/t-moonphase.lua
+++ b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Moonphase/t-moonphase.lua
@@ -1,5 +1,5 @@
if not modules then modules = { } end modules ['t-moonphase'] = {
- version = 1.0,
+ version = 2023.04.15,
comment = "Moonphase calculation",
author = "SubSystems www.subsystems.us edited by Willi Egger",
copyright = "Willi Egger",
diff --git a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/PocketDiary.tex b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/PocketDiary.tex
index 9f21c68e6e..fb2172fc6c 100644
--- a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/PocketDiary.tex
+++ b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/PocketDiary.tex
@@ -1,27 +1,38 @@
-% Context file
-% Filename: PocketDiary.tex
-%
-% Version 1: 30-12-2010
-% Version 2: December-2022
-%
-% This is the base for the compilation of a PocketDiary.
-% Please refer to the documentation of the module to see
-% which options you have to make up your own layout for the PocketDiary
-% This module is built for usage withKIV and LUAMETATEX (LMTX)
-
-
+%D \module
+%D [ file=t-pocketdiary.tex,
+%D version=2023.04.15,
+%D title=PocketDiary,
+%D subtitle=User file for PocketDiary,,
+%D author=W. Egger,
+%D date=\currentdate,
+%D copyright=W. Egger,
+%D license=Public Domain]
+
+
+%D This is the base for the compilation of a PocketDiary.
+%D Please refer to the documentation of the module to see
+%D which options you have to make up your own layout for the PocketDiary
+%D This module is built for usage withKIV and LUAMETATEX (LMTX)
+
+%D Load the PocketDiary module
\usemodule[pocketdiary]
+%D Choose and setup the desired font to be used
+
\setupbodyfont[ibmplex,rm,8pt]
\definefontfeature[f:tabular][tnum=yes]
\addfeature[f:tabular]
-% Supported interfaces: en,de,nl,fr,it,es,pl
+%D Set the main language, which sets the interface to be used. Supported interfaces: EN,DE,NL,FR,IT,ES,PL
-\mainlanguage[pl]
+\mainlanguage[en]
-%\setuppapersize[A6][A4,landscape]
+%D setup the paper size and mapping onto the print paper
+
+\setuppapersize[A6][A4,landscape]
+
+%D Setup of the different variable sets of the PocketDiary
\setvariables
[PocketDiary]
@@ -32,9 +43,9 @@
Nextyear=yes,
Daybyday=no]
-% If "Daybyday = yes" then the first 6 pages are filled with 5 times a single
-% day and the weekend is 1 page. The pages 7 and 8 are filled with what is set
-% in PockedDiaryLayout for page 7 and 8.
+%D If "Daybyday = yes" then the first 6 pages are filled with 5 times a single
+%D day and the weekend is 1 page. The pages 7 and 8 are filled with what is set
+%D in PockedDiaryLayout for page 7 and 8.
\setvariables
[PocketDiaryLayout]
@@ -48,34 +59,37 @@
Page8=Lost-Returnto]
-% Names of included templates: You are allowed to use the same template on multiple pages.
-% Dayplan
-% Weekcurrentplan
-% Weekendplan
-% Weeknextplan
-% Monthcurrentplan
-% Monthnextplan
-% Yearcurrentplan
-% Yearnextplan
-% Lines
-% Blank
-% Caro
-% Todo
-% Contact
-% Lost-Returnto
+%D Names of included templates: You are allowed to use the same template
+%D on multiple pages.
+%D \startlines
+%D Dayplan
+%D Weekcurrentplan
+%D Weekendplan
+%D Weeknextplan
+%D Monthcurrentplan
+%D Monthnextplan
+%D Yearcurrentplan
+%D Yearnextplan
+%D Lines
+%D Blank
+%D Caro
+%D Todo
+%D Contact
+%D Lost-Returnto
+%D \stoplines
\setvariables
[PocketDiaryAddress]
- [Familyname={2023},
- Forename={Bacho\TEX\ },
- Street={Ośrodek szkoleniowo - wypoczynkowy Uniwersytetu Mikołaja Kopernika},
- Zipcode=87-313,
- City=Brzozie,
- Country=Polska,
+ [Familyname={YourFamilyName},
+ Forename={YourFirstName},
+ Street=Pine Lane
+ Zipcode=2080,
+ City=YourTown,
+ Country=YourCountry,
Phone={\dots},
Mobile={\dots},
- E-mail=sekretariat@gust.org.pl,
- Web={https://www.gust.org.pl/}]
+ E-mail={\dots},
+ Web={\dots}]
\setvariables
[PocketDiaryFooter]
@@ -91,13 +105,15 @@
\setvariables %Dreifelden
[PocketDiaryGeoPosition]
- [lat=52.467860, %Dreifelden: lat=50.590494, lon=7.835367,
+ [lat=52.467860,
lon=16.981240,
timezoneoffset=1,
continent=US] % EU, US or leave empty for no DST
-
+
+%D Setup the document
\starttext
\setuparranging[1*8] % this can be uncommented in t-pocketdiary.tex
+
\getbuffer[Pocketdiary]
\stoptext \ No newline at end of file
diff --git a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Solar/sun-MP.tex b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Solar/sun-MP.tex
index 3eca68a8c9..0ccd8923cc 100644
--- a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Solar/sun-MP.tex
+++ b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Solar/sun-MP.tex
@@ -1,6 +1,13 @@
-% Metafun
-% filename: moons.tex
-% Boede 2021
+%D \module
+%D [ file=t-pocketdiary,
+%D version=2023-04-15,
+%D title=PocketDiary \CONTEXT\ User Module,
+%D subtitle=Sun pictogrammes,
+%D author=Willi Egger,
+%D date=\currentdate,
+%D copyright=Willi Egger,
+%D email=w.egger@boede.nl,
+%D license=Public Domain]
% \setupbodyfont[plex,ss,14pt]
diff --git a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Solar/t-solar.lua b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Solar/t-solar.lua
index eb6756aaa6..98f4c585aa 100644
--- a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Solar/t-solar.lua
+++ b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Solar/t-solar.lua
@@ -1,5 +1,5 @@
if not modules then modules = { } end modules ['t-solar'] = {
- version = 1.0,
+ version = 2023.04.15,
comment = "Sun rise and sun set calculation",
author = "Alexander Yakushev, edited by Willi Egger",
copyright = "Willi Egger",
diff --git a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-calendar.lua b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-calendar.lua
index 2c15fcc424..7f94397351 100644
--- a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-calendar.lua
+++ b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-calendar.lua
@@ -1,5 +1,5 @@
if not modules then modules = { } end modules ['t-calendar'] = {
- version = 1.100,
+ version = 2023.04.15,
comment = "Date calculation collection",
author = "Willi Egger",
copyright = "Willi Egger",
diff --git a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-pocketdiary.lua b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-pocketdiary.lua
index 843a3e510b..fe893d3f7e 100644
--- a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-pocketdiary.lua
+++ b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-pocketdiary.lua
@@ -1,10 +1,10 @@
if not modules then modules = { } end modules ['t-pocketdiary'] = {
- version = 1.0,
+ version = 2023.04.15,
comment = "Layouts of diary pages",
author = "Willi Egger",
copyright = "Willi Egger",
email = "w.egger@boede.nl",
- license = "CC0 http://creativecommons.org/about/cc0"
+ license = "Public Domain"
}
thirddata = thirddata or { }
diff --git a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-pocketdiary.tex b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-pocketdiary.tex
index 22bfda6241..0c84937223 100644
--- a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-pocketdiary.tex
+++ b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-pocketdiary.tex
@@ -1,7 +1,7 @@
%D \module
%D [ file=t-pocketdiary,
-%D version=2022.07.05,
-%D title=\CONTEXT\ User Module,
+%D version=2023-04-15,
+%D title=PocketDiary \CONTEXT\ User Module,
%D subtitle=PocketDiary,
%D author=Willi Egger,
%D date=\currentdate,
@@ -976,8 +976,8 @@
\startsetups table:topinfo
\setupTABLE[each][each][frame=off]
\setupTABLE[r][1][offset=0pt,loffset=1pt,roffset=1pt,align=lohi] % Date row
- \setupTABLE[r][2][height=1.3\bodyfontsize] % Astronomy row
- \setupTABLE[c][1][style=bold,width=0.25\textwidth,align=lohi] % Day
+ \setupTABLE[r][2][height=1.3\bodyfontsize,frame=off,offset=0pt] % Astronomy row
+ \setupTABLE[c][1][style=bold,width=0.25\textwidth] % Day
\setupTABLE[c][2][width=0.35\textwidth,align=lohi] % Feastname column
\setupTABLE[c][3][width=0.4\textwidth,
align={flushright,lohi}] % Month / year column
diff --git a/macros/latex/contrib/lettrine/README.md b/macros/latex/contrib/lettrine/README.md
index f62a7c20c6..57f41e59ff 100644
--- a/macros/latex/contrib/lettrine/README.md
+++ b/macros/latex/contrib/lettrine/README.md
@@ -9,10 +9,10 @@ This package is meant for typesetting dropped capitals in LaTeX documents.
Documentation
-------------
-Have a look at one of the PDF files, demo-fr.pdf (in French),
-demo-de.pdf (in German) or demo-lua.pdf in the doc directory,
-to see how different layouts for dropped capitals can be achieved.
-You can also play with the source files demo-*.tex.
+Have a look at one of the PDF files, lettrine-demo-fr.pdf (in French),
+lettrine-demo-de.pdf (in German) or lettrine-demo-lua.pdf in the doc
+directory, to see different layouts for dropped capitals.
+You can also play with the source files lettrine-demo-*.tex.
Have a look at lettrine.pdf in the doc directory, if you are interested
in the complete documentation and code.
@@ -31,20 +31,24 @@ Installation
This bundle is included in most TeX distributions, but if you need
to install it by yourself
-1. run lualatex on lettrine.dtx to get the documentation (lettrine.pdf);
-2. run luatex on lettrine.ins to strip the comments and create
+1. run luatex on lettrine.dtx to strip the comments and create
lettrine.sty and lettrine.cfg;
-3. run luatex on contrib.dtx to produce the *.cfl files.
+2. run lualatex on lettrine.dtx to get the documentation (lettrine.pdf).
Files lettrine.sty, lettrine.cfg, lettrine-*.sty and *.cfl go to to
a directory searched by TeX, typically $TEXMF/tex/latex/lettrine.
-Files README, demo*, *.pdf go to a doc directory, typically
-$TEXMF/doc/latex/lettrine.
+Files README, lettrine-demo*, lettrine.pdf go to a doc directory,
+typically $TEXMF/doc/latex/lettrine.
-Files *.dtx, *.ins go to a source directory, typically
+Files lettrine.dtx goes to a source directory, typically
$TEXMF/source/latex/lettrine
+Changes
+-------
+
+See the included manual lettrine.pdf, section "Change History".
+
--
-Copyright 1999--2022 Daniel Flipo
+Copyright 1999--2023 Daniel Flipo
E-mail: daniel (dot) flipo (at) free (dot) fr
diff --git a/macros/latex/contrib/lettrine/contrib.dtx b/macros/latex/contrib/lettrine/contrib.dtx
deleted file mode 100644
index 63d23d094b..0000000000
--- a/macros/latex/contrib/lettrine/contrib.dtx
+++ /dev/null
@@ -1,376 +0,0 @@
-% \iffalse meta-comment
-%
-% This program can be distributed and/or modified under the terms
-% of the LaTeX Project Public License either version 1.3c of this
-% license or (at your option) any later version.
-% The latest version of this license is in
-% http://www.latex-project.org/lppl.txt
-% and version 1.3c or later is part of all distributions of LaTeX
-% version 2005/12/01 or later.
-%
-% This file has the LPPL maintenance status "maintained".
-%
-% \fi
-%
-% \iffalse
-%<*opt>
-% \fi
-% \begin{macrocode}
-%% This is an example of config file *for syntax only*.
-%%
-%% Copy it to your document's directory and add
-%% \renewcommand{\DefaultOptionsFile}{optfile.cfl}
-%% to your document's preamble to use it.
-%%
-%% The settings below are just *examples*, they are not meant to be good!
-%% Proper values heavily depend on the font used!
-%%
-%% Letters not listed below, will get either the default parameters,
-%% or those given as optional argument of \lettrine, if any.
-%%
-%% The values of the parameters set in this file can be overridden locally
-%% using the optional argument of \lettrine.
-%%
-%% A
-\LettrineOptionsFor{A}{slope=0.1\LettrineWidth, findent=-.5em, nindent=.7em}
-%% Same parameters for À (utf-8)
-\LettrineOptionsFor{À}{slope=0.1\LettrineWidth, findent=-.5em, nindent=0.7em}
-%% C'
-\LettrineOptionsFor{C'}{nindent=-0.5em}
-%% I and J hang into the margin
-\LettrineOptionsFor{I}{lhang=1, nindent=0pt}
-\LettrineOptionsFor{J}{lhang=1, nindent=0pt}
-%% Q
-\LettrineOptionsFor{Q}{loversize=-0.1, lraise=0.1}
-%% V
-\LettrineOptionsFor{V}{slope=-0.1\LettrineWidth, lhang=0.5, nindent=0pt}
-% \end{macrocode}
-% \iffalse
-%</opt>
-% \fi
-%
-% \iffalse
-%<*pzc2>
-% \fi
-% \begin{macrocode}
-%%% This is file `pzc2.cfl'.
-%%% It is provided under the LPPL. Copyright is held by Kevin M. Dunn.
-%%% If you modify this file you *MUST* change its name.
-
-%%% This file contains config values to simplify the use of the
-%%% Zapf-Chancery (aka pzc) font with the lettrine package by Daniel Flipo.
-%%% This file provides the parameters for 2 DefaultLines.
-
-%%% If you want to use this file, your document should contain
-%%% the next three lines, without the leading percent signs.
-%%% \setcounter{DefaultLines}{2}
-%%% \renewcommand\LettrineFontHook{\fontencoding{T1}\fontfamily{pzc}\selectfont}
-%%% \renewcommand{\DefaultOptionsFile}{pzc2.cfl}
-
-%%% Comments about this file can be sent to Kevin Dunn
-%%% (cavema2 at cavemanchemistry.com)
-
-\ProvidesFile{pzc2.cfl}[2006/03/19 v0.1 Kevin M. Dunn]
-
-\LettrineOptionsFor{A}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.05\LettrineWidth,nindent= 0.25\LettrineWidth}
-\LettrineOptionsFor{B}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.10\LettrineWidth,nindent= 0.08\LettrineWidth}
-\LettrineOptionsFor{C}{loversize= 0.35,lraise= 0.10,lhang= 0.35,findent= 0.00\LettrineWidth,nindent= 0.28\LettrineWidth}
-\LettrineOptionsFor{D}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.15\LettrineWidth,nindent= 0.05\LettrineWidth}
-\LettrineOptionsFor{E}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.00\LettrineWidth,nindent= 0.28\LettrineWidth}
-\LettrineOptionsFor{F}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.10\LettrineWidth,nindent= 0.00\LettrineWidth}
-\LettrineOptionsFor{G}{loversize= 0.35,lraise= 0.10,lhang= 0.35,findent= 0.10\LettrineWidth,nindent= 0.17\LettrineWidth}
-\LettrineOptionsFor{H}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.10\LettrineWidth,nindent= 0.20\LettrineWidth}
-\LettrineOptionsFor{I}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.05\LettrineWidth,nindent= 0.25\LettrineWidth}
-\LettrineOptionsFor{J}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.15\LettrineWidth,nindent= 0.00\LettrineWidth}
-\LettrineOptionsFor{K}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.05\LettrineWidth,nindent= 0.13\LettrineWidth}
-\LettrineOptionsFor{L}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=-0.02\LettrineWidth,nindent= 0.30\LettrineWidth}
-\LettrineOptionsFor{M}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.05\LettrineWidth,nindent= 0.15\LettrineWidth}
-\LettrineOptionsFor{N}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.10\LettrineWidth,nindent= 0.10\LettrineWidth}
-\LettrineOptionsFor{O}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.15\LettrineWidth,nindent= 0.08\LettrineWidth}
-\LettrineOptionsFor{P}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.25\LettrineWidth,nindent= 0.05\LettrineWidth}
-\LettrineOptionsFor{Q}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.15\LettrineWidth,nindent= 0.10\LettrineWidth}
-\LettrineOptionsFor{R}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.08\LettrineWidth,nindent= 0.15\LettrineWidth}
-\LettrineOptionsFor{S}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.10\LettrineWidth,nindent= 0.13\LettrineWidth}
-\LettrineOptionsFor{T}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.05\LettrineWidth,nindent= 0.20\LettrineWidth}
-\LettrineOptionsFor{U}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.05\LettrineWidth,nindent= 0.15\LettrineWidth}
-\LettrineOptionsFor{V}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.18\LettrineWidth,nindent=-0.15\LettrineWidth}
-\LettrineOptionsFor{W}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.15\LettrineWidth,nindent=-0.05\LettrineWidth}
-\LettrineOptionsFor{X}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.00\LettrineWidth,nindent= 0.35\LettrineWidth}
-\LettrineOptionsFor{Y}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.10\LettrineWidth,nindent= 0.05\LettrineWidth}
-\LettrineOptionsFor{Z}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.00\LettrineWidth,nindent= 0.30\LettrineWidth}
-% \end{macrocode}
-% \iffalse
-%</pzc2>
-% \fi
-%
-% \iffalse
-%<*pzc3>
-% \fi
-% \begin{macrocode}
-%%% This is file `pzc3.cfl'.
-%%% It is provided under the LPPL. Copyright is held by Kevin M. Dunn.
-%%% If you modify this file you *MUST* change its name.
-
-%%% This file contains config values to simplify the use of the
-%%% Zapf-Chancery (aka pzc) font with the lettrine package by Daniel Flipo.
-%%% This file provides the parameters for 3 DefaultLines.
-
-%%% If you want to use this file, your document should contain
-%%% the next three lines, without the leading percent signs.
-%%% \setcounter{DefaultLines}{3}
-%%% \renewcommand\LettrineFontHook{\fontencoding{T1}\fontfamily{pzc}\selectfont}
-%%% \renewcommand{\DefaultOptionsFile}{pzc3.cfl}
-
-%%% Comments about this file can be sent to Kevin Dunn
-%%% (cavema2 at cavemanchemistry.com)
-
-\ProvidesFile{pzc3.cfl}[2006/03/19 v0.1 Kevin M. Dunn]
-
-\LettrineOptionsFor{A}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.05\LettrineWidth,nindent= 0.25\LettrineWidth}
-\LettrineOptionsFor{B}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.10\LettrineWidth,nindent= 0.08\LettrineWidth,slope=-0.08\LettrineWidth}
-\LettrineOptionsFor{C}{loversize= 0.35,lraise= 0.10,lhang= 0.35,findent=0.00\LettrineWidth,nindent= 0.28\LettrineWidth}
-\LettrineOptionsFor{D}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.15\LettrineWidth,nindent= 0.05\LettrineWidth,slope=-0.05\LettrineWidth}
-\LettrineOptionsFor{E}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.00\LettrineWidth,nindent= 0.28\LettrineWidth}
-\LettrineOptionsFor{F}{loversize= 0.35,lraise= 0.05,lhang= 0.35,findent=0.10\LettrineWidth,nindent= 0.00\LettrineWidth}
-\LettrineOptionsFor{G}{loversize= 0.30,lraise= 0.30,lhang= 0.5,findent=0.10\LettrineWidth,nindent= 0.15\LettrineWidth}
-\LettrineOptionsFor{H}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.10\LettrineWidth,nindent= 0.20\LettrineWidth}
-\LettrineOptionsFor{I}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.05\LettrineWidth,nindent= 0.25\LettrineWidth}
-\LettrineOptionsFor{J}{loversize= 0.35,lraise= 0.05,lhang= 0.35,findent=0.15\LettrineWidth,nindent= 0.00\LettrineWidth}
-\LettrineOptionsFor{K}{loversize= 0.30,lraise= 0.20,lhang= 0.35,findent=0.05\LettrineWidth,nindent= 0.13\LettrineWidth,slope= 0.20\LettrineWidth}
-\LettrineOptionsFor{L}{loversize= 0.35,lraise= 0.00,lhang=0.35,findent=-0.02\LettrineWidth,nindent= 0.30\LettrineWidth}
-\LettrineOptionsFor{M}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.05\LettrineWidth,nindent= 0.15\LettrineWidth}
-\LettrineOptionsFor{N}{loversize= 0.30,lraise= 0.20,lhang= 0.35,findent=0.10\LettrineWidth,nindent= 0.10\LettrineWidth,slope= 0.20\LettrineWidth}
-\LettrineOptionsFor{O}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.15\LettrineWidth,nindent= 0.08\LettrineWidth}
-\LettrineOptionsFor{P}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.25\LettrineWidth,nindent= 0.05\LettrineWidth}
-\LettrineOptionsFor{Q}{loversize= 0.30,lraise= 0.25,lhang= 0.35,findent=0.15\LettrineWidth,nindent= 0.10\LettrineWidth,slope= 0.20\LettrineWidth}
-\LettrineOptionsFor{R}{loversize= 0.30,lraise= 0.20,lhang= 0.35,findent=0.08\LettrineWidth,nindent= 0.15\LettrineWidth,slope= 0.20\LettrineWidth}
-\LettrineOptionsFor{S}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.10\LettrineWidth,nindent= 0.13\LettrineWidth}
-\LettrineOptionsFor{T}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.05\LettrineWidth,nindent= 0.20\LettrineWidth}
-\LettrineOptionsFor{U}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.05\LettrineWidth,nindent= 0.15\LettrineWidth}
-\LettrineOptionsFor{V}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.18\LettrineWidth,nindent=-0.05\LettrineWidth,slope=-0.15\LettrineWidth}
-\LettrineOptionsFor{W}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.18\LettrineWidth,nindent=-0.05\LettrineWidth,slope=-0.10\LettrineWidth}
-\LettrineOptionsFor{X}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.00\LettrineWidth,nindent= 0.35\LettrineWidth}
-\LettrineOptionsFor{Y}{loversize= 0.30,lraise= 0.10,lhang= 0.40,findent=0.10\LettrineWidth,nindent= 0.00\LettrineWidth,slope=-0.10\LettrineWidth}
-\LettrineOptionsFor{Z}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.00\LettrineWidth,nindent= 0.30\LettrineWidth}
-% \end{macrocode}
-% \iffalse
-%</pzc3>
-% \fi
-%
-% \iffalse
-%<*pacl>
-% \fi
-% \begin{macrocode}
-%%% This is file `pacl.cfl'.
-%%% It is provided under the LPPL. Copyright is hold by Pascal Kockaert.
-%%% If you modify this file you *MUST* change its name.
-
-%%% This file contains config values to simplify the use of the
-%%% ACaslon-SwashItalic (aka pacri8s) font from Adobe
-%%% with the lettrine package by Daniel Flipo.
-
-%%% If you want to use this file, your document should contain
-%%% the two next lines, without the leading percent signs.
-%%% \renewcommand\LettrineFontHook{\fontencoding{T1}\fontfamily{pacl}\selectfont}
-%%% \renewcommand{\DefaultOptionsFile}{pacl.cfl}
-
-%%% The fontfamily pacl is defined through the file T1pacl.fd.
-%%% The contents of T1pacl.fd is listed at the end of this file.
-
-%%% The settings below were defined according to my visual tastes.
-%%% No mathematical rule based on the metrices was applied.
-%%% Though the result may not please you, it should be better
-%%% than the default placement. This said, comments are welcome.
-
-%%% Comments about this file can be sent to Pascal.Kockaert
-%%% at the mail server ulb.ac.be.
-
-\ProvidesFile{pacl.cfl}[2003/08/24 v0.1 Pascal Kockaert]
-
-\LettrineOptionsFor{A}{loversize= 0.15,lraise= 0.02,lhang= 0.30,findent= 0.00\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{B}{loversize= 0.15,lraise= 0.00,lhang= 0.25,findent=-0.05\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{C}{loversize=-0.10,lraise= 0.25,lhang= 0.05,findent= 0.00\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{D}{loversize= 0.15,lraise= 0.00,lhang= 0.20,findent=-0.07\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{E}{loversize= 0.15,lraise= 0.00,lhang= 0.05,findent=-0.10\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{F}{loversize=-0.10,lraise= 0.20,lhang= 0.00,findent= 0.05\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{G}{loversize=-0.10,lraise= 0.20,lhang= 0.05,findent=-0.05\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{H}{loversize= 0.05,lraise= 0.00,lhang= 0.25,findent= 0.00\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{I}{loversize= 0.15,lraise= 0.00,lhang= 0.00,findent= 0.00\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{J}{loversize=-0.10,lraise= 0.20,lhang= 0.00,findent= 0.00\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{K}{loversize=-0.10,lraise= 0.25,lhang= 0.00,findent= 0.00\LettrineWidth,nindent= 0.45\LettrineWidth}
-\LettrineOptionsFor{L}{loversize= 0.00,lraise= 0.20,lhang= 0.00,findent=-0.10\LettrineWidth,nindent= 0.40\LettrineWidth}
-\LettrineOptionsFor{M}{loversize= 0.15,lraise= 0.00,lhang= 0.24,findent=-0.05\LettrineWidth,nindent= 0.10\LettrineWidth}
-\LettrineOptionsFor{N}{loversize=-0.05,lraise= 0.25,lhang= 0.13,findent= 0.05\LettrineWidth,nindent= 0.35\LettrineWidth}
-\LettrineOptionsFor{O}{loversize= 0.15,lraise= 0.00,lhang= 0.05,findent=-0.12\LettrineWidth,nindent= 0.15\LettrineWidth}
-\LettrineOptionsFor{P}{loversize= 0.15,lraise= 0.00,lhang= 0.25,findent= 0.00\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{Q}{loversize=-0.15,lraise= 0.25,lhang= 0.10,findent=-0.05\LettrineWidth,nindent= 0.55\LettrineWidth}
-\LettrineOptionsFor{R}{loversize=-0.15,lraise= 0.25,lhang= 0.20,findent=-0.05\LettrineWidth,nindent= 0.45\LettrineWidth}
-\LettrineOptionsFor{S}{loversize=-0.10,lraise= 0.25,lhang=-0.05,findent=-0.05\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{T}{loversize= 0.15,lraise= 0.00,lhang= 0.15,findent= 0.00\LettrineWidth,nindent= 0.15\LettrineWidth}
-\LettrineOptionsFor{U}{loversize= 0.15,lraise= 0.00,lhang= 0.05,findent= 0.00\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{V}{loversize= 0.15,lraise= 0.00,lhang= 0.20,findent=-0.05\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{W}{loversize= 0.15,lraise= 0.00,lhang= 0.15,findent=-0.05\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{X}{loversize= 0.15,lraise= 0.00,lhang= 0.45,findent= 0.05\LettrineWidth,nindent= 0.15\LettrineWidth}
-\LettrineOptionsFor{Y}{loversize= 0.15,lraise= 0.00,lhang= 0.05,findent= 0.20\LettrineWidth,nindent= 0.25\LettrineWidth}
-\LettrineOptionsFor{Z}{loversize= 0.05,lraise= 0.15,lhang= 0.15,findent= 0.00\LettrineWidth,nindent= 0.30\LettrineWidth}
-\let\EOF\endinput
-\EOF
-
-%% The installation of the pacl family can be performed using the
-%% fontinst package.
-%% You must own the font ACaslon-SwashItalic, that is an AFM and a PFB file
-%% which should be renamed as padri8w.afm and padri8w.pfb.
-
-%% You should process the file Makepacl.tex (see below) through TeX,
-%% and follow the instructions of the fontinst manual to finish the install.
-%% The file T1pacl.fd should be defined as below and put with other local
-%% FD files.
-
-%%% File Makepacl.tex
-\input fontinst.sty
-\installfonts
- \declareencoding{T1-SWASH}{T1}
- \fromafm{pacri8s} %%% File containing metrics of ACaslon-SwashItalic
- \installfont{pacri9s}{pacri8s}{T1}{T1}{pacl}{m}{n}{}
-\endinstallfonts
-\bye
-%%% End of file Makepacl.tex
-
-%%% The pacl family is defined by the file T1pacl.fd, as follows
-
-%%% File T1pacl.fd
-%%% THIS FILE SHOULD BE PUT IN A TEX INPUTS DIRECTORY
-\ProvidesFile{t1pacl.fd}[2003/08/24 v1.0 Pascal Kockaert]
-\DeclareFontFamily{T1}{pacl}{}
-\DeclareFontShape{T1}{pacl}{m}{n}{<->pacri9s}{}
-%%% End of file T1pacl.fd
-% \end{macrocode}
-% \iffalse
-%</pacl>
-% \fi
-%
-% \iffalse
-%<*padl>
-% \fi
-% \begin{macrocode}
-%%% This is file `padl.cfl'.
-%%% It is provided under the LPPL. Copyright is hold by Pascal Kockaert.
-%%% If you modify this file you *MUST* change its name.
-
-%%% This file contains config values to simplify the use of the
-%%% AGaramondAlt-Italic (aka padri8w) font from Adobe
-%%% with the lettrine package by Daniel Flipo.
-
-%%% If you want to use this file, your document should contain
-%%% the two next lines, without the leading percent signs.
-%%% \renewcommand\LettrineFontHook{\fontencoding{T1}\fontfamily{padl}\selectfont}
-%%% \renewcommand{\DefaultOptionsFile}{padl.cfl}
-
-%%% The fontfamily padl is defined through the file T1padl.fd.
-%%% The contents of T1padl.fd is listed at the end of this file.
-
-%%% The settings below were defined according to my visual tastes.
-%%% No mathematical rule based on the metrices was applied.
-%%% Though the result may not please you, it should be better
-%%% than the default placement. This said, comments are welcome.
-
-%%% Comments about this file can be sent to Pascal.Kockaert
-%%% at the mail server ulb.ac.be.
-
-\ProvidesFile{padl.cfl}[2003/08/24 v1.0 Pascal Kockaert]
-
-\LettrineOptionsFor{A}{loversize= 0.05,lraise= 0.10,lhang= 0.40,findent= 0.000\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{B}{loversize= 0.10,lraise= 0.00,lhang= 0.30,findent= 0.025\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{C}{loversize= 0.00,lraise= 0.10,lhang= 0.15,findent= 0.175\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{D}{loversize= 0.10,lraise= 0.00,lhang= 0.30,findent=-0.025\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{E}{loversize= 0.10,lraise= 0.00,lhang= 0.10,findent= 0.100\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{F}{loversize= 0.10,lraise= 0.00,lhang= 0.30,findent= 0.100\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{G}{loversize=-0.08,lraise= 0.20,lhang= 0.10,findent= 0.000\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{H}{loversize=-0.01,lraise= 0.00,lhang= 0.00,findent= 0.040\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{I}{loversize= 0.10,lraise= 0.00,lhang= 0.00,findent= 0.050\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{J}{loversize=-0.08,lraise= 0.20,lhang= 0.00,findent=-0.025\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{K}{loversize=-0.05,lraise= 0.25,lhang= 0.00,findent=-0.050\LettrineWidth,nindent= 0.60\LettrineWidth}
-\LettrineOptionsFor{L}{loversize= 0.00,lraise= 0.20,lhang= 0.00,findent= 0.100\LettrineWidth,nindent= 0.40\LettrineWidth}
-\LettrineOptionsFor{M}{loversize= 0.10,lraise= 0.00,lhang= 0.40,findent= 0.040\LettrineWidth,nindent= 0.10\LettrineWidth}
-\LettrineOptionsFor{N}{loversize= 0.00,lraise= 0.20,lhang= 0.20,findent=-0.010\LettrineWidth,nindent= 0.40\LettrineWidth}
-\LettrineOptionsFor{O}{loversize= 0.10,lraise= 0.00,lhang= 0.20,findent=-0.010\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{P}{loversize= 0.10,lraise= 0.00,lhang= 0.30,findent= 0.050\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{Q}{loversize= 0.00,lraise= 0.20,lhang= 0.20,findent= 0.050\LettrineWidth,nindent= 0.70\LettrineWidth}
-\LettrineOptionsFor{R}{loversize=-0.05,lraise= 0.25,lhang= 0.25,nindent= 0.500\LettrineWidth,nindent= 0.50\LettrineWidth}
-\LettrineOptionsFor{S}{loversize= 0.10,lraise= 0.05,lhang= 0.00,findent= 0.000\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{T}{loversize= 0.10,lraise= 0.00,lhang= 0.35,findent= 0.100\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{U}{loversize= 0.10,lraise= 0.00,lhang= 0.20,findent= 0.050\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{V}{loversize= 0.10,lraise= 0.00,lhang= 0.40,findent= 0.050\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{W}{loversize= 0.10,lraise= 0.00,lhang= 0.30,findent= 0.040\LettrineWidth,nindent= 0.50em}
-\LettrineOptionsFor{X}{loversize= 0.10,lraise= 0.00,lhang= 0.40,findent= 0.040\LettrineWidth,nindent= 0.20\LettrineWidth}
-\LettrineOptionsFor{Y}{loversize= 0.10,lraise= 0.00,lhang= 0.20,findent= 0.100\LettrineWidth,nindent= 0.20\LettrineWidth}
-\LettrineOptionsFor{Z}{loversize=-0.05,lraise= 0.25,lhang= 0.00,findent= 0.050\LettrineWidth,nindent= 0.55\LettrineWidth}
-\let\EOF\endinput
-\EOF
-
-%% The installation of the padl family can be performed using the
-%% fontinst package.
-%% You must own the font AGaramondAlt-Italic, that is an AFM and a PFB
-%% file which should be renamed as padri8w.afm and padri8w.pfb.
-
-%% You should process the file Makepadl.tex (see below) through TeX,
-%% and follow the instructions of the fontinst manual to finish the
-%% install.
-%% The file T1padl.fd should be defined as below and put with other
-%% local FD files.
-
-%%% File Makepadl.tex
-\input fontinst.sty
-\installfonts
- \declareencoding{T1-SWASH}{T1}
- \fromafm{padri8w} %%% File containing metrics of AGaramondAlt-Italic
- \gdef\uc#1#2{#1swash}
- \installfont{padw9w}{padri8w}{T1}{T1}{padl}{m}{n}{}
-\endinstallfonts
-\bye
-%%% End of file Makepadl.tex
-
-%% The padl family is defined by the file T1padl.fd, as follows
-
-%%% File T1padl.fd
-%%% THIS FILE SHOULD BE PUT IN A TEX INPUTS DIRECTORY
-\ProvidesFile{t1padl.fd}[2003/08/24 v0.1 Pascal Kockaert]
-\DeclareFontFamily{T1}{padl}{}
-\DeclareFontShape{T1}{padl}{m}{n}{<->padw9w}{}
-%%% End of file T1padl.fd
-% \end{macrocode}
-% \iffalse
-%</padl>
-% \fi
-%
-% \iffalse
-%<*dtx>
-% \fi
-%%
-%% \CharacterTable
-%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
-%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
-%% Digits \0\1\2\3\4\5\6\7\8\9
-%% Exclamation \! Double quote \" Hash (number) \#
-%% Dollar \$ Percent \% Ampersand \&
-%% Acute accent \' Left paren \( Right paren \)
-%% Asterisk \* Plus \+ Comma \,
-%% Minus \- Point \. Solidus \/
-%% Colon \: Semicolon \; Less than \<
-%% Equals \= Greater than \> Question mark \?
-%% Commercial at \@ Left bracket \[ Backslash \\
-%% Right bracket \] Circumflex \^ Underscore \_
-%% Grave accent \` Left brace \{ Vertical bar \|
-%% Right brace \} Tilde \~}
-%%
-% \iffalse
-%</dtx>
-% \fi
-%
-% \Finale
-\endinput
-
-%%% Local Variables:
-%%% fill-column: 70
-%%% coding: utf-8
-%%% End:
diff --git a/macros/latex/contrib/lettrine/contrib.ins b/macros/latex/contrib/lettrine/contrib.ins
deleted file mode 100644
index 3762e5aef2..0000000000
--- a/macros/latex/contrib/lettrine/contrib.ins
+++ /dev/null
@@ -1,59 +0,0 @@
-%%
-%% Copyright (C) 1999-2020 Daniel Flipo.
-%%
-%% This program can be distributed and/or modified under the terms
-%% of the LaTeX Project Public License either version 1.3c of this
-%% license or (at your option) any later version.
-%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.3c or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
-%%
-%% This file will generate fast loadable files and documentation
-%% driver files from the doc files in this package when run through
-%% LaTeX or TeX.
-%%
-\def\batchfile{contrib.ins}
-\input docstrip.tex
-
-{\ifx\generate\undefined
-\Msg{**********************************************}
-\Msg{*}
-\Msg{* This installation requires docstrip}
-\Msg{* version 2.3c or later.}
-\Msg{*}
-\Msg{* An older version of docstrip has been input}
-\Msg{*}
-\Msg{**********************************************}
-\errhelp{Move or rename old docstrip.tex.}
-\errmessage{Old docstrip in input path}
-\batchmode
-\csname @@end\endcsname
-\fi}
-
-\keepsilent
-\askforoverwritefalse
-
-\usedir{tex/latex/lettrine}
-
-\nopreamble
-\generate{\file{optfile.cfl}{\from{contrib.dtx}{opt}}
- \usedir{tex/latex/lettrine/contrib}
- \file{pzc2.cfl}{\from{contrib.dtx}{pzc2}}
- \file{pzc3.cfl}{\from{contrib.dtx}{pzc3}}
- \nopostamble
- \file{pacl.cfl}{\from{contrib.dtx}{pacl}}
- \file{padl.cfl}{\from{contrib.dtx}{padl}}
- }
-
-\Msg{***********************************************************}
-\Msg{*}
-\Msg{* To finish the installation please move all the *.cfl}
-\Msg{* files to the contrib subdirectory of tex/latex/lettrine.}
-\Msg{*}
-\Msg{* Happy TeXing!}
-\Msg{*}
-\Msg{***********************************************************}
-
-\endbatchfile
-\endinput
diff --git a/macros/latex/contrib/lettrine/contrib/optfile.cfl b/macros/latex/contrib/lettrine/contrib/optfile.cfl
new file mode 100644
index 0000000000..407ed82c99
--- /dev/null
+++ b/macros/latex/contrib/lettrine/contrib/optfile.cfl
@@ -0,0 +1,28 @@
+%% This is an example of config file *for syntax only*.
+%% To use it, copy it to your document's directory and code
+%% \usepackage[optionsfile=optfile.cfl]{lettrine}
+%%
+%% The settings below are just *examples*, they are not meant to be good!
+%% Proper values heavily depend on the font used!
+%%
+%% Letters not listed below, will get either the default parameters,
+%% or those given as optional argument of \lettrine, if any.
+%%
+%% The values of the parameters set in this file can be overridden
+%% locally using the optional argument of \lettrine.
+
+%% A
+\LettrineOptionsFor{A}{slope=0.1\LettrineWidth, findent=-.5em, nindent=.7em}
+%% Same parameters for À (utf-8)
+\LettrineOptionsFor{À}{slope=0.1\LettrineWidth, findent=-.5em, nindent=0.7em}
+%% C'
+\LettrineOptionsFor{C'}{nindent=-0.5em}
+%% I and J hang into the margin
+\LettrineOptionsFor{I}{lhang=1, nindent=0pt}
+\LettrineOptionsFor{J}{lhang=1, nindent=0pt}
+%% Q
+\LettrineOptionsFor{Q}{loversize=0, lraise=0.1}
+%% V
+\LettrineOptionsFor{V}{slope=-0.1\LettrineWidth, lhang=0.5, nindent=0pt}
+
+\endinput
diff --git a/macros/latex/contrib/lettrine/contrib/pacl.cfl b/macros/latex/contrib/lettrine/contrib/pacl.cfl
new file mode 100644
index 0000000000..e8de17b6d6
--- /dev/null
+++ b/macros/latex/contrib/lettrine/contrib/pacl.cfl
@@ -0,0 +1,84 @@
+%%% This is file `pacl.cfl'.
+%%% It is provided under the LPPL. Copyright is hold by Pascal Kockaert.
+%%% If you modify this file you *MUST* change its name.
+%%%
+%%% This file contains config values to simplify the use of the
+%%% ACaslon-SwashItalic (aka pacri8s) font from Adobe
+%%% with the lettrine package by Daniel Flipo.
+%%%
+%%% If you want to use this file, your document should contain
+%%% the two next lines, without the leading percent signs.
+%%% \renewcommand\LettrineFontHook{\fontencoding{T1}\fontfamily{pacl}\selectfont}
+%%% \renewcommand{\DefaultOptionsFile}{pacl.cfl}
+%%%
+%%% The fontfamily pacl is defined through the file T1pacl.fd.
+%%% The contents of T1pacl.fd is listed at the end of this file.
+%%%
+%%% The settings below were defined according to my visual tastes.
+%%% No mathematical rule based on the metrices was applied.
+%%% Though the result may not please you, it should be better
+%%% than the default placement. This said, comments are welcome.
+%%%
+%%% Comments about this file can be sent to Pascal.Kockaert
+%%% at the mail server ulb.ac.be.
+
+
+\ProvidesFile{pacl.cfl}[2003/08/24 v0.1 Pascal Kockaert]
+\LettrineOptionsFor{A}{loversize= 0.15,lraise= 0.02,lhang= 0.30,findent= 0.00\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{B}{loversize= 0.15,lraise= 0.00,lhang= 0.25,findent=-0.05\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{C}{loversize=-0.10,lraise= 0.25,lhang= 0.05,findent= 0.00\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{D}{loversize= 0.15,lraise= 0.00,lhang= 0.20,findent=-0.07\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{E}{loversize= 0.15,lraise= 0.00,lhang= 0.05,findent=-0.10\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{F}{loversize=-0.10,lraise= 0.20,lhang= 0.00,findent= 0.05\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{G}{loversize=-0.10,lraise= 0.20,lhang= 0.05,findent=-0.05\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{H}{loversize= 0.05,lraise= 0.00,lhang= 0.25,findent= 0.00\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{I}{loversize= 0.15,lraise= 0.00,lhang= 0.00,findent= 0.00\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{J}{loversize=-0.10,lraise= 0.20,lhang= 0.00,findent= 0.00\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{K}{loversize=-0.10,lraise= 0.25,lhang= 0.00,findent= 0.00\LettrineWidth,nindent= 0.45\LettrineWidth}
+\LettrineOptionsFor{L}{loversize= 0.00,lraise= 0.20,lhang= 0.00,findent=-0.10\LettrineWidth,nindent= 0.40\LettrineWidth}
+\LettrineOptionsFor{M}{loversize= 0.15,lraise= 0.00,lhang= 0.24,findent=-0.05\LettrineWidth,nindent= 0.10\LettrineWidth}
+\LettrineOptionsFor{N}{loversize=-0.05,lraise= 0.25,lhang= 0.13,findent= 0.05\LettrineWidth,nindent= 0.35\LettrineWidth}
+\LettrineOptionsFor{O}{loversize= 0.15,lraise= 0.00,lhang= 0.05,findent=-0.12\LettrineWidth,nindent= 0.15\LettrineWidth}
+\LettrineOptionsFor{P}{loversize= 0.15,lraise= 0.00,lhang= 0.25,findent= 0.00\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{Q}{loversize=-0.15,lraise= 0.25,lhang= 0.10,findent=-0.05\LettrineWidth,nindent= 0.55\LettrineWidth}
+\LettrineOptionsFor{R}{loversize=-0.15,lraise= 0.25,lhang= 0.20,findent=-0.05\LettrineWidth,nindent= 0.45\LettrineWidth}
+\LettrineOptionsFor{S}{loversize=-0.10,lraise= 0.25,lhang=-0.05,findent=-0.05\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{T}{loversize= 0.15,lraise= 0.00,lhang= 0.15,findent= 0.00\LettrineWidth,nindent= 0.15\LettrineWidth}
+\LettrineOptionsFor{U}{loversize= 0.15,lraise= 0.00,lhang= 0.05,findent= 0.00\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{V}{loversize= 0.15,lraise= 0.00,lhang= 0.20,findent=-0.05\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{W}{loversize= 0.15,lraise= 0.00,lhang= 0.15,findent=-0.05\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{X}{loversize= 0.15,lraise= 0.00,lhang= 0.45,findent= 0.05\LettrineWidth,nindent= 0.15\LettrineWidth}
+\LettrineOptionsFor{Y}{loversize= 0.15,lraise= 0.00,lhang= 0.05,findent= 0.20\LettrineWidth,nindent= 0.25\LettrineWidth}
+\LettrineOptionsFor{Z}{loversize= 0.05,lraise= 0.15,lhang= 0.15,findent= 0.00\LettrineWidth,nindent= 0.30\LettrineWidth}
+\endinput
+
+
+% The installation of the pacl family can be performed using the fontinst
+% package.
+% You must own the font ACaslon-SwashItalic, that is an AFM and a PFB file
+% which should be renamed as padri8w.afm and padri8w.pfb.
+%
+% You should process the file Makepacl.tex (see below) through TeX,
+% and follow the instructions of the fontinst manual to finish the install.
+% The file T1pacl.fd should be defined as below and put with other local FD
+% files.
+
+%%% File Makepacl.tex
+\input fontinst.sty
+\installfonts
+ \declareencoding{T1-SWASH}{T1}
+ \fromafm{pacri8s} %%% File containing metrics of ACaslon-SwashItalic
+ \installfont{pacri9s}{pacri8s}{T1}{T1}{pacl}{m}{n}{}
+\endinstallfonts
+\bye
+%%% End of file Makepacl.tex
+
+% The pacl family is defined by the file T1pacl.fd, as follows
+
+%%% File T1pacl.fd
+%THIS FILE SHOULD BE PUT IN A TEX INPUTS DIRECTORY
+\ProvidesFile{t1pacl.fd}[2003/08/24 v1.0 Pascal Kockaert]
+\DeclareFontFamily{T1}{pacl}{}
+\DeclareFontShape{T1}{pacl}{m}{n}{<->pacri9s}{}
+\endinput
+%%% End of file T1pacl.fd
diff --git a/macros/latex/contrib/lettrine/contrib/padl.cfl b/macros/latex/contrib/lettrine/contrib/padl.cfl
new file mode 100644
index 0000000000..784bebc935
--- /dev/null
+++ b/macros/latex/contrib/lettrine/contrib/padl.cfl
@@ -0,0 +1,85 @@
+%%% This is file `padl.cfl'.
+%%% It is provided under the LPPL. Copyright is hold by Pascal Kockaert.
+%%% If you modify this file you *MUST* change its name.
+%%%
+%%% This file contains config values to simplify the use of the
+%%% AGaramondAlt-Italic (aka padri8w) font from Adobe
+%%% with the lettrine package by Daniel Flipo.
+%%%
+%%% If you want to use this file, your document should contain
+%%% the two next lines, without the leading percent signs.
+%%% \renewcommand\LettrineFontHook{\fontencoding{T1}\fontfamily{padl}\selectfont}
+%%% \renewcommand{\DefaultOptionsFile}{padl.cfl}
+%%%
+%%% The fontfamily padl is defined through the file T1padl.fd.
+%%% The contents of T1padl.fd is listed at the end of this file.
+%%%
+%%% The settings below were defined according to my visual tastes.
+%%% No mathematical rule based on the metrices was applied.
+%%% Though the result may not please you, it should be better
+%%% than the default placement. This said, comments are welcome.
+%%%
+%%% Comments about this file can be sent to Pascal.Kockaert
+%%% at the mail server ulb.ac.be.
+
+
+
+\ProvidesFile{padl.cfl}[2003/08/24 v1.0 Pascal Kockaert]
+
+\LettrineOptionsFor{A}{loversize= 0.05,lraise= 0.10,lhang= 0.40,findent= 0.000\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{B}{loversize= 0.10,lraise= 0.00,lhang= 0.30,findent= 0.025\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{C}{loversize= 0.00,lraise= 0.10,lhang= 0.15,findent= 0.175\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{D}{loversize= 0.10,lraise= 0.00,lhang= 0.30,findent=-0.025\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{E}{loversize= 0.10,lraise= 0.00,lhang= 0.10,findent= 0.100\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{F}{loversize= 0.10,lraise= 0.00,lhang= 0.30,findent= 0.100\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{G}{loversize=-0.08,lraise= 0.20,lhang= 0.10,findent= 0.000\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{H}{loversize=-0.01,lraise= 0.00,lhang= 0.00,findent= 0.040\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{I}{loversize= 0.10,lraise= 0.00,lhang= 0.00,findent= 0.050\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{J}{loversize=-0.08,lraise= 0.20,lhang= 0.00,findent=-0.025\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{K}{loversize=-0.05,lraise= 0.25,lhang= 0.00,findent=-0.050\LettrineWidth,nindent= 0.60\LettrineWidth}
+\LettrineOptionsFor{L}{loversize= 0.00,lraise= 0.20,lhang= 0.00,findent= 0.100\LettrineWidth,nindent= 0.40\LettrineWidth}
+\LettrineOptionsFor{M}{loversize= 0.10,lraise= 0.00,lhang= 0.40,findent= 0.040\LettrineWidth,nindent= 0.10\LettrineWidth}
+\LettrineOptionsFor{N}{loversize= 0.00,lraise= 0.20,lhang= 0.20,findent=-0.010\LettrineWidth,nindent= 0.40\LettrineWidth}
+\LettrineOptionsFor{O}{loversize= 0.10,lraise= 0.00,lhang= 0.20,findent=-0.010\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{P}{loversize= 0.10,lraise= 0.00,lhang= 0.30,findent= 0.050\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{Q}{loversize= 0.00,lraise= 0.20,lhang= 0.20,findent= 0.050\LettrineWidth,nindent= 0.70\LettrineWidth}
+\LettrineOptionsFor{R}{loversize=-0.05,lraise= 0.25,lhang= 0.25,nindent= 0.500\LettrineWidth,nindent= 0.50\LettrineWidth}
+\LettrineOptionsFor{S}{loversize= 0.10,lraise= 0.05,lhang= 0.00,findent= 0.000\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{T}{loversize= 0.10,lraise= 0.00,lhang= 0.35,findent= 0.100\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{U}{loversize= 0.10,lraise= 0.00,lhang= 0.20,findent= 0.050\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{V}{loversize= 0.10,lraise= 0.00,lhang= 0.40,findent= 0.050\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{W}{loversize= 0.10,lraise= 0.00,lhang= 0.30,findent= 0.040\LettrineWidth,nindent= 0.50em}
+\LettrineOptionsFor{X}{loversize= 0.10,lraise= 0.00,lhang= 0.40,findent= 0.040\LettrineWidth,nindent= 0.20\LettrineWidth}
+\LettrineOptionsFor{Y}{loversize= 0.10,lraise= 0.00,lhang= 0.20,findent= 0.100\LettrineWidth,nindent= 0.20\LettrineWidth}
+\LettrineOptionsFor{Z}{loversize=-0.05,lraise= 0.25,lhang= 0.00,findent= 0.050\LettrineWidth,nindent= 0.55\LettrineWidth}
+\endinput
+
+
+% The installation of the padl family can be performed using the fontinst package.
+% You must own the font AGaramondAlt-Italic, that is an AFM and a PFB file
+% which should be renamed as padri8w.afm and padri8w.pfb.
+%
+% You should process the file Makepadl.tex (see below) through TeX,
+% and follow the instructions of the fontinst manual to finish the install.
+% The file T1padl.fd should be defined as below and put with other local FD files.
+
+%%% File Makepadl.tex
+\input fontinst.sty
+\installfonts
+ \declareencoding{T1-SWASH}{T1}
+ \fromafm{padri8w} %%% File containing metrics of AGaramondAlt-Italic
+ \gdef\uc#1#2{#1swash}
+ \installfont{padw9w}{padri8w}{T1}{T1}{padl}{m}{n}{}
+\endinstallfonts
+\bye
+%%% End of file Makepadl.tex
+
+% The padl family is defined by the file T1padl.fd, as follows
+
+%%% File T1padl.fd
+%THIS FILE SHOULD BE PUT IN A TEX INPUTS DIRECTORY
+\ProvidesFile{t1padl.fd}[2003/08/24 v0.1 Pascal Kockaert]
+\DeclareFontFamily{T1}{padl}{}
+\DeclareFontShape{T1}{padl}{m}{n}{<->padw9w}{}
+\endinput
+%%% End of file T1padl.fd
diff --git a/macros/latex/contrib/lettrine/contrib/pzc2.cfl b/macros/latex/contrib/lettrine/contrib/pzc2.cfl
new file mode 100644
index 0000000000..7779968780
--- /dev/null
+++ b/macros/latex/contrib/lettrine/contrib/pzc2.cfl
@@ -0,0 +1,45 @@
+%%% This is file `pzc2.cfl'.
+%%% It is provided under the LPPL. Copyright is held by Kevin M. Dunn.
+%%% If you modify this file you *MUST* change its name.
+%%%
+%%% This file contains config values to simplify the use of the
+%%% Zapf-Chancery (aka pzc) font with the lettrine package by Daniel Flipo.
+%%% This file provides the parameters for 2 DefaultLines.
+%%%
+%%% If you want to use this file, your document should contain
+%%% the next three lines, without the leading percent signs.
+%%% \setcounter{DefaultLines}{2}
+%%% \renewcommand\LettrineFontHook{\fontencoding{T1}\fontfamily{pzc}\selectfont}
+%%% \renewcommand{\DefaultOptionsFile}{pzc2.cfl}
+%%%
+%%% Comments about this file can be sent to Kevin Dunn
+%%% (cavema2 at cavemanchemistry.com)
+%%%
+\ProvidesFile{pzc2.cfl}[2006/03/19 v0.1 Kevin M. Dunn]
+\LettrineOptionsFor{A}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.05\LettrineWidth,nindent= 0.25\LettrineWidth}
+\LettrineOptionsFor{B}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.10\LettrineWidth,nindent= 0.08\LettrineWidth}
+\LettrineOptionsFor{C}{loversize= 0.35,lraise= 0.10,lhang= 0.35,findent= 0.00\LettrineWidth,nindent= 0.28\LettrineWidth}
+\LettrineOptionsFor{D}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.15\LettrineWidth,nindent= 0.05\LettrineWidth}
+\LettrineOptionsFor{E}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.00\LettrineWidth,nindent= 0.28\LettrineWidth}
+\LettrineOptionsFor{F}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.10\LettrineWidth,nindent= 0.00\LettrineWidth}
+\LettrineOptionsFor{G}{loversize= 0.35,lraise= 0.10,lhang= 0.35,findent= 0.10\LettrineWidth,nindent= 0.17\LettrineWidth}
+\LettrineOptionsFor{H}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.10\LettrineWidth,nindent= 0.20\LettrineWidth}
+\LettrineOptionsFor{I}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.05\LettrineWidth,nindent= 0.25\LettrineWidth}
+\LettrineOptionsFor{J}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.15\LettrineWidth,nindent= 0.00\LettrineWidth}
+\LettrineOptionsFor{K}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.05\LettrineWidth,nindent= 0.13\LettrineWidth}
+\LettrineOptionsFor{L}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=-0.02\LettrineWidth,nindent= 0.30\LettrineWidth}
+\LettrineOptionsFor{M}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.05\LettrineWidth,nindent= 0.15\LettrineWidth}
+\LettrineOptionsFor{N}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.10\LettrineWidth,nindent= 0.10\LettrineWidth}
+\LettrineOptionsFor{O}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.15\LettrineWidth,nindent= 0.08\LettrineWidth}
+\LettrineOptionsFor{P}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.25\LettrineWidth,nindent= 0.05\LettrineWidth}
+\LettrineOptionsFor{Q}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.15\LettrineWidth,nindent= 0.10\LettrineWidth}
+\LettrineOptionsFor{R}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.08\LettrineWidth,nindent= 0.15\LettrineWidth}
+\LettrineOptionsFor{S}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.10\LettrineWidth,nindent= 0.13\LettrineWidth}
+\LettrineOptionsFor{T}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.05\LettrineWidth,nindent= 0.20\LettrineWidth}
+\LettrineOptionsFor{U}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.05\LettrineWidth,nindent= 0.15\LettrineWidth}
+\LettrineOptionsFor{V}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.18\LettrineWidth,nindent=-0.15\LettrineWidth}
+\LettrineOptionsFor{W}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.15\LettrineWidth,nindent=-0.05\LettrineWidth}
+\LettrineOptionsFor{X}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.00\LettrineWidth,nindent= 0.35\LettrineWidth}
+\LettrineOptionsFor{Y}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.10\LettrineWidth,nindent= 0.05\LettrineWidth}
+\LettrineOptionsFor{Z}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent= 0.00\LettrineWidth,nindent= 0.30\LettrineWidth}
+\endinput
diff --git a/macros/latex/contrib/lettrine/contrib/pzc3.cfl b/macros/latex/contrib/lettrine/contrib/pzc3.cfl
new file mode 100644
index 0000000000..a67ba9b5b0
--- /dev/null
+++ b/macros/latex/contrib/lettrine/contrib/pzc3.cfl
@@ -0,0 +1,45 @@
+%%% This is file `pzc2.cfl'.
+%%% It is provided under the LPPL. Copyright is held by Kevin M. Dunn.
+%%% If you modify this file you *MUST* change its name.
+%%%
+%%% This file contains config values to simplify the use of the
+%%% Zapf-Chancery (aka pzc) font with the lettrine package by Daniel Flipo.
+%%% This file provides the parameters for 3 DefaultLines.
+%%%
+%%% If you want to use this file, your document should contain
+%%% the next three lines, without the leading percent signs.
+%%% \setcounter{DefaultLines}{3}
+%%% \renewcommand\LettrineFontHook{\fontencoding{T1}\fontfamily{pzc}\selectfont}
+%%% \renewcommand{\DefaultOptionsFile}{pzc3.cfl}
+%%%
+%%% Comments about this file can be sent to Kevin Dunn
+%%% (cavema2 at cavemanchemistry.com)
+
+\ProvidesFile{pzc3.cfl}[2006/03/19 v0.1 Kevin M. Dunn]
+\LettrineOptionsFor{A}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.05\LettrineWidth,nindent= 0.25\LettrineWidth}
+\LettrineOptionsFor{B}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.10\LettrineWidth,nindent= 0.08\LettrineWidth,slope=-0.08\LettrineWidth}
+\LettrineOptionsFor{C}{loversize= 0.35,lraise= 0.10,lhang= 0.35,findent=0.00\LettrineWidth,nindent= 0.28\LettrineWidth}
+\LettrineOptionsFor{D}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.15\LettrineWidth,nindent= 0.05\LettrineWidth,slope=-0.05\LettrineWidth}
+\LettrineOptionsFor{E}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.00\LettrineWidth,nindent= 0.28\LettrineWidth}
+\LettrineOptionsFor{F}{loversize= 0.35,lraise= 0.05,lhang= 0.35,findent=0.10\LettrineWidth,nindent= 0.00\LettrineWidth}
+\LettrineOptionsFor{G}{loversize= 0.30,lraise= 0.30,lhang= 0.5,findent=0.10\LettrineWidth,nindent= 0.15\LettrineWidth}
+\LettrineOptionsFor{H}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.10\LettrineWidth,nindent= 0.20\LettrineWidth}
+\LettrineOptionsFor{I}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.05\LettrineWidth,nindent= 0.25\LettrineWidth}
+\LettrineOptionsFor{J}{loversize= 0.35,lraise= 0.05,lhang= 0.35,findent=0.15\LettrineWidth,nindent= 0.00\LettrineWidth}
+\LettrineOptionsFor{K}{loversize= 0.30,lraise= 0.20,lhang= 0.35,findent=0.05\LettrineWidth,nindent= 0.13\LettrineWidth,slope= 0.20\LettrineWidth}
+\LettrineOptionsFor{L}{loversize= 0.35,lraise= 0.00,lhang=0.35,findent=-0.02\LettrineWidth,nindent= 0.30\LettrineWidth}
+\LettrineOptionsFor{M}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.05\LettrineWidth,nindent= 0.15\LettrineWidth}
+\LettrineOptionsFor{N}{loversize= 0.30,lraise= 0.20,lhang= 0.35,findent=0.10\LettrineWidth,nindent= 0.10\LettrineWidth,slope= 0.20\LettrineWidth}
+\LettrineOptionsFor{O}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.15\LettrineWidth,nindent= 0.08\LettrineWidth}
+\LettrineOptionsFor{P}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.25\LettrineWidth,nindent= 0.05\LettrineWidth}
+\LettrineOptionsFor{Q}{loversize= 0.30,lraise= 0.25,lhang= 0.35,findent=0.15\LettrineWidth,nindent= 0.10\LettrineWidth,slope= 0.20\LettrineWidth}
+\LettrineOptionsFor{R}{loversize= 0.30,lraise= 0.20,lhang= 0.35,findent=0.08\LettrineWidth,nindent= 0.15\LettrineWidth,slope= 0.20\LettrineWidth}
+\LettrineOptionsFor{S}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.10\LettrineWidth,nindent= 0.13\LettrineWidth}
+\LettrineOptionsFor{T}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.05\LettrineWidth,nindent= 0.20\LettrineWidth}
+\LettrineOptionsFor{U}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.05\LettrineWidth,nindent= 0.15\LettrineWidth}
+\LettrineOptionsFor{V}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.18\LettrineWidth,nindent=-0.05\LettrineWidth,slope=-0.15\LettrineWidth}
+\LettrineOptionsFor{W}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.18\LettrineWidth,nindent=-0.05\LettrineWidth,slope=-0.10\LettrineWidth}
+\LettrineOptionsFor{X}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.00\LettrineWidth,nindent= 0.35\LettrineWidth}
+\LettrineOptionsFor{Y}{loversize= 0.30,lraise= 0.10,lhang= 0.40,findent=0.10\LettrineWidth,nindent= 0.00\LettrineWidth,slope=-0.10\LettrineWidth}
+\LettrineOptionsFor{Z}{loversize= 0.35,lraise= 0.00,lhang= 0.35,findent=0.00\LettrineWidth,nindent= 0.30\LettrineWidth}
+\endinput
diff --git a/macros/latex/contrib/lettrine/doc/lettrine-demo-de.pdf b/macros/latex/contrib/lettrine/doc/lettrine-demo-de.pdf
index f27982ed41..bf74f1840c 100644
--- a/macros/latex/contrib/lettrine/doc/lettrine-demo-de.pdf
+++ b/macros/latex/contrib/lettrine/doc/lettrine-demo-de.pdf
Binary files differ
diff --git a/macros/latex/contrib/lettrine/doc/lettrine-demo-fr.pdf b/macros/latex/contrib/lettrine/doc/lettrine-demo-fr.pdf
index 0d311f197b..c14ada6737 100644
--- a/macros/latex/contrib/lettrine/doc/lettrine-demo-fr.pdf
+++ b/macros/latex/contrib/lettrine/doc/lettrine-demo-fr.pdf
Binary files differ
diff --git a/macros/latex/contrib/lettrine/doc/lettrine-demo-lua.pdf b/macros/latex/contrib/lettrine/doc/lettrine-demo-lua.pdf
index e8c19c69d4..40694cd70b 100644
--- a/macros/latex/contrib/lettrine/doc/lettrine-demo-lua.pdf
+++ b/macros/latex/contrib/lettrine/doc/lettrine-demo-lua.pdf
Binary files differ
diff --git a/macros/latex/contrib/lettrine/doc/lettrine.pdf b/macros/latex/contrib/lettrine/doc/lettrine.pdf
index 6870682712..5f4c521e91 100644
--- a/macros/latex/contrib/lettrine/doc/lettrine.pdf
+++ b/macros/latex/contrib/lettrine/doc/lettrine.pdf
Binary files differ
diff --git a/macros/latex/contrib/lettrine/lettrine-2022-09-25.sty b/macros/latex/contrib/lettrine/lettrine-2022-09-25.sty
new file mode 100644
index 0000000000..6ef4f4b070
--- /dev/null
+++ b/macros/latex/contrib/lettrine/lettrine-2022-09-25.sty
@@ -0,0 +1,302 @@
+%%
+%% This is file `lettrine.sty', v2.30.
+%%
+%% IMPORTANT NOTICE:
+%%
+%% For the copyright see the source file `lettine.dtx'.
+%%
+%% This file can be distributed and/or modified under the terms
+%% of the LaTeX Project Public License either version 1.3c of this
+%% license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The Current Maintainer of this work is Daniel Flipo.
+%%
+%% Please report errors to: <daniel (dot) flipo (at) free (dot) fr>
+%%
+\NeedsTeXFormat{LaTeX2e}[2018-04-01]
+\ProvidesFile{lettrine.sty}
+ [2022-09-25 v2.30 (Daniel Flipo)]
+\RequirePackage{xkeyval,minifp}
+\newcounter{DefaultLines}
+\setcounter{DefaultLines}{2}
+\newcounter{DefaultDepth}
+\newcommand*{\DefaultOptionsFile}{\relax}
+\newcommand*{\DefaultLoversize}{0}
+\newcommand*{\DefaultLraise}{0}
+\newcommand*{\DefaultLhang}{0}
+\newdimen\DefaultFindent
+\setlength{\DefaultFindent}{\z@}
+\newdimen\DefaultNindent
+\setlength{\DefaultNindent}{0.5em}
+\newdimen\DefaultSlope
+\setlength{\DefaultSlope}{\z@}
+\newdimen\DiscardVskip
+\setlength{\DiscardVskip}{0.2\p@}
+\newif\ifLettrineImage
+\newif\ifLettrineOnGrid
+\newif\ifLettrineRealHeight
+\InputIfFileExists{lettrine.cfg}
+ {\typeout{Loading lettrine.cfg}}
+ {\typeout{lettrine.cfg not found, using default values}}
+\DeclareOptionX{lines}[\value{DefaultLines}]{\setcounter{DefaultLines}{#1}}
+\DeclareOptionX{depth}[\value{DefaultDepth}]{\setcounter{DefaultDepth}{#1}}
+\DeclareOptionX{lhang}[]{\ifx#1\@empty\else
+ \renewcommand*{\DefaultLhang}{#1}\fi}
+\DeclareOptionX{loversize}[]{\ifx#1\@empty\else
+ \renewcommand*{\DefaultLoversize}{#1}\fi}
+\DeclareOptionX{lraise}[]{\ifx#1\@empty\else
+ \renewcommand*{\DefaultLraise}{#1}}
+\DeclareOptionX{findent}[\the\DefaultFindent]{%
+ \setlength{\DefaultFindent}{#1}}
+\DeclareOptionX{nindent}[\the\DefaultNindent]{%
+ \setlength{\DefaultNindent}{#1}}
+\DeclareOptionX{slope}[\the\DefaultSlope]{\setlength{\DefaultSlope}{#1}}
+\DeclareOptionX{image}[true]{\csname LettrineImage#1\endcsname}
+\DeclareOptionX{grid}[true]{\csname LettrineOnGrid#1\endcsname}
+\DeclareOptionX{novskip}[\the\DiscardVskip]{\setlength{\DiscardVskip}{#1}}
+\DeclareOptionX{realheight}[true]{\csname LettrineRealHeight#1\endcsname}
+\DeclareOptionX{optionsfile}[]{\ifx#1\@empty\else
+ \renewcommand*{\DefaultOptionsFile}{#1}\fi}
+\ProcessOptionsX
+
+\newsavebox{\L@lbox}
+\newsavebox{\L@tbox}
+\newcounter{L@lines}
+\newcounter{L@depth}
+\newdimen\L@Pindent
+\newdimen\L@Findent
+\newdimen\L@Nindent
+\newdimen\L@lraise
+\newdimen\L@first
+\newdimen\L@next
+\newdimen\L@slope
+\newdimen\L@height
+\newdimen\L@novskip
+\newdimen\L@target@ht
+\newdimen\L@target@dp
+\newdimen\L@target@tht
+\newdimen\LettrineWidth
+\newdimen\LettrineHeight
+\newdimen\LettrineDepth
+\newcommand*{\L@file}{}
+\newcommand*{\L@hang}{}
+\newcommand*{\L@oversize}{}
+\newcommand*{\L@raise}{}
+\newcommand*{\L@ante}{}
+\newif\ifL@image
+\newif\ifL@grid
+\newif\ifL@realh
+\newif\ifL@selfref
+\newcommand*{\LettrineTextFont}{\scshape}
+\newcommand*{\LettrineSecondString}{x}
+\newcommand*{\LettrineFontHook}{}
+\def\computeL@height{%
+ \setlength{\L@target@ht}{\ht\L@tbox}%
+ \@tempdima=\baselineskip
+ \setlength{\L@target@dp}{\value{L@lines}\@tempdima}%
+ \ifnum\value{L@lines}>1
+ \addtolength{\L@target@dp}{-\@tempdima}%
+ \else
+ \addtolength{\L@target@ht}{\L@target@dp}%
+ \setlength{\L@target@dp}{0pt}%
+ \fi
+ \setlength{\L@target@tht}{\L@target@ht}%
+ \addtolength{\L@target@tht}{\L@target@dp}%
+ \setlength{\L@height}{\L@target@tht}%
+ \addtolength{\L@height}{\L@oversize\L@target@tht}%
+}
+\newcommand*{\LettrineTestString}{EFTZ}
+\def\compute@fontsize{%
+ \ifL@selfref
+ \def\Lettrine@RefString{\l@refstring}%
+ \else
+ \def\Lettrine@RefString{\LettrineTestString}%
+ \fi
+ \sbox{\@tempboxa}{\LettrineFontHook
+ \fontsize{\L@height}{\L@height}\selectfont
+ \Lettrine@RefString}%
+ \@tempcnta=\ht\@tempboxa
+ \ifnum\@tempcnta=0
+ \PackageWarning{lettrine}{Unable to compute \protect\fontsize!%
+ \MessageBreak \protect\LettrineTestString\space empty? reported}
+ \def\L@factor{1}%
+ \else
+ \@tempcntb=\L@height
+ \MFPdiv{\the\@tempcntb}{\the\@tempcnta}\L@factor
+ \fi
+}
+\newcommand*{\LettrineFont}{%
+ \LettrineFontHook
+ \fontsize{\L@factor\L@height}{\L@factor\L@height}%
+ \selectfont
+}
+\newcommand*{\LettrineImage}{%
+ \LettrineFontHook\includegraphics[height=\L@height]%
+}
+\def\setupL@lbox{%
+ \computeL@height
+ \ifL@image
+ \sbox{\L@lbox}{\LettrineImage{\l@initial}}%
+ \else
+ \compute@fontsize
+ \sbox{\L@lbox}{\LettrineFont \l@initial}%
+ \fi
+}
+\define@key{L}{lines}{\setcounter{L@lines}{#1}}
+\define@key{L}{depth}{\setcounter{L@depth}{#1}}
+\define@key{L}{lhang}{\renewcommand*{\L@hang}{#1}}
+\define@key{L}{loversize}{\renewcommand*{\L@oversize}{#1}}
+\define@key{L}{lraise}{\renewcommand*{\L@raise}{#1}}
+\define@key{L}{ante}{\renewcommand*{\L@ante}{#1}}
+\define@key{L}{findent}{\setlength{\L@Findent}{#1}}
+\define@key{L}{nindent}{\setlength{\L@Nindent}{#1}}
+\define@key{L}{slope}{\setlength{\L@slope}{#1}}
+\define@key{L}{image}[true]{\csname L@image#1\endcsname}
+\define@key{L}{grid}[true]{\csname L@grid#1\endcsname}
+\define@key{L}{realheight}[true]{\csname L@realh#1\endcsname}
+\define@key{L}{novskip}{\setlength{\L@novskip}{#1}}
+\define@key{L}{refstring}[\l@initial]{\L@selfreftrue
+ \def\l@refstring{#1}}
+\newcommand*{\LettrineOptionsFor}[2]{\@namedef{l@#1-keys}{#2}}
+\def\lettrine{\@ifnextchar[\@lettrine{\@lettrine[]}}
+\def\@lettrine[#1]#2#3{%
+ \def\l@initial{#2}\let\l@refstring\l@initial
+ \setcounter{L@lines}{\value{DefaultLines}}%
+ \setcounter{L@depth}{\value{DefaultDepth}}%
+ \renewcommand*{\L@hang}{\DefaultLhang}%
+ \renewcommand*{\L@oversize}{\DefaultLoversize}%
+ \renewcommand*{\L@raise}{\DefaultLraise}%
+ \renewcommand*{\L@ante}{}%
+ \setlength{\L@Findent}{\DefaultFindent}%
+ \setlength{\L@Nindent}{\DefaultNindent}%
+ \setlength{\L@slope}{\DefaultSlope}%
+ \setlength{\L@novskip}{\DiscardVskip}%
+ \ifLettrineImage\L@imagetrue\else\L@imagefalse\fi
+ \ifLettrineOnGrid\L@gridtrue\else\L@gridfalse\fi
+ \ifLettrineRealHeight\L@realhtrue\else\L@realhfalse\fi
+ \setkeys{L}{#1}%
+ \sbox{\L@tbox}{\LettrineTextFont{\LettrineSecondString}}%
+ \ifL@realh
+ \def\@tempa{#3}%
+ \ifx\@tempa\@empty
+ \PackageWarning{lettrine.sty}%
+ {Empty second argument,\MessageBreak
+ ignoring option `realheight';}%
+ \else
+ \sbox{\L@tbox}{\LettrineTextFont{#3}}%
+ \fi
+ \fi
+ \if\DefaultOptionsFile\relax
+ \else
+ \begingroup
+ \InputIfFileExists{\DefaultOptionsFile}%
+ {}%
+ {\PackageWarning{lettrine.sty}%
+ {File \DefaultOptionsFile\space not found}%
+ }%
+ \def\color##1##{\l@color{##1}}%
+ \let\l@color\@gobbletwo
+ \def\textcolor##1##{\l@textcolor{##1}}%
+ \def\l@textcolor##1##2##3{##3}%
+ \expandafter\ifx\csname l@#2-keys\endcsname\relax
+ \gdef\l@LOKeys{}%
+ \else
+ \xdef\l@LOKeys{\csname l@#2-keys\endcsname}%
+ \fi
+ \endgroup
+ \def\KV@prefix{KV@L@}%
+ \let\@tempc\relax
+ \expandafter\KV@do\l@LOKeys,\relax,
+ \setupL@lbox
+ \setlength{\LettrineWidth}{\wd\L@lbox}%
+ \def\KV@prefix{KV@L@}%
+ \let\@tempc\relax
+ \expandafter\KV@do\l@LOKeys,\relax,
+ \setkeys{L}{#1}%
+ \fi
+ \setupL@lbox
+ \setlength{\LettrineWidth}{\wd\L@lbox}%
+ \setlength{\LettrineHeight}{\ht\L@lbox}%
+ \setlength{\LettrineDepth}{\dp\L@lbox}%
+ \begingroup
+ \def\IeC##1{##1}%
+ \@tempdima=\L@oversize pt\relax
+ \PackageInfo{lettrine.sty}%
+ {Targeted height = \the\L@target@tht\MessageBreak
+ (for loversize=0, accent excluded),\MessageBreak
+ Lettrine height = \the\LettrineHeight\space (#2)%
+ \ifdim\@tempdima=\z@\else\space loversize=\L@oversize\fi;%
+ \MessageBreak reported}%
+ \endgroup
+ \sbox{\L@tbox}{\LettrineTextFont{#3}}%
+ \setlength{\L@first}{\LettrineHeight}%
+ \setlength{\L@lraise}{\L@raise\L@target@tht}%
+ \addtolength{\L@first}{\L@lraise}%
+ \ifnum\value{L@lines}=1
+ \addtolength{\L@first}{-\ht\L@tbox}%
+ \else
+ \addtolength{\L@first}{-\L@target@tht}%
+ \addtolength{\L@lraise}{-\L@target@dp}%
+ \fi
+ \par
+ \ifdim\L@first>\L@novskip
+ \ifL@grid
+ \@tempdima=\baselineskip
+ \@tempdimb=\@tempdima
+ \advance\@tempdimb by \L@novskip
+ \@tempcnta=1
+ \loop\ifdim\L@first>\@tempdimb
+ \advance\@tempcnta by 1
+ \advance\L@first by -\@tempdima
+ \repeat
+ \L@first=\@tempcnta\baselineskip
+ \fi
+ \vskip\L@first
+ \fi
+ \setlength{\L@Pindent}{\wd\L@lbox}%
+ \addtolength{\L@Pindent}{-\L@hang\wd\L@lbox}%
+ \settowidth{\L@first}{\L@ante}%
+ \addtolength{\L@Pindent}{\L@first}%
+ \addtolength{\L@Pindent}{\L@Findent}%
+ \setlength{\L@first}{\linewidth}%
+ \addtolength{\L@first}{-\L@Pindent}%
+ \addtolength{\L@Nindent}{\L@Pindent}%
+ \setlength{\L@next}{\linewidth}%
+ \addtolength{\L@next}{-\L@Nindent}%
+ \addtolength{\L@Pindent}{\@totalleftmargin}%
+ \addtolength{\L@Nindent}{\@totalleftmargin}%
+ \addtocounter{L@lines}{1}%
+ \addtocounter{L@lines}{\value{L@depth}}%
+ \def\L@parshape{\c@L@lines \the\L@Pindent \the\L@first}%
+ \@tempcnta=\tw@
+ \@whilenum \@tempcnta<\c@L@lines\do{%
+ \edef\L@parshape{\L@parshape \the\L@Nindent \the\L@next}%
+ \addtolength{\L@Nindent}{\L@slope}%
+ \addtolength{\L@next}{-\L@slope}%
+ \advance\@tempcnta\@ne}%
+ \edef\L@parshape{\L@parshape \@totalleftmargin \the\linewidth}%
+ \noindent
+ \parshape=\L@parshape\relax
+ \smash{\llap{\mbox{\L@ante}\raisebox{\L@lraise}{\usebox{\L@lbox}}%
+ \hskip \the\L@Findent}}%
+ \usebox{\L@tbox}%
+ \ifnum\@listdepth>0 \Lreset@listparshape \fi
+}
+\newtoks\Llist@everypar
+\def\Lreset@listparshape{%
+ \let\Lnew@everypar\everypar
+ \Llist@everypar=\expandafter{\the\everypar}%
+ \Lnew@everypar={\the\Llist@everypar
+ \parshape=\@ne \@totalleftmargin \linewidth \relax
+ \let\everypar\Llist@everypar
+ }%
+}
+\endinput
+%%
+%% End of file `lettrine.sty'.
diff --git a/macros/latex/contrib/lettrine/lettrine.dtx b/macros/latex/contrib/lettrine/lettrine.dtx
index 65f301e6af..be96ffe2f8 100644
--- a/macros/latex/contrib/lettrine/lettrine.dtx
+++ b/macros/latex/contrib/lettrine/lettrine.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright © 1999-2022 Daniel Flipo.
+% Copyright © 1999-2023 Daniel Flipo.
%
% This program can be distributed and/or modified under the terms
% of the LaTeX Project Public License either version 1.3c of this
@@ -12,31 +12,36 @@
%
% This file has the LPPL maintenance status "maintained".
%
-% \fi
-%
-% \iffalse
-%
-%<*sty>
-\NeedsTeXFormat{LaTeX2e}[2018-04-01]
-\ProvidesFile{lettrine.sty}
-%</sty>
-%<*dtx>
-\ProvidesFile{lettrine.dtx}
-%</dtx>
-%<*!cfg>
- [2022-09-25 v2.30 (Daniel Flipo)]
-%</!cfg>
-%
-% Lettrine package for LaTeX version 2e
-%
-% Copyright © 1999-2020 by Daniel Flipo
-%
-% Please report errors to: daniel (dot) flipo (at) free (dot) fr
-%
+%<*batch>
+%<*gobble>
+\ifx\jobname\relax\let\documentclass\undefined\fi
+\ifx\documentclass\undefined
+\csname fi\endcsname
+%</gobble>
+\input docstrip.tex
+\keepsilent
+\let\MetaPrefix\relax
+\preamble
+\endpreamble
+\postamble
+\endpostamble
+\let\MetaPrefix\DoubleperCent
+\askforoverwritefalse
+\generate{\file{lettrine.sty}{\from{lettrine.dtx}{sty}}
+ \nopreamble
+ \file{lettrine.cfg}{\from{lettrine.dtx}{cfg}}
+ }
+\endbatchfile
+%</batch>
+%<*gobble>
+\fi
+\expandafter\ifx\csname @currname\endcsname\empty
+\csname fi\endcsname
+%</gobble>
%<*driver>
-\RequirePackage{pdfmanagement-testphase}
-\DeclareDocumentMetadata{pdfstandard=A-2b, lang=en-US}
-\documentclass[a4paper]{ltxdoc}
+\DocumentMetadata{pdfstandard=A-2b, lang=en-GB}
+\documentclass[a4paper,british]{ltxdoc}
+\usepackage{babel,varioref}
\usepackage[dvipsnames]{xcolor}
\usepackage{unicode-math}
\setmainfont{erewhon}
@@ -73,7 +78,7 @@
\setlength{\parindent}{0pt}
\setlength{\parskip}{.3\baselineskip}
\begin{document}
-\GetFileInfo{lettrine.dtx}
+\GetFileInfo{lettrine.sty}
\begin{center}
\textbf{\Large Typesetting dropped capitals with LaTeX}
\\[.5\baselineskip]^^A\]
@@ -83,8 +88,27 @@
\DocInput{lettrine.dtx}
\end{document}
%</driver>
+%<*gobble>
+\fi
+%</gobble>
+% \fi
%
-%\fi
+% \iffalse
+%
+%<*sty>
+%% IMPORTANT NOTICE:
+%% For the copyright see the source file `lua-typo.dtx’.
+%%
+\NeedsTeXFormat{LaTeX2e}[2022-06-01]
+\ProvidesFile{lettrine.sty}
+%</sty>
+%<*dtx>
+\ProvidesFile{lettrine.dtx}
+%</dtx>
+%<*sty|dtx>
+ [2023-04-18 v2.40 (Daniel Flipo)]
+%</sty|dtx>
+% \fi
%
% \section{Introduction}
%
@@ -113,8 +137,7 @@
% \item ``Mise en page et impression’’ Yves~Perrousseaux,
% ISBN-2-911220-01-3.
% \end{itemize}
-% The parameters can be set using David Carlisle’s
-% \texttt{keyval.sty} syntax:
+% The parameters can be set using the \texttt{key=value} syntax:
% \begin{itemize}
% \item \lopt{lines=}\meta{integer} sets how many lines the
% dropped capital will occupy (default=2);
@@ -146,7 +169,7 @@
% like |A| or |V| to add \meta{dimen} (positive or negative) to the
% indentation of each line starting from the third one (no effect if
% \lopt{lines=2}, default=0pt);
-% \item \lopt{ante=}\meta{text} can be used to typeset \meta{text}
+% \item \lopt{ante=}\meta{string} can be used to typeset \meta{string}
% \emph{before} the dropped capital (typical use is for French
% guillemets starting the paragraph).
%
@@ -210,18 +233,17 @@
% top of the non accented letters).
% \end{description}
%
-% \item \lopt{refstring}\footnote{Unlike \lopt{grid} or
-% \lopt{realheight}, \lopt{refstring} is not a flag (\emph{do not}
-% add \lopt{=true}!); it is possible to set
-% \lopt{refstring=}\meta{string} to override \cs{LettrineTestString}
-% locally.} is meant for fancy initials with
-% irregular heights (i.e.\ taken in fonts like Yinit (OpenType),
-% \file{cfr-initials},…). \lopt{refstring} forces the
+% \item \lopt{refstring} with no value, is meant for fancy initials
+% with irregular heights (i.e.\ taken in fonts like Yinit (OpenType),
+% \file{cfr-initials},…). Option \lopt{refstring} forces the
% |\fontsize| computations to be run on the initial given as
% |\lettrine|’s first mandatory argument instead of the reference
% string |\LettrineTestString|. In most cases, this option should
% \emph{not} be used: think of accentuated initials or capitals with
-% optical correction.
+% optical correction.\par
+% \lopt{refstring}=\meta{string} can be used to override
+% |\LettrineTestString|, the default reference string
+% (option \emph{seldom useful}).
%
% \end{itemize}
%
@@ -230,7 +252,7 @@
% \mbox{}\phantom{\tt Example: lettrine}%
% |{V}{oici} un exemple |…
%
-% Coloured initials are possible in conjonction with package
+% Coloured initials are available in conjonction with package
% \file{color}, examples: \\
% |\lettrine{\textcolor{red}{A}}{n} example|\quad or\\
% |\lettrine{\textcolor[gray]{0.5}{A}}{nother} one| \\
@@ -241,26 +263,27 @@
% Three dimensions, |\LettrineWidth|, |\LettrineHeight| and
% |\LettrineDepth|, store the final size of the initial.
%
-% Have a look at files \file{demo-fr.tex} and \file{demo-lua.tex}
-% and at the resulting PDFs in the \file{doc} folder to see the
-% possible usage of these parameters.
+% Have a look at files \file{lettrine-demo-fr.tex} and
+% \file{lettrine-demo-lua.tex} and at the resulting PDFs in the
+% \file{doc} folder to see the possible usage of these parameters.
%
% \changes{v1.9}{2015/08/31}{New customisable string
% \cs{LettrineSecondString} to tune the initial’s height.}
%
-% Starting with version~2.30, the default settings can be
+% Starting with version~2.30, the default settings can easily be
% specified as options passed to the \pkg{lettrine} \emph{package}.
-% These options are the same as those of the |\lettrine| command%
-% \footnote{With one exception: \lopt{refstring} is available only
-% for the \cs{lettrine} command.}:
-% f.i. |\usepackage[lines=3]{lettrine}| will set the default to three
-% lines of text. Options passed to the \pkg{lettrine} package override
-% the defaults set in the \file{lettrine.cfg} file (see below) and will
-% be overriden by options passed to the |\lettrine| command.
-%
-% The default settings can be customized in a config file
-% \file{lettrine.cfg} for a global usage. The following list shows
-% the syntax to set them and their default values:
+% These options are the same as those of the |\lettrine| command
+% previously described%
+% \footnote{With the exception of \lopt{ante} which doesn’t make
+% sense for a global usage.}: f.i. |\usepackage[lines=3]{lettrine}|
+% will set the default to three lines of text.
+% Options passed to the \pkg{lettrine} package override the defaults
+% set in the \file{lettrine.cfg} file (see below) and will be
+% overriden by options passed to the |\lettrine| command.
+%
+% The default settings can also be customized in a config file
+% \file{lettrine.cfg} (backward compatibility). The following list
+% shows the syntax to set them and their default values:
% \begin{itemize}
% \item |\setcounter{DefaultLines}{2}|,
% \item |\setcounter{DefaultDepth}{0}|,
@@ -288,9 +311,9 @@
%
% The dimensional parameters \lopt{findent}, \lopt{nindent} and
% \lopt{slope}, can be set relative to |\LettrineWidth| if needed,
-% \emph{in \meta{filename} only}. The settings read from this file
-% will be overridden by the optional arguments eventually given to
-% |\lettrine|.
+% \emph{in an \file{optionsfile} only}. The settings read from this
+% file will be overridden by the optional arguments eventually given
+% to the |\lettrine| command.
%
% |\LettrineTextFont| sets the font used for the second argument
% of |\lettrine|, its default definition is
@@ -332,12 +355,12 @@
% \vspace{\baselineskip}
% \textbf{Important notice:}
% the sizing works fine with \emph{fully scalable} fonts (like the
-% standard PostScript fonts), but might not work well with CM/EC
-% fonts which have two limitations: only a limited number of sizes
-% is available by default (precise adjustments are impossible),
-% and the largest size (25pt or 35pt) is often too small.
-% The CM fonts are now available in PostScript type1 format for
-% free (courtesy of BlueSky/Y\&Y), to make them fully scalable,
+% standard PostScript or OpenType fonts), but might not work well
+% with CM/EC fonts which have two limitations: only a limited number
+% of sizes is available by default (precise adjustments are
+% impossible), and the largest size (25pt or 35pt) is often too
+% small. The CM fonts are available in PostScript type1 format
+% for free (courtesy of BlueSky/Y\&Y), to make them fully scalable,
% it is mandatory to add |\usepackage{type1cm}| in the preamble
% of your document.
% The EC fonts are also available in type1 format for free
@@ -411,30 +434,21 @@
% \changes{v2.2}{2018/08/25}{Rollback mechanism used for recovering
% older versions.}
%
-% The lettrine package now uses the rollback mechanism recently
-% introduced by the LaTeX Team to provide easier backward
-% compatibility. This requires a recent LaTeX kernel (at least
-% 2018-04-01), roolback is ignored with older kernels.
-% \begin{macrocode}
-\ifdefined\DeclareRelease
- \DeclareRelease{v1.6}{1999-03-03}{lettrine-2006-03-17.sty}
- \DeclareRelease{v1.9}{2012-07-20}{lettrine-2015-08-31.sty}
- \DeclareRelease{v2.0}{2018-07-21}{lettrine-2018-08-18.sty}
- \DeclareCurrentRelease{}{2020-03-14}
-\else
- \PackageWarning{lettrine}{Your LaTeX kernel is too old to provide
- access\MessageBreak to former versions of the lettrine package.%
- \MessageBreak If you need rollback, please upgrade%
- \MessageBreak your LaTeX kernel (2018-04-01 or newer),%
- \MessageBreak otherwise you are fine; reported}
-\fi
-% \end{macrocode}
-%
-% This package only runs with LaTeX and requires files
-% \file{xkeyval.sty} and \file{minifp.sty}.
+% \changes{v2.40}{2023/04/18}{lettrine.dtx auto-generates lettrine.sty
+% and lettrine.cfg (lettrine.ins deleted).}
%
+% The lettrine package uses the rollback mechanism
+% introduced by the LaTeX Team to provide easier backward
+% compatibility. The current release requires a LaTeX version
+% not older than 2022-06-01 (kernel packages \pkg{ltkeys} and
+% \pkg{xfp} are required).
% \begin{macrocode}
-\RequirePackage{xkeyval,minifp}
+\DeclareRelease{v1.6}{1999-03-03}{lettrine-2006-03-17.sty}
+\DeclareRelease{v1.9}{2012-07-20}{lettrine-2015-08-31.sty}
+\DeclareRelease{v2.0}{2018-07-21}{lettrine-2018-08-18.sty}
+\DeclareRelease{v2.3}{2022-09-25}{lettrine-2022-09-25.sty}
+\DeclareCurrentRelease{}{2023-04-18}
+\RequirePackage{xfp}
% \end{macrocode}
%
% Default initializations: define the necessary counters, lengths,
@@ -477,42 +491,6 @@
\newif\ifLettrineRealHeight
% \end{macrocode}
%
-% Load a local config file if present in LaTeX’s search path.
-% \begin{macrocode}
-\InputIfFileExists{lettrine.cfg}
- {\typeout{Loading lettrine.cfg}}
- {\typeout{lettrine.cfg not found, using default values}}
-% \end{macrocode}
-%
-% \changes{v2.30}{2022/09/23}{Added global options to package
-% \pkg{lettrine}.}
-%
-% Global package options enable to override the default values given
-% above to generic parameters. These may be overriden again by
-% options passed to the |\lettrine[]{}{}| command.
-% \begin{macrocode}
-\DeclareOptionX{lines}[\value{DefaultLines}]{\setcounter{DefaultLines}{#1}}
-\DeclareOptionX{depth}[\value{DefaultDepth}]{\setcounter{DefaultDepth}{#1}}
-\DeclareOptionX{lhang}[]{\ifx#1\@empty\else
- \renewcommand*{\DefaultLhang}{#1}\fi}
-\DeclareOptionX{loversize}[]{\ifx#1\@empty\else
- \renewcommand*{\DefaultLoversize}{#1}\fi}
-\DeclareOptionX{lraise}[]{\ifx#1\@empty\else
- \renewcommand*{\DefaultLraise}{#1}}
-\DeclareOptionX{findent}[\the\DefaultFindent]{%
- \setlength{\DefaultFindent}{#1}}
-\DeclareOptionX{nindent}[\the\DefaultNindent]{%
- \setlength{\DefaultNindent}{#1}}
-\DeclareOptionX{slope}[\the\DefaultSlope]{\setlength{\DefaultSlope}{#1}}
-\DeclareOptionX{image}[true]{\csname LettrineImage#1\endcsname}
-\DeclareOptionX{grid}[true]{\csname LettrineOnGrid#1\endcsname}
-\DeclareOptionX{novskip}[\the\DiscardVskip]{\setlength{\DiscardVskip}{#1}}
-\DeclareOptionX{realheight}[true]{\csname LettrineRealHeight#1\endcsname}
-\DeclareOptionX{optionsfile}[]{\ifx#1\@empty\else
- \renewcommand*{\DefaultOptionsFile}{#1}\fi}
-\ProcessOptionsX
-% \end{macrocode}
-
% Then let’s define the necessary internal counters, lengths,
% and commands.
%
@@ -548,17 +526,95 @@
\newif\ifL@image
\newif\ifL@grid
\newif\ifL@realh
-\newif\ifL@selfref
% \end{macrocode}
%
-% Provide commands for the fonts used to typeset the two
-% mandatory arguments of |\lettrine|.
+% \begin{macro}{\LettrineTestString}
+% As some font designers apply optical correction to capitals C, G,
+% O, or Q (they are slightly taller than `T’ or `Z’), they are better
+% left out of |\LettrineTestString|. |EFTZ| should be a good default
+% for most fonts.
+%
+% \changes{v1.63}{2012/07/20}{(new) it defaults to
+% `ABCDEFGHIJKLMNOQPRSTUVWXYZ’. In previous versions height
+% computations were based on letter `X’ which might not exist
+% in some (rare) fonts. Pointed out by Raphaël Pinson.}
+%
+% \changes{v2.0}{2018/07/21}{changed from `ABCDEFGHIJKLMNOQPRSTUVWXYZ’
+% to `EFTZ’ as some capitals like C, G, O, Q or X might be slightly
+% taller (possible optical correction).}
+%
+% \begin{macrocode}
+\newcommand*{\LettrineTestString}{EFTZ}
+% \end{macrocode}
+% \end{macro}
+%
+% Load a local config file if present in LaTeX’s search path.
+% \begin{macrocode}
+\InputIfFileExists{lettrine.cfg}
+ {\typeout{Loading lettrine.cfg}}
+ {\typeout{lettrine.cfg not found, using default values}}
+% \end{macrocode}
+%
+% \changes{v2.30}{2022/09/23}{Added global options to package
+% \pkg{lettrine}.}
+%
+% \changes{v2.40}{2023/04/18}{Package options and \cs{lettrine} options
+% no longer depend on \pkg{xkeyval}, they are based on ltkeys.dtx.}
+%
+% Global package options enable to override the default values given
+% above to generic parameters. These may be overriden again by
+% options passed to the |\lettrine[]{}{}| command.
+% This code is based on \pkg{ltkeys.dtx}.
+% \begin{macrocode}
+\DeclareKeys[LettrineGlobal]
+ {
+ lines.code = \setcounter{DefaultLines}{#1} ,
+ depth.code = \setcounter{DefaultDepth}{#1} ,
+ lhang.store = \DefaultLhang ,
+ loversize.store = \DefaultLoversize ,
+ lraise.store = \DefaultLraise ,
+ findent.code = \setlength{\DefaultFindent}{#1} ,
+ nindent.code = \setlength{\DefaultNindent}{#1} ,
+ slope.code = \setlength{\DefaultSlope}{#1} ,
+ novskip.code = \setlength{\DiscardVskip}{#1} ,
+ image.if = LettrineImage ,
+ grid.if = LettrineOnGrid ,
+ realheight.if = LettrineRealHeight ,
+ refstring.default:n = \l@initial ,
+ refstring.store = \LettrineTestString ,
+ optionsfile.store = \DefaultOptionsFile
+ }
+\ProcessKeyOptions[LettrineGlobal]
+% \end{macrocode}
+%
+% Ditto for the |\lettrine| command’s options.
+%
+% \begin{macrocode}
+\DeclareKeys[LettrineLocal]
+ {
+ lines.code = \setcounter{L@lines}{#1} ,
+ depth.code = \setcounter{L@depth}{#1} ,
+ lhang.code = \renewcommand*{\L@hang}{#1} ,
+ loversize.code = \renewcommand*{\L@oversize}{#1} ,
+ lraise.code = \renewcommand*{\L@raise}{#1} ,
+ ante.code = \renewcommand*{\L@ante}{#1} ,
+ findent.code = \setlength{\L@Findent}{#1} ,
+ nindent.code = \setlength{\L@Nindent}{#1} ,
+ slope.code = \setlength{\L@slope}{#1} ,
+ novskip.code = \setlength{\L@novskip}{#1} ,
+ image.if = L@image ,
+ grid.if = L@grid ,
+ realheight.if = L@realh ,
+ refstring.default:n = \l@initial ,
+ refstring.store = \l@refstring
+ }
+% \end{macrocode}
%
% \changes{v2.21}{2018/08/28}{Code clean up, new commands
% \cs{computeL@height}, \cs{compute@fontsize}, \cs{setupL@lbox}.}
%
% \begin{macro}{\LettrineTextFont}
-% In French, small caps usually follow the dropped capital.
+% In French, small caps usually follow the initial.
% \begin{macrocode}
\newcommand*{\LettrineTextFont}{\scshape}
\newcommand*{\LettrineSecondString}{x}
@@ -657,41 +713,20 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\LettrineTestString}
+% \begin{macro}{\compute@fontsize}
% After executing |\computeL@height|, |\L@height| holds the exact
% height required for the dropped capital, nothing more is needed if
% the initial is a picture, otherwise we need to compute the matching
% |\fontsize|’s value. This is done by measuring the height of
% a ``reference’’ capital (i.e.\ either listed in
% |\LettrineTestString| or the initial itself).
-% As some font designers apply optical correction to capitals C, G,
-% O, or Q (they are slightly taller than `T’ or `Z’), they are better
-% left out of |\LettrineTestString|. |EFTZ| should be a good default
-% for most fonts.
-%
-% \changes{v1.63}{2012/07/20}{(new) it defaults to
-% `ABCDEFGHIJKLMNOQPRSTUVWXYZ’. In previous versions height
-% computations were based on letter `X’ which might not exist
-% in some (rare) fonts. Pointed out by Raphaël Pinson.}
-%
-% \changes{v2.0}{2018/07/21}{changed from `ABCDEFGHIJKLMNOQPRSTUVWXYZ’
-% to `EFTZ’ as some capitals like C, G, O, Q or X might be slightly
-% taller (possible optical correction).}
-%
-% \begin{macrocode}
-\newcommand*{\LettrineTestString}{EFTZ}
-% \end{macrocode}
-% \end{macro}
-%
-% \begin{macro}{\compute@fontsize}
% This command compares the height of a ``reference’’ capital scaled
-% by |\fontsize| with argument |\L@height| to |\L@height| (the
+% by |\fontsize| with argument |\L@height|, to |\L@height| (the
% required height for the initial); both are converted into integers
-% (in sp) to compute a ratio |\L@factor|.
-% Up to v2.01, possible values for |\L@factor| were either 1 or any
-% value $\geq 1.1$ which was fine for almost every font but not
-% all (i.e.\ \file{cfr-initials}). Starting with v2.1, |\L@factor|
-% is computed more accurately by |\MFPdiv| from \file{minifp.sty}.
+% (in sp), to compute a ratio |\L@factor| (decimal number).
+% Then, the initial will be scaled by |\L@factor\L@height|.
+% Starting with v2.40, |\L@factor| is computed by |\fpeval|
+% from \file{xfp.sty}.
%
% \changes{v2.1}{2018/08/14}{Computation of \cs{L@factor} for
% \cs{fontsize} done by the minifp package.}
@@ -699,17 +734,20 @@
% \changes{v2.22}{2018/09/14}{Warn if \cs{fontsize} computation fails
% due to division by 0.}
%
-% The conditional |\ifL@selfref| is set to \lopt{true} by |\lettrine|
-% option \lopt{refstring}, then the initial itself is taken as
-% reference to compute |\fontsize|, this can be handy when working
-% with fancy fonts (i.e.\ cfr-initials, Yinit). In most cases, the
-% default is a better choice.
+% \changes{v2.40}{2023/04/18}{Computation of \cs{L@factor} for
+% \cs{fontsize} done by the xfp package.}
+%
+% If the option \lopt{refstring} is set in the |\lettrine| command
+% the initial itself is taken as reference to compute |\fontsize|,
+% this can be handy when working with fancy fonts
+% (i.e.\ cfr-initials, Yinit).
+% In most cases, the default is a better choice .
% \begin{macrocode}
\def\compute@fontsize{%
- \ifL@selfref
- \def\Lettrine@RefString{\l@refstring}%
- \else
+ \ifx\l@refstring\@empty
\def\Lettrine@RefString{\LettrineTestString}%
+ \else
+ \def\Lettrine@RefString{\l@refstring}%
\fi
\sbox{\@tempboxa}{\LettrineFontHook
\fontsize{\L@height}{\L@height}\selectfont
@@ -721,7 +759,7 @@
\def\L@factor{1}%
\else
\@tempcntb=\L@height
- \MFPdiv{\the\@tempcntb}{\the\@tempcnta}\L@factor
+ \def\L@factor{\fpeval{\the\@tempcntb/\the\@tempcnta}}%
\fi
}
% \end{macrocode}
@@ -746,7 +784,8 @@
%
% \begin{macro}{\LettrineImage}
% The following definition is for use with dropped capitals defined
-% as images: EPS, PDF, JPG, PNG files (see examples in demo-fr.tex).
+% as images: EPS, PDF, JPG, PNG files (see examples in
+% lettrine-demo-fr.tex).
% Its requires the |graphicx| package to be loaded in the
% preamble with |\usepackage{graphicx}|. The image’s height is
% computed just as in the standard case and passed to
@@ -778,26 +817,6 @@
% \end{macrocode}
% \end{macro}
%
-% Set up keyval initializations for the |\lettrine| command.
-%
-% \begin{macrocode}
-\define@key{L}{lines}{\setcounter{L@lines}{#1}}
-\define@key{L}{depth}{\setcounter{L@depth}{#1}}
-\define@key{L}{lhang}{\renewcommand*{\L@hang}{#1}}
-\define@key{L}{loversize}{\renewcommand*{\L@oversize}{#1}}
-\define@key{L}{lraise}{\renewcommand*{\L@raise}{#1}}
-\define@key{L}{ante}{\renewcommand*{\L@ante}{#1}}
-\define@key{L}{findent}{\setlength{\L@Findent}{#1}}
-\define@key{L}{nindent}{\setlength{\L@Nindent}{#1}}
-\define@key{L}{slope}{\setlength{\L@slope}{#1}}
-\define@key{L}{image}[true]{\csname L@image#1\endcsname}
-\define@key{L}{grid}[true]{\csname L@grid#1\endcsname}
-\define@key{L}{realheight}[true]{\csname L@realh#1\endcsname}
-\define@key{L}{novskip}{\setlength{\L@novskip}{#1}}
-\define@key{L}{refstring}[\l@initial]{\L@selfreftrue
- \def\l@refstring{#1}}
-% \end{macrocode}
-%
% \changes{v1.5}{2003/08/18}{\cs{LettrineOptionsFor} and
% \cs{LettrineWidth} added.}
%
@@ -805,23 +824,33 @@
% This command is to be used in an optional config file (the name
% of which is found in |\DefaultOptionsFile|) to set the values
% of parameters on a per character basis, for instance:\\
-% |\LettrineOptionsFor{A}{slope=0.6em, findent=-1em, nindent=0.6em}|\\
-% creates an internal command (|\l@A-keys| in this example),
-% which expands to the options given as second argument of
-% |\LettrineOptionsFor| for letter `A’.
+% |\LettrineOptionsFor{A}{slope=0.6em, findent=-1em, nindent=0.6em}|
%
% \begin{macrocode}
-\newcommand*{\LettrineOptionsFor}[2]{\@namedef{l@#1-keys}{#2}}
+\newcommand*{\LettrineOptionsFor}[2]{%
+ \edef\l@tmpa{#1}%
+% \end{macrocode}
+% Gobble potential color commands for the initial.
+% \begin{macrocode}
+ \begingroup
+ \def\color##1##{\l@color{##1}}%
+ \let\l@color\@gobbletwo
+ \def\textcolor##1##{\l@textcolor{##1}}%
+ \def\l@textcolor##1##2##3{##3}%
+ \xdef\l@tmpb{\l@initial}%
+ \endgroup
+ \ifx\l@tmpa\l@tmpb \SetKeys[LettrineLocal]{#2}\fi
+ }
% \end{macrocode}
% \end{macro}
%
% \begin{macro}{\lettrine}
-% Now let’s define |\lettrine|.
+% Now let’s define the |\lettrine| command.
%
% \begin{macrocode}
\def\lettrine{\@ifnextchar[\@lettrine{\@lettrine[]}}
\def\@lettrine[#1]#2#3{%
- \def\l@initial{#2}\let\l@refstring\l@initial
+ \def\l@initial{#2}\let\l@refstring\@empty
% \end{macrocode}
%
% \changes{v1.9}{2015/08/31}{\cs{theDefaultLines} changed to
@@ -846,11 +875,11 @@
\ifLettrineRealHeight\L@realhtrue\else\L@realhfalse\fi
% \end{macrocode}
%
-% The final initial size depends on the height of |\L@tbox|; the
-% content of |\L@tbox| depends on option |realheight|, so we have
-% to read |\lettrine|’s optional argument and initialise the
-% |\L@tbox| content now\footnote{Now means before eventually
-% reading the config file.}.
+% Then take the local options passed to |\lettrine| into account.
+% The content of |\L@tbox| depends on option |realheight|, so we
+% have to initialise the |\L@tbox| content now%
+% \footnote{Now means before eventually reading the per character
+% config file.}.
%
% \changes{v1.9}{2015/08/31}{Use the second mandatory
% argument of \cs{lettrine} or \cs{LettrineSecondString} (which
@@ -858,7 +887,7 @@
% the `realheight’ flag.}
%
% \begin{macrocode}
- \setkeys{L}{#1}%
+ \SetKeys[LettrineLocal]{#1}%
\sbox{\L@tbox}{\LettrineTextFont{\LettrineSecondString}}%
\ifL@realh
\def\@tempa{#3}%
@@ -867,7 +896,7 @@
{Empty second argument,\MessageBreak
ignoring option `realheight';}%
\else
- \sbox{\L@tbox}{\LettrineTextFont{#3}}%
+ \sbox{\L@tbox}{{\LettrineTextFont{#3}}}%
\fi
\fi
% \end{macrocode}
@@ -878,74 +907,39 @@
% global command |\l@LOKeys| which will expand to the list of
% options given by |\LettrineOptionsFor| for the current initial
% (defined by |#2|)…
+%
+% \changes{v2.40}{2023/04/18}{Options from the per letter config file
+% are now handled by LaTeX command \cs{SetKeys}.}
+%
+% Take the per character config file into account if any.
% \begin{macrocode}
\if\DefaultOptionsFile\relax
\else
- \begingroup
- \InputIfFileExists{\DefaultOptionsFile}%
- {}%
- {\PackageWarning{lettrine.sty}%
- {File \DefaultOptionsFile\space not found}%
- }%
-% \end{macrocode}
-% Gobble the colour commands, just keep the letter argument.
-% \begin{macrocode}
- \def\color##1##{\l@color{##1}}%
- \let\l@color\@gobbletwo
- \def\textcolor##1##{\l@textcolor{##1}}%
- \def\l@textcolor##1##2##3{##3}%
-% \end{macrocode}
-% Save the list of options relevant to the letter in |#2|
-% in |\l@LOKeys| (list is empty eventually).
-% \begin{macrocode}
- \expandafter\ifx\csname l@#2-keys\endcsname\relax
- \gdef\l@LOKeys{}%
- \else
- \xdef\l@LOKeys{\csname l@#2-keys\endcsname}%
- \fi
- \endgroup
-% \end{macrocode}
-% Now apply these options (the following code executes
-% |\setkeys{L}{\l@LOKeys}}| where |\l@LOKeys| is expanded,
-% see \file{keyval.sty}).
-% \begin{macrocode}
- \def\KV@prefix{KV@L@}%
- \let\@tempc\relax
- \expandafter\KV@do\l@LOKeys,\relax,
% \end{macrocode}
% As some parameters’ values \lopt{findent}, \lopt{nindent} and
% \lopt{slope} ---which do not influence the initial’s size--- may
% be given relative to |\LettrineWidth|, the |\L@lbox| has to be
% set up to evaluate |\LettrineWidth|.
-%
-% \changes{v2.21}{2018/08/28}{\lopt{findent} computation
-% relative to \cs{LettrineWidth} in \lopt{.cfl} files fixed;
-% thanks to Frank Mittelbach for raising the issue.}
-%
% \begin{macrocode}
\setupL@lbox
\setlength{\LettrineWidth}{\wd\L@lbox}%
- \def\KV@prefix{KV@L@}%
- \let\@tempc\relax
- \expandafter\KV@do\l@LOKeys,\relax,
+ \InputIfFileExists{\DefaultOptionsFile}%
+ {}%
+ {\PackageWarning{lettrine.sty}%
+ {File \DefaultOptionsFile\space not found}%
+ }%
% \end{macrocode}
% As local options prevail on those held in the config file, we
-% have to read local options again:
+% have to read again the optionnal argument of |\lettrine|.
% \begin{macrocode}
- \setkeys{L}{#1}%
+ \SetKeys[LettrineLocal]{#1}%
\fi
% \end{macrocode}
-% Options and optional config file have be taken into account, we
-% can now finally save the first mandatory argument of |\lettrine|
-% properly scaled into |\L@lbox|.
-% \begin{macrocode}
- \setupL@lbox
-% \end{macrocode}
-%
% \changes{v1.65}{2014/09/04}{Measure and store the initial’s
% final dimensions.}
% Store the initial’s final dimensions,
% \begin{macrocode}
+ \setupL@lbox
\setlength{\LettrineWidth}{\wd\L@lbox}%
\setlength{\LettrineHeight}{\ht\L@lbox}%
\setlength{\LettrineDepth}{\dp\L@lbox}%
@@ -954,7 +948,7 @@
% \changes{v2.0}{2018/07/21}{Add informations about targeted
% and actual height of the initial to the .log file.}
%
-% print some informations about accuracy to the log file,
+% and print some informations about accuracy to the log file,
% \begin{macrocode}
\begingroup
\def\IeC##1{##1}%
@@ -975,7 +969,7 @@
% \cs{LettrineTextFont}. Suggested by Philipp Lehman.}
%
% \begin{macrocode}
- \sbox{\L@tbox}{\LettrineTextFont{#3}}%
+ \sbox{\L@tbox}{{\LettrineTextFont{#3}}}%
% \end{macrocode}
%
% Start a new paragraph, skipping the necessary amount of space
@@ -1093,12 +1087,16 @@
% \changes{v1.64}{2013/03/14}{Remove \$ around \cs{smash}
% and add \cs{relax}. Bug pointed out by David Monniaux.
% Correction by Enrico Gregorio.}
+%
+% \changes{v2.40}{2023/04/18}{Replace \cs{usebox} by \cs{unhcopy}
+% for box \cs{L@tbox} to allow footnote calls and microtype action.}
+%
% Write the dropped capital into the left margin, and wrap
% the rest of paragraph around it.
% \begin{macrocode}
\smash{\llap{\mbox{\L@ante}\raisebox{\L@lraise}{\usebox{\L@lbox}}%
\hskip \the\L@Findent}}%
- \usebox{\L@tbox}%
+ \unhcopy\L@tbox\relax
% \end{macrocode}
%
%\changes{v2.22}{2019/03/30}{\cs{parshape} reset added in lists.}
@@ -1170,7 +1168,7 @@
%%
%% In case you want to set parameters for some letters
%% in file `optfile.cfl'
-%% \renewcommand{\DefaultOptionsFile}{optfile.cfl}
+%%\renewcommand{\DefaultOptionsFile}{optfile.cfl}
% \end{macrocode}
% \iffalse
%</cfg>
diff --git a/macros/latex/contrib/lettrine/lettrine.ins b/macros/latex/contrib/lettrine/lettrine.ins
deleted file mode 100644
index 4c0c40bc7b..0000000000
--- a/macros/latex/contrib/lettrine/lettrine.ins
+++ /dev/null
@@ -1,84 +0,0 @@
-%%
-%% Copyright (C) 1999-2022 Daniel Flipo.
-%%
-%% This file will generate fast loadable files and documentation
-%% driver files from the doc files in this package when run through
-%% LaTeX or TeX.
-%%
-%% This program can be distributed and/or modified under the terms
-%% of the LaTeX Project Public License either version 1.3c of this
-%% license or (at your option) any later version.
-%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.3c or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
-%%
-\def\batchfile{lettrine.ins}
-\input docstrip.tex
-
-{\ifx\generate\undefined
-\Msg{**********************************************}
-\Msg{*}
-\Msg{* This installation requires docstrip}
-\Msg{* version 2.3c or later.}
-\Msg{*}
-\Msg{* An older version of docstrip has been input}
-\Msg{*}
-\Msg{**********************************************}
-\errhelp{Move or rename old docstrip.tex.}
-\errmessage{Old docstrip in input path}
-\batchmode
-\csname @@end\endcsname
-\fi}
-
-\keepsilent
-\askforoverwritefalse
-
-\usedir{tex/latex/lettrine}
-
-\preamble
-
-This file is a generated file part of the lettrine package.
------------------------------------------------------------
-
-For the copyright see the source file `lettine.dtx'.
-
-This file can be distributed and/or modified under the terms
-of the LaTeX Project Public License either version 1.3c of this
-license or (at your option) any later version.
-The latest version of this license is in
- http://www.latex-project.org/lppl.txt
-and version 1.3c or later is part of all distributions of LaTeX
-version 2005/12/01 or later.
-
-This work has the LPPL maintenance status "maintained".
-
-The Current Maintainer of this work is Daniel Flipo.
-
-Please report errors to: <daniel (dot) flipo (at) free (dot) fr>
-
-\endpreamble
-
-\generate{\file{lettrine.sty}{\from{lettrine.dtx}{sty}}
- \nopreamble
- \file{lettrine.cfg}{\from{lettrine.dtx}{cfg}}
- }
-
-\Msg{***********************************************************}
-\Msg{*}
-\Msg{* To finish the installation you have to move}
-\Msg{* lettrine.sty, lettrine.cfg and the *.cfl files generated}
-\Msg{* from contrib.ins into a directory searched by TeX.}
-\Msg{*}
-\Msg{* If you want to change the default settings, uncomment the}
-\Msg{* lines you want in file lettrine.cfg and customize them.}
-\Msg{*}
-\Msg{* To produce the documentation run lettrine.dtx}
-\Msg{* through LuaLaTeX.}
-\Msg{*}
-\Msg{* Happy TeXing!}
-\Msg{*}
-\Msg{***********************************************************}
-
-\endbatchfile
-\endinput
diff --git a/macros/latex/contrib/pagecolor/README b/macros/latex/contrib/pagecolor/README
index 115461645c..8d1c8ee0c3 100644
--- a/macros/latex/contrib/pagecolor/README
+++ b/macros/latex/contrib/pagecolor/README
@@ -1,4 +1,4 @@
-README for pagecolor package, 2023-02-14, v1.2b
+README for pagecolor package, 2023-04-18, v1.2c
TABLE OF CONTENTS
@@ -46,7 +46,7 @@ LaTeX version 2005-12-01 or later.
==========
"pagecolor" is available on CTAN:
-https://www.ctan.org/pkg/pagecolor
+https://ctan.org/pkg/pagecolor
Also a ZIP file is provided that contains the files:
the manual (pagecolor.pdf), the example (pagecolor-example.tex),
@@ -66,7 +66,7 @@ Installation with ZIP file in TDS format
The ZIP file "pagecolor.tds.zip" contains the files
sorted in a TDS tree. Thus you can directly unpack the
ZIP file inside a TDS tree.
-See https://www.ctan.org/TDS-guidelines for an explanation
+See https://ctan.org/TDS-guidelines for an explanation
of TDS.
Example:
cd /...somewhere.../texmf
@@ -108,7 +108,6 @@ g) Copy the documentation files to
=====================
pagecolor loads other packages:
-- hardwrap
- kvoptions
- xcolor, if the color package has not been loaded before pagecolor
which again load other packages
@@ -129,13 +128,13 @@ they also should be loaded before pagecolor.
6 AUTHOR/MAINTAINER
-=====================
+===================
H.-Martin Münch
7 BUG REPORTS
-==============
+=============
A bug report should contain:
* Comprehensive problem description. This includes error or
@@ -162,6 +161,6 @@ Bug reports can be send to the maintainer:
8 KNOWN PROBLEMS
-=================
+================
* as yet: none. \ No newline at end of file
diff --git a/macros/latex/contrib/pagecolor/pagecolor-crop-example.pdf b/macros/latex/contrib/pagecolor/pagecolor-crop-example.pdf
index 52c21eb648..3a3a9f51ba 100644
--- a/macros/latex/contrib/pagecolor/pagecolor-crop-example.pdf
+++ b/macros/latex/contrib/pagecolor/pagecolor-crop-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/pagecolor/pagecolor-example.pdf b/macros/latex/contrib/pagecolor/pagecolor-example.pdf
index 996f485f6e..d9e8735460 100644
--- a/macros/latex/contrib/pagecolor/pagecolor-example.pdf
+++ b/macros/latex/contrib/pagecolor/pagecolor-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/pagecolor/pagecolor.dtx b/macros/latex/contrib/pagecolor/pagecolor.dtx
index 75e0beec2f..2180821b93 100644
--- a/macros/latex/contrib/pagecolor/pagecolor.dtx
+++ b/macros/latex/contrib/pagecolor/pagecolor.dtx
@@ -1,10 +1,10 @@
% \iffalse meta-comment
%
% File: pagecolor.dtx
-% Version: 2023-02-14 v1.2b
+% Version: 2023-04-18 v1.2c
% Info: Provides thepagecolor
%
-% Copyright (C) 2011 - 2023 by
+% Copyright © 2011 - 2023 by
% H.-Martin Münch <Martin dot Muench at Uni-Bonn dot de>
%
% This work may be distributed and/or modified under the
@@ -28,7 +28,7 @@
% pagecolor-example.tex, pagecolor-example.pdf.
%
% "pagecolor" is available on CTAN:
-% https://www.ctan.org/pkg/pagecolor
+% https://ctan.org/pkg/pagecolor
%
% Also a TDS.ZIP file is provided that contains all the files
% already sorted in a TDS tree:
@@ -49,7 +49,7 @@
\input docstrip.tex
\Msg{******************************************************************}
\Msg{* Installation *}
-\Msg{* Package: pagecolor 2023-02-14 v1.2b Provides thepagecolor (HMM)*}
+\Msg{* Package: pagecolor 2023-04-18 v1.2c Provides thepagecolor (HMM)*}
\Msg{******************************************************************}
\keepsilent
@@ -61,7 +61,8 @@
This is a generated file.
Project: pagecolor
-Version: 2023-02-14 v1.2b
+Version: 2023-04-18 v1.2c
+Info: Provides thepagecolor
Copyright (C) 2011 - 2023 by
H.-Martin Muench <Martin dot Muench at Uni-Bonn dot de>
@@ -136,7 +137,7 @@ In memoriam
% \section{The documentation driver file}
%
% The next bit of code contains the documentation driver file for
-% \TeX , i.\,e., the file that will produce the documentation you
+% \TeX, i.\,e., the file that will produce the documentation you
% are currently reading. It will be extracted from this file by the
% \texttt{docstrip} programme. That is, run \LaTeX{} on \texttt{docstrip}
% and specify the \texttt{driver} option when \texttt{docstrip}
@@ -146,10 +147,10 @@ In memoriam
%<*driver>
\NeedsTeXFormat{LaTeX2e}[2022-11-01]
\ProvidesFile{pagecolor.drv}%
- [2023-02-14 v1.2b Provides thepagecolor (HMM)]
-\documentclass{ltxdoc}[2022/06/22]% v2.1i
-\usepackage{xcolor}[2022/06/12]% v2.14
-\usepackage{holtxdoc}[2019/12/09]% v0.30
+ [2023-04-18 v1.2c Provides thepagecolor (HMM)]
+\documentclass{ltxdoc}[2022/06/22]% v2.1i Standard LaTeX documentation class
+\usepackage{xcolor}[2022/06/12]% v2.14 LaTeX color extensions (UK)
+\usepackage{holtxdoc}[2019/12/09]% v0.30 Private additional ltxdoc support (HO)
\hypersetup{%
pdfsubject={Providing the thepagecolor command (HMM)},%
pdfkeywords={LaTeX, pagecolor, thepagecolor},%
@@ -200,15 +201,15 @@ In memoriam
% \DoNotIndex{\color,\gdef,\lipsum,\ifdefined,\IfPackageAtLeastTF,\IfFormatAtLeastTF}
% \DoNotIndex{\IfPackageLoadedTF,\ifx,\MessageBreak}
% \DoNotIndex{\Alternatives,\transparent,\newcommand,\verb,\listfiles,\newpage}
-% \DoNotIndex{\pagecolor@info,\pagecolor@info@noline,\pagecolor@warning,\pagecolor@warning@noline}
% \DoNotIndex{\AddToHook,\afterpage,\Alternatives,\DeclareStringOption,\holtxdoc,\hyperref}
% \DoNotIndex{\kvoptions,\NeedsTeXFormat,\Oberdiek,\OCG,\options}
+% \DoNotIndex{\PackageInfo,\PackageNoteNoLine,\PackageWarning,\PackageWarningNoLine}
% \DoNotIndex{\pagecolortmpa,\pagecolortmpb,\pagecolortmpc,\pagecolortmpd,\pagecolortmpe,\pagecolortmpf}
% \DoNotIndex{\ProcessKeyvalOptions,\ProvidesPackage,\renewcommand,\RequirePackage}
% \DoNotIndex{\setkeys,\SetupKeyvalOptions,\transparent,\@ifl@t@r,\fmtversion,\PackageError}
%
% \title{The \xpackage{pagecolor} package}
-% \date{2023-02-14 v1.2b}
+% \date{2023-04-18 v1.2c}
% \author{H.-Martin Münch\\\xemail{Martin.Muench at Uni-Bonn.de}}
%
% \maketitle
@@ -269,7 +270,6 @@ In memoriam
% |\restorebackgroundpagecolor| are provided.
%
% \section{Usage}
-%
% \indent Just load the package placing
% \begin{quote}
% |\usepackage[<|\textit{options}|>]{pagecolor}|
@@ -341,12 +341,12 @@ In memoriam
% \begin{description}
% \item[-] \xpackage{transparent} package: With it some object can be made
% (fully or partially) transparent,
-% \url{https://www.ctan.org/pkg/transparent}.
+% \url{https://ctan.org/pkg/transparent}.
%
% \item[-] OCG (Optional Content Groups): It allows for example
% to \textquotedblleft hide\textquotedblright{} something when
% printing the document while keeping the layout,
-% \url{https://www.ctan.org/search?phrase=ocg}.
+% \url{https://ctan.org/search?phrase=ocg}.
% \end{description}
%
% \bigskip
@@ -359,7 +359,6 @@ In memoriam
% \newpage
%
% \section{Example}
-%
% \begin{macrocode}
%<*example>
\NeedsTeXFormat{LaTeX2e}[2022-11-01]
@@ -384,7 +383,7 @@ In memoriam
% \usepackage[cam,center,a3]{crop}[2017/11/19]% 1.10
\usepackage[pagecolor={LightGoldenrod1},%
- nopagecolor={none}]{pagecolor}[2023-02-14]% v1.2b Provides thepagecolor (HMM)
+ nopagecolor={none}]{pagecolor}[2023-04-18]% v1.2c Provides thepagecolor (HMM)
\usepackage{afterpage}[2014/10/28]% v1.08 After-Page Package (DPC)
% The afterpage package is generally not needed,
@@ -401,7 +400,7 @@ In memoriam
\section*{Example for pagecolor}
This example demonstrates the use of package\newline
-\textsf{pagecolor}, v1.2b as of 2023-02-14 (HMM).\newline
+\textsf{pagecolor}, v1.2c as of 2023-04-18 (HMM).\newline
The used options were\newline
\verb|pagecolor={LightGoldenrod1}|\newline
(\verb|pagecolor={none}| would be the default), and\newline
@@ -505,7 +504,6 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
% \StopEventually{}
%
% \section{The implementation}
-%
% We start off by checking that we are loading into \LaTeXe{} and
% announcing the name and version of this package.
%
@@ -515,8 +513,7 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[2022-11-01]
-\ProvidesPackage{pagecolor}[2023-02-14 v1.2b
- Provides thepagecolor (HMM)]
+\ProvidesPackage{pagecolor}[2023-04-18 v1.2c Provides thepagecolor (HMM)]
% \end{macrocode}
%
% A short description of the \xpackage{pagecolor} package:
@@ -526,18 +523,11 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
%% \restorepagecolor, \backgroundpagecolor, \newbackgroundpagecolor{...},
%% and \restorebackgroundpagecolor commands and a replacement for the
%% \nopagecolor command, if this is not available.
-% \end{macrocode}
-%
-% We want to wrap the messages nicely:
-%
-% \begin{macrocode}
-\RequirePackage{hardwrap}[2011/02/12]% v0.2 Hard wrap messages
-\GenerateLogMacros{package}{pagecolor}
-\@ifl@t@r\fmtversion{2022/11/01}{% would have understood
- % \IfFormatAtLeastTF{2022-11-01}{<true code>}{<false code>}
- }{\PackageError{pagecolor}{%
- Newer LaTeX format needed or older undolabl package%
+\providecommand\IfFormatAtLeastTF{\@ifl@t@r\fmtversion}
+
+\IfFormatAtLeastTF{2022/11/01}{\relax}{%
+ \PackageError{pagecolor}{Newer LaTeX format needed or older pagecolor package%
}{Needed LaTeX format version: 2022-11-01 or newer.\MessageBreak%
Found\space\space LaTeX format version: \fmtversion.\MessageBreak%
Either update your TeX distribution\MessageBreak%
@@ -563,15 +553,15 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
}{% xcolor not loaded
\IfPackageLoadedTF{color}{%
\RequirePackage{color}[2022-01-06]% v1.3d Standard LaTeX Color (DPC)
- }{\pagecolor@warning@noline{%
- The pagecolor package must be loaded after either %
- package color or after package xcolor (at your %
- option). Neither package was loaded before package %
- pagecolor. Loading of package xcolor will now be %
- tried automatically. \\%
- When the pagecolor package is used with option %
- pagecolor using a color requiring e.g. x11names %
- option for xcolor package, this will not work!%
+ }{\PackageWarningNoLine{pagecolor}{%
+ The pagecolor package must be loaded after either\MessageBreak%
+ package color or after package xcolor (at your\MessageBreak%
+ option). Neither package was loaded before package\MessageBreak%
+ pagecolor. Loading of package xcolor will now be\MessageBreak%
+ tried automatically.\MessageBreak%
+ When the pagecolor package is used with option\MessageBreak%
+ pagecolor using a color requiring e.g. x11names\MessageBreak%
+ option for xcolor package, this will not work%
}
}
\RequirePackage{xcolor}[2022/06/12]% v2.14 LaTeX color extensions (UK)
@@ -595,30 +585,28 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
% \begin{macrocode}
\ifdefined\nopagecolor\relax
\else
- \pagecolor@info@noline{\string\nopagecolor\ is undefined!}
+ \PackageNoteNoLine{pagecolor}{\string\nopagecolor\ is undefined}
\def\pagecolortmpb{none}
\edef\pagecolortmpa{\pagecolor@nopagecolor}
\ifx\pagecolortmpa\pagecolortmpb
- \pagecolor@warning@noline{%
- Option nopagecolor=none requested but \string\nopagecolor\ %
- unknown: \\%
- By option nopagecolor the "color" to be used with %
- \string\nopagecolor\ %
- is set. The current value is "none" (maybe by default), %
- but command \string\nopagecolor\ is undefined. %
- Therefore the color cannot be "none". %
- Please change the option accordingly! - %
- As first aid nopagecolor is now set to white.%
+ \PackageWarningNoLine{pagecolor}{%
+ Option nopagecolor=none requested but \string\nopagecolor\space unknown:\MessageBreak%
+ By option nopagecolor the "color" to be used with \string\nopagecolor\MessageBreak%
+ is set. The current value is "none" (maybe by default),\MessageBreak%
+ but command \string\nopagecolor\ is undefined.\MessageBreak%
+ Therefore the color cannot be "none".\MessageBreak%
+ Please change the option accordingly! -\MessageBreak%
+ As first aid nopagecolor is now set to white%
}
\setkeys{pagecolor}{nopagecolor=white}
\fi
\edef\pagecolortmpa{\pagecolor@pagecolor}
\ifx\pagecolortmpa\pagecolortmpb\relax
- \pagecolor@warning@noline{%
- Option pagecolor=none (maybe by default) used, %
- but \string\nopagecolor\ is unknown. %
- Please use another option value; %
- \pagecolor@nopagecolor\ will be used now.%
+ \PackageWarningNoLine{pagecolor}{%
+ Option pagecolor=none (maybe by default) used,\MessageBreak%
+ but \string\nopagecolor\ is unknown.\MessageBreak%
+ Please use another option value;\MessageBreak%
+ \pagecolor@nopagecolor\ will be used now%
}
\setkeys{pagecolor}{pagecolor={\pagecolor@nopagecolor}}
\fi
@@ -645,14 +633,13 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
\ifdefined\nopagecolor\relax%
\nopagecolor%
\else%
- \pagecolor@warning{%
- pagecolor=none requested but \string\nopagecolor\ %
- unknown: \\%
- \string\pagecolor{none} was used, but the command %
- \string\nopagecolor\ is undefined. %
- Please use another color. \\%
- pagecolor=\pagecolor@nopagecolor\ \\%
- will be used now.%
+ \PackageWarning{pagecolor}{%
+ pagecolor=none requested but \string\nopagecolor\space unknown:\MessageBreak%
+ \string\pagecolor{none} was used, but the command\MessageBreak%
+ \string\nopagecolor\space is undefined.\MessageBreak%
+ Please use another color.\MessageBreak%
+ pagecolor=\pagecolor@nopagecolor\MessageBreak%
+ will be used now.\MessageBreak%
}%
\xdef\thepagecolor{\pagecolor@nopagecolor}%
\xdef\thepagecolornone{\pagecolor@nopagecolor}%
@@ -679,22 +666,23 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
\gdef\pagecolor@cl{0}
\IfPackageLoadedTF{crop}{% crop loaded
\gdef\pagecolor@cl{1}
- \pagecolor@info{\string\nopagecolor\space did not work with the crop package %
- 2017/11/19 v1.10. Using \\%
- \pagecolor@nopagecolor\ \\%
- as nopagecolor now.%
+ \PackageNoteNoLine{pagecolor}{%
+ \string\nopagecolor\space did not work with the crop package\MessageBreak%
+ 2017/11/19 v1.10. Using\MessageBreak%
+ \pagecolor@nopagecolor\MessageBreak%
+ as nopagecolor now%
}
\def\pagecolortmpb{none}
\edef\pagecolortmpa{\pagecolor@nopagecolor}
\ifx\pagecolortmpa\pagecolortmpb\relax
- \pagecolor@warning@noline{%
- Option nopagecolor=none requested but this does not work with the %
- crop package. By option nopagecolor the "color" to be used with %
- \string\nopagecolor\ is set. The current value is "none" (maybe by %
- default), but the crop package broke \string\nopagecolor . %
- Therefore the color cannot be "none". %
- Please change the option accordingly! %
- As first aid nopagecolor is now set to white.%
+ \PackageWarningNoLine{pagecolor}{%
+ Option nopagecolor=none requested but this does not work with the\MessageBreak%
+ crop package. By option nopagecolor the "color" to be used with\MessageBreak%
+ \string\nopagecolor\ is set. The current value is "none" (maybe by\MessageBreak%
+ default), but the crop package broke \string\nopagecolor .\MessageBreak%
+ Therefore the color cannot be "none".\MessageBreak%
+ Please change the option accordingly!\MessageBreak%
+ As first aid nopagecolor is now set to white%
}
\setkeys{pagecolor}{nopagecolor=white}
\fi
@@ -735,7 +723,7 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
% There have been requests (via e-mail and at
% \url{https://tex.stackexchange.com/q/25137/6865}) to change the color of just one
% (or two) page(s) only, similar to |\newgeometry| and |\restoregeometry| of the
-% \xpackage{geometry} package (\url{https://www.ctan.org/pkg/geometry}).
+% \xpackage{geometry} package (\url{https://ctan.org/pkg/geometry}).
% Therefore |\newpagecolor| and |\restorepagecolor| are introduced (as suggested by
% \textsc{haoyun\_tex}):
% \begin{macrocode}
@@ -804,8 +792,8 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
% Set the background/outer/physical page color:
% \begin{macrocode}
\xdef\CROP@stockcolor{\pagecolortmpe}%
- }{\pagecolor@info{\string\backgroundpagecolor\ does not do %
- anything when the crop package has not been loaded.}%
+ }{\PackageInfo{pagecolor}{\string\backgroundpagecolor\space does not do\MessageBreak%
+ anything when the crop package has not been loaded;\MessageBreak}%
% \end{macrocode}
% - except giving this information.
% \begin{macrocode}
@@ -823,8 +811,8 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
\IfPackageLoadedTF{crop}{%
\xdef\pagecolortmpf{\CROP@stockcolor}%
\backgroundpagecolor{#1}%
- }{\pagecolor@info{\string\newbackgroundpagecolor\ does not do %
- anything when the crop package has not been loaded.}%
+ }{\PackageInfo{pagecolor}{\string\newbackgroundpagecolor\space does not do\MessageBreak%
+ anything when the crop package has not been loaded;\MessageBreak}%
}%
}
@@ -834,8 +822,8 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
% \begin{macrocode}
\newcommand{\restorebackgroundpagecolor}{%
\IfPackageLoadedTF{crop}{\xdef\CROP@stockcolor{\pagecolortmpf}}{%
- \pagecolor@info{\string\newbackgroundpagecolor\ does not do %
- anything when the crop package has not been loaded.}}%
+ \PackageInfo{pagecolor}{\string\newbackgroundpagecolor\space does not do\MessageBreak%
+ anything when the crop package has not been loaded;\MessageBreak}}%
}
% \end{macrocode}
@@ -851,22 +839,22 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
% crop not loaded before pagecolor, but maybe afterwards:
\IfPackageLoadedTF{crop}{% crop indeed loaded afterwards.
\gdef\pagecolor@cl{1}%
- \pagecolor@info{\string\nopagecolor\space did not work with the crop package %
- 2017/11/19 v1.10. Using \\%
- \pagecolor@nopagecolor\ \\%
- as nopagecolor now.%
+ \PackageInfo{pagecolor}{\string\nopagecolor\space did not work with the crop package\MessageBreak%
+ 2017/11/19 v1.10. Using\MessageBreak%
+ \pagecolor@nopagecolor\MessageBreak%
+ as nopagecolor now.\MessageBreak%
}%
\def\pagecolortmpb{none}%
\edef\pagecolortmpa{\pagecolor@nopagecolor}%
\ifx\pagecolortmpa\pagecolortmpb\relax%
- \pagecolor@warning@noline{%
- Option nopagecolor=none requested but this does not work with %
- the crop package. By option nopagecolor the "color" to be used %
- with \string\nopagecolor\ is set. The current value is "none" %
- (maybe by default), but the crop package broke %
- \string\nopagecolor . Therefore the color cannot be "none". %
- Please change the option accordingly! %
- As first aid nopagecolor is now set to white.%
+ \PackageWarningNoLine{pagecolor}{%
+ Option nopagecolor=none requested but this does not work with\MessageBreak%
+ the crop package. By option nopagecolor the "color" to be used\MessageBreak%
+ with \string\nopagecolor\space is set. The current value is "none"\MessageBreak%
+ (maybe by default), but the crop package broke\MessageBreak%
+ \string\nopagecolor . Therefore the color cannot be "none".\MessageBreak%
+ Please change the option accordingly!\MessageBreak%
+ As first aid nopagecolor is now set to white%
}%
\setkeys{pagecolor}{nopagecolor=white}%
\fi%
@@ -884,73 +872,69 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
%
% \section{Installation}
% \subsection{Downloads}
-% Everything is available at \url{https://www.ctan.org},
+% Everything is available at \url{https://ctan.org},
% but may need additional packages themselves.\\
%
% \DescribeMacro{pagecolor.dtx}
% For unpacking the |pagecolor.dtx| file and constructing the documentation
% it is required:
% \begin{description}
-% \item[-] \TeX Format \LaTeXe{} 2022-11-01 or newer: \url{https://www.CTAN.org}
+% \item[-] \TeX-format \LaTeXe{} 2022-11-01 or newer: \url{https://www.CTAN.org/}
%
% \item[-] document class \xclass{ltxdoc}, 2022/06/22, v2.1i,
-% \url{https://www.ctan.org/pkg/ltxdoc}
+% \url{https://ctan.org/pkg/ltxdoc}
%
% \item[-] package \xpackage{holtxdoc}, 2019/12/09, v0.30,
-% \url{https://www.ctan.org/pkg/holtxdoc}
+% \url{https://ctan.org/pkg/holtxdoc}
% \end{description}
%
% \DescribeMacro{pagecolor.sty}
-% The |pagecolor.sty| for \LaTeXe{} (i.\,e. each document using
+% The |pagecolor.sty| for \LaTeXe{} (i.\,e.~each document using
% the \xpackage{pagecolor} package) requires:
% \begin{description}
-% \item[-] \TeX{} Format \LaTeXe{} 2022-11-01 or newer, \url{https://www.CTAN.org}
-%
-% \item[-] package \xpackage{hardwrap}, 2011/02/12, v0.2,
-% \url{https://www.ctan.org/pkg/hardwrap}
+% \item[-] \TeX{}-format \LaTeXe{} 2022-11-01 or newer, \url{https://www.CTAN.org/}
%
% \item[-] package \xpackage{kvoptions}, 2022-06-15, v3.15,
-% \url{https://www.ctan.org/pkg/kvoptions}
+% \url{https://ctan.org/pkg/kvoptions}
+%
+% \item[-] package \xpackage{pagecolor}, 2023-04-18, v1.2c,
+% \url{https://ctan.org/pkg/pagecolor}\\
+% (Because you are reading the documentation for the
+% \xpackage{pagecolor} package, it can be assumed that you already
+% have some version of it~-- is it the current one?)
% \end{description}
% and either
% \begin{description}
% \item[-] package \xpackage{xcolor}, 2022/06/12, v2.14,
-% \url{https://www.ctan.org/pkg/xcolor}
+% \url{https://ctan.org/pkg/xcolor}
% \end{description}
% or
% \begin{description}
% \item[-] package \xpackage{color}, 2022-01-06, v1.3d,
-% \url{https://www.ctan.org/pkg/color} (from the\\
+% \url{https://ctan.org/pkg/color} (from the\\
% \xpackage{graphics} package bundle).
% \end{description}
%
% \DescribeMacro{pagecolor-example.tex}
-% The |pagecolor-example.tex| requires the same file as all
-% documents using the \xpackage{pagecolor} package, i.\,e.
-% \begin{description}
-% \item[-] package \xpackage{pagecolor}, 2023-02-14, v1.2b,
-% \url{https://www.ctan.org/pkg/pagecolor}\\
-% (Well, it is the example file for this package, and because you are reading the
-% documentation for the \xpackage{pagecolor} package, it~can be assumed that you already
-% have some version of it -- is it the current one?)
-% \end{description}
-% and additionally:
+% The |pagecolor-example.tex| requires the same files as all
+% documents using the \xpackage{pagecolor} package
+% (see preceding paragraph |pagecolor.sty|) and additionally:
% \begin{description}
% \item[-] class \xpackage{article}, 2022/07/02, v1.4n, from \xpackage{classes}:\\
-% \url{https://www.ctan.org/pkg/classes}
+% \url{https://ctan.org/pkg/classes}
%
% \item[-] package \xpackage{xcolor}, 2022/06/12, v2.14,
-% \url{https://www.ctan.org/pkg/xcolor}\\
+% \url{https://ctan.org/pkg/xcolor}\\
% This package would not be needed for the use of just base colors only,
% the \xpackage{color} package would be sufficient for that.
%
% \item[-] package \xpackage{afterpage}, 2014/10/28, v1.08,
-% \url{https://www.ctan.org/pkg/afterpage}\\
+% \url{https://ctan.org/pkg/afterpage}\\
% This package is only needed for demonstrating the\\
% |\newpagecolor{somecolor}\afterpage{\restorepagecolor}| construct.
%
% \item[-] package \xpackage{lipsum}, 2021-09-20, v2.7,
-% \url{https://www.ctan.org/pkg/lipsum}\\
+% \url{https://ctan.org/pkg/lipsum}\\
% This package is only needed for some blind text.
% \end{description}
%
@@ -961,10 +945,10 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
% there are listed (newer versions might be available):
% \begin{description}
% \item[-] package \xpackage{transparent}, 2022-10-27, v1.5,\\
-% \url{https://www.ctan.org/pkg/transparent}
+% \url{https://ctan.org/pkg/transparent}
%
% \item[-] OCG (Optional Content Groups),\\
-% \url{https://www.ctan.org/search?phrase=ocg}
+% \url{https://ctan.org/search?phrase=ocg}
% \end{description}
%
% \DescribeMacro{Oberdiek}
@@ -984,7 +968,7 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
%
% \DescribeMacro{Münch}
% A hyperlinked list of my (other) packages can be found at
-% \url{https://www.ctan.org/author/muench-hm}.\\
+% \url{https://ctan.org/author/muench-hm}.\\
%
% \subsection{Package, unpacking TDS}
% \paragraph{Package.} This package is available on \url{https://www.CTAN.org}.
@@ -1014,7 +998,7 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
%
% \bigskip
%
-% \noindent For required other packages, please see the preceding subsection.
+% \noindent For required other packages please see the preceding subsection.
%
% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting
% \docstrip{} archive. The files are extracted by running the
@@ -1149,7 +1133,8 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
% \subsection{Compiling the example}
%
% The example file, \textsf{pagecolor-example.tex}, can be compiled via\\
-% |(pdf)latex pagecolor-example.tex|.
+% |(pdf)latex pagecolor-example.tex|\\
+% and needs at least two compilation runs.
%
% \section{Acknowledgements}
%
@@ -1221,7 +1206,7 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
% \item \XeLaTeX{} and others now do know |\nopagecolor|.
% \item Package \xpackage{crop} has been updated, but |\nopagecolor|
% still applies to the physical background sheet instead of the logical foreground area.
-% \item Now using the \xpackage{hardwrap} package.
+% \item Now using the \xpackage{hardwrap} package. [Removed in v1.2c again.]
% \end{Version}
% \begin{Version}{2022-11-27 v1.2a}
% \item Now also handling the background/outer/physical page color,
@@ -1230,7 +1215,11 @@ was restored by \verb|\restorebackgroundpagecolor| (if crop is used).
% \begin{Version}{2023-02-14 v1.2b}
% \item Example now also handling |\newbackgroundpagecolor| and |\restorebackgroundpagecolor|
% when the \xpackage{crop} package is used.
-% \item Fixed a missing v in version number.
+% \item Fixed a missing |v| in the version number.
+% \end{Version}
+% \begin{Version}{2023-04-18 v1.2c}
+% \item No longer using the \xpackage{hardwrap} package.
+% \item Bug fix: There was an |undolabl| where a |pagecolor| belongs.
% \item Documentation and README updates.
% \end{Version}
% \end{History}
diff --git a/macros/latex/contrib/pagecolor/pagecolor.pdf b/macros/latex/contrib/pagecolor/pagecolor.pdf
index 02a3d46784..b94d9a4e87 100644
--- a/macros/latex/contrib/pagecolor/pagecolor.pdf
+++ b/macros/latex/contrib/pagecolor/pagecolor.pdf
Binary files differ
diff --git a/macros/latex/contrib/prettytok/DEPENDS.txt b/macros/latex/contrib/prettytok/DEPENDS.txt
index dd4fa25323..a575b01313 100644
--- a/macros/latex/contrib/prettytok/DEPENDS.txt
+++ b/macros/latex/contrib/prettytok/DEPENDS.txt
@@ -1 +1,2 @@
precattl
+l3keys2e
diff --git a/macros/latex/contrib/prettytok/README b/macros/latex/contrib/prettytok/README
index 531d9833dd..421737ab54 100644
--- a/macros/latex/contrib/prettytok/README
+++ b/macros/latex/contrib/prettytok/README
@@ -1,6 +1,5 @@
prettytok -- Pretty-print token list
-Pretty-print token lists to HTML file for debugging purposes.
-Open the file in any browser to view the result.
+Pretty-print token lists for debugging purposes.
Can be used to replace |\tl_analysis_show:n|.
@@ -11,7 +10,7 @@ Report bugs at https://github.com/user202729/TeXlib
========
-Copyright 2022 user202729
+Copyright 2022-2023 user202729
This work may be distributed and/or modified under the conditions of the
LaTeX Project Public License (LPPL), either version 1.3c of this license or
@@ -24,4 +23,4 @@ This work has the LPPL maintenance status `maintained'.
The Current Maintainer of this work is user202729.
-This work consists of the files prettytok.sty, prettytok.lua, prettytok_template.html.
+This work consists of the files prettytok.sty, prettytok.lua, prettytok_template.html, prettytok-decode-8bit.py, prettytok-test.tex.
diff --git a/macros/latex/contrib/prettytok/prettytok-decode-8bit.py b/macros/latex/contrib/prettytok/prettytok-decode-8bit.py
new file mode 100755
index 0000000000..231cf84bd9
--- /dev/null
+++ b/macros/latex/contrib/prettytok/prettytok-decode-8bit.py
@@ -0,0 +1,12 @@
+#!/bin/python3
+"""
+A hack to allow decoding for example ^^[ to the proper escape sequence.
+"""
+
+import sys
+import re
+def replace_8bit(match_: re.Match) -> str:
+ return chr(ord(match_.group(1))^0x40)
+if __name__ == '__main__':
+ for line in sys.stdin:
+ sys.stdout.write(re.sub(r"\^\^(.)", replace_8bit, line))
diff --git a/macros/latex/contrib/prettytok/prettytok-test.tex b/macros/latex/contrib/prettytok/prettytok-test.tex
new file mode 100644
index 0000000000..cc3ad7e8fd
--- /dev/null
+++ b/macros/latex/contrib/prettytok/prettytok-test.tex
@@ -0,0 +1,17 @@
+\documentclass{article}
+\usepackage{prettytok}
+
+\prettyN{123{4 5}\6}
+\prettyN{#&^_:}
+\edef\mytest{\prettyeN{\error}}
+
+\prettyN {very long long long long long long long long long long long long long long argument \argument\argument\test123456}
+\prettyeN {very long long long long long long long long long long long long long long argument \argument\argument\test123456}
+
+\ExplSyntaxOn
+\pretty:n {#&^_:}
+\ExplSyntaxOff
+
+\begin {document}
+\prettyW abc \prettystop
+\end {document}
diff --git a/macros/latex/contrib/prettytok/prettytok.lua b/macros/latex/contrib/prettytok/prettytok.lua
index a0aba07243..0abb6595f0 100644
--- a/macros/latex/contrib/prettytok/prettytok.lua
+++ b/macros/latex/contrib/prettytok/prettytok.lua
@@ -6,8 +6,8 @@ end
-- public API :: once the package is loaded, this holds the .tok value of the frozen relax token
prettyprint_frozenrelaxtok=nil
-local function prettyprint_one_arg(tokenlist)
+local function prettyprint_one_arg(tokenlist)
if looks_like_token(tokenlist) then
return prettyprint_one_arg({tokenlist})
end
@@ -46,8 +46,9 @@ local function prettyprint_one_arg(tokenlist)
s=s.."csfrozenrelax(),"
else
s=s.."cs("
- for j=1, #t.csname do
- s=s..t.csname:byte(j)..","
+ -- TODO
+ for _, c in utf8.codes(t.csname) do
+ s=s..c..","
end
s=s.."),"
end
@@ -58,41 +59,192 @@ local function prettyprint_one_arg(tokenlist)
return s
end
-local function check_file_opened()
- -- if it's \relax then get_macro() also returns nil
- if token.get_macro("pretty_check_already_init:") == nil then
- error("Output file not initialized!")
- end
+local function get_output_format()
+ return token.get_macro "_prettytok_mode"
end
local function get_file_number()
- check_file_opened()
- return token.get_mode(token.create("__prettyh_file"))
+ return token.get_mode(token.create("_prettytok_file"))
end
function prettyprint(...)
- local prettyfilenumber=get_file_number()
-
- local s="print_tl("
+ local output_format=get_output_format()
local args={...}
- for i=1, select("#", ...) do
- s=s..prettyprint_one_arg(args[i])
- end
+ if output_format=="html" then
+ local prettyfilenumber=get_file_number()
+
+ local s="print_tl("
+ for i=1, select("#", ...) do
+ s=s..prettyprint_one_arg(args[i])
+ end
+
+ texio.write(prettyfilenumber, s..")//</script><script>\n")
+ else
+ assert(output_format=="term-8bit" or output_format=="term-shell")
+ texio.write_nl("")
+
+ local content=""
+ local content_len=0 -- only count visible content
+
+ local function typeout_content()
+ print(content)
+ content=""
+ content_len=0
+ end
+
+ local function append_content(s) -- only call this on content that takes visible width. For example don't use this to set color
+ assert(type(s)=="string")
+ content=content..s
+ content_len=content_len+utf8.len(s)
+ end
+
+ append_content(token.get_macro "prettytermprefix")
+ local wraplimit=tonumber(token.get_macro "prettytermwraplimit")
+
+ ---- color
+
+ --[[
+ local gray ='\x1b[90m'
+ local red ='\x1b[31m'
+ local green ='\x1b[38;5;121m'
+ local yellow='\x1b[93m'
+ local white ='\x1b[0m'
+ ]]
- texio.write(prettyfilenumber, s..")//</script><script>\n")
+ local gray =token.get_macro "_prettytok_gray"
+ local red =token.get_macro "_prettytok_red"
+ local green =token.get_macro "_prettytok_green"
+ local yellow=token.get_macro "_prettytok_yellow"
+ local white =token.get_macro "_prettytok_white"
+
+ local current_color=white
+ local function setcolor(c)
+ if current_color~=c then
+ current_color=c
+ content=content..c
+ end
+ end
+
+ local prettytermprefixmore=token.get_macro "prettytermprefixmore"
+
+ local function check_wrap()
+ if content_len>wraplimit then
+ if current_color~=white then
+ content=content..white
+ end
+ print(content)
+
+ content=""
+ content_len=0
+ append_content(prettytermprefixmore)
+ if current_color~=white then
+ content=content..current_color
+ end
+ end
+ end
+
+ local function prettyprint_term_one_arg(tokenlist)
+ if looks_like_token(tokenlist) then
+ return prettyprint_term_one_arg({tokenlist})
+ end
+
+
+ local function print_term_char(code)
+ if code<27 then
+ if code==9 then
+ append_content("⇥")
+ else
+ append_content("^^"..string.char(code+64))
+ if code==13 or code==10 then
+ typeout_content()
+ append_content(prettytermprefixmore) -- color the prefix with the same color
+ end
+ end
+ elseif code==32 then
+ append_content("␣")
+ else
+ append_content(utf8.char(code)) -- unlike TeX implementation currently this does not show ^^⟨hex digits⟩ representation
+ end
+ end
+
+
+ local function printstring(t)
+ -- this is just for debugging/convenience purpose. If the item is a string instead of a token...
+ t=tostring(t)
+ for _, c in utf8.codes(t) do
+ if c==32 then
+ setcolor(gray)
+ append_content("␣")
+ else
+ setcolor(white)
+ append_content(utf8.char(c))
+ end
+ end
+ end
+
+ if type(tokenlist)~="table" then
+ -- user give a string (or something similar). Print it as detokenized characters
+ printstring(tokenlist)
+ check_wrap()
+
+ else
+
+ -- normal print of tokenlist
+ for i=1, #tokenlist do
+ local t=tokenlist[i]
+ if not looks_like_token(t) then
+ printstring(t)
+ check_wrap()
+ elseif t.csname==nil then
+ setcolor(({left_brace=red, right_brace=red, math_shift=red, tab_mark=red, mac_param=red, sup_mark=red, sub_mark=red, spacer=gray, letter=green, other_char=white})[t.cmdname])
+ print_term_char(t.mode)
+ check_wrap()
+ else
+ if t.active then
+ setcolor(yellow)
+ print_term_char(utf8.codepoint(t.csname))
+ elseif t.tok==prettyprint_frozenrelaxtok then
+ setcolor(red)
+ append_content("\\relax ")
+ else
+ setcolor(yellow)
+ append_content("\\")
+ for _, c in utf8.codes(t.csname) do
+ print_term_char(c)
+ end
+ append_content(" ")
+ end
+ check_wrap()
+ end
+ end
+
+ end
+ end
+
+ for i=1, select("#", ...) do
+ prettyprint_term_one_arg(args[i])
+ end
+
+ setcolor(white)
+
+ typeout_content()
+ end
end
function prettyprintw()
- check_file_opened()
+ local callback=token.scan_toks()
local extra=token.scan_toks()
local s={}
+ local last_token
while true do
- local n=token.get_next()
- s[#s+1]=n
- if n.csname=="prettystop" then break end
+ last_token=token.get_next()
+ if last_token.csname=="prettystop" then break end
+ s[#s+1]=last_token
+ callback[#callback+1]=last_token
end
- prettyprint(extra, s)
- token.put_next(s)
+ prettyprint(extra, s) -- exclude the \prettystop token
+ callback[#callback+1]=last_token
+ token.put_next(callback)
end
end
diff --git a/macros/latex/contrib/prettytok/prettytok.pdf b/macros/latex/contrib/prettytok/prettytok.pdf
index 5b10ffaf19..87fda692ff 100644
--- a/macros/latex/contrib/prettytok/prettytok.pdf
+++ b/macros/latex/contrib/prettytok/prettytok.pdf
Binary files differ
diff --git a/macros/latex/contrib/prettytok/prettytok.sty b/macros/latex/contrib/prettytok/prettytok.sty
index 3acea38c62..d12abc727d 100644
--- a/macros/latex/contrib/prettytok/prettytok.sty
+++ b/macros/latex/contrib/prettytok/prettytok.sty
@@ -1,5 +1,5 @@
% File: prettytok.sty
-% Copyright 2022 user202729
+% Copyright 2022-2023 user202729
%
% This work may be distributed and/or modified under the conditions of the
% LaTeX Project Public License (LPPL), either version 1.3c of this license or
@@ -12,33 +12,60 @@
%
% The Current Maintainer of this work is user202729.
-\ProvidesExplPackage{prettytok}{2022/07/08}{0.0.1}{Pretty-print token list}
+\ProvidesExplPackage{prettytok}{2023-04-18}{0.2.0}{Pretty-print token list}
\RequirePackage{precattl}
+\RequirePackage{l3keys2e}
-% ======== check tl_analysis bug.
-\msg_new:nnn {prettytok} {tl-analysis-bug}
- {
- Because~of~an~tl-analysis~bug~(see~https://github.com/latex3/latex3/issues/1073),~functions~will~not~be~usable~inside~tl-analysis~functions!~
- Upgrade~your~LaTeX~version,~or~
- define~macro~"prettyignoretlanalysisbug"~before~loading~the~package~to~ignore~this~error.
- }
+\keys_define:nn{prettytok}{
+ mode.choices:nn={ term-8bit, term-shell, html }{
+ \str_set:Nx \_prettytok_mode {\l_keys_choice_tl}
+ },
+ mode.initial:n = { term-8bit },
-\ifdefined \prettyignoretlanalysisbug
- \relax
-\else
-\begingroup
- \tl_set:Nn \__test {}
+ ignore-tlanalysis-bug.bool_set:N=\_prettytok_ignore_tlanalysis_bug,
+
+ term-shell-decode-cmd.tl_set:N=\_prettytok_term_shell_decode_cmd,
+ term-shell-decode-cmd.initial:n={},
+ term-shell-decode-cmd-print.bool_set:N=\_prettytok_term_shell_decode_cmd_print,
+
+ html-file-name.tl_set:N=\_prettytok_html_file_name,
+ html-file-name.initial:x={pretty-\jobname.html},
+ html-refresh-strategy.tl_set:N=\_prettytok_html_refresh_strategy,
+ html-refresh-strategy.initial:n=4,
+ html-refresh-duration.tl_set:N=\_prettytok_html_refresh_duration,
+ html-refresh-duration.initial:n=1000,
+
+ term-prefix.tl_set:N=\prettytermprefix,
+ term-prefix.initial:n={>~},
+ term-prefix-more.tl_set:N=\prettytermprefixmore,
+ term-prefix-more.initial:n={>~ ..~},
+ term-wrap-limit.tl_set:N=\prettytermwraplimit,
+ term-wrap-limit.initial:n=70,
+
+}
+\ProcessKeysOptions{prettytok}
+
+
+% ======== check tl_analysis bug.
+\bool_if:NF \_prettytok_ignore_tlanalysis_bug {
+ \tl_set:Nn \_prettytok_test {}
\tl_analysis_map_inline:nn {ab} {
\tl_analysis_map_inline:nn {cd} {
- \tl_put_right:Nx \__test {#1 ##1 .}
+ \tl_put_right:Nx \_prettytok_test {#1 ##1 .}
}
}
- \tl_if_eq:NnF \__test {ac.ad.bc.bd.} {
+ \tl_if_eq:NnF \_prettytok_test {ac.ad.bc.bd.} {
+ \msg_new:nnn {prettytok} {tl-analysis-bug}
+ {
+ Because~of~an~tl-analysis~bug~(see~https://github.com/latex3/latex3/issues/1073),~
+ functions~will~not~be~usable~inside~tl-analysis~functions!~
+ Upgrade~your~LaTeX~version,~or~
+ pass-option~"ignore-tlanalysis-bug"~to~ignore~this~error.
+ }
\msg_error:nn {prettytok} {tl-analysis-bug}
}
-\endgroup
-\fi
+}
% ======== load Lua module.
\sys_if_engine_luatex:T{
@@ -49,7 +76,6 @@
}
% ======== main code start.
-
\cs_generate_variant:Nn \exp_args:NNn {NNx}
\cs_generate_variant:Nn \iow_open:Nn {NV}
\cs_generate_variant:Nn \exp_args:NNn {NNV}
@@ -59,90 +85,241 @@
\cs_generate_variant:Nn \use:N {c}
\cs_generate_variant:Nn \str_map_inline:nn {xn}
\cs_generate_variant:Nn \tl_build_put_right:Nn {Nx}
+\cs_generate_variant:Nn \tl_build_put_right:Nn {NV}
\cs_generate_variant:Nn \iow_now:Nn {NV}
-\iow_new:N \_prettytok_file
-\ior_new:N \_prettytok_input_template_file
+\str_if_eq:VnTF \_prettytok_mode {html} {
+ \iow_new:N \_prettytok_file
+ \ior_new:N \_prettytok_input_template_file
+
+ \iow_open:NV \_prettytok_file \_prettytok_html_file_name
-\exp_args:NNx \providecommand \prettyfilename {pretty-\jobname.html}
-\providecommand \prettyrefreshstrategy {4}
-\providecommand \prettyrefreshduration {1000}
+ \precattl_exec:n{
+ % write the template
+ \ior_open:Nn \_prettytok_input_template_file {prettytok_template.html}
+ \ior_str_map_variable:NNn \_prettytok_input_template_file \_prettytok_line {
+ \str_replace_all:Nnn \_prettytok_line {\cO\^^I} {~} % workaround: XeTeX prints literal tab character as ^^I which obviously breaks JavaScript
+ \iow_now:NV \_prettytok_file \_prettytok_line
+ }
+ \ior_close:N \_prettytok_input_template_file
-\msg_new:nnn {prettytok} {already-initialized} {Output~file~is~already~initialized!}
+ % refresh strategy
+ \iow_now:Nx \_prettytok_file {set_refresh_strategy(\_prettytok_html_refresh_strategy,\_prettytok_html_refresh_duration)}
+ \cs_new_protected:Npn \pretty:n #1 {
-% See also Lua function: local function check_file_opened()
+ % ======== the actual content. Collect to one \write to put them on the same line (also maybe for efficiency???)
+ \tl_build_begin:N \_prettytok_content
+ \tl_build_put_right:Nn \_prettytok_content {print_tl(}
+ \tl_analysis_map_inline:nn {#1} {
+ % by documentation of \tl_analysis_map_inline:nn: #1=token, #2=char code, #3=catcode
+ \int_compare:nNnTF {##2} = {-1} {
+ % token is control sequence
+ \tl_if_eq:onTF {##1} {\cFrozenRelax} {
+ \tl_build_put_right:Nn \_prettytok_content {csfrozenrelax(),}
+ } {
+ \tl_build_put_right:Nn \_prettytok_content {cs(}
+ \tl_if_eq:xoF {\use:c {}} {##1} {
+ \str_map_inline:xn {\exp_after:wN \cs_to_str:N ##1} { % side note, must use str here to preserve spaces
+ \tl_build_put_right:Nx \_prettytok_content {\int_eval:n {`####1},}
+ }
+ }
+ \tl_build_put_right:Nn \_prettytok_content {),}
+ }
+ }
+ {
+ % token is not control sequence
+ \tl_build_put_right:Nn \_prettytok_content {token(##2, "##3"),}
+ }
+ }
+ \tl_build_put_right:Nn \_prettytok_content {)//</script><script>}
+ \tl_build_end:N \_prettytok_content
+ \iow_now:NV \_prettytok_file \_prettytok_content
+ }
+ }
-\global\let \pretty_check_already_init: \relax
+} {
+ \str_if_eq:VnTF \_prettytok_mode {term-shell} {
+ \newwrite \_prettytok_typeout_stream
+ \tl_if_empty:NTF \_prettytok_term_shell_decode_cmd {
+ \sys_get_shell:nnN {kpsewhich~ prettytok-decode-8bit.py} {\cctab_select:N \c_other_cctab} \_prettytok_term_shell_decode_cmd
+ } {
+ \begingroup
+ \escapechar=-1~
+ \str_gset:NV \_prettytok_term_shell_decode_cmd \_prettytok_term_shell_decode_cmd
+ \endgroup
+ }
+ \bool_if:NT \_prettytok_term_shell_decode_cmd_print {
+ \typeout{^^JThe~ value~ of~ term-shell-decode-cmd~ is:~ [[[\_prettytok_term_shell_decode_cmd]]]^^J}
+ }
+ \immediate \openout \_prettytok_typeout_stream = {|\_prettytok_term_shell_decode_cmd}
+ } {
+ \int_const:Nn \_prettytok_typeout_stream {128} % 16 works except on LuaLaTeX
+ }
-\precattl_exec:n {
- \cs_new_protected:Npn \_prettyinit_unchecked: {
- \global\protected\def \pretty_check_already_init: {\msg_error:nn {prettytok} {already-initialized}}
- \iow_open:NV \_prettytok_file \prettyfilename
+ \precattl_exec:n{
+ \str_gset:Nn \_prettytok_gray {\cO\^^[[90m}
+ \str_gset:Nn \_prettytok_red {\cO\^^[[31m}
+ \str_gset:Nn \_prettytok_green {\cO\^^[[38;5;121m} % this is the color vim use for green on my machine. Anyway~
+ %\str_gset:Nn \_prettytok_green {\cO\^^[[92m}
+ \str_gset:Nn \_prettytok_yellow {\cO\^^[[93m}
+ %\str_gset:Nn \_prettytok_white {\cO\^^[[0m} % i.e. the default
+ \str_gset:Nn \_prettytok_white {\cO\^^[[97m} % vim terminal has a quirk that if a line wraps, the status at the start of the line is considered "default" for that line, so need to explicitly specify color as white
- % write the template
- \begingroup
- \ior_open:Nn \_prettytok_input_template_file {prettytok_template.html}
- \ior_str_map_variable:NNn \_prettytok_input_template_file \_prettytok_line {
- \str_replace_all:Nnn \_prettytok_line {\cO\^^I} {~} % workaround: XeTeX prints literal tab character as ^^I which obviously breaks JavaScript
- \iow_now:NV \_prettytok_file \_prettytok_line
- }
- \ior_close:N \_prettytok_input_template_file
- \endgroup
+ % https://stackoverflow.com/q/4842424/5267751
- % refresh strategy
- \iow_now:Nx \_prettytok_file {set_refresh_strategy(\prettyrefreshstrategy,\prettyrefreshduration)}
+ \cs_new_protected:Npn \_prettytok_setcolor:N #1 {
+ \ifx \_prettytok_current_color #1
+ \else
+ \let \_prettytok_current_color #1
+ \tl_build_put_right:NV \_prettytok_content #1
+ \fi
}
- \cs_new_protected:Npn \prettyinit: {
- \pretty_check_already_init:
- \_prettyinit_unchecked:
+ % caller should call \_prettytok_check_wrap: when useful.
+ \cs_new_protected:Npn \_prettytok_term_prepare_print_char:n #1 {
+ \_prettytok_append_content:x {
+ \ifnum #1 < 27 ~
+ \ifnum #1 = 9 ~ % tab
+ \cO{⇥}
+ \else
+ \cO{\^\^} \char_generate:nn {#1+64} {12}
+ \bool_if:nT {\int_compare_p:nNn {#1} = {13} || \int_compare_p:nNn {#1} = {10}} {
+ \cO{^^J} \prettytermprefixmore
+ }
+ \fi
+ \else
+ \ifnum #1 = 32 ~
+ \cO{␣}
+ \else
+ \bool_if:nTF {\int_compare_p:nNn {#1} > {32} && \int_compare_p:nNn {#1} < {127}} { % printable ASCII character
+ \char_generate:nn {#1} {12}
+ } {
+ \ifnum #1 < "100 ~
+ ^ ^
+ \expandafter \@gobble \exp:w \exp_end_continue_f:w \int_to_hex:n {"100+#1} % convert to hex, exactly 2 digits (by adding 100 then delete first '1')
+ \else
+ \ifnum #1 < "10000 ~
+ ^ ^ ^ ^
+ \expandafter \@gobble \exp:w \exp_end_continue_f:w \int_to_hex:n {"10000+#1} % convert to hex, exactly 4 digits
+ \else
+ ^ ^ ^ ^ ^ ^
+ \expandafter \@gobble \exp:w \exp_end_continue_f:w \int_to_hex:n {"1000000+#1} % convert to hex, exactly 6 digits
+ \fi
+ \fi
+ }
+ \fi
+ \fi
+ }
}
-}
+ \cs_generate_variant:Nn \_prettytok_term_prepare_print_char:n {x}
-\cs_new_eq:NN \prettyinit \prettyinit:
+ \int_new:N \_prettytok_content_len
+ % only call this on content that takes visible width. For example don't use this to set color
+ \cs_new_protected:Npn \_prettytok_append_content:n #1 {
+ \tl_build_put_right:Nn \_prettytok_content {#1}
+ \int_add:Nn \_prettytok_content_len {\str_count:n {#1}}
+ }
-\precattl_exec:n {
+ \cs_generate_variant:Nn \_prettytok_append_content:n {V,x}
+
+ \cs_new_protected:Npn \_prettytok_check_wrap: {
+ \int_compare:nNnT {\_prettytok_content_len} > {\prettytermwraplimit} {
+ % be careful to not color the \prettytermprefixmore part
+ \ifx \_prettytok_current_color \_prettytok_white
+ \else
+ \tl_build_put_right:NV \_prettytok_content \_prettytok_white
+ \fi
+ \tl_build_end:N \_prettytok_content
+ \_prettytok_typeout_content:
+
+ \tl_build_begin:N \_prettytok_content
+ \int_zero:N \_prettytok_content_len
+ \_prettytok_append_content:V \prettytermprefixmore
+ \ifx \_prettytok_current_color \_prettytok_white
+ \else
+ \tl_build_put_right:NV \_prettytok_content \_prettytok_current_color
+ \fi
+ }
+ }
+ % \_prettytok_content must have been called \tl_build_end:N on before this function is called
+ \sys_if_engine_luatex:TF {
+ \cs_new_protected:Npn \_prettytok_typeout_content: {
+ \directlua{
+ texio.write_nl("")
+ print(token.get_macro("_prettytok_content"))
+ } % https://tex.stackexchange.com/questions/64462/lualatex-print-directlua-env-and-newlinehttps://tex.stackexchange.com/questions/64462/lualatex-print-directlua-env-and-newline
+ }
+ } {
+ \cs_new_protected:Npn \_prettytok_typeout_content: {
+ \immediate\write\_prettytok_typeout_stream{\_prettytok_content}
+ }
+ }
\cs_new_protected:Npn \pretty:n #1 {
+ \tl_build_begin:N \_prettytok_content
+ \int_zero:N \_prettytok_content_len
+ \_prettytok_append_content:V \prettytermprefix
- % ======== first write out the preamble if it isn't written. Only do once.
- \ifx \pretty_check_already_init: \relax \prettyinit: \fi
+ \let \_prettytok_current_color \_prettytok_white
- % ======== the actual content. Collect to one \write to put them on the same line (also maybe for efficiency???)
- \tl_build_begin:N \_prettytok_content
- \tl_build_put_right:Nn \_prettytok_content {print_tl(}
\tl_analysis_map_inline:nn {#1} {
% by documentation of \tl_analysis_map_inline:nn: #1=token, #2=char code, #3=catcode
\int_compare:nNnTF {##2} = {-1} {
% token is control sequence
\tl_if_eq:onTF {##1} {\cFrozenRelax} {
- \tl_build_put_right:Nn \_prettytok_content {csfrozenrelax(),}
+ \_prettytok_setcolor:N \_prettytok_red
+ \_prettytok_append_content:n { \cO\\relax~ }
} {
- \tl_build_put_right:Nn \_prettytok_content {cs(}
+ \_prettytok_setcolor:N \_prettytok_yellow
+ \_prettytok_append_content:n { \cO\\ }
\tl_if_eq:xoF {\use:c {}} {##1} {
\str_map_inline:xn {\exp_after:wN \cs_to_str:N ##1} { % side note, must use str here to preserve spaces
- \tl_build_put_right:Nx \_prettytok_content {\int_eval:n {`####1},}
+ \_prettytok_term_prepare_print_char:x {\int_eval:n {`####1}}
}
}
- \tl_build_put_right:Nn \_prettytok_content {),}
+ \_prettytok_append_content:n {~}
+ \_prettytok_check_wrap: % here we do not wrap in the middle of a csname
}
}
{
% token is not control sequence
- \tl_build_put_right:Nn \_prettytok_content {token(##2, "##3"),}
+ \if ##3 B % letter
+ \_prettytok_setcolor:N \_prettytok_green
+ \else
+ \if ##3 A % spacer
+ \_prettytok_setcolor:N \_prettytok_gray
+ \else
+ \if ##3 D % active
+ \_prettytok_setcolor:N \_prettytok_yellow
+ \else
+ \if ##3 C % other cat
+ \_prettytok_setcolor:N \_prettytok_white
+ \else % something else.
+ \_prettytok_setcolor:N \_prettytok_red
+ \fi
+ \fi
+ \fi
+ \fi
+
+ \_prettytok_term_prepare_print_char:n {##2}
+ \_prettytok_check_wrap:
}
}
- \tl_build_put_right:Nn \_prettytok_content {)//</script><script>}
+ \_prettytok_setcolor:N \_prettytok_white
\tl_build_end:N \_prettytok_content
- \iow_now:NV \_prettytok_file \_prettytok_content
+
+ \_prettytok_typeout_content:
+ }
}
+
}
+
% ======== Lua expandable variant.
\sys_if_engine_luatex:T {
\cs_new:Npn \prettye:n #1 {
@@ -150,65 +327,84 @@
}
\cs_new:Npn \prettye:w {
- \directlua{prettyprintw()} {}
+ \directlua{prettyprintw()} {} {}
}
\cs_new:Npn \prettye:nw #1 {
- \directlua{prettyprintw()} {#1}
+ \directlua{prettyprintw()} {#1} {}
+ }
+ \cs_new:Npn \prettye:nnw #1 #2 {
+ \directlua{prettyprintw()} {#1} {#2}
}
}
-\cs_new_protected:Npn \pretty:w #1 \prettystop {
- \pretty:n {#1} #1 \prettystop
-}
+% ======== w variant.
+\cs_new_protected:Npn \pretty:w { \pretty_aux:w \empty }
+\cs_new_protected:Npn \pretty_aux:w #1 \prettystop {
+ \pretty:o { #1 } % use o-expansion to remove the \empty
+ #1 \prettystop
+}
\cs_new:Npn \prettystop {}
+% ======== other variants.
\cs_generate_variant:Nn \pretty:n {x, o, V}
-\let \pretty:N \pretty:n
+\cs_new_eq:NN \pretty:N \pretty:n
+\cs_generate_variant:Nn \pretty:N {c}
-% ======== normal-catcode alias
-\let\prettyN\pretty:n
-\let\prettyX\pretty:x
-\let\prettyO\pretty:o
-\let\prettyV\pretty:V
-\let\prettyeN\prettye:n
-\let\prettyeW\prettye:w
+\cs_new_protected:Npn \prettythenrun:n #1 {
+ \pretty:n {running~#1}
+ #1
+ \pretty:n {done}
+}
+\cs_new_protected:Npn \prettythenrun:w #1 \prettythenrunstop {
+ \prettythenrun:n {#1}
+}
-\cs_generate_variant:Nn \pretty:N {c}
+\cs_new_protected:Nn \prettyshow:N { \pretty:o {\meaning #1} }
+\cs_generate_variant:Nn \prettyshow:N {c}
% ======== generate \pretty:nn, \pretty:nnn, etc.
\begingroup
- \def \__tmp:NN #1 #2 { % #1: example \pretty:nn, #2: example \pretty:n (the latter has one more n than the former)
+ \def \_prettytok_tmp:NN #1 #2 { % #1: example \pretty:nn, #2: example \pretty:n (the latter has one more n than the former)
\cs_new_protected:Npn #1 ##1 ##2 { #2 {##1 ##2} }
}
- \cs_generate_variant:Nn \__tmp:NN {cc}
+ \cs_generate_variant:Nn \_prettytok_tmp:NN {cc}
- \def \__tmp {pretty:n}
+ \def \_prettytok_tmp {pretty:n}
\int_step_inline:nn {9} {
- \__tmp:cc {\__tmp n} {\__tmp}
- \tl_put_right:Nn \__tmp {n}
+ \_prettytok_tmp:cc {\_prettytok_tmp n} {\_prettytok_tmp}
+ \tl_put_right:Nn \_prettytok_tmp {n}
}
\sys_if_engine_luatex:T {
- \def \__tmp:NN #1 #2 { % #1: example \prettye:nn, #2: example \prettye:n (the latter has one more n than the former)
+ \def \_prettytok_tmp:NN #1 #2 { % #1: example \prettye:nn, #2: example \prettye:n (the latter has one more n than the former)
\cs_new:Npn #1 ##1 ##2 { #2 {##1 ##2} }
}
- \def \__tmp {prettye:n}
+ \def \_prettytok_tmp {prettye:n}
+ \int_step_inline:nn {9} {
+ \_prettytok_tmp:cc {\_prettytok_tmp n} {\_prettytok_tmp}
+ \tl_put_right:Nn \_prettytok_tmp {n}
+ }
+
+ \def \_prettytok_tmp:NN #1 #2 { % #1: example \prettye:nnnw, #2: example \prettye:nnw (the latter has one more n than the former)
+ \cs_new:Npn #1 ##1 ##2 ##3 { #2 {##1} {##2 ##3} } % here ##1 is the callback (first ⟨n⟩), ##2 etc. are the additional-print things
+ }
+ \def \_prettytok_tmp {prettye:nn}
\int_step_inline:nn {9} {
- \__tmp:cc {\__tmp n} {\__tmp}
- \__tmp:cc {\__tmp nw} {\__tmp w}
- \tl_put_right:Nn \__tmp {n}
+ \_prettytok_tmp:cc {\_prettytok_tmp nw} {\_prettytok_tmp w}
+ \tl_put_right:Nn \_prettytok_tmp {n}
}
}
\endgroup
-
-\cs_new_protected:Nn \prettyshow:N {
- \exp_args:No \pretty:n {\meaning #1}
-}
-\cs_generate_variant:Nn \prettyshow:N {c}
+% ======== normal-catcode alias
+\let\prettyN\pretty:n
+\let\prettyX\pretty:x
+\let\prettyO\pretty:o
+\let\prettyV\pretty:V
+\let\prettyW\pretty:w
+\let\prettyeN\prettye:n
+\let\prettyeW\prettye:w
\let\prettyshowN\prettyshow:N
\let\prettyshowC\prettyshow:c
-
-
diff --git a/macros/latex/contrib/prettytok/prettytok.tex b/macros/latex/contrib/prettytok/prettytok.tex
index 96878ec457..ddd77dc494 100644
--- a/macros/latex/contrib/prettytok/prettytok.tex
+++ b/macros/latex/contrib/prettytok/prettytok.tex
@@ -1,14 +1,19 @@
%! TEX program = lualatex
-\ProvidesFile{prettytok.tex} [2022/07/08 v0.0.1 ]
+\ProvidesFile{prettytok.tex} [2023/04/18 v0.2.0 ]
+\RequirePackage{fvextra}
\documentclass{l3doc}
+\usepackage[svgnames]{xcolor}
\EnableCrossrefs
\CodelineIndex
-\RecordChanges
+\fvset{breaklines=true,gobble=0,tabsize=4,frame=single,numbers=left,numbersep=3pt}
+\AtBeginDocument{\DeleteShortVerb\"}
+\MakeOuterQuote{"}
+\usepackage{cleveref}
\begin{document}
+\hfuzz=1pt
\GetFileInfo{\jobname.tex}
-\DoNotIndex{\newcommand,\newenvironment}
-\title{\textsf{prettytok} --- Pretty-print token lists\thanks{This file
+\title{\pkg{prettytok} --- Pretty-print token lists\thanks{This file
describes version \fileversion, last revised \filedate.}
}
\author{user202729%
@@ -18,110 +23,300 @@
\maketitle
-\changes{v0.0.0}{2022/05/18}{First public release}
-
\begin{abstract}
-Pretty-print token lists to HTML file for debugging purposes.
-Open the file in any browser to view the result.
+Pretty-print token lists for debugging purposes.
Can be used to replace |\tl_analysis_show:n|.
\end{abstract}
+\section{Motivation}
+
+\TeX/\LaTeX's default mechanism for debug-printing -- that is, the following:
+\begin{itemize}
+ \item |\showtokens{...}|,
+ \item |\show...|,
+ \item |\typeout{\unexpanded{...}}|,
+ \item |\tl_show:n|,
+ \item etc.
+\end{itemize}
+has a few limitations:
+
+\begin{itemize}
+ \item |\show| and similar is considered an error and stops the \TeX\ run. (this point is partially fixable, see the package writer's question \url{https://tex.stackexchange.com/q/621919/250119})
+ \item If there's some unprintable character in the output (for example, |^^J|, |^^M|, |^^I| -- literal tab character), it's not easy to distinguish between them.
+ \item If some token has unexpected catcode (most commonly, letter versus other), it's not easy to distinguish as well.
+ \item They does not work in expansion-only context.
+
+ (apart from |\msg_expandable_error:nn|, but this one suffers from the first problem as well)
+\end{itemize}
+
+|\tl_analysis_show:n| attempts to fix the third problem, but is very, very verbose and does not fix the other problems.
+
+This package aims to fix all of them.
+
+(although the expandable debug printing functions are \LuaTeX-only.)
+
+And some more additional (expandable in \LuaTeX) functions to inspect the content of the input stream at a particular moment in time.
+
+
\section{Usage}
+\subsection{A complete example}
+
+For a full example, the following code, which prints several things, both using the \LaTeXe\ interface
+and using the \pkg{expl3}-style interface, using both expandable and unexpandable command (the former requires \LuaTeX, as mentioned in \ref{subsec:expandable-interface}):
+\VerbatimInput{prettytok-test.tex}
+The corresponding output (in the current version) is:
+\begingroup%
+\ExplSyntaxOn
+
+\definecolor{myyellow}{RGB}{173, 174, 0}
+\definecolor{mygreen}{RGB}{52, 174, 0}
+
+\let \\ \textbackslash
+\def \cmd#1{\textcolor{myyellow}{\textbf{\textbackslash}#1}}
+\def \spec#1 {\textcolor{red}{#1}}
+\def \letr#1 {\textcolor{mygreen}{#1}}
+\setlength{\parindent}{0pt}
+\frenchspacing % no double space after dot
+
+\catcode`␣\active \def␣{\textbf{\textcolor{gray!60}{\char32}}}
+
+\ExplSyntaxOff
+\small%
+\obeylines%
+\texttt{
+> 123\spec\{4␣5\spec\}\cmd{6}
+> \spec{\#\&\textasciicircum\_}:
+> \cmd{error}
+> \letr{very␣long␣long␣long␣long␣long␣long␣long␣long␣long␣long␣long␣long␣long}
+> .. \letr{␣long␣argument}␣\cmd{argument} \cmd{argument} \cmd{test} 123456
+> \letr{very␣long␣long␣long␣long␣long␣long␣long␣long␣long␣long␣long␣long␣long}
+> .. \letr{␣long␣argument}␣\cmd{argument} \cmd{argument} \cmd{test} 123456
+> \spec{\#\&\textasciicircum}\letr{\_:}
+> \letr{abc}␣
+}\endgroup
+
+\subsection{Loading the package}
+
+\begin{verbatim}
+\usepackage{prettytok}
+\end{verbatim}
+
+\subsection{Options}
+
+There are several options that can be passed to the package.
+
+Usage example: |\usepackage[mode=term-shell]{prettytok}|.
+
+\begin{variable}{mode=}
+ Specify the working mode of the package, that is, where the output is displayed. It can either be:
+\begin{itemize}
+ \item |term-8bit|: this is the default.
+
+ Assume XTerm-compatible system, output to the terminal.
+
+ Requires |-8bit| option on engines other than \LuaTeX, see the following link: \\
+ \url{https://tex.stackexchange.com/q/168460/250119}.
+
+ Besides, this drops the distinction between the catcode of some tokens (for example \verb|{}$#&^_| are all shown as the same color as "special catcode"),
+ which is available in the tooltip in the HTML version.
+
+ This might work on Windows, although the package writer have not tested it.
+ Refer to \url{https://stackoverflow.com/q/2048509/5267751}
+ and \url{https://superuser.com/q/413073/577463}.
+
+ \item |term-shell|:
+ To output colored text to the terminal, |--8bit| flag is needed otherwise the terminal escape codes will be
+ changed to |^^[| etc.
+ A workaround, using \TeX\ Live's behavior when the file name has the form \verb+|...+,
+ is provided with this option.
+
+ Requires |--shell-escape| flag. May not be very reliable.
+
+ Refer to \url{https://tex.stackexchange.com/a/670572/250119} for more details.
+
+ \item |html|: output to a HTML file named for example |pretty-abc.html| (although this can be customized,
+ refer to \hyperref[opt:html-file-name]{|html-file-name=|}%
+ ) if the main \TeX\ file is named |abc.tex|.
+
+ Open the file in any browser to view the result.
+
+ Using this option, the output will not be cluttered with the traceback/other \TeX\ default output.
+
+By default, the output refreshes whenever the \TeX\ file is recompiled. The behavior
+can be customized with \hyperref[opt:html-refresh-strategy]{|html-refresh-strategy=|} and \hyperref[opt:html-refresh-duration]{|html-refresh-duration=|}.
+
+\end{itemize}
+\end{variable}
+
+Currently, it's not supported to print the debug output to the PDF itself,
+because if the \TeX\ program stops with error / has some error that corrupts the PDF output, the output will even with corrupted more by the debug print.
+
+\subsubsection{HTML configuration}
+
+These options are only meaningful if |mode=html|.
+
+\begin{variable}{html-file-name=}\label{opt:html-file-name}
+ The output file name. Defaults to |pretty-|\meta{jobname}|.html|, as mentioned above.
+\end{variable}
+
+\begin{variable}{html-refresh-strategy=}\label{opt:html-refresh-strategy}
+ The auto-refresh strategy. Allowed values are 0-4. 0 is no refresh. \\
+ Which value works best depends on the particular browser. \\
+ If you're using Google Chrome to view the output HTML,
+ invoking the browser from the command-line with |--allow-file-access-from-files| flag may be useful.
+\end{variable}
+
+\begin{variable}{html-refresh-duration=}\label{opt:html-refresh-duration}
+ The duration between two consecutive refresh check, in milliseconds. Defaults to 1000.
+\end{variable}
+
+\subsubsection{Terminal configuration}
+
+These options are only meaningful if |mode=term-8bit| or |mode=term-shell|.
+
+\begin{variable}{term-prefix=,term-prefix-more=}
+ Strings consist of prefixes to be output before each terminal line.
+
+ This might be useful for log-filtering/output-filtering tools such as |texfot| to recognize the output line.
+
+ Defaults to \verb*|> | and \verb*|> .. | respectively.
+\end{variable}
+
+\begin{variable}{term-wrap-limit=}
+ Estimated line length limit. Set this to a little smaller than your terminal width.
+
+ Defaults to 70.
+\end{variable}
+
+\begin{variable}{term-shell-decode-cmd=}
+ Only meaningful with |mode=term-shell|.
+
+ Normally you would not need to explicitly pass this option, unless something does not work.
+
+ By default, a file named \file{prettytok-decode-8bit.py}
+ should be included in your \TeX\ distribution, and
+ the package runs |kpsewhich prettytok-decode-8bit.py| to find the location
+ of that file in order to execute it.
+ However, if by any reason this does not work, you can specify an explicit command such as
+ |python3 /full/path/to/prettytok-decode-8bit.py| to override it.
+
+ Passing blank value invokes the default behavior (runs |kpsewhich|).
+
+ Alternatively, you can also choose to explicitly pass the path in order to save a call to |kpsewhich|
+ to make the program a bit faster.
+
+ If you \emph{really} want to, special characters may be passed by prefixing them with |\|.
+ \DisableQuotes
+ But |\"| won't work anyway (as far as the package writer know, this is impossible in non-\LuaTeX\ engines).
+ \EnableQuotes
+ \begin{texnote} The path is interpreted by detokenizing the value in |escapechar=-1|. \end{texnote}
+\end{variable}
+
+\begin{variable}{term-shell-decode-cmd-print=}
+ If |mode=term-shell|, print out the command correspond to |term-shell-decode-cmd| on the console, for debugging purpose.
+
+ Example output:
+ |The value of term-shell-decode-cmd is: [[[./prettytok-decode-8bit.py]]]|
+\end{variable}
+
+
\subsection{Main function}
\begin{function}{\pretty:n,\pretty:x,\pretty:o,\pretty:V}
\begin{syntax}
\cs{pretty:n} \Arg{token list}
\end{syntax}
Print the content of \meta{token list}.
+
+ This is a simple replacement of the functions above. (|\tl_analysis_show:n|, etc.)
\end{function}
-\begin{function}{\pretty:N,\pretty:c}
+\begin{function}{\pretty:w}
\begin{syntax}
- \cs{pretty:N} \meta{token}
- \cs{pretty:c} \Arg{control sequence name}
+ \cs{pretty:w} \meta{token list} \cs{prettystop}
\end{syntax}
- Print \meta{token}.
-
- This function is not very useful. Usually it's preferable to use |\pretty:V| to print a token list variable's value,
- or |\prettyshow:N| to print a control sequence's meaning.
+ Print the content of \meta{token list}.
+
+The purpose of this function is that
+it can be inserted "anywhere" in order to \emph{inspect the input stream}
+without affecting how the function works.
+
+Note that the input stream will be tokenized and has catcode frozen.
+
+For example
+\begin{verbatim}
+\ExplSyntaxOn
+\def \f #1 {\prettye:w 789}
+\f 123456 \prettystop
+\end{verbatim}
+will print out |78923456|.
+
+For now, it must be brace-balanced. Use \cs{prettye:w} instead if this is a problem.
\end{function}
-\begin{function}{\prettyinit:}
+\begin{function}[EXP]{\prettystop}
\begin{syntax}
- \cs{prettyinit:}
+ \cs{prettystop}
\end{syntax}
- Do necessary initialization.
-
- This should be called right after the package is loaded, after setting the configuration variables described below.
+ Only used as a delimiter for |:w| functions. For convenience, this function is defined to do nothing.
\end{function}
-\subsection{Expandable interface (\LuaTeX\ only)}
-
-\cs{prettyinit:} must be called before calling the functions in this section.
-
-\begin{function}[EXP]{\prettye:n}
+\begin{function}{\prettyshow:N,\prettyshow:c}
\begin{syntax}
- \cs{prettye:n} \Arg{token list}
+ \cs{prettyshow:N} \meta{token}
+ \cs{prettyshow:c} \Arg{control sequence name}
\end{syntax}
- Print the token list, similar to \cs{pretty:n}, but is fully expandable.
+ Show the meaning of a |N|-type argument.
\end{function}
-\begin{function}[EXP]{\prettye:w}
+\begin{function}{\pretty:N,\pretty:c}
\begin{syntax}
- \cs{prettye:w} \meta{tokens} \cs{prettystop}
+ \cs{pretty:N} \meta{token}
+ \cs{pretty:c} \Arg{control sequence name}
\end{syntax}
- Print the tokens until \cs{prettystop} is seen. Useful for inspecting the content of the input stream.
+ Print \meta{token}.
- Note that the input stream will be tokenized and has catcode frozen. Use with care.
+ It may also be useful to use |\pretty:V| to print a token list variable's value,
+ or |\prettyshow:N| to print a control sequence's meaning.
\end{function}
-\subsection{Lua programming interface}
-
-\cs{prettyinit:} must also be called before calling the functions in this section.
-
-\begin{function}{prettyprint}
+\begin{function}{\pretty:nn, \pretty:nnn}
\begin{syntax}
- |prettyprint(|\meta{content}|)|
+ \cs{pretty:nn} \Arg{token list} \Arg{token list}
+ \cs{pretty:nnn} \Arg{token list} \Arg{token list} \Arg{token list}
\end{syntax}
- Print the content, which should be a table of token objects.
-
- For convenience, you can pass multiple arguments. Strings are also supported.
+ Print multiple token lists. Its effect is similar to multiple consecutive calls to \cs{pretty:n}.
\end{function}
-\subsection{View result}
-The result is printed to a HTML file named |pretty-|\meta{jobname}|.html| by default.
-Open the file in any browser to view the result.
-Note that the HTML file will not be touched if nothing is printed, as such it's encouraged to add a line such as |\pretty:n {start}| right after loading the file.
-Why HTML file?
-\begin{itemize}
- \item If the \TeX\ program stops with error / has some error that corrupts the PDF output, the output will even with corrupted more by the debug print.
- \item Printing to the console is extremely limited (difficult syntax highlighting/scrolling/line wrapping), and most likely cluttered with the traceback/other \TeX\ default output.
+\subsection{Expandable interface (\LuaTeX\ only)}
+\label{subsec:expandable-interface}
- (nevertheless, there might be plan to support output to console with syntax highlighting later.)
- \item Output to another \TeX\ file to be compiled works as well; however it's necessary to run another instance of |latexmk| (or other tool used to compile \TeX\ code)
- and compiling \TeX\ file takes longer than loading a HTML file.
-\end{itemize}
+\begin{function}[EXP]{\prettye:n}
+ \begin{syntax}
+ \cs{prettye:n} \Arg{token list}
+ \end{syntax}
+ Print the token list, similar to \cs{pretty:n}, but is fully expandable.
+\end{function}
-By default, the output refreshes whenever the \TeX\ file is recompiled. The behavior
-can be customized with \cs{prettyrefreshstrategy} and \cs{prettyrefreshduration}.
+\begin{function}[EXP]{\prettye:w}
+ \begin{syntax}
+ \cs{prettye:w} \meta{tokens} \cs{prettystop}
+ \end{syntax}
+ Print the tokens until \cs{prettystop} is seen. Useful for inspecting the content of the input stream.
-\subsection{Additional functions}
+ As a debugging tool, it's possible to execute |\everyeof{\prettystop}| to avoid runaway printing in weird catcode environments.
-There are also these functions, for convenience.
+ Currently some implementation details (it can be fixed, but the package writer does not
+have an immediate need for it, see \url{https://tex.stackexchange.com/q/335994/250119}) means control sequences not
+in the hash table will be destroyed.
+Use with care.
-\begin{function}{\pretty:nn, \pretty:nnn}
- \begin{syntax}
- \cs{pretty:nn} \Arg{token list} \Arg{token list}
- \cs{pretty:nnn} \Arg{token list} \Arg{token list} \Arg{token list}
- \end{syntax}
- Print multiple token lists. Its effect is similar to multiple consecutive calls to \cs{pretty:n}.
\end{function}
\begin{function}[EXP]{\prettye:nn, \prettye:nnn}
@@ -132,49 +327,63 @@ There are also these functions, for convenience.
Similar to multiple consecutive calls to \cs{prettye:n}.
\end{function}
-\begin{function}[EXP]{\prettye:nw, \prettye:nnw}
+
+
+\begin{function}[EXP]{\prettye:nw}
\begin{syntax}
- \cs{prettye:nw} \Arg{token list} \meta{tokens} \cs{prettystop}
- \cs{prettye:nnw} \Arg{token list} \Arg{token list} \meta{tokens} \cs{prettystop}
+ \cs{prettye:nw} \Arg{callback} \meta{tokens} \cs{prettystop}
\end{syntax}
- Similar to call(s) to \cs{prettye:n} followed by a call to \cs{prettye:w}.
+ Same as above, but has a callback, that is, code that is put in the input stream after the content is printed.
+
+ Useful if you want to fine-tune what is printed exactly.
+ (\texttt{\cs{prettye:w} \meta{callback} \meta{tokens}} is functionally the same, but the callback
+ is also printed, which will clutter the debug output)
+
+ For example
+\begin{verbatim}
+\prettye:nw {\somecode ...} 123 \prettystop
+\end{verbatim}
+will print |123|, then after some expansion steps results in the input stream contain
+|\somecode ... 123 \prettystop|.
\end{function}
-\begin{function}{\pretty:w}
+\begin{function}[EXP]{\prettye:nnw, \prettye:nnnw}
\begin{syntax}
- \cs{pretty:w} \meta{token list} \cs{prettystop}
+ \cs{prettye:nnw} \Arg{callback} \Arg{token list} \meta{tokens} \cs{prettystop}
+ \cs{prettye:nnnw} \Arg{callback} \Arg{token list} \Arg{token list} \meta{tokens} \cs{prettystop}
\end{syntax}
- Print the content of \meta{token list}.
-
- Same restriction applies -- the catcode is frozen.
+ Similar to call(s) to \cs{prettye:n} followed by a call to \cs{prettye:nw}.
- In addition -- for now, it must be brace-balanced and if \meta{token list} has a surrounding brace group it will be removed. Use \cs{prettye:w} instead if possible.
+ For example
+\begin{verbatim}
+\prettye:nnw {\somecode ...} {123} 456 \prettystop
+\end{verbatim}
+will print |123456|, then, after some expansion steps, |\somecode ... 456 \prettystop| remains in the input stream.
\end{function}
-\begin{function}[EXP]{\prettystop}
- \begin{syntax}
- \cs{prettystop}
- \end{syntax}
- Only used as a delimiter for |:w| functions. For convenience, this function is defined to do nothing.
-\end{function}
+\subsection{Lua programming interface}
-\begin{function}{\prettyshow:N,\prettyshow:c}
+\begin{function}{prettyprint}
\begin{syntax}
- \cs{prettyshow:N} \meta{token}
- \cs{prettyshow:c} \Arg{control sequence name}
+ |prettyprint(|\meta{content}|)|
\end{syntax}
- Show the meaning of a |N|-type argument.
+ Print the content, which should be a table of token objects.
+
+ For convenience, you can pass multiple arguments. Strings are also supported.
\end{function}
+
+
+
\subsection{\LaTeXe\ interface}
-\begin{function}{\prettyN,\prettyX,\prettyO,\prettyV,\prettyinit,\prettyshowN,\prettyshowC}
+\begin{function}{\prettyN,\prettyX,\prettyO,\prettyV,\prettyW,\prettyshowN,\prettyshowC}
\begin{syntax}
\tn{prettyN} \Arg{token list}
\tn{prettyX} \Arg{token list}
\tn{prettyO} \Arg{token list}
\tn{prettyV} \meta{tl var}
- \tn{prettyinit}
+ \cs{prettyW} \meta{token list} \cs{prettystop}
\tn{prettyshowN} \meta{token}
\tn{prettyshowC} \Arg{control sequence name}
\end{syntax}
@@ -190,33 +399,19 @@ There are also these functions, for convenience.
\end{function}
-\subsection{Customization}
-
-These variables can be redefined before the
-first call to \cs{pretty:n} or \cs{prettyinit:} to customize the behavior.
-
-\begin{variable}{\prettyfilename}
- The output file name. Defaults to |pretty-|\meta{jobname}|.html|, as mentioned above.
-\end{variable}
-
-\begin{variable}{\prettyrefreshstrategy}
- The auto-refresh strategy. Allowed values are 0-4. 0 is no refresh. \\
- Which value works best depends on the particular browser. \\
- On Google Chrome, passing |--allow-file-access-from-files| may be useful.
-\end{variable}
-
-\begin{variable}{\prettyrefreshduration}
- The duration between two consecutive refresh check, in milliseconds. Defaults to 1000.
-\end{variable}
-
\section{Implementation}
Unfortunately, the implementation is not typesetted in \TeX. Read the |.sty| file.
-\StopEventually{^^A
- \PrintChanges
- \PrintIndex
-}
+Remark: it's possible to do expandable printing in other engines as well by, for example, turning on |\tracingmacros|, parse the token list somehow
+(and use some not-always-exact logic to distinguish normal character and active character with same meaning;
+then grep the resulting log file for special markers.
+
+But that would be very, very slow and slows down everything else by turning on logging. Just use \LuaTeX\ for debugging.
+
+There's another option of recompiling the engine and adding some expandable primitive for debug logging...
+\PrintChanges
+\PrintIndex
\Finale
\end{document}
diff --git a/macros/latex/contrib/prettytok/prettytok_template.html b/macros/latex/contrib/prettytok/prettytok_template.html
index 8764d49809..5b0d988a4c 100644
--- a/macros/latex/contrib/prettytok/prettytok_template.html
+++ b/macros/latex/contrib/prettytok/prettytok_template.html
@@ -37,10 +37,9 @@ iframe{
.tokenlist, .fileline{
border: 1px solid gray;
- overflow: scroll;
- white-space: nowrap;
+ padding: 2px;
+ line-height: 1.5em;
}
-.tokenlist::-webkit-scrollbar, .fileline::-webkit-scrollbar { width: 0 !important }
.fileline{
background-color: #404040;
@@ -57,12 +56,6 @@ iframe{
.cs, .active_char{
color: #FFFF00;
}
-.cs::before{
- content: "\\";
-}
-.cs::after{
- content: " ";
-}
#popup{
display: none;
@@ -106,6 +99,18 @@ input[type=button]{
flex: 0 0 30%;
overflow: scroll;
}
+
+/*
+ hack to make it display as ␣ but copy-paste (or search) as space
+*/
+.space_charcode{
+ font-size: 0pt;
+}
+
+.space_charcode::before{
+ font-size: medium;
+ content: "␣";
+}
</style>
</head>
<body>
@@ -117,22 +122,29 @@ input[type=button]{
</div>
<script>
"use strict"
-function show_html(s){
- return s.replace(/ /g, "␣")
+
+function show_html_except_space(s){
+ return s
.replace(/\r|\n/g, "↵")
.replace(/\t/g, "⇥")
}
+function show_html(s){
+ return show_html_except_space(s).replace(/ /g, "␣")
+}
+
output.innerHTML=""
function print_tl(...tokens){
const tl_div=document.createElement("div")
- tl_div.className="tokenlist"
+ tl_div.classList.add("tokenlist")
for(let token of tokens){
tl_div.appendChild(token)
if({13: true, 10: true}[token.data_charcode]){
tl_div.appendChild(document.createElement("br"))
- }
+ }else{
+ tl_div.appendChild(document.createElement("wbr"))
+ }
}
output.appendChild(tl_div)
}
@@ -140,10 +152,13 @@ function print_tl(...tokens){
function token(charcode /* int */, catcode /* single character string in hex */){
const token_span=document.createElement("span")
const ch=String.fromCodePoint(charcode)
- token_span.innerText=show_html(ch)
+ token_span.innerText=show_html_except_space(ch)
token_span.data_charcode=charcode
+ if(charcode==32){ // special handle space here
+ token_span.classList.add("space_charcode")
+ }
if(catcode==='D'){
- token_span.className="active_char"
+ token_span.classList.add("active_char")
token_span.title=`active ${ch} # ${charcode}`
}else{
const cls={
@@ -158,7 +173,7 @@ function token(charcode /* int */, catcode /* single character string in hex */)
B: 'cmd__letter_cmd',
C: 'cmd__other_char_cmd',
}[catcode]
- token_span.className="token "+cls
+ token_span.classList.add("token", cls)
token_span.title=`${cls} ${ch} # ${charcode}`
}
return token_span
@@ -170,18 +185,37 @@ function cs(...codepoints){
const control_sequence_name=String.fromCodePoint(...codepoints)
//const meaning_str=readstr()
- token_span.innerText=show_html(control_sequence_name)
- //token_span.title=`cs '${control_sequence_name}' → ${meaning_str}`
- token_span.className="cs"
+ /*
+ token_span.innerText='\\' + show_html(control_sequence_name) + ' '
+ */
+
+ var items=control_sequence_name.split(' ')
+ items[0]="\\"+items[0]
+ items[items.length-1]+=' '
+ for(var i=0; i<items.length; i++){
+ if(i!=0){ // append a '␣' span that copy-paste as a space
+ var space_span=document.createElement("span")
+ space_span.innerText=' '
+ space_span.classList.add("space_charcode")
+ token_span.appendChild(space_span)
+ }
+
+ // append the text itself
+ if(items[i]!="")
+ token_span.appendChild(new Text(show_html_except_space(items[i])))
+ }
+
+ //token_span.title=`cs '${control_sequence_name}' → ${meaning_str}`
+ token_span.classList.add("cs")
return token_span
}
function csfrozenrelax(){
const token_span=document.createElement("span")
- token_span.innerText="relax"
+ token_span.innerText="\\relax"
token_span.title="frozen relax"
- token_span.className="cs frozenrelax"
+ token_span.classList.add("cs", "frozenrelax")
return token_span
}
diff --git a/macros/latex/contrib/se2thesis/CHANGELOG.md b/macros/latex/contrib/se2thesis/CHANGELOG.md
index c93bb1110b..96e937e109 100644
--- a/macros/latex/contrib/se2thesis/CHANGELOG.md
+++ b/macros/latex/contrib/se2thesis/CHANGELOG.md
@@ -7,6 +7,30 @@ and this project adheres to
## [Unreleased]
+## [v3.0.0] – 2023–04–18
+
+### Added
+
+- Add documentation on how to install the bundle if it is not part of the
+ existing TeX distribution.
+- Add a package `se2packages` that provides the ability to directly load
+ recommended packages with recommended options.
+
+### Changed
+
+- The `paper=a4` and `paper=b5` options now produce the exact same text-block
+ sizes.
+- Make the logo height smaller for B5 paper.
+- The default class is now `scrbook` instead of `scrreprt`.
+
+### Removed
+
+- **Breaking:** Removed the `biblatex` class option from `se2thesis`, use the
+ `se2packages` package with its `biblatex=true` option instead.
+- **Breaking:** Removed the `paper=a5` option.
+- Removed the automated loading of the `microtype`, `selnolig`, and
+ `lua-widow-control` packages from `se2thesis`—use `se2packages` instead.
+
## [v2.1.0] – 2023–01–27
### Added
@@ -100,6 +124,7 @@ These changes might be breaking changes!
### Added
- First official release
+[v3.0.0]: https://github.com/se2p/se2thesis/compare/v3.0.0...v2.1.0
[v2.1.0]: https://github.com/se2p/se2thesis/compare/v2.1.0...v2.0.0
[v2.0.0]: https://github.com/se2p/se2thesis/compare/v2.0.0...v1.3.1
[v1.3.1]: https://github.com/se2p/se2thesis/compare/v1.3.1...v1.3.0
diff --git a/macros/latex/contrib/se2thesis/se2colors.dtx b/macros/latex/contrib/se2thesis/se2colors.dtx
index 5fa39c0c34..bf2af3728f 100644
--- a/macros/latex/contrib/se2thesis/se2colors.dtx
+++ b/macros/latex/contrib/se2thesis/se2colors.dtx
@@ -231,7 +231,7 @@
%
% Identify the package and give the overall version information.
% \begin{macrocode}
-\ProvidesExplPackage {se2colors} {2023-01-27} {2.1.0}
+\ProvidesExplPackage {se2colors} {2023-04-18} {3.0.0}
{A colour support package for the se2thesis bundle}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/se2thesis/se2fonts.dtx b/macros/latex/contrib/se2thesis/se2fonts.dtx
index 0743d85cbc..dccb8420b1 100644
--- a/macros/latex/contrib/se2thesis/se2fonts.dtx
+++ b/macros/latex/contrib/se2thesis/se2fonts.dtx
@@ -159,7 +159,7 @@
%
% Identify the package and give the overall version information.
% \begin{macrocode}
-\ProvidesExplPackage {se2fonts} {2023-01-27} {2.1.0}
+\ProvidesExplPackage {se2fonts} {2023-04-18} {3.0.0}
{A font-selection support package for the se2thesis bundle}
% \end{macrocode}
%
diff --git a/macros/latex/contrib/se2thesis/se2packages.dtx b/macros/latex/contrib/se2thesis/se2packages.dtx
new file mode 100644
index 0000000000..319bbfeed1
--- /dev/null
+++ b/macros/latex/contrib/se2thesis/se2packages.dtx
@@ -0,0 +1,788 @@
+% \iffalse meta-comment
+%
+% File: se2packages.dtx Copyright (C) 2022--2023 Stephan Lukasczyk
+%
+% It may be distributed and/or modified under the conditions of the
+% LaTeX Project Public License (LPPL), either version 1.3c of this
+% license or (at your option) any later version. The latest version
+% of this license is in the file
+%
+% https://www.latex-project.org/lppl.txt
+%
+% This file is part of the "se2thesis bundle" (The Work in LPPL)
+% and all files in that bundle must be distributed together.
+%
+% The released version of this bundle is available from CTAN.
+%
+% ----------------------------------------------------------------------
+%
+% The development version of the bundle can be found at
+%
+% https://github.com/se2p/se2thesis
+%
+% for those people who are interested.
+%
+% ----------------------------------------------------------------------
+%
+%<*driver>
+\documentclass{l3doc}
+% The next line is needed so that \GetFileInfo will be able to pick up
+% version data.
+\usepackage{se2packages}
+
+\usepackage[UKenglish]{babel}
+\usepackage{hvlogos}
+
+\begin{document}
+ \DocInput{\jobname.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \GetFileInfo{se2packages.sty}
+%
+% \title{^^A
+% \pkg{se2packages} -- Supporting Packages for the \pkg{se2thesis} Bundle^^A
+% \thanks{This file describes \fileversion, last revised \filedate.}^^A
+% }
+%
+% \author{^^A
+% Stephan Lukasczyk^^A
+% \thanks{Email: \href{mailto:stephan@dante.de}{stephan@dante.de}}^^A
+% }
+%
+% \date{Released \filedate}
+%
+% \maketitle
+%
+% \begin{documentation}
+%
+% \section{The \pkg{se2packages} package}\label{sec:doc-se2packages}
+%
+% Several packages can be useful for writing a thesis.
+% We provide a simple package for the user
+% that loads these support packages with the recommended options.
+% Please note that you might not need all these packages,
+% however,
+% having a look at them (especially their documentation)
+% might give you an insight whether to use a certain package.
+% Our general recommendation is to use as few packages as you can;
+% some might have conflicts,
+% others basically do the same,
+% or are outdated.
+% Please consider reading the documentation of each package you are using
+% to figure out whether they have any conflicts with other packages
+% (for example, one cannot use the recommended \pkg{siunitx} package
+% together with \pkg{SIunits}) or they might require to be loaded
+% at special places in your preamble (for example, \pkg{hyperref}
+% is usually meant to be loaded as the last package,
+% except you are also using \pkg{cleveref},
+% which needs to be loaded \emph{after} \pkg{hyperref}).
+%
+% \subsection{The Recommended Packages}
+%
+% We first present the packages we recommend
+% and give a rationale why we believe they should be used.
+% Afterwards,
+% we will discuss how to load the \pkg{se2packages} package
+% to use one or the other of these recommended packages
+% in the next section.
+%
+% \subsubsection{Quoting with \pkg{csquotes}}
+%
+% The \pkg{csquotes} packages allows you for intelligent quoting of text.
+% While verbose quotes are not that common in computer science,
+% the package still provides some useful macros to the user.
+%
+% \subsubsection{Number formatting with \pkg{siunitx}}
+%
+% While \pkg{siunitx}'s original purpose was to format physical quantities,
+% it provides a lot of useful features
+% when typesetting theses (and other documents) in computer science.
+% When you skim through its documentation,
+% especiall look at the \cmd{\qty} and \cmd{\num} macros,
+% as well as the section on typesetting tabular material.
+% We also recommend reading an extensive discussion on number formatting,
+% precision of presented numbers,
+% and more related topics in Beyer et al.'s journal paper
+% on requirements and solutions for reliable
+% benchmarking~\cite{DBLP:journals/sttt/BeyerLW19}.
+%
+% \subsubsection{Code Listings}
+%
+% We prefer using the \pkg{minted} package for code listings
+% because it provides a lot of options for styling
+% as well as built-in support for a huge number of languages.
+% However,
+% this package requires the installation of Python
+% and the setting of the |-shell-escape| option to your \TeX{} engine.
+% Please read the package's documentation to set it up;
+% the aforementioned Docker images from the Island of \TeX{} project
+% provide you everything set up already.
+%
+% In case you do not want to use the \pkg{minted} package,
+% please consider using \pkg{listings} for typesetting your code listings.
+%
+% Please be aware to use \emph{either} \pkg{minted} \emph{or} \pkg{listings}!
+%
+% \subsubsection{Designing Tables}
+%
+% A basically mandatory package to all users of tables
+% is the \pkg{booktabs} package.
+% Especially its documentation is a must-read!
+% It provides a large variety of hints for designing tables,
+% most notably that one should never ever use vertical lines;
+% horizontal lines should be used sparesly;
+% \pkg{booktabs} provides three macros for lines that shall be used
+% instead of \cmd{\hline} from standard \LaTeX:
+% \cmd{\toprule} for a rule on the top of a table,
+% above the column heads;
+% \cmd{\midrule} to separate column heads and the content,
+% and \cmd{\bottomrule} to mark the bottom of a table.
+% We highly recommend that you follow this style when writing your thesis.
+%
+% Note that captions of tables shall be put \emph{above} the table
+% whereas captions of figures shall go \emph{below} the figure.
+% The rationale is that a figure should be more or less self explaining
+% while a table almost always needs some explanation.
+%
+% Unfortunately,
+% the distances when using a \cmd{\caption} above a table are wrong by default;
+% when creating tables,
+% consider loading the \pkg{hvfloats} package
+% and use its \cmd{\tabcaption} instead of \cmd{\caption} for tables.
+% The \pkg{hvfloats} package furthermore provides additional useful macros
+% to typeset all kinds of floats.
+%
+% \subsubsection{Controlling Ligatures, Orphans, and Widows}
+%
+% When using \LuaTeX{}~(which we recommend anyway),
+% we additionally recommend to use the \pkg{selnolig}
+% and \pkg{lua-widow-control} packages.
+% The former implements a better control over ligatures,
+% the latter provides better control over orphans and widows.
+%
+% \subsubsection{Use \pkg{microtype} for Microtypographic Optimisation}
+%
+% \pkg{microtype} is a game changer when writing documents.
+% While standard \LaTeX{} provides reasonably good typography,
+% the \pkg{microtype} package brings it to the next level.
+% We refer you to the documentation of the package for details.
+%
+% Additionally,
+% we prefer to have a thin space around the m-dash.
+% Although we are aware of the discussion
+% whether to have such a space in English,
+% we think it looks more beautiful and thus recommend it.
+%
+% \subsubsection{Use \pkg{biblatex} for Bibliographic References}
+%
+% The standard way of typesetting bibliographic references used to be \BibTeX.
+% The original \BibTeX,
+% however,
+% seems to be very outdated in various ways:
+% it originally only supported 7\,bit character sets
+% and creating citation styles requires the usage
+% of a kind of an archaic language.
+% \BibLaTeX{} resolves many of the drawbacks of \BibTeX;
+% when combined with the |biber| engine,
+% it supports full UTF-8 unicode,
+% therefore correct sorting of the references now works out of the box;
+% also creating citation styles can now be done using simple \LaTeX{} commands.
+%
+% \subsubsection{Use \pkg{cleveref} for Internal References}
+%
+% \LaTeX{} provides an easy-to-use reference mechanism using the \cmd{\label}
+% and \cmd{\ref} macros.
+% However,
+% this requires some manual effort and the text needs to specify
+% whether a reference is to a figure, section, or table.
+% We often see in drafts artefacts such as \enquote{we discuss our findings in 4};
+% but what is \enquote{4} here?
+% Is it a section?
+% A table?
+% A figure?
+%
+% To avoid such confusion,
+% use the \pkg{cleveref} package,
+% which automatically infers the type of the reference~(see its documentation
+% on how this works).
+% The \pkg{cleveref} package furthermore avoids an additional, common mistake:
+% between the name of the element and its reference
+% one needs to have a non-breaking space that is often forgotten.
+% Instead people are using normal spaces that can break at the end of a line
+% which looks very ugly.
+%
+% Please note that,
+% in contrast to most other packages,
+% \pkg{cleveref} has to be loaded \emph{after} the \pkg{hyperref} package!
+%
+% \subsection{Loading \pkg{se2packages}}
+%
+% When you load the \pkg{se2packages} package
+% it will automatically load the \pkg{csquotes} and \pkg{booktabs} packages
+% because we believe that you definitely should use them.
+% Still, it is possible to avoid this by setting the following
+% load-time options to the package.
+% \begin{function}{csquotes,nocsquotes}
+% \begin{syntax}
+% |csquotes| = \meta{true,false}
+% |nocsquotes|
+% \end{syntax}
+% The argument to |csquotes| can be one of |true| or |false|.
+% The latter does not load \pkg{csquotes}, the former is the default value.
+% By using |nocsquotes| you can also avoid that \pkg{csquote} is loaded.
+% \end{function}
+%
+% \begin{function}{booktabs,nobooktabs}
+% \begin{syntax}
+% |booktabs| = \meta{true,false}
+% |nobooktabs|
+% \end{syntax}
+% The argument to |booktabs| can be one of |true| or |false|.
+% The latter does not load \pkg{booktabs}, the former is the default value.
+% By using |nobooktabs| you can also avoid that \pkg{booktabs} is loaded.
+% \end{function}
+%
+% The \pkg{siunitx} package is helpful to set quantities
+% and to automatically format numbers consistently.
+% The following load-time option loads it automatically.
+% \begin{function}{siunitx}
+% \begin{syntax}
+% |siunitx| = \meta{true,false}
+% \end{syntax}
+% Decides whether the package loads \pkg{siunitx}
+% and sets the options for \pkg{siunitx} to the values we recommend.
+% The default value is |false|, set it to |true| to load \pkg{siunitx}.
+% \end{function}
+%
+% We provide a load-time option to load \pkg{minted}
+% and configure it.
+% \begin{function}{minted}
+% \begin{syntax}
+% |minted| = \meta{true,false}
+% \end{syntax}
+% Decides whether the package loads \pkg{minted}
+% and sets the options for \pkg{minted} to the values we recommend.
+% The default value is |false|, set it to |true| to load \pkg{minted}.
+% Note that \pkg{minted} requires additional installation effort
+% and the use of the |-shell-escape| option, see its documentation.
+% \end{function}
+%
+% We also provide a load-time option to load \pkg{listings}
+% and configure it.
+% This option and the |minted| option are mutually exclusive!
+% \begin{function}{listings}
+% \begin{syntax}
+% |listings| = \meta{true,false}
+% \end{syntax}
+% Decides whether the package loads \pkg{listings}
+% and sets the options for \pkg{listings} to the values we recommend.
+% The default value is |false|, set it to |true| to load \pkg{listings}.
+% \end{function}
+%
+% We provide a load-time option to load \pkg{selnolig}.
+% \begin{function}{selnolig,noselnolig}
+% \begin{syntax}
+% |selnolig| = \meta{true,false}
+% |noselnolig|
+% \end{syntax}
+% The argument to |selnolig| can be one of |true| or |false|.
+% The latter does not load \pkg{selnolig}, the former is the default value.
+% By using |noselnolig| you can also avoid that \pkg{selnolig} is loaded.
+% \end{function}
+%
+% We provide a load-time option to load \pkg{lua-widow-control}.
+% \begin{function}{widowcontrol,nowidowcontrol}
+% \begin{syntax}
+% |widowcontrol| = \meta{true,false}
+% |nowidowcontrol|
+% \end{syntax}
+% The argument to |widowcontrol| can be one of |true| or |false|.
+% The latter does not load \pkg{lua-widow-control},
+% the former is the default value.
+% By using |nowidowcontrol| you can also avoid
+% that \pkg{lua-widow-control} is loaded.
+% \end{function}
+%
+% We provide a load-time option to load and configure \pkg{microtype}.
+% \begin{function}{microtype,nomicrotype}
+% \begin{syntax}
+% |microtype| = \meta{true,false}
+% |nomicrotype|
+% \end{syntax}
+% The argument to |microtype| can be one of |true| or |false|.
+% The latter does not load \pkg{microtype}, the former is the default value.
+% By using |nomicrotype| you can also avoid that \pkg{microtype} is loaded.
+% \end{function}
+%
+% We provide a load-time option to load and configure \pkg{biblatex}.
+% \begin{function}{biblatex}
+% \begin{syntax}
+% |biblatex| = \meta{true,false}
+% \end{syntax}
+% Decides whether the package loads \pkg{biblatex}
+% and sets the options for \pkg{biblatex} to the values we recommend.
+% The default value is |false|, set it to |true| to load \pkg{biblatex}.
+% \end{function}
+%
+% Additionally,
+% we provide a load-time option to load \pkg{cleveref}.
+% This option makes use of \LaTeX's hook system to load it as the very last
+% thing in the preamble.
+% You shall not use this option, but load \pkg{cleveref} on your own,
+% if your document requires packages that need to be loaded even \emph{after}
+% \pkg{cleveref}.
+% \begin{function}{cleveref}
+% \begin{syntax}
+% |cleveref| = \meta{true,false}
+% \end{syntax}
+% Decides whether the package load \pkg{cleveref}.
+% The default value is |false|, set it to |true| to load \pkg{cleveref}.
+% \end{function}
+%
+% Lastly,
+% we provide one option to load all recommended packages~(with \pkg{minted}
+% prefered over \pkg{listings}).
+% \begin{function}{all}
+% \begin{syntax}
+% |all| = \meta{true,false}
+% \end{syntax}
+% Decides whether the package loads all recommended packages.
+% The default value is |false|, set it to |true| to load them.
+% \end{function}
+%
+% \subsection{Additional Recommended Packages}
+%
+% The following packages are not part of \pkg{se2packages}
+% because they serve a very specific purpose.
+% They might not be needed by many thesis writers,
+% however,
+% we mention them here in order to give you a pointer.
+% We list them in alphabetic order.
+%
+% \begin{itemize}
+% \item \pkg{algorithm2e}: provides tooling for typesetting algorithm
+% diagrams.
+% We recommend loading it with the following options:
+% \begin{LaTeXdemo}[code only]
+% \usepackage[ruled,noline,noend,linesnumbered]{algorithm2e}
+% \end{LaTeXdemo}
+% \item \pkg{hvfloat}: a package to control captions, fullpage, and
+% double-page floats.
+% We recommend to load it and use its \cmd{\tabcaption} for table captions.
+% \item \pkg{lettrine}: allows to start a paragraph with a large initial.
+% This is a beautiful opener for the first paragraph of a thesis' main
+% content.
+% \item \pkg{mathtools}: an enhanced version of the famous \amsmath
+% package that provides more functionality and fixes some of the known bugs.
+% \item \pkg{pdfx}: adds support for PDF/X and PDF/A, which is useful for
+% creating documents that can be archived, for example, by the University's
+% library.
+% \item \pkg{pgfplots}: a library for creating all kinds of plots, based on
+% \pkg{pgf}, which is also the basis of the \pkg{tikz} package.
+% \item \pkg{sidenotesplus}: a package to place all kinds of objects in the
+% margin of a document, from footnotes (then called sidenotes) to figures
+% and tables.
+% \item \pkg{subcaption}: support for sub-captions and sub-figures.
+% \item \pkg{tabularray}: a rewrite of \LaTeX's array and tabular abilities
+% in \LaTeXIII.
+% While the package offers a great combination of several other packages'
+% functionality, it tends to be quite slow for large tables due to the way
+% it is implemented internally.
+% \item \pkg{tcolorbox}: allows to typeset coloured boxes, for example, for
+% short summaries on research questions or hypotheses.
+% \item \pkg{tikz}: for creating all kinds of figures.
+% Beware: \TikZ{} is a really huge package with a lot of functionality and
+% a manual of more than 1300~pages.
+% \end{itemize}
+%
+%
+% \begin{thebibliography}{9}
+% \bibitem{DBLP:journals/sttt/BeyerLW19} Dirk Beyer, Stefan Löwe, and Philipp
+% Wendler: \emph{Reliable benchmarking: requirements and solutions}. STTT
+% 21(1): 1--29 (2019)
+% \end{thebibliography}
+%
+%
+%
+%
+% \end{documentation}
+%
+% \begin{implementation}
+%
+% \section{\pkg{se2packages} implementation}
+%
+% Start the \pkg{DocStrip} guards.
+% \begin{macrocode}
+%<*package>
+% \end{macrocode}
+%
+% Identify the internal prefix (\LaTeX3 \pkg{DocStrip} convention): only
+% internal material in this \emph{submodule} should be used directly.
+% \begin{macrocode}
+%<@@=slcd_packages>
+% \end{macrocode}
+%
+% Identify the package and give the overall version information.
+% \begin{macrocode}
+\ProvidesExplPackage {se2packages} {2023-04-18} {3.0.0}
+ {Supporting packages for the se2thesis bundle}
+% \end{macrocode}
+%
+% \subsection{Load-time options}
+%
+% Before we define the actual options,
+% define some Boolean variables to store the selected values.
+%
+% \begin{macro}{\l_@@_csquotes_bool}
+% Whether or not to load \pkg{csquotes}.
+% \begin{macrocode}
+\bool_new:N \l_@@_csquotes_bool
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l_@@_booktabs_bool}
+% Whether or not to load \pkg{booktabs}.
+% \begin{macrocode}
+\bool_new:N \l_@@_booktabs_bool
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l_@@_siunitx_bool}
+% Whether or not to load and configure \pkg{siunitx}.
+% \begin{macrocode}
+\bool_new:N \l_@@_siunitx_bool
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l_@@_minted_bool}
+% Whether or not to load and configure \pkg{minted}.
+% \begin{macrocode}
+\bool_new:N \l_@@_minted_bool
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l_@@_listings_bool}
+% Whether or not to load and configure \pkg{listings}.
+% \begin{macrocode}
+\bool_new:N \l_@@_listings_bool
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l_@@_biblatex_bool}
+% Whether or not to load and configure \pkg{biblatex}.
+% \begin{macrocode}
+\bool_new:N \l_@@_biblatex_bool
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l_@@_selnolig_bool}
+% Whether or not to load \pkg{selnolig} (\LuaTeX{} only).
+% \begin{macrocode}
+\bool_new:N \l_@@_selnolig_bool
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l_@@_luawidowcontrol_bool}
+% Whether or not to load \pkg{luawidowcontrol} (\LuaTeX{} only).
+% \begin{macrocode}
+\bool_new:N \l_@@_luawidowcontrol_bool
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l_@@_microtype_bool}
+% Whether or not to load \pkg{microtype}.
+% \begin{macrocode}
+\bool_new:N \l_@@_microtype_bool
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l_@@_cleveref_bool}
+% Whether or not to load and configure \pkg{cleveref}.
+% \begin{macrocode}
+\bool_new:N \l_@@_cleveref_bool
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\l_@@_all_bool}
+% Whether or not to load and configure all recommended packages.
+% \begin{macrocode}
+\bool_new:N \l_@@_all_bool
+% \end{macrocode}
+% \end{macro}
+%
+% Define the actual load-time options.
+% \begin{macrocode}
+\keys_define:nn { seiipackages }
+ {
+ csquotes .bool_gset:N = \l_@@_csquotes_bool,
+ csquotes .initial:n = true,
+ nocsquotes .meta:n = {csquotes=false},
+
+ booktabs .bool_gset:N = \l_@@_booktabs_bool,
+ booktabs .initial:n = true,
+ nobooktabs .meta:n = {booktabs=false},
+
+ siunitx .bool_gset:N = \l_@@_siunitx_bool,
+ siunitx .initial:n = false,
+
+ minted .bool_gset:N = \l_@@_minted_bool,
+ minted .initial:n = false,
+
+ listings .bool_gset:N = \l_@@_listings_bool,
+ listings .initial:n = false,
+
+ biblatex .bool_gset:N = \l_@@_biblatex_bool,
+ biblatex .initial:n = false,
+
+ selnolig .bool_gset:N = \l_@@_selnolig_bool,
+ selnolig .initial:n = true,
+ noselnolig .meta:n = {selnolig=false},
+
+ widowcontrol .bool_gset:N = \l_@@_luawidowcontrol_bool,
+ widowcontrol .initial:n = true,
+ nowidowcontrol .meta:n = {widowcontrol=false},
+
+ microtype .bool_gset:N = \l_@@_microtype_bool,
+ microtype .initial:n = true,
+ nomicrotype .meta:n = {microtype=false},
+
+ cleveref .bool_gset:N = \l_@@_cleveref_bool,
+ cleveref .initial:n = false,
+
+ all .bool_gset:N = \l_@@_all_bool,
+ all .initial:n = false,
+ }
+% \end{macrocode}
+%
+% \subsection{Option handling}
+%
+% \begin{macrocode}
+\IfFormatAtLeastTF { 2022-06-01 }
+ { \ProcessKeyOptions [ seiipackages ] }
+ {
+ \RequirePackage{ l3keys2e }
+ \ProcessKeysOptions { seiipackages }
+ }
+% \end{macrocode}
+%
+% Define an error message if both \pkg{minted} and \pkg{listings} are requested.
+% \begin{macrocode}
+\msg_set:nnnn { seiipackages } { conflicting-packages }
+ { Setting~ both~ minted~ and~ listings~ to~ true~ is~ not~ possible. }
+ { Choose~ either~ of~ them! }
+% \end{macrocode}
+%
+% Define a message for logging that a specific package will be loaded by
+% \pkg{se2packages}.
+% Expects as parameter the name of the package that will be loaded.
+% \begin{macrocode}
+\msg_new:nnn { seiipackages } { load-package }
+ { se2packages~ loads~ the~ #1~ package now. }
+% \end{macrocode}
+%
+% And, in case both values are set to |true|,
+% raise the error message.
+% \begin{macrocode}
+\bool_lazy_and:nnT { \l_@@_minted_bool } { \l_@@_listings_bool }
+ {
+ \msg_error:nn { seiipackages } { conflicting-packages }
+ }
+% \end{macrocode}
+%
+% In case the |all| option is set,
+% set all other values to |true|.
+% \begin{macrocode}
+\bool_if:NT \l_@@_all_bool
+ {
+ \bool_gset_true:N \l_@@_csquotes_bool
+ \bool_gset_true:N \l_@@_booktabs_bool
+ \bool_gset_true:N \l_@@_siunitx_bool
+ \bool_gset_true:N \l_@@_minted_bool
+ \bool_gset_false:N \l_@@_listings_bool
+ \bool_gset_true:N \l_@@_selnolig_bool
+ \bool_gset_true:N \l_@@_luawidowcontrol_bool
+ \bool_gset_true:N \l_@@_microtype_bool
+ \bool_gset_true:N \l_@@_biblatex_bool
+ \bool_gset_true:N \l_@@_cleveref_bool
+ }
+% \end{macrocode}
+%
+% \subsection{Package loading}
+%
+% Conditionally load the \pkg{csquotes} package.
+% \begin{macrocode}
+\bool_if:NT \l_@@_csquotes_bool
+ {
+ \msg_info:nnn { seiipackages } { load-package } { csquotes }
+ \RequirePackage{csquotes}
+ }
+% \end{macrocode}
+%
+% Conditionally load the \pkg{booktabs} package.
+% \begin{macrocode}
+\bool_if:NT \l_@@_booktabs_bool
+ {
+ \msg_info:nnn { seiipackages } { load-package } { booktabs }
+ \RequirePackage{booktabs}
+ }
+% \end{macrocode}
+%
+% Conditionally load and configure the \pkg{siunitx} package.
+% \begin{macrocode}
+\bool_if:NT \l_@@_siunitx_bool
+ {
+ \msg_info:nnn { seiipackages } { load-package } { siunitx }
+ \RequirePackage[
+ add-integer-zero=false,
+ detect-inline-weight=math,
+ detect-weight=true,
+ free-standing-units,
+ group-minimum-digits=4,
+ list-final-separator={, and },
+ round-mode=figures,
+ round-precision=3,
+ separate-uncertainty=true,
+ uncertainty-mode=separate,
+ ]{siunitx}
+ }
+% \end{macrocode}
+%
+% Conditionally load and configure the \pkg{minted} package.
+% \begin{macrocode}
+\bool_if:NT \l_@@_minted_bool
+ {
+ \msg_info:nnn { seiipackages } { load-package } { minted }
+ \RequirePackage[newfloat=true]{minted}
+ \setminted{
+ autogobble,
+ breaklines=true,
+ fontsize=\footnotesize,
+ frame=single,
+ linenos=false,
+ resetmargins=true,
+ xleftmargin=1em,
+ xrightmargin=1em,
+ }
+ }
+% \end{macrocode}
+%
+% Conditionally load and configure the \pkg{listings} package.
+% \begin{macrocode}
+\bool_if:NT \l_@@_listings_bool
+ {
+ \msg_info:nnn { seiipackages } { load-package } { listings }
+ \RequirePackage{listings}
+ \lstset{
+ basicstyle=\footnotesize\ttfamily,
+ breaklines=true,
+ captionpos=t,
+ extendedchars=true,
+ frame=single,
+ keywordstyle=\color{blue}\bfseries,
+ showspaces=false,
+ showtabs=false,
+ showstringspaces=false,
+ tabsize=2,
+ }
+ }
+% \end{macrocode}
+%
+% Conditionally load \pkg{selnolig} if present and we run \LuaTeX.
+% \begin{macrocode}
+\bool_lazy_and:nnT { \l_@@_selnolig_bool } { \sys_if_engine_luatex_p: }
+ {
+ \IfFileExists { selnolig.sty }
+ {
+ \RequirePackage{selnolig}
+ } {
+ \msg:nnnn { seiipackages }
+ { selnolig-not-available }
+ { Could~ not~ find~ selnolig.sty }
+ { You~ might~ want~ to~ install~ it~ for~ better~ ligatures~ control.}
+ \msg_note:nn { seipackages } { selnolig-not-available }
+ }
+ }
+% \end{macrocode}
+%
+% Conditionally load \pkg{luawidowcontrol} if present and we run \LuaTeX.
+% \begin{macrocode}
+\bool_lazy_and:nnT { \l_@@_luawidowcontrol_bool } { \sys_if_engine_luatex_p: }
+ {
+ \IfFileExists { lua-widow-control.sty }
+ {
+ \RequirePackage{lua-widow-control}
+ } {
+ \msg:nnnn { seiipackages }
+ { lua-widow-control-not-available }
+ { Could~ not~ find~ lua-widow-control.sty }
+ {
+ You~ might~ want~ to~ install~ it~ for~ better~ control~ over~
+ widows~ and~ orphans.
+ }
+ \msg_note:nn { seipackages } { lua-widow-control-not-available }
+ }
+ }
+% \end{macrocode}
+%
+% Conditionally load and configure \pkg{microtype}.
+% \begin{macrocode}
+\bool_if:NT \l_@@_microtype_bool
+ {
+ \msg_info:nnn { seiipackages } { load-package } { microtype }
+ \RequirePackage{microtype}
+ \clubpenalty=10000
+ \widowpenalty=10000
+ \displaywidowpenalty=10000
+ \SetExtraKerning{
+ encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,TS1,EU1,EU2}
+ }{
+ \textemdash = {167,167},
+ — = {167,167}
+ }
+ }
+% \end{macrocode}
+%
+% Conditionally load and configure the \pkg{biblatex} package.
+% \begin{macrocode}
+\bool_if:NT \l_@@_biblatex_bool
+ {
+ \msg_info:nnn { seiipackages } { load-package } { biblatex }
+ \PassOptionsToPackage
+ {
+ backend=biber,
+ backref=true,
+ giveninits=true,
+ hyperref=auto,
+ maxnames=100,
+ minalphanames=3,
+ sorting=nyt,
+ style=alphabetic,
+ } { biblatex }
+ \RequirePackage{biblatex}
+ }
+% \end{macrocode}
+%
+% Conditionally load the \pkg{cleveref} package as the last of the preamble.
+% \begin{macrocode}
+\bool_if:NT \l_@@_cleveref_bool
+ {
+ \msg_info:nnn { seiipackages } { load-package } { cleveref }
+ \AddToHook { begindocument/before }
+ {
+ \RequirePackage[capitalise]{cleveref}
+ }
+ }
+% \end{macrocode}
+%
+%
+%
+%
+% \begin{macrocode}
+%</package>
+% \end{macrocode}
+%
+% \end{implementation}
+%
+% \PrintIndex
diff --git a/macros/latex/contrib/se2thesis/se2thesis-master-thesis-example.pdf b/macros/latex/contrib/se2thesis/se2thesis-master-thesis-example.pdf
index 3b09372b1c..df38c24126 100644
--- a/macros/latex/contrib/se2thesis/se2thesis-master-thesis-example.pdf
+++ b/macros/latex/contrib/se2thesis/se2thesis-master-thesis-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/se2thesis/se2thesis-master-thesis-example.tex b/macros/latex/contrib/se2thesis/se2thesis-master-thesis-example.tex
index 2a7cf037a2..da47aaa56e 100644
--- a/macros/latex/contrib/se2thesis/se2thesis-master-thesis-example.tex
+++ b/macros/latex/contrib/se2thesis/se2thesis-master-thesis-example.tex
@@ -2,37 +2,25 @@
chapterprefix=true,%
open=right,%
twoside=true,%
+ paper=a4,%
logofile={logo.png},%
thesistype=master,%
- biblatex=true,%
UKenglish,%
]{se2thesis}
\listfiles
\usepackage[ngerman,main=UKenglish]{babel}
\usepackage{blindtext}
\usepackage[%
- group-minimum-digits=4,%
- list-final-separator={, and },%
- add-integer-zero=false,%
- free-standing-units,%
- round-mode=figures,%
- round-precision=3,%
- detect-weight=true,%
- separate-uncertainty=true,%
- uncertainty-mode=separate,%
-]{siunitx}
-
-\usepackage[newfloat=true]{minted}
-\setminted{%
- autogobble,%
- breaklines=true,%
- fontsize=\footnotesize,%
- linenos=false,%
- resetmargins=true,%
- xleftmargin=1em,%
- xrightmargin=1em,%
- frame=single,%
-}
+ csquotes=true,%
+ booktabs=true,%
+ siunitx=true,%
+ minted=true,%
+ selnolig=true,%
+ widowcontrol=false,%
+ microtype=true,%
+ biblatex=true,%
+ cleveref=true,%
+]{se2packages}
\begin{filecontents}{\jobname.bib}
@book{Knu86,
@@ -43,18 +31,14 @@
\end{filecontents}
\addbibresource{\jobname.bib}
-\usepackage{booktabs}
-
-\usepackage{csquotes}
-
\usepackage{hyperref}
-\usepackage{cleveref}
\author{Stephan Lukasczyk}
\title{A Master Thesis Example Document}
\degreeprogramme{Computer Science}
\matrnumber{0815}
\supervisor{Prof.\,Dr.~Max Mustermann}
+\external{Prof.~John Doe,~PhD}
\advisor{Marianne Musterfrau}
\department{Faculty of Examples}
\institute{Chair of Example}
diff --git a/macros/latex/contrib/se2thesis/se2thesis.dtx b/macros/latex/contrib/se2thesis/se2thesis.dtx
index 525d551869..8826356f6c 100644
--- a/macros/latex/contrib/se2thesis/se2thesis.dtx
+++ b/macros/latex/contrib/se2thesis/se2thesis.dtx
@@ -80,6 +80,46 @@
% They are available as separate packages, however, to allow their reuse for
% other classes, packages, and projects, as well.
%
+% \subsection{Installation}\label{sec:doc-intro-install}
+%
+% The \pkg{se2thesis} bundle is available from \CTAN\footnote{
+% \href{https://ctan.org/pkg/se2thesis}{ctan.org/pkg/se2thesis}
+% }.
+% It is part of both \MiKTeX{} and \TeXLive.
+% You can find its development version from GitHub\footnote{
+% \href{https://github.com/se2p/se2thesis}{github.com/se2p/se2thesis}
+% }.
+% The easiest way of installing it is through your \TeX{} distribution;
+% please check your distribution's documentation on this.
+% Note that it might be necessary to update your \TeX{} distribution
+% because they might not provide you updates;
+% for example, there is a new version of \TeXLive{} every year
+% which needs to be installed separately.
+% If you have installed an older version of \pkg{se2thesis}
+% consider updating it to the latest version available from \CTAN{}
+% through your distribution.
+%
+% For manual installation, we recommend to clone the Git repository
+% and run the \texttt{l3build} tool that we also use for building the bundle.
+% Running |l3build ctan| builds the source files and compiles the documentation.
+% This creates a folder |build| containing these artefacts;
+% |build/doc| contains the documentation,
+% |build/local| the source files.
+% See the documentation of \texttt{l3build} and your \TeX{} distribution
+% on how to install them manually.
+% Please note that \texttt{l3build} also provides a |l3build install| target
+% to install the bundle files to your local texmf tree.
+%
+% The “Island of \TeX{}” project provides Docker images of \TeXLive.
+% If you do not want to install/update \TeXLive{} on your system
+% you might want to consider their \texttt{latest} image,
+% which contains a recent \TeXLive{} 2023 build.
+% They build their images weekly,
+% thus also recent releases of \pkg{se2thesis} will be part of the image
+% soon after their release date.
+%
+% \subsection{General Macros}\label{sec:doc-intro-macros}
+%
% They all have in common one macro, \cs{IfFormatAtLeastTF};
% this macro is part of the latest \LaTeX{} kernel.
% However, not all users might have upgraded their \TeX{} installation
@@ -128,7 +168,7 @@
%
% However, we recommend to use a couple of further packages, together with some
% further options to those package. We describe these settings in
-% \cref{sec:doc-se2thesis-pkgs}.
+% \cref{sec:doc-se2packages}.
% Please consider looking at this section when starting to write your document.
%
% Before we start with a detailed documentation of the class, we explain one
@@ -151,7 +191,7 @@
% \end{syntax}
% Set the base document class.
% Values are \cls{scrreprt}, \cls{scrartcl}, or \cls{scrbook}.
-% Default is |scrreprt|.
+% Default is |scrbook|.
% \end{function}
%
% \begin{function}{paper}
@@ -159,7 +199,7 @@
% |paper| = \meta{choice}
% \end{syntax}
% Set the paper format.
-% Possible values are |a4|, |a5|, or |b5|.
+% Possible values are |a4| or |b5|.
% Default is |a4|.
% \end{function}
%
@@ -182,14 +222,6 @@
% and |phd| for a PhD thesis.
% \end{function}
%
-% \begin{function}{biblatex}
-% \begin{syntax}
-% |biblatex| = \meta{true,false}
-% \end{syntax}
-% Whether \cls{se2thesis} shall load the \pkg{biblatex} package together with
-% some settings automatically.
-% \end{function}
-%
% \begin{function}{colormode}
% \begin{syntax}
% |colormode| = \meta{choice}
@@ -354,164 +386,6 @@
% page numbers in the outer margin and the headmarks split from the page numbers
% by a vertical bar.
%
-% \subsection{Recommended additional packages}\label{sec:doc-se2thesis-pkgs}
-%
-% Several packages can be useful for writing a thesis.
-% We list them in this section; for the recommended option settings, please have
-% a look at our examples.
-% Please note that you might not need all these packages, however, having a look
-% at them (especially their documentation) might give you an insight, whether to
-% use a package.
-% Our general recommendation is to use as few packages as you can; some might
-% have conflicts, others basically do the same or are outdated.
-% Please consider reading the documentation of each package you are using to
-% figure out whether they have any conflicts with other packages~(for example,
-% one cannot use the recommended \pkg{siunitx} package together with
-% \pkg{SIunits}) or they might require to be loaded at special places in your
-% preamble~(for example, \pkg{hyperref} is usually meant to be loaded as the
-% last package, except you are also using \pkg{cleveref}, which needs to be
-% loaded \emph{after} \pkg{hyperref}).
-%
-% \subsubsection{Quoting with \pkg{csquotes}}
-%
-% The \pkg{csquotes} package allows for intelligent quoting of text.
-% While verbose quotes are not that common on computer science, the package
-% still provides some useful macros to the user.
-%
-% \subsubsection{Number formatting with \pkg{siunitx}}
-%
-% While \pkg{siunitx}'s original purpose was to format physical quantities, it
-% provides a lot of useful features when typesetting theses~(and other
-% documents) in computer science.
-% When you skim through its documentation, especially look at the \cmd{\qty} and
-% \cmd{\num} macros, as well as the section on typesetting tabular material.
-% We also recommend reading an extensive discussion on number formatting,
-% precision of presented numbers, and many more related topics in Beyer et al.'s
-% journal paper on requirements and solutions for reliable
-% benchmarking~\cite{DBLP:journals/sttt/BeyerLW19}.
-%
-% When using the \pkg{siunitx} package, we recommend adding the following lines
-% to your document's preamble
-% \begin{LaTeXdemo}[code only]
-% \usepackage[
-% group-minimum-digits=4,
-% list-final-separator={, and },
-% add-integer-zero=false,
-% free-standing-units,
-% round-mode=figures,
-% round-precision=3,
-% detect-weight=true,
-% detect-inline-weight=math,
-% separate-uncertainty=true,
-% uncertainty-mode=separate,
-% ]{siunitx}
-% \end{LaTeXdemo}
-%
-% \subsubsection{Code listings with \pkg{minted}}
-%
-% We prefer using the \pkg{minted} package for code listings.
-% However, this package requires the installation of Python and the setting of
-% the |-shell-escape| option to your \TeX{} engine.
-% Please read the package's documentation to set it up.
-% If you do not want to install Python and the dependencies, we also provide
-% settings for the alternative \pkg{listings} package in the next subsection.
-%
-% When using \pkg{minted} we recommend the following settings:
-% \begin{LaTeXdemo}[code only]
-% \usepackage[newfloat=true]{minted}
-% \setminted{
-% autogobble,
-% breaklines=true,
-% fontsize=\footnotesize,
-% linenos=false,
-% resetmargins=true,
-% xleftmargin=1em,
-% xrightmargin=1em,
-% frame=single,
-% }
-% \end{LaTeXdemo}
-%
-% \subsubsection{Code listing with \pkg{listings}}
-%
-% In case you do not want to use the aforementioned \pkg{minted} package, please
-% consider using \pkg{listings} for typesetting your code listings.
-% \begin{LaTeXdemo}[code only]
-% \usepackage{listings}
-% \lstset{
-% frame=single,
-% extendedchars=true,
-% basicstyle=\footnotesize\ttfamily,
-% keywordstyle=\color{blue}\bfseries,
-% showstringspaces=false,
-% showspaces=false,
-% tabsize=2,
-% breaklines=true,
-% showtabs=false,
-% captionpos=t,
-% }
-% \end{LaTeXdemo}
-%
-% Please be aware to use \emph{either} \pkg{minted} \emph{or} \pkg{listings}!
-%
-% \subsubsection{Designing tables}
-%
-% A basically mandatory package to all users of tables is the \pkg{booktabs}
-% package.
-% Especially its documentation is a must read!
-% It provides a large variety of hints for designing tables,
-% most notably that one should never ever use vertical lines;
-% horizontal lines should be used sparsely; \pkg{booktabs} provides three macros
-% for lines that shall be used: \cmd{\toprule} for a rule on the top of a table,
-% above the column heads, \cmd{\midrule} to separate column heads and the
-% content but, and \cmd{\bottomrule} to mark the bottom of a table.
-%
-% Note that captions of tables shall be put \emph{above} the table whereas
-% captions of figures shall go \emph{below} the figure.
-% The rationale is that a figure should be more of less self explaining whereas
-% a table almost always needs some explanation.
-%
-% Unfortunately, the distances when using a \cmd{\caption} above a table are
-% wrong by default; when creating tables, consider loading the \pkg{hvfloats}
-% package and use its \cmd{\tabcaption} instead of \cmd{\caption} for tables.
-% The \pkg{hvfloats} package furthermore provides additional useful things to
-% typeset all kinds of floats.
-%
-% \subsubsection{Use \pkg{biblatex} for bibliographic references}
-%
-% The standard way of typesetting bibliographic references was using
-% \BibTeX.
-% The original \BibTeX, however, seems to be very outdated in
-% various ways: it originally supported only 7\,bit character sets and creating
-% citation styles requires the usage of an archaic language.
-% \BibLaTeX resolves many of the drawbacks of \BibTeX;
-% when combined with the |biber| engine, it supports full UTF-8 unicode,
-% therefore correct sorting of the references now works out of the box; also
-% creating citation styles can now be done using simple \LaTeX{} commands.
-%
-% For easier usage, we provide the load-time option |biblatex| that already sets
-% all settings~(see \cref{sec:doc-se2thesis-options}.
-% Set this options to \cls{se2thesis} and add your reference file using the
-% \cmd{\addbibresource} macro. \cmd{\printbibliography} will print your
-% references.
-%
-% \subsubsection{Use \pkg{cleveref} for internal references}
-%
-% \LaTeX{} provides an easy-to-use reference mechanism using the \cmd{\label}
-% and \cmd{\ref} macros.
-% However, this requires some manual effort and the text needs to specify
-% whether a reference is to a figure, section, or table.
-% We often see things in drafts such as \enquote{we discuss our findings in 4};
-% but what is \enquote{4} here?
-% Is it a section, a table, a figure?
-% To avoid such confusion, use the \pkg{cleveref} package, which automatically
-% infers the type of the reference~(see its documentation on how this works).
-% The \pkg{cleveref} package furthermore avoids one additional mistake: between
-% the name of the element and its reference one needs to have a non-breaking
-% space that often is forgotten.
-%
-% Please note that, in contrast to most other packages, \pkg{cleveref} has to be
-% loaded \emph{after} the \pkg{hyperref} package!
-%
% \subsection{Abstract for the thesis}\label{sec:doc-se2thesis-abstract}
%
% Each thesis shall come with an abstract that summarises its content.
@@ -648,12 +522,6 @@
% question;
% however, this can also be arbitrary text.
%
-% \begin{thebibliography}{9}
-% \bibitem{DBLP:journals/sttt/BeyerLW19} Dirk Beyer, Stefan Löwe, and Philipp
-% Wendler: \emph{Reliable benchmarking: requirements and solutions}. STTT
-% 21(1): 1--29 (2019)
-% \end{thebibliography}
-%
% \end{documentation}
%
% \clearpage
@@ -721,7 +589,7 @@
%
% Identify the class and give the overall version number.
% \begin{macrocode}
-\ProvidesExplClass {se2thesis} {2023-01-27} {2.1.0}
+\ProvidesExplClass {se2thesis} {2023-04-18} {3.0.0}
{A thesis class for the Chair of Software Engineering II}
% \end{macrocode}
%
@@ -788,14 +656,6 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\l_@@_biblatex_bool}
-% The user wants to load the \pkg{biblatex} package together with our
-% settings.
-% \begin{macrocode}
-\bool_new:N \l_@@_biblatex_bool
-% \end{macrocode}
-% \end{macro}
-%
% Define internal variables to hold the values of the fields of the title
% page.
% \begin{macro}
@@ -886,9 +746,9 @@
class / scrartcl .code:n = \tl_gset:Nn \l_@@_base_class_tl {scrartcl},
class / book .meta:n = {class=scrbook},
class / scrbook .code:n = \tl_gset:Nn \l_@@_base_class_tl {scrbook},
- class .initial:n = scrreprt,
+ class .initial:n = scrbook,
- paper .choices:nn = {a4,a5,b5}{
+ paper .choices:nn = {a4,b5}{
\int_gset_eq:NN \l_@@_paper_int \l_keys_choice_int
},
paper .initial:n = a4,
@@ -911,9 +771,6 @@
},
thesistype .initial:n = master,
- biblatex .bool_gset:N = \l_@@_biblatex_bool,
- biblatex .initial:n = false,
-
colormode .choices:nn = {cmyk,rgb,bw}{
\tl_gset_eq:NN \l_@@_colormode_tl \l_keys_choice_tl
},
@@ -986,86 +843,6 @@
\RequirePackage{se2fonts}
% \end{macrocode}
%
-% Load the \pkg{microtype} package.
-% We also set some options to \pkg{microtype}, namely the penalties for widows
-% and orphans (which might also be corrected by \pkg{lua-widow-control} when
-% using \LuaTeX{}) and a thin space around the m-dash.
-% We are aware of the discussion whether to have a space around the m-dash in
-% English, however, we think it looks more beautiful.
-% We took this from \href{https://tex.stackexchange.com/a/109188/14622}{a
-% \TeX{}.StackExchange post}.
-% \begin{macrocode}
-\RequirePackage{microtype}
-\clubpenalty=10000
-\widowpenalty=10000
-\displaywidowpenalty=10000
-\SetExtraKerning{
- encoding = {OT1,T1,T2A,LY1,OT4,QX,T5,TS1,EU1,EU2}
-}{
- \textemdash = {167,167},
- — = {167,167}
-}
-% \end{macrocode}
-%
-% When using \LuaTeX{} load the \pkg{lua-widow-control} package for a better
-% control of orphans and widows.
-% \begin{macrocode}
-\ifengineT { \luatexengine }
- {
- \IfFileExists { lua-widow-control.sty }
- { \RequirePackage{lua-widow-control} }
- {
- \msg:nnn { seiithesis }
- { lua-widow-control-not-available }
- {
- Could~ not~ find~ lua-widow-control.sty.~ You~ might~ want~ to~
- install~ it~ for~ better~ control~ over~ orphans~ and~ widows.
- }
- \msg_note:nn { seiithesis } { lua-widow-control-not-available }
- }
- }
-% \end{macrocode}
-%
-% Similarly, load \pkg{ligtype} when using \LuaTeX.
-% \begin{macrocode}
-\ifengineT { \luatexengine }
- {
- \IfFileExists { selnolig.sty }
- { \RequirePackage{selnolig} }
- {
- \msg:nnn { seiithesis }
- { selnolig-not-available }
- {
- Could~ not~ find~ selnolig.sty.~ You~ might~ want~ to~ install~ it~
- for~ better~ ligatures~ control.
- }
- \msg_note:nn { seiithesis } { selnolig-not-available }
- }
- }
-% \end{macrocode}
-%
-% When the user requests the |biblatex| option, also load \pkg{biblatex}
-% \begin{macrocode}
-\bool_if:NT \l_@@_biblatex_bool
- {
- \PassOptionsToPackage
- {
- backend=biber,
- hyperref=auto,
- backref=true,
- style=alphabetic,
- maxnames=100,
- minalphanames=3,
- sorting=nyt,
- giveninits=true,
- }{biblatex}
- \RequirePackage{biblatex}
-% \end{macrocode}
-% End of the \BibLaTeX{} settings.
-% \begin{macrocode}
- }
-% \end{macrocode}
-%
% \subsection{User macros for the title page}
%
% In addition to the macros provided by the \KOMAScript{} classes
@@ -1174,7 +951,12 @@
\dim_if_exist:NF \l_@@_logo_height_dim
{
\dim_new:N \l_@@_logo_height_dim
- \dim_gset:Nn \l_@@_logo_height_dim { 67.5pt }
+ \int_compare:nTF { \l_@@_paper_int=1 }
+ {
+ \dim_gset:Nn \l_@@_logo_height_dim { 67.5pt }
+ } {
+ \dim_gset:Nn \l_@@_logo_height_dim { 56.8pt }
+ }
}
\box_if_exist:NF \l_@@_logo_box
{
@@ -1200,16 +982,9 @@
\setlength{\marginparsep}{8.5cm}
\setlength{\marginparsep}{1em}
}{
- \int_compare:nTF { \l_@@_paper_int=2 }
- {
- \areaset[current]{247pt}{400pt}
- \setlength{\marginparsep}{6.0cm}
- \setlength{\marginparsep}{0.71em}
- }{
- \areaset[current]{303pt}{491pt}
- \setlength{\marginparsep}{7.4cm}
- \setlength{\marginparsep}{0.87em}
- }
+ \areaset[current]{350pt}{567pt}
+ \setlength{\marginparsep}{7.4cm}
+ \setlength{\marginparsep}{0.87em}
}
% \end{macrocode}
%
@@ -1835,7 +1610,7 @@
% We provide the following English translations.
%
% \begin{macrocode}
-\ProvideDictionaryFor{English}{se2translations}[2023/01/27]
+\ProvideDictionaryFor{English}{se2translations}[2023/04/18]
\ProvideDictTranslation{abstract}{abstract}
\ProvideDictTranslation{Abstract}{Abstract}
\ProvideDictTranslation{acknowledgement}{acknowledgement}
@@ -1886,7 +1661,7 @@
% We provide the following German translations.
%
% \begin{macrocode}
-\ProvideDictionaryFor{German}{se2translations}[2023/01/27]
+\ProvideDictionaryFor{German}{se2translations}[2023/04/18]
\ProvideDictTranslation{abstract}{Zusammenfassung}
\ProvideDictTranslation{Abstract}{Zusammenfassung}
\ProvideDictTranslation{acknowledgement}{Danksagung}
diff --git a/macros/latex/contrib/se2thesis/se2thesis.ins b/macros/latex/contrib/se2thesis/se2thesis.ins
index 1ad8d4c021..c3af7cd020 100644
--- a/macros/latex/contrib/se2thesis/se2thesis.ins
+++ b/macros/latex/contrib/se2thesis/se2thesis.ins
@@ -47,6 +47,7 @@ This work consists of the files se2thesis.dtx,
se2thesis.ins,
se2colors.dtx,
se2fonts.dtx,
+ se2packages.dtx,
se2thesis-master-thesis-example.tex
and the derived files se2thesis.pdf,
se2thesis.cls,
@@ -54,6 +55,7 @@ This work consists of the files se2thesis.dtx,
se2translations-german.trsl,
se2colors.sty,
se2fonts.sty,
+ se2packages.sty,
se2thesis-master-thesis-example.bib, and
se2thesis-master-thesis-example.pdf
\endpreamble
@@ -99,6 +101,14 @@ This work consists of the files se2thesis.dtx,
\from{se2fonts.dtx}{package}
}
}
+\generate
+ {%
+ \file{se2packages.sty}
+ {%
+ \from{se2thesis.dtx}{init}
+ \from{se2packages.dtx}{package}
+ }
+ }
\endbatchfile
diff --git a/macros/latex/contrib/se2thesis/se2thesis.pdf b/macros/latex/contrib/se2thesis/se2thesis.pdf
index 89835e4070..dd2d5278ec 100644
--- a/macros/latex/contrib/se2thesis/se2thesis.pdf
+++ b/macros/latex/contrib/se2thesis/se2thesis.pdf
Binary files differ
diff --git a/macros/latex/contrib/se2thesis/se2thesis.tex b/macros/latex/contrib/se2thesis/se2thesis.tex
index 6035c60e18..4747857e55 100644
--- a/macros/latex/contrib/se2thesis/se2thesis.tex
+++ b/macros/latex/contrib/se2thesis/se2thesis.tex
@@ -229,6 +229,7 @@ starting at page~\pageref{sec:impl}, for those who are curious.
\DocInput{se2thesis.dtx}
\DocInput{se2colors.dtx}
\DocInput{se2fonts.dtx}
+\DocInput{se2packages.dtx}
\EnableImplementation
\DisableDocumentation
diff --git a/macros/latex/contrib/se2thesis/test.pdf b/macros/latex/contrib/se2thesis/test.pdf
index 1690e75f98..d33ba70794 100644
--- a/macros/latex/contrib/se2thesis/test.pdf
+++ b/macros/latex/contrib/se2thesis/test.pdf
Binary files differ
diff --git a/macros/latex/contrib/se2thesis/test.tex b/macros/latex/contrib/se2thesis/test.tex
index 866a44d2f2..79694db902 100644
--- a/macros/latex/contrib/se2thesis/test.tex
+++ b/macros/latex/contrib/se2thesis/test.tex
@@ -1,68 +1,107 @@
-\documentclass[twoside]{scrartcl}
-\usepackage[automark]{scrlayer-scrpage}
-\usepackage{xcolor}
+\documentclass[%
+ chapterprefix=true,%
+ open=right,%
+ twoside=true,%
+ logofile={logo.png},%
+ thesistype=master,%
+ biblatex=true,%
+ UKenglish,%
+ class=book,%
+ paper=b5,%
+]{se2thesis}
+\listfiles
+\usepackage[ngerman,main=UKenglish]{babel}
\usepackage{blindtext}
-%\DeclareLayer[clone=scrheadings.head.oneside,
-% contents={%
-% \color{yellow}%
-% \rule[-\dp\strutbox]%
-% {\layerwidth}{\layerheight}%
-% }%
-%]{scrheadings.head.oneside.background}
-%\DeclareLayer[clone=scrheadings.head.odd,
-% contents={%
-% \color{yellow}%
-% \rule[-\dp\strutbox]%
-% {\layerwidth}{\layerheight}%
-% }%
-%]{scrheadings.head.odd.background}
-%\DeclareLayer[clone=scrheadings.head.even,
-% contents={%
-% \color{yellow}%
-% \rule[-\dp\strutbox]%
-% {\layerwidth}{\layerheight}%
-% }%
-%]{scrheadings.head.even.background}
-%\AddLayersAtBeginOfPageStyle{scrheadings}{%
-% scrheadings.head.oneside.background,%
-% scrheadings.head.odd.background,%
-% scrheadings.head.even.background%
-%}
-\DeclareLayer[%
- clone=scrheadings.foot.odd,%
- contents={%
- {\ }%
- \footnotesize%
- {\color{blue}\headmark}%
- \hspace*{0.75cm}%
- {\color{blue}\rule[-5pt]{1.25pt}{15pt}}%
- \hspace*{0.75cm}%
- \begin{minipage}[b]{1.5cm}%
- \normalsize\textbf{\pagemark}%
- \end{minipage}%
- \hspace{-1.85cm}%
- }%
-]{scrheadings.foot.odd.slcd}
-\DeclareLayer[%
- clone=scrheadings.foot.even,%
- contents={%
- \null\hspace{-1.85cm}%
- \footnotesize%
- \begin{minipage}[b]{1.5cm}
- \raggedleft\normalsize\textbf{\pagemark}%
- \end{minipage}%
- \footnotesize%
- \hspace*{0.75cm}%
- {\color{blue}\rule[-5pt]{1.25pt}{15pt}}%
- \hspace*{0.75cm}%
- {\color{blue}\headmark}%
- }%
-]{scrheadings.foot.even.slcd}
-\AddLayersAtBeginOfPageStyle{scrheadings}{%
- scrheadings.foot.odd.slcd,%
- scrheadings.foot.even.slcd%
+\usepackage[%
+ group-minimum-digits=4,%
+ list-final-separator={, and },%
+ add-integer-zero=false,%
+ free-standing-units,%
+ round-mode=figures,%
+ round-precision=3,%
+ detect-weight=true,%
+ separate-uncertainty=true,%
+ uncertainty-mode=separate,%
+]{siunitx}
+
+\usepackage[newfloat=true]{minted}
+\setminted{%
+ autogobble,%
+ breaklines=true,%
+ fontsize=\footnotesize,%
+ linenos=false,%
+ resetmargins=true,%
+ xleftmargin=1em,%
+ xrightmargin=1em,%
+ frame=single,%
}
-\pagestyle{scrheadings}
+
+\begin{filecontents}{\jobname.bib}
+ @book{Knu86,
+ author = {Knuth, Donald E.},
+ year = {1986},
+ title = {The \TeX book},
+ }
+\end{filecontents}
+\addbibresource{\jobname.bib}
+
+\usepackage{booktabs}
+
+\usepackage{csquotes}
+
+\usepackage{hyperref}
+\usepackage{cleveref}
+
+\author{Stephan Lukasczyk}
+\title{A Master Thesis Example Document}
+\degreeprogramme{Computer Science}
+\matrnumber{0815}
+\supervisor{Prof.\,Dr.~Max Mustermann}
+\advisor{Marianne Musterfrau}
+\department{Faculty of Examples}
+\institute{Chair of Example}
+\location{Passau}
+
\begin{document}
+
+\frontmatter
+
+\maketitle
+
+\authorshipDeclaration
+
+\begin{abstract}
+ An English abstract to the thesis.
+\end{abstract}
+
+\begin{abstract}[german]
+ Eine deutschsprachige Zusammenfassung der Arbeit.
+\end{abstract}
+
+\begin{acknowledgements}
+ Some acknowledgements.
+\end{acknowledgements}
+
+\tableofcontents
+
+\mainmatter
+
\blinddocument
-\end{document} \ No newline at end of file
+
+\section{Further Examples}
+
+We could reference the \TeX{} book~\cite{Knu86}.
+
+\begin{resq}
+ What is \(41 + 1\)?
+\end{resq}
+
+\begin{summary}{Research Question 1}
+ It's 42, obviously!
+\end{summary}
+
+\backmatter
+
+\printbibliography
+
+\end{document}
diff --git a/macros/latex/required/babel/base/README.md b/macros/latex/required/babel/base/README.md
index d355b868d3..1ecd1bfdba 100644
--- a/macros/latex/required/babel/base/README.md
+++ b/macros/latex/required/babel/base/README.md
@@ -1,6 +1,6 @@
-## Babel 3.87
+## Babel 3.88
-2023-03-28
+2023-04-18
This package manages culturally-determined typographical (and other)
rules, and hyphenation patterns for a wide range of languages. Many
@@ -10,9 +10,9 @@ is a set of ini files for about 250 languages.
The latest stable version is available on <https://ctan.org/pkg/babel>.
-Changes in version 3.87 are described in:
+Changes in version 3.88 are described in:
-https://latex3.github.io/babel/news/whats-new-in-babel-3.87.html
+https://latex3.github.io/babel/news/whats-new-in-babel-3.88.html
Apart from the manual, you can find information on some aspects of babel at:
@@ -48,18 +48,18 @@ respective authors.
### Summary of latest changes
```
-3.87 2023-03-28
- * Fixes:
- - Typo in 'syllable' counter name in Korean (#225).
- - Language leakage with xetex and on-the-fly loading in a few
- locales.
- - Misplaced text with tikz. Fixed thanks to Salim Bou (#211).
- - Misplaced text body with 'multicol' and RTL (#228).
- * 'hyphenrules=' is applied with the current locale.
- * Updates to the CLDR: Swedish, Swahili, Tamil, Telugu, Thai,
- Tigrinya, Turkmen, Tongan, Turkish, Tasawaq, Central Atlas
- Tamazight, Uyghur, Ukrainian, Urdu, Vietnamese, Yiddish,
- Yoruba, Cantonese.
+3.88 2023-04-18
+ * 37 new locale files: Abkhazian, Afar, Atsam, Baluchi, Bhojpuri,
+ Blin, Corsican, Erzya, Ga, Geez, Guarani, Haryanvi, Inuktitut,
+ Jju, Ligurian, Muscogee, Northern Sotho, Nyanja, N’Ko,
+ Papiamento, Prussian, Rajasthani, Saho, Sicilian, Silesian,
+ South Ndebele, Southern Sotho, Swati, Taroko, Tigre, Tok Pisin,
+ Tsonga, Tswana, Tyap, Venda, Volapük, Wolaytta.
+ * Fixed a few month names in Greek locales (thanks to Günter Milde).
+ * New hook 'begindocument'.
+ * Feature preview: option 'casing' in '\babelprovide' (requires a
+ future change in the LaTeX kernel).
+ * Some minor changes.
```
### Previous changes
diff --git a/macros/latex/required/babel/base/babel.dtx b/macros/latex/required/babel/base/babel.dtx
index 76a7168fb2..937d698789 100644
--- a/macros/latex/required/babel/base/babel.dtx
+++ b/macros/latex/required/babel/base/babel.dtx
@@ -32,7 +32,7 @@
%
% \iffalse
%<*filedriver>
-\ProvidesFile{babel.dtx}[2023/03/28 v3.87 The Babel package]
+\ProvidesFile{babel.dtx}[2023/04/18 v3.88 The Babel package]
\documentclass{ltxdoc}
\GetFileInfo{babel.dtx}
\usepackage{fontspec}
@@ -2579,7 +2579,7 @@ languages.
Polytonic Greek with but with some sections in Italian. Then, the
first attempt should be:
\begin{verbatim}
-\usepackage[italian, greek.polutonico]{babel}
+\usepackage[italian, greek.polutoniko]{babel}
\end{verbatim}
But if, say, accents in Greek are not shown correctly, you can try
\begin{verbatim}
@@ -2791,7 +2791,7 @@ which is not recommended).
\end{note}
\Describe{\localenumeral}{\marg{style}\marg{number}}
-\DescribeOther{\localecounterl}{\marg{style}\marg{counter}}
+\DescribeOther{\localecounter}{\marg{style}\marg{counter}}
\New{3.41} Many `ini` locale files has been extended with information
about non-positional numerical systems, based on those predefined in
@@ -2991,7 +2991,7 @@ expandable, and the available fields are:
extension whose singleton is \m{s} (currently the recognized
singletons are |x|, |t| and |u|). The internal syntax can be somewhat
complex, and this feature is still somewhat tentative. An example is
- \textsf{classiclatin} which sets |extension.x.tag.bcp47| to classic.
+ \textsf{classiclatin} which sets |extension.x.tag.bcp47| to |classic|.
\New{3.75}
\end{description}
@@ -4036,6 +4036,11 @@ three \TeX{} parameters (|#1|, |#2|, |#3|), with the meaning given:
\item[afterreset] \New{3.9i} Executed when selecting a language just after
|\originalTeX| is run and reset to its base value, before executing
|\captions|\m{language} and |\date|\m{language}.
+\item[begindocument] \New{3.88} Executed before the code written by
+ |ldf| files with |\AtBeginDocument|. The optional argument with the
+ language in this particular case is the language that wrote the code.
+ The special value |/| means ‘return to the core \babel{} definitions’
+ (in other words, what follows hasn’t been written by any language).
% STILL UNDER STUDY:
% \item[beforestart] \New{3.34} Executed either at the beginning of the
% |aux| file (when read at the start of the document), or else at begin
@@ -5295,8 +5300,8 @@ help from Bernd Raichle, for which I am grateful.
% \section{Tools}
%
% \begin{macrocode}
-%<<version=3.87>>
-%<<date=2023/03/28>>
+%<<version=3.88>>
+%<<date=2023/04/18>>
% \end{macrocode}
%
% \textbf{Do not use the following macros in \texttt{ldf} files. They
@@ -7222,16 +7227,17 @@ help from Bernd Raichle, for which I am grateful.
\bbl@csarg\newcommand{ev@#2@#3@#1}[\bbl@tempb]}
\newcommand\EnableBabelHook[1]{\bbl@csarg\let{hk@#1}\@firstofone}
\newcommand\DisableBabelHook[1]{\bbl@csarg\let{hk@#1}\@gobble}
-\def\bbl@usehooks#1#2{%
- \ifx\UseHook\@undefined\else\UseHook{babel/*/#1}\fi
+\def\bbl@usehooks{\bbl@usehooks@lang\languagename}
+\def\bbl@usehooks@lang#1#2#3{%
+ \ifx\UseHook\@undefined\else\UseHook{babel/*/#2}\fi
\def\bbl@elth##1{%
- \bbl@cs{hk@##1}{\bbl@cs{ev@##1@#1@}#2}}%
- \bbl@cs{ev@#1@}%
+ \bbl@cs{hk@##1}{\bbl@cs{ev@##1@#2@}#3}}%
+ \bbl@cs{ev@#2@}%
\ifx\languagename\@undefined\else % Test required for Plain (?)
- \ifx\UseHook\@undefined\else\UseHook{babel/\languagename/#1}\fi
+ \ifx\UseHook\@undefined\else\UseHook{babel/#1/#2}\fi
\def\bbl@elth##1{%
- \bbl@cs{hk@##1}{\bbl@cl{ev@##1@#1}#2}}%
- \bbl@cl{ev@#1}%
+ \bbl@cs{hk@##1}{\bbl@cs{ev@##1@#2@#1}#3}}%
+ \bbl@cs{ev@#2@#1}%
\fi}
% \end{macrocode}
%
@@ -7247,7 +7253,7 @@ help from Bernd Raichle, for which I am grateful.
adddialect=2,patterns=2,defaultcommands=0,encodedcommands=2,write=0,%
beforeextras=0,afterextras=0,stopcommands=0,stringprocess=0,%
hyphenation=2,initiateactive=3,afterreset=0,foreign=0,foreign*=0,%
- beforestart=0,languagename=2}
+ beforestart=0,languagename=2,begindocument=1}
\ifx\NewHook\@undefined\else
\def\bbl@tempa#1=#2\@@{\NewHook{babel/#1}}
\bbl@foreach\bbl@evargs{\bbl@tempa#1\@@}
@@ -7499,8 +7505,10 @@ help from Bernd Raichle, for which I am grateful.
\renewcommand\selectlanguage[1]{}%
\renewcommand\foreignlanguage[2]{#2}%
\global\let\babel@aux\@gobbletwo % Also as flag
- \fi
- \ifcase\bbl@engine\or\pagedir\bodydir\fi} % TODO - a better place
+ \fi}
+\ifcase\bbl@engine\or
+ \AtBeginDocument{\pagedir\bodydir} % TODO - a better place
+\fi
% \end{macrocode}
%
% \end{macro}
@@ -8498,8 +8506,7 @@ help from Bernd Raichle, for which I am grateful.
\def\bbl@clear@ttribs{%
\ifx\bbl@attributes\@undefined\else
\bbl@loopx\bbl@tempa{\bbl@attributes}{%
- \expandafter\bbl@clear@ttrib\bbl@tempa.
- }%
+ \expandafter\bbl@clear@ttrib\bbl@tempa.}%
\let\bbl@attributes\@undefined
\fi}
\def\bbl@clear@ttrib#1-#2.{%
@@ -9822,7 +9829,7 @@ help from Bernd Raichle, for which I am grateful.
\bbl@vforeach{captions,date,import,main,script,language,%
hyphenrules,linebreaking,justification,mapfont,maparabic,%
mapdigits,intraspace,intrapenalty,onchar,transforms,alph,%
- Alph,labels,labels*,calendar,date}%
+ Alph,labels,labels*,calendar,date,casing}%
{\bbl@csarg\let{KVP@##1}\@nnil}%
\global\let\bbl@release@transforms\@empty
\let\bbl@calendars\@empty
@@ -9830,8 +9837,8 @@ help from Bernd Raichle, for which I am grateful.
\global\let\bbl@extend@ini\@gobble
\gdef\bbl@key@list{;}%
\bbl@forkv{#1}{%
- \in@{/}{##1}%
- \ifin@
+ \in@{/}{##1}% With /, (re)sets a value in the ini
+ \ifin@
\global\let\bbl@extend@ini\bbl@extend@ini@aux
\bbl@renewinikey##1\@@{##2}%
\else
@@ -10126,6 +10133,10 @@ help from Bernd Raichle, for which I am grateful.
\\\babel@save\\\@Alph
\let\\\@Alph\<bbl@cntr@\bbl@KVP@Alph @\languagename>}}%
\fi
+ % == Casing ==
+ \bbl@exp{\def\<bbl@casing@\languagename>%
+ {\<bbl@lbcp@\languagename>%
+ \ifx\bbl@KVP@casing\@nnil\else-x-\bbl@KVP@casing\fi}}%
% == Calendars ==
\ifx\bbl@KVP@calendar\@nnil
\edef\bbl@KVP@calendar{\bbl@cl{calpr}}%
@@ -10307,7 +10318,8 @@ help from Bernd Raichle, for which I am grateful.
\fi}%
\ifnum\@tempcnta=\m@ne
\bbl@warning{%
- Requested 'hyphenrules=' for '\languagename' not found.\\%
+ Requested 'hyphenrules' for '\languagename' not found:\\%
+ \bbl@KVP@hyphenrules.\\%
Using the default value. Reported}%
\fi
\fi
@@ -10434,7 +10446,7 @@ help from Bernd Raichle, for which I am grateful.
\ifx\bbl@required@inis\@empty\else
\bbl@replace\bbl@required@inis{ }{,}%
\bbl@foreach\bbl@required@inis{%
- \openin\bbl@readstream=##1.ini
+ \openin\bbl@readstream=babel-##1.ini
\bbl@loop@ini}%
\fi
% == Process stored data ==
@@ -10460,10 +10472,6 @@ help from Bernd Raichle, for which I am grateful.
{\bbl@ini@calendar{##1}}%
{}%
\fi
- \in@{=identification/extension.}{=##1/##2}%
- \ifin@
- \bbl@ini@extension{##2}%
- \fi
\bbl@ifunset{bbl@inikv@##1}{}%
{\csname bbl@inikv@##1\endcsname{##2}{##3}}}%
\bbl@inidata}
@@ -10567,6 +10575,11 @@ help from Bernd Raichle, for which I am grateful.
% is called always (via |\bbl@inisec|), while |\bbl@after@ini| must be
% called explicitly after |\bbl@read@ini| if necessary.
%
+% Although BCP 47 doesn’t treat ‘-x-’ as an extension, the CLDR and
+% many other sources do (as a \textit{private use extension}). For
+% consistency with other single-letter subtags or ‘singletons’, here
+% is considered an extension, too.
+%
% \begin{macrocode}
\def\bbl@iniwarning#1{%
\bbl@ifunset{bbl@@kv@identification.warning#1}{}%
@@ -10576,25 +10589,6 @@ help from Bernd Raichle, for which I am grateful.
Reported }}}
%
\let\bbl@release@transforms\@empty
-% \end{macrocode}
-%
-% BCP 47 extensions are separated by a single letter (eg,
-% |latin-x-medieval|. The following macro handles this special case to
-% create correctly the correspondig info.
-%
-% \begin{macrocode}
-\def\bbl@ini@extension#1{%
- \def\bbl@tempa{#1}%
- \bbl@replace\bbl@tempa{extension.}{}%
- \bbl@replace\bbl@tempa{.tag.bcp47}{}%
- \bbl@ifunset{bbl@info@#1}%
- {\bbl@csarg\xdef{info@#1}{ext/\bbl@tempa}%
- \bbl@exp{%
- \\\g@addto@macro\\\bbl@moreinfo{%
- \\\bbl@exportkey{ext/\bbl@tempa}{identification.#1}{}}}}%
- {}}
-\let\bbl@moreinfo\@empty
-%
\def\bbl@ini@exports#1{%
% Identification always exported
\bbl@iniwarning{}%
@@ -10611,6 +10605,8 @@ help from Bernd Raichle, for which I am grateful.
{\csname bbl@elname@\languagename\endcsname}}%
\bbl@exportkey{tbcp}{identification.tag.bcp47}{}%
\bbl@exportkey{lbcp}{identification.language.tag.bcp47}{}%
+ % Somewhat hackish. TODO
+ \bbl@exportkey{casing}{identification.language.tag.bcp47}{}%
\bbl@exportkey{lotf}{identification.tag.opentype}{dflt}%
\bbl@exportkey{esname}{identification.script.name}{}%
\bbl@exp{\\\bbl@exportkey{sname}{identification.script.name.opentype}%
@@ -10619,7 +10615,9 @@ help from Bernd Raichle, for which I am grateful.
\bbl@exportkey{sotf}{identification.script.tag.opentype}{DFLT}%
\bbl@exportkey{rbcp}{identification.region.tag.bcp47}{}%
\bbl@exportkey{vbcp}{identification.variant.tag.bcp47}{}%
- \bbl@moreinfo
+ \bbl@exportkey{extt}{identification.extension.t.tag.bcp47}{}%
+ \bbl@exportkey{extu}{identification.extension.u.tag.bcp47}{}%
+ \bbl@exportkey{extx}{identification.extension.x.tag.bcp47}{}%
% Also maps bcp47 -> languagename
\ifbbl@bcptoname
\bbl@csarg\xdef{bcp@map@\bbl@cl{tbcp}}{\languagename}%
@@ -11251,9 +11249,29 @@ help from Bernd Raichle, for which I am grateful.
\@namedef{bbl@info@script.tag.opentype}{sotf}
\@namedef{bbl@info@region.tag.bcp47}{rbcp}
\@namedef{bbl@info@variant.tag.bcp47}{vbcp}
-% Extensions are dealt with in a special way
-% Now, an internal \LaTeX{} macro:
-\providecommand\BCPdata[1]{\localeinfo*{#1.tag.bcp47}}
+\@namedef{bbl@info@extension.t.tag.bcp47}{extt}
+\@namedef{bbl@info@extension.u.tag.bcp47}{extu}
+\@namedef{bbl@info@extension.x.tag.bcp47}{extx}
+% \end{macrocode}
+%
+% \LaTeX{} needs to know the BCP 47 codes for some features. For that,
+% it expects |\BCPdata| to be defined. While |language|, |region|,
+% |script|, and |variant| are recognized, |extension.|\m{s} for
+% singletons may change.
+%
+% \begin{macrocode}
+\providecommand\BCPdata{}
+\ifx\renewcommand\@undefined\else % For plain. TODO. It’s a quick fix
+ \renewcommand\BCPdata[1]{%
+ \bbl@ifunset{bbl@info@#1.tag.bcp47}%
+ {\bbl@error{Unknown field '#1' in \string\BCPdata.\\%
+ Perhaps you misspelled it.}%
+ {See the manual for details.}}%
+ {\bbl@ifunset{bbl@\csname bbl@info@#1.tag.bcp47\endcsname @\languagename}{}%
+ {\bbl@cs{\csname bbl@info@#1.tag.bcp47\endcsname @\languagename}}}}
+\fi
+% Still somewhat hackish:
+\@namedef{bbl@info@casing.tag.bcp47}{casing}
% \end{macrocode}
%
% With version 3.75 |\BabelEnsureInfo| is executed always, but there is
@@ -11271,6 +11289,7 @@ help from Bernd Raichle, for which I am grateful.
\bbl@ifunset{bbl@lname@##1}{\bbl@load@info{##1}}{}}%
\fi
\bbl@foreach\bbl@loaded{{%
+ \let\bbl@ensuring\@empty % Flag used in a couple of babel-*.tex files
\def\languagename{##1}%
\bbl@ensureinfo{##1}}}}
\@ifpackagewith{babel}{ensureinfo=off}{}%
@@ -12386,7 +12405,9 @@ help from Bernd Raichle, for which I am grateful.
\expandafter\let\expandafter\bbl@afterlang
\csname\CurrentOption.ldf-h@@k\endcsname
\expandafter\let\expandafter\BabelModifiers
- \csname bbl@mod@\CurrentOption\endcsname}%
+ \csname bbl@mod@\CurrentOption\endcsname
+ \bbl@exp{\\\AtBeginDocument{%
+ \\\bbl@usehooks@lang{\CurrentOption}{begindocument}{{\CurrentOption}}}}}%
{\bbl@error{%
Unknown option '\CurrentOption'. Either you misspelled it\\%
or the language definition file \CurrentOption.ldf was not found}{%
@@ -12476,7 +12497,8 @@ help from Bernd Raichle, for which I am grateful.
\else
\bbl@info{Main language set with 'main='. Except if you have\\%
problems, prefer the default mechanism for setting\\%
- the main language. Reported}
+ the main language, ie, as the last declared.\\%
+ Reported}
\fi
% \end{macrocode}
%
@@ -12595,6 +12617,8 @@ help from Bernd Raichle, for which I am grateful.
\DeclareOption*{}
\ProcessOptions*
\fi
+\bbl@exp{%
+ \\\AtBeginDocument{\\\bbl@usehooks@lang{/}{begindocument}{{}}}}%
\def\AfterBabelLanguage{%
\bbl@error
{Too late for \string\AfterBabelLanguage}%
@@ -23176,6 +23200,7 @@ Babel.cjk_breaks = {
\bbl@elt{identification}{derivate}{no}}
\@namedef{bbl@tbcp@nil}{und}
\@namedef{bbl@lbcp@nil}{und}
+\@namedef{bbl@casing@nil}{und} % TODO
\@namedef{bbl@lotf@nil}{dflt}
\@namedef{bbl@elname@nil}{nil}
\@namedef{bbl@lname@nil}{nil}
diff --git a/macros/latex/required/babel/base/babel.ins b/macros/latex/required/babel/base/babel.ins
index 00ede1d332..f89a5a3498 100644
--- a/macros/latex/required/babel/base/babel.ins
+++ b/macros/latex/required/babel/base/babel.ins
@@ -26,7 +26,7 @@
%% and covered by LPPL is defined by the unpacking scripts (with
%% extension .ins) which are part of the distribution.
%%
-\def\filedate{2023/03/28}
+\def\filedate{2023/04/18}
\def\batchfile{babel.ins}
\input docstrip.tex
diff --git a/macros/latex/required/babel/base/babel.pdf b/macros/latex/required/babel/base/babel.pdf
index d729e48170..c9e2caadd7 100644
--- a/macros/latex/required/babel/base/babel.pdf
+++ b/macros/latex/required/babel/base/babel.pdf
Binary files differ
diff --git a/macros/latex/required/babel/base/bbcompat.dtx b/macros/latex/required/babel/base/bbcompat.dtx
index caebb44c38..59a9f961ef 100644
--- a/macros/latex/required/babel/base/bbcompat.dtx
+++ b/macros/latex/required/babel/base/bbcompat.dtx
@@ -30,7 +30,7 @@
%
% \iffalse
%<*dtx>
-\ProvidesFile{bbcompat.dtx}[2023/03/28 v3.87]
+\ProvidesFile{bbcompat.dtx}[2023/04/18 v3.88]
%</dtx>
%
%% File 'bbcompat.dtx'