summaryrefslogtreecommitdiff
path: root/macros/context/contrib/context-calendar-examples
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-03-25 03:02:28 +0000
committerNorbert Preining <norbert@preining.info>2023-03-25 03:02:28 +0000
commit2d6e8c1374d2f1b73403403fe3c1ed84180d3bfa (patch)
tree52a0314aa04c42f356a77ee714677c3a9c3b55e3 /macros/context/contrib/context-calendar-examples
parent85fda71ebb01e4a5b0ce50edf3dda43f45ebb55a (diff)
CTAN sync 202303250302
Diffstat (limited to 'macros/context/contrib/context-calendar-examples')
-rw-r--r--macros/context/contrib/context-calendar-examples/t-calendar-examples/VERSION2
-rw-r--r--macros/context/contrib/context-calendar-examples/t-calendar-examples/tex/context/third/calendar-examples/Menu-calendar.tex82
2 files changed, 48 insertions, 36 deletions
diff --git a/macros/context/contrib/context-calendar-examples/t-calendar-examples/VERSION b/macros/context/contrib/context-calendar-examples/t-calendar-examples/VERSION
index b123147e2a..bcdfbcd1bb 100644
--- a/macros/context/contrib/context-calendar-examples/t-calendar-examples/VERSION
+++ b/macros/context/contrib/context-calendar-examples/t-calendar-examples/VERSION
@@ -1 +1 @@
-1.1 \ No newline at end of file
+2023.03.23 \ No newline at end of file
diff --git a/macros/context/contrib/context-calendar-examples/t-calendar-examples/tex/context/third/calendar-examples/Menu-calendar.tex b/macros/context/contrib/context-calendar-examples/t-calendar-examples/tex/context/third/calendar-examples/Menu-calendar.tex
index 3101cbc2d8..135994f9d8 100644
--- a/macros/context/contrib/context-calendar-examples/t-calendar-examples/tex/context/third/calendar-examples/Menu-calendar.tex
+++ b/macros/context/contrib/context-calendar-examples/t-calendar-examples/tex/context/third/calendar-examples/Menu-calendar.tex
@@ -25,7 +25,8 @@
% Add a path to the picture placed on page 3:
\setupexternalfigures
- [directory=/YourFolder]
+ [directory=/Users/willi/Documents/TEXdata
+ /Koken/Grossmutters-Guetzli-Rezepte/]
% Choose the main language it determines the interface:
@@ -36,17 +37,25 @@
% 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:
-\setuppapersize[A6][A4]
+%\setuppapersize[A6][A4]
+\setuppapersize[A5][A4,landscape]
-\setuparranging[2*4*2]
+% \setuparranging[2*4*2]
+%\setuparranging[2*2*4]
+\setuparranging[2SIDE]
% The module Collating marks needs appropriate information:
+% \setupMPvariables
+% [pages=8, % pages per sheet of paper doublesided
+% sheets=2, % sheets of paper used per section
+% horpageshift=0mm]
\setupMPvariables
- [pages=8, % pages per sheet of paper doublesided
- sheets=2, % sheets of paper used per section
+ [pages=4, % pages per sheet of paper doublesided
+ sheets=4, % sheets of paper used per section
horpageshift=0mm]
+
% Adapt the layout of the page to the size of the page:
\setuplayout
[topspace=.6cm,
@@ -101,7 +110,7 @@
\setuplabeltext[fr][menu=Menu]
\setuplabeltext[fr][comment=Commentaire]
-% Dutch interfac
+% Dutch interface
\setuplabeltext[nl][menu=Menu]
\setuplabeltext[nl][comment=Commentaar]
@@ -113,30 +122,31 @@
\setuplabeltext[es][menu=MenĂº]
\setuplabeltext[es][comment=Comentario]
+
% The lua code performing all the magic:
\startluacode
local report = logs.reporter("Menu calendar")
-
+
function thirddata.calendar.menuweektable(mondaytimestamp,year,w)
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")
-
+
local monthname = string.lower(os.date("%B",day))
-
+
--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
@@ -145,21 +155,20 @@
daynumber = tonumber(os.date("%d",day)) --day number
dayname = string.lower(os.date("%a",day)) -- day name short
monthnumber = tonumber(os.date("%m",day)) -- month name
- holiday = thirddata.calendar.checkchristianfeast(daynumber,monthnumber,year) --
- -- Christian holida
+ holiday = thirddata.calendar.checkchristianfeast(daynumber,monthnumber,year) -- Christian holida
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)
@@ -187,11 +196,11 @@
context.eTABLE()
context.page({"yes"})
end
-
+
function thirddata.calendar.myheadertext(monthname,week)
-
- report("Working in function myheadertext")
-
+
+ report("Working in function myheadertext")
+
context.setupheadertexts{
function()
context("\\bgroup\\bfa")
@@ -204,14 +213,16 @@
return true
end}
end
-
+
function thirddata.calendar.week(weeknumber,year)
local w = weeknumber
- local mondaytimestamp = thirddata.calendar.weekcalendar(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")
--report("Mondaytimestamp %s", mondaytimestamp)
-
+
thirddata.calendar.menuweektable(mondaytimestamp,year,w)
end
@@ -238,10 +249,10 @@
\stopstandardmakeup
\setupheadertexts[][]
-
+
\strut\vfil
-
- \startplacefigure
+
+ \startplacefigure
[number=,
title=,
location=middle]
@@ -253,13 +264,13 @@
\page
\setups{Footertext}
-
+
\dorecurse{52}
{\setvariables
[PocketDiary]
[Week=\recurselevel]
\MenuWeektable{\recurselevel}{\getvariable{PocketDiary}{Year}}\page}
-
+
\page
\setupheadertexts[\bf \labeltext{notes}]
@@ -268,3 +279,4 @@
{3}
{\strut\page}
\stoptext
+