summaryrefslogtreecommitdiff
path: root/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Sundata-calendar.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Sundata-calendar.tex')
-rw-r--r--macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Sundata-calendar.tex619
1 files changed, 322 insertions, 297 deletions
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 18726204cb..99865d70c0 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
@@ -10,269 +10,296 @@
\usemodule[pocketdiary]
\usemodule[collatingmarks][Collatingmarks=yes]
+
+% \definemode[English,Dutch,German,French,Italian,Spanish][keep]
-\definemode[English,Dutch,German,French,Italian,Spanish][keep]
-
-\enablemode[English]
+\mainlanguage[es]
+% \enablemode[English]
% \enablemode[German]
% \enablemode[Dutch]
% \enablemode[Italian]
% \enablemode[French]
-%\enablemode[Spanish]
+% \enablemode[Spanish]
+
+\setvariables
+ [PocketDiary]
+ [Year=2023,
+ Week=1,
+ Day=1,
+ Month=1,
+ Nextyear=no,
+ Place=Kozeigłowy,
+ Country=PL]
+%{Ośrodek szkoleniowo \crlf wypoczynkowy Uniwersytetu Mikołaja Kopernika \crlf Bacho\TEX},
\setvariables
- [PocketDiary]
- [Year=2023,
- Week=1,
- Day=1,
- Month=1,
- Nextyear=no,
- Place=Sambeek,
- Country=NL]
+ [PocketDiaryFooter]
+ [Lefttext={\jobname .pdf},
+ Centertext=\pagenumber,
+ Righttext=]
\setvariables
- [PocketDiaryFooter]
- [Lefttext={\jobname .pdf},
- Centertext=\pagenumber,
- Righttext=]
+ [PocketDiaryColors]
+ [Separatorline=blue,
+ Gridline={s=.75}]
\setvariables
- [PocketDiaryColors]
- [Separatorline=blue,
- Gridline={s=.75}]
-
-\setvariables %Koziegłowy 52.467860,16.981240 //52.5921425,6.0962685, % Hasselt
- [PocketDiaryGeoPosition]
- [lat=51.63682, %Sambeek Maasstraat 2A (Google Maps)
- lon=5.96655, %Sambeek, Maasstraat 2A (Google Maps)
+ [PocketDiaryGeoPosition]
+ [lat=52.464588,
+ lon=16.981689,
timezoneoffset=1,
continent=EU] %EU, US or empty for no DST
-\setupbodyfont[ibmplex,ss,10pt]
-% \usetypescriptfile[type-seravek]
-% \usetypescript[Seravek]
-% \setupbodyfont[Seravek,ss,10pt]
-
-% Modes for the international interface
-
-\startmode[English]
- \mainlanguage[en]
-\stopmode
+% lat=51.63682, %Sambeek Maasstraat 2A (Google Maps)
+% lon=5.96655, %Sambeek, Maasstraat 2A (Google Maps)
-\startmode[Dutch]
- \mainlanguage[nl]
-\stopmode
+% lat=53.287540, %Bachotek lake head
+% lon=19.475584 %Bachotek lake head
-\startmode[German]
- \mainlanguage[de]
-\stopmode
+ %Koziegłowy
+ % lat = 52.467860
+ % lon= 16.981240
+
+% Czerwonak
+% lat": 52.464588
+% lon": 16.981689
-\startmode[French]
- \mainlanguage[fr]
-\stopmdode
+ % Hasselt
+ % lat = 52.5921425
+ % lon = 6.0962685,
-\startmode[Italian]
- \mainlanguage[it]
-\stopmode
+\setupbodyfont[ibmplex,ss,10pt]
+% \usetypescriptfile[type-seravek]
+% \usetypescript[Seravek]
+% \setupbodyfont[Seravek,ss,10pt]
-\startmode[Spanish]
- \mainlanguage[es]
-\stopmode
+% % 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
\setuppagenumbering[alternative=doublesided,location=]
-\setuppapersize[A6][A6]
+%\setuppapersize[A6][A4]
+% \setuppapersize[A6][A6]
+\setuppapersize[A6][A5,landscape]
\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]
+ [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]
\setupMPvariables % for collatingmarks
[pages=8, % pages per sheet of paper doublesided
sheets=2, % sheets of paper used per section
horpageshift=0mm]
-
+
+
\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,1 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.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(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
context.eTABLE()
context.page()
end
-\stopluacode
+\stopluacode
\startsetups[table:monthblock]
\setupTABLE[split=yes]
@@ -327,29 +354,27 @@ end
\strut
\startalignment [middle]
\godown[.3\textheight]
- \startmode[English]
+ \startmode[**en]
{\bfc \labeltext{sunstar}- and \labeltext{moon}-\labeltext{calendar}}
- \stopmode
- \startmode[Dutch]
+ \stopmode
+ \startmode[**nl]
{\bfc \labeltext{sunstar}- en \labeltext{moon}-\labeltext{calendar}}
- \stopmode
- \startmode[German]
- {\bfc \labeltext{sunstar}n- und \labeltext{moon}-\labeltext{calendar} }
- \stopmode
- \startmode[French]
- {\bfc \labeltext{calendar} du \labeltext{sunstar}
- et de la \labeltext{moon}}
- \stopmode
- \startmode[Italian]
- {\bfc \labeltext{calendar} di \labeltext{sunstar}
- e della \labeltext{moon}}
- \stopmode
- \startmode[Spanish]
- {\labeltext{calendar} del \labeltext{sunstar}
- y la \labeltext{moon}}
- \stopmode
- \blank
- {\bfb \getvariable{PocketDiary}{Place}}
+ \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]
+ {\bfc \labeltext{calendar} di \labeltext{sunstar} e della \labeltext{moon}}
+ \stopmode
+ \startmode[**es]
+ {\labeltext{calendar} del \labeltext{sunstar} y la
+ \labeltext{moon}}
+ \stopmode
+ \blank
+ {\bfb \getvariable{PocketDiary}{Place}}
\vfill
{\tfa \getvariable{PocketDiary}{Year}}
\stopalignment
@@ -358,67 +383,67 @@ end
\startstandardmakeup[page=yes,doublesided=no]
\starttabulate[|l|p|]
- \NC \labeltext{title}
- \EQ
- \startmode[English]
- {\labeltext{sunstar}- and \labeltext{moon}-\labeltext{calendar}}
- \stopmode
- \startmode[Dutch]
- {\labeltext{sunstar}- en \labeltext{moon}-\labeltext{calendar}}
- \stopmode
- \startmode[German]
- {\labeltext{sunstar}n- und \labeltext{moon}-\labeltext{calendar}}
- \stopmode
- \startmode[French]
- {\labeltext{calendar} du \labeltext{sunstar}
- et de la \labeltext{moon}}
- \stopmode
- \startmode[Italian]
- {\labeltext{calendar} di \labeltext{sunstar}
- e della \labeltext{moon}}
- \stopmode
- \startmode[Spanish]
- {\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[English]
- This calendar is generated for \getvariable{PocketDiary}{Place},
- \getvariable{PocketDiary}{Country}
- \stopmode
- \startmode[German]
- Dieser Kalender ist berechnet für \getvariable{PocketDiary}{Place},
- \getvariable{PocketDiary}{Country}
- \stopmode
- \startmode[Dutch]
- Deze kalender is opgemaakt voor \getvariable{PocketDiary}{Place},
- \getvariable{PocketDiary}{Country}
- \stopmode
- \startmode[French]
- Ce calendrier est fait pour \getvariable{PocketDiary}{Place},
- \getvariable{PocketDiary}{Country}
- \stopmode
- \startmode[Italian]
- Questo calendario è prodotto per \getvariable{PocketDiary}{Place},
- \getvariable{PocketDiary}{Country}
- \stopmode
- \startmode[Spanish]
- 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
+ \NC \labeltext{title}
+ \EQ
+ \startmode[**en]
+ {\labeltext{sunstar}- and \labeltext{moon}-\labeltext{calendar}}
+ \stopmode
+ \startmode[**nl]
+ {\labeltext{sunstar}- en \labeltext{moon}-\labeltext{calendar}}
+ \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{calendar} di \labeltext{sunstar} e della
+ \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
\stopstandardmakeup
-
+
\getbuffer[Yearofmonthtables]
\stoptext \ No newline at end of file