From 1ea4eef62d24f4f0574afba646c635f677eeb7cc Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 26 Apr 2023 03:02:07 +0000 Subject: CTAN sync 202304260302 --- .../contrib/context-calendar-examples/VERSION | 2 +- .../third/calendar-examples/A5-day_per_page.mkiv | 426 ++++++ .../third/calendar-examples/A5-day_per_page.tex | 426 ------ .../calendar-examples/A6-1week_per_2pages.mkiv | 387 +++++ .../calendar-examples/A6-1week_per_2pages.tex | 387 ----- .../third/calendar-examples/Menu-calendar.mkiv | 313 ++++ .../third/calendar-examples/Menu-calendar.tex | 313 ---- .../third/calendar-examples/Photocalendar.mkiv | 222 +++ .../third/calendar-examples/Photocalendar.tex | 222 --- .../third/calendar-examples/Sundata-calendar.mkiv | 439 ++++++ .../third/calendar-examples/Sundata-calendar.tex | 439 ------ .../context/contrib/context-collatingmarks/VERSION | 2 +- .../context-collatingmarks/__MACOSX/._VERSION | Bin 0 -> 209 bytes .../third/collating-marks/t-collatingmarks.mkiv | 174 +++ .../third/collating-marks/t-collatingmarks.tex | 174 --- .../contrib/context-interval-calendar/VERSION | 2 +- .../third/interval-calendar/Interval-calendar.mkiv | 71 + .../third/interval-calendar/Interval-calendar.tex | 71 - .../interval-calendar/t-intervalcalendar.mkiv | 265 ++++ .../third/interval-calendar/t-intervalcalendar.tex | 265 ---- macros/context/contrib/context-pocketdiary/VERSION | 2 +- .../third/pocketdiary/Moonphase/moons-MP.mkiv | 86 ++ .../third/pocketdiary/Moonphase/moons-MP.tex | 86 -- .../third/pocketdiary/Moonphase/t-moonphase.lua | 2 +- .../tex/context/third/pocketdiary/PocketDiary.mkiv | 119 ++ .../tex/context/third/pocketdiary/PocketDiary.tex | 119 -- .../context/third/pocketdiary/Solar/sun-MP.nkiv | 137 ++ .../tex/context/third/pocketdiary/Solar/sun-MP.tex | 137 -- .../context/third/pocketdiary/Solar/t-solar.lua | 2 +- .../tex/context/third/pocketdiary/t-calendar.lua | 2 +- .../context/third/pocketdiary/t-pocketdiary.lua | 2 +- .../context/third/pocketdiary/t-pocketdiary.mkiv | 1507 ++++++++++++++++++++ .../context/third/pocketdiary/t-pocketdiary.tex | 1507 -------------------- 33 files changed, 4154 insertions(+), 4154 deletions(-) create mode 100644 macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A5-day_per_page.mkiv delete mode 100644 macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A5-day_per_page.tex create mode 100644 macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A6-1week_per_2pages.mkiv delete mode 100644 macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A6-1week_per_2pages.tex create mode 100644 macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Menu-calendar.mkiv delete mode 100644 macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Menu-calendar.tex create mode 100644 macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Photocalendar.mkiv delete mode 100644 macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Photocalendar.tex create mode 100644 macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Sundata-calendar.mkiv delete mode 100644 macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Sundata-calendar.tex create mode 100644 macros/context/contrib/context-collatingmarks/__MACOSX/._VERSION create mode 100644 macros/context/contrib/context-collatingmarks/tex/context/third/collating-marks/t-collatingmarks.mkiv delete mode 100644 macros/context/contrib/context-collatingmarks/tex/context/third/collating-marks/t-collatingmarks.tex create mode 100644 macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/Interval-calendar.mkiv delete mode 100644 macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/Interval-calendar.tex create mode 100644 macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/t-intervalcalendar.mkiv delete mode 100644 macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/t-intervalcalendar.tex create mode 100644 macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Moonphase/moons-MP.mkiv delete mode 100644 macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Moonphase/moons-MP.tex create mode 100644 macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/PocketDiary.mkiv delete mode 100644 macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/PocketDiary.tex create mode 100644 macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Solar/sun-MP.nkiv delete mode 100644 macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Solar/sun-MP.tex create mode 100644 macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-pocketdiary.mkiv delete mode 100644 macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-pocketdiary.tex (limited to 'macros/context/contrib') diff --git a/macros/context/contrib/context-calendar-examples/VERSION b/macros/context/contrib/context-calendar-examples/VERSION index faab976b2f..4689b28be5 100644 --- a/macros/context/contrib/context-calendar-examples/VERSION +++ b/macros/context/contrib/context-calendar-examples/VERSION @@ -1 +1 @@ -2023.04.15 +2023.04.25 diff --git a/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A5-day_per_page.mkiv b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A5-day_per_page.mkiv new file mode 100644 index 0000000000..44d48f6cf8 --- /dev/null +++ b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A5-day_per_page.mkiv @@ -0,0 +1,426 @@ +%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] + +%D Setup the language to be used: EN,DE,NL,FR,IT,ES + +\mainlanguage[en] + +%D The variable sets for the PocketDiary module: + +\setvariables + [PocketDiary] + [Year=2023, + Week=1, + Day=1, + Month=1, + Nextyear=yes, + Yearnext=2024] + +\setvariables + [PocketDiaryFooter] + [Lefttext={\jobname .pdf}, + Centertext=\pagenumber, + Righttext=] + +\setvariables + [PocketDiaryColors] + [Separatorline=blue, + Gridline={s=.75}] + +\setvariables %Koziegłowy 52.467860 16.981240 + [PocketDiaryGeoPosition] + [lat=52.467860, + lon=16.981240, + timezoneoffset=1, + continent=US] % EU, US or empty for no Daylight Saving Time (DST) + +\setvariables + [PocketDiaryAddress] + [Familyname={\bf YourFamilyName}, + Forename=YourName, + Street=YourStreet and Number, + Zipcode=YourPostalCode, + City=YourPlace, + Country=YourCountry, + Phone=YourPhoneNumber, + Mobile=YourMobilePhoneNumber, + E-mail=YourEmail@YourProvider, + Web=YourWWW] + +\setupbodyfont[ibmplex,ss,10pt] + +\definefontfeature[f:Tabular][tnum=yes] + +\addfeature[f:Tabular] + +%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] + +%D Adapt the page layout to the size of the page: + +\setuplayout + [topspace=.6cm, + backspace=1.5cm, + header=2\bodyfontsize, + headerdistance=.5\bodyfontsize, + footer=1.2\bodyfontsize, + footerdistance=.5\bodyfontsize, + margin=0pt, + height=middle, + width=middle, + location=middle] + +%D Enable the imposition: 2 pages recto and verso using 4 sheets of A4 for forming one section + +\setuparranging[2*2*4] + + +%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 + +%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) + + 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) + + 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 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 sunrise,sunset,lighthours = + thirddata.srss.sundata( + i,month,year,lat,lon,timeoffset,dst_start,dst_stop) + + if holiday ~= "" then + report("Holiday: %s", holiday) + report("Day number: %s", i) + end + + context.bTABLE({setups="table:dayblock"}) + context.bTR() + context.bTD() + context.starttabulate{"|lw(0.1\\textwidth)|p(0.06\\textwidth)|p|"} + context.NC() + context("\\bf") + --report("Daynumber: %s Month %s", i,month) + if dayname == "sun" or holiday ~= "" and holiday ~= "ashw" + 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.par() + context(weeknumber) + context.NC() + context.switchtobodyfont{"6pt"} + context.labeltext("day") + context(":") + context.par() + context(ordinalday) + context("/") + context(yeardays) + context.NC() + context.NR() + context.stoptabulate() + context.eTD() + context.bTD() + context.starttabulate{"|lw(0.2\\textwidth)|p|p|p|p|"} + context.NC() + if holiday == "" then + context.strut() + else + context.labeltext(holiday) + end + context.NC() + if tonumber(moondata) then + context.labeltext("moondays") + else + context.labeltext("moon") + end + context(":~") + context.par() + context(moondata) + context.NC() + context("\\SunA[background=Sunrise]{}") + context.par() + context(sunrise) + context.NC() + context("\\SunA[background=Sunset]{}") + context.par() + context(sunset) + context.NC() + context("\\SunB[background=Light]{}") + context.par() + context(lighthours) + context.NC() + context.NR() + context.stoptabulate() + context.eTD() + context.eTR() + context.eTABLE() + context.page() + end + end + + function thirddata.diary.header_text(monthname,year) + 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 + }) + 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 + {\getvariable{PocketDiary}{Year}} + {\getvariable{PocketDiaryGeoPosition}{lat}} + {\getvariable{PocketDiaryGeoPosition}{lon}} + {\getvariable{PocketDiaryGeoPosition}{timeoffset}} + {"\getvariable{PocketDiaryGeoPosition}{continent}"} +\stopbuffer + +%D Create a time-table in \METAFUN\ as a background to the page + +\startreusableMPgraphic{Time-Lines} + numeric w; w:= OverlaytWidth; + numeric h; h:= (OverlayHeight-2cm)/18; + 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}; + for i = 1 upto 17: + 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); + endfor; +\stopreusableMPgraphic + +%D Make the timetable available as a background on the page + +\defineoverlay[Textbackground][\reuseMPgraphic{Time-Lines}] + +%D Implement international interface: +\setuplabeltext[en][title=Title] +\setuplabeltext[nl][title=Titel] +\setuplabeltext[de][title=Titel] +\setuplabeltext[fr][title=Titre] +\setuplabeltext[it][title=Titolo] +\setuplabeltext[es][title=Título] + +\setuplabeltext[en][author=Author] +\setuplabeltext[nl][author=Auteur] +\setuplabeltext[de][author=Autor] +\setuplabeltext[fr][author=Auteur] +\setuplabeltext[it][author=autore] +\setuplabeltext[es][author=Autor] + +\setuplabeltext[en][typography=Typography] +\setuplabeltext[nl][typography=Typografie] +\setuplabeltext[de][typography=Typographie] +\setuplabeltext[fr][typography=Typographie] +\setuplabeltext[it][typography=Tipografia] +\setuplabeltext[es][typography=Tipografía] + +\setuplabeltext[en][compilation=Compilation date] +\setuplabeltext[nl][compilation=Compilatie datum] +\setuplabeltext[de][compilation=Kompilationsdatum] +\setuplabeltext[fr][compilation=Date de compilation] +\setuplabeltext[it][compilation=Dato di compilazione] +\setuplabeltext[es][compilation=Fecha de compilación] + +%D Setup the TeX side of the document: + +\starttext + +%D Create the title pages + + \startstandardmakeup[page=yes,doublesided=no] + \strut + \startalignment [middle] + \godown[.3\textheight] + {\bfa \labeltext{calendar}} + \vfil + {\bf \getvariable{PocketDiary}{Year}} + \stopalignment + \stopstandardmakeup + + \startstandardmakeup[page=yes,doublesided=no] + \starttabulate[|l|p|] + \NC \labeltext{title} + \EQ {\bf \labeltext{calendar}} \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 + \stopstandardmakeup + +%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/A5-day_per_page.tex b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A5-day_per_page.tex deleted file mode 100644 index 44d48f6cf8..0000000000 --- a/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A5-day_per_page.tex +++ /dev/null @@ -1,426 +0,0 @@ -%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] - -%D Setup the language to be used: EN,DE,NL,FR,IT,ES - -\mainlanguage[en] - -%D The variable sets for the PocketDiary module: - -\setvariables - [PocketDiary] - [Year=2023, - Week=1, - Day=1, - Month=1, - Nextyear=yes, - Yearnext=2024] - -\setvariables - [PocketDiaryFooter] - [Lefttext={\jobname .pdf}, - Centertext=\pagenumber, - Righttext=] - -\setvariables - [PocketDiaryColors] - [Separatorline=blue, - Gridline={s=.75}] - -\setvariables %Koziegłowy 52.467860 16.981240 - [PocketDiaryGeoPosition] - [lat=52.467860, - lon=16.981240, - timezoneoffset=1, - continent=US] % EU, US or empty for no Daylight Saving Time (DST) - -\setvariables - [PocketDiaryAddress] - [Familyname={\bf YourFamilyName}, - Forename=YourName, - Street=YourStreet and Number, - Zipcode=YourPostalCode, - City=YourPlace, - Country=YourCountry, - Phone=YourPhoneNumber, - Mobile=YourMobilePhoneNumber, - E-mail=YourEmail@YourProvider, - Web=YourWWW] - -\setupbodyfont[ibmplex,ss,10pt] - -\definefontfeature[f:Tabular][tnum=yes] - -\addfeature[f:Tabular] - -%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] - -%D Adapt the page layout to the size of the page: - -\setuplayout - [topspace=.6cm, - backspace=1.5cm, - header=2\bodyfontsize, - headerdistance=.5\bodyfontsize, - footer=1.2\bodyfontsize, - footerdistance=.5\bodyfontsize, - margin=0pt, - height=middle, - width=middle, - location=middle] - -%D Enable the imposition: 2 pages recto and verso using 4 sheets of A4 for forming one section - -\setuparranging[2*2*4] - - -%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 - -%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) - - 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) - - 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 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 sunrise,sunset,lighthours = - thirddata.srss.sundata( - i,month,year,lat,lon,timeoffset,dst_start,dst_stop) - - if holiday ~= "" then - report("Holiday: %s", holiday) - report("Day number: %s", i) - end - - context.bTABLE({setups="table:dayblock"}) - context.bTR() - context.bTD() - context.starttabulate{"|lw(0.1\\textwidth)|p(0.06\\textwidth)|p|"} - context.NC() - context("\\bf") - --report("Daynumber: %s Month %s", i,month) - if dayname == "sun" or holiday ~= "" and holiday ~= "ashw" - 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.par() - context(weeknumber) - context.NC() - context.switchtobodyfont{"6pt"} - context.labeltext("day") - context(":") - context.par() - context(ordinalday) - context("/") - context(yeardays) - context.NC() - context.NR() - context.stoptabulate() - context.eTD() - context.bTD() - context.starttabulate{"|lw(0.2\\textwidth)|p|p|p|p|"} - context.NC() - if holiday == "" then - context.strut() - else - context.labeltext(holiday) - end - context.NC() - if tonumber(moondata) then - context.labeltext("moondays") - else - context.labeltext("moon") - end - context(":~") - context.par() - context(moondata) - context.NC() - context("\\SunA[background=Sunrise]{}") - context.par() - context(sunrise) - context.NC() - context("\\SunA[background=Sunset]{}") - context.par() - context(sunset) - context.NC() - context("\\SunB[background=Light]{}") - context.par() - context(lighthours) - context.NC() - context.NR() - context.stoptabulate() - context.eTD() - context.eTR() - context.eTABLE() - context.page() - end - end - - function thirddata.diary.header_text(monthname,year) - 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 - }) - 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 - {\getvariable{PocketDiary}{Year}} - {\getvariable{PocketDiaryGeoPosition}{lat}} - {\getvariable{PocketDiaryGeoPosition}{lon}} - {\getvariable{PocketDiaryGeoPosition}{timeoffset}} - {"\getvariable{PocketDiaryGeoPosition}{continent}"} -\stopbuffer - -%D Create a time-table in \METAFUN\ as a background to the page - -\startreusableMPgraphic{Time-Lines} - numeric w; w:= OverlaytWidth; - numeric h; h:= (OverlayHeight-2cm)/18; - 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}; - for i = 1 upto 17: - 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); - endfor; -\stopreusableMPgraphic - -%D Make the timetable available as a background on the page - -\defineoverlay[Textbackground][\reuseMPgraphic{Time-Lines}] - -%D Implement international interface: -\setuplabeltext[en][title=Title] -\setuplabeltext[nl][title=Titel] -\setuplabeltext[de][title=Titel] -\setuplabeltext[fr][title=Titre] -\setuplabeltext[it][title=Titolo] -\setuplabeltext[es][title=Título] - -\setuplabeltext[en][author=Author] -\setuplabeltext[nl][author=Auteur] -\setuplabeltext[de][author=Autor] -\setuplabeltext[fr][author=Auteur] -\setuplabeltext[it][author=autore] -\setuplabeltext[es][author=Autor] - -\setuplabeltext[en][typography=Typography] -\setuplabeltext[nl][typography=Typografie] -\setuplabeltext[de][typography=Typographie] -\setuplabeltext[fr][typography=Typographie] -\setuplabeltext[it][typography=Tipografia] -\setuplabeltext[es][typography=Tipografía] - -\setuplabeltext[en][compilation=Compilation date] -\setuplabeltext[nl][compilation=Compilatie datum] -\setuplabeltext[de][compilation=Kompilationsdatum] -\setuplabeltext[fr][compilation=Date de compilation] -\setuplabeltext[it][compilation=Dato di compilazione] -\setuplabeltext[es][compilation=Fecha de compilación] - -%D Setup the TeX side of the document: - -\starttext - -%D Create the title pages - - \startstandardmakeup[page=yes,doublesided=no] - \strut - \startalignment [middle] - \godown[.3\textheight] - {\bfa \labeltext{calendar}} - \vfil - {\bf \getvariable{PocketDiary}{Year}} - \stopalignment - \stopstandardmakeup - - \startstandardmakeup[page=yes,doublesided=no] - \starttabulate[|l|p|] - \NC \labeltext{title} - \EQ {\bf \labeltext{calendar}} \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 - \stopstandardmakeup - -%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.mkiv b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A6-1week_per_2pages.mkiv new file mode 100644 index 0000000000..eaee939c4c --- /dev/null +++ b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A6-1week_per_2pages.mkiv @@ -0,0 +1,387 @@ +%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] + +%D Define the modes for the different formats + +\definemode[A5,A6][keep] + +%D Enable the desired format of the calendar + +\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] + [Year=2020, + Week=1, + Day=1, + Month=1, + Nextyear=yes] + +\setvariables + [PocketDiaryFooter] + [Lefttext={\jobname .pdf}, + Centertext=\pagenumber, + Righttext=] + +\setvariables + [PocketDiaryColors] + [Separatorline=blue, + Gridline={s=.75}] + +\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) + +\setvariables + [PocketDiaryAddress] + [Familyname=YourFamilyName, + Forename=YourName, + Street=YourStreet and Number, + Zipcode=YourPostalCode, + City=YourPlace, + Country=YourCountry, + Phone=YourPhoneNumber, + 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] + +%D Make the document doublesided, switch off the page numbering. The latter +%D is done in the PocketDiary footer setup + +\setuppagenumbering[alternative=doublesided,location=] + +\setuplayout + [topspace=.6cm, + backspace=1cm, + header=2\bodyfontsize, + headerdistance=.5\bodyfontsize, + footer=1.2\bodyfontsize, + footerdistance=.5\bodyfontsize, + margin=0pt, + height=middle, + width=middle, + location=middle, + marking=on] + +%D Elaborate the definitions for the A6 format + +\startmode[A6] + \definepapersize[Agenda][width=100mm,height=140mm] + + \setuppapersize[Agenda][A4,portrait] + % \setuppapersize[Agenda][Agenda] + + % The vertical page-shift enables to make a 2.5mm cut at the head of the + % section + \definepageshift + [ver] + [vertical] + [2.5mm,2.5mm,2.5mm,2.5mm,2.5mm,2.5mm,2.5mm,2.5mm, + 2.5mm,2.5mm,2.5mm,2.5mm,2.5mm,2.5mm,2.5mm,2.5mm] + + \setuppageshift[paper][ver] + + \setuparranging[2*4*2] + + \setupMPvariables % for collatingmarks + [pages=8, % pages per sheet of paper doublesided + sheets=2, % sheets of paper used per section + horpageshift=-0.5mm] +\stopmode + +%D Elaborate the definition for the A5 format + +\startmode[A5] + \definepapersize[Agenda][width=148mm,height=210mm] + + \setuppapersize[Agenda][A4,landscape] + + \setuparranging[2SIDE] + %\setuparranging[2*2*4] + + \setupMPvariables % for collatingmarks + [pages=4, % pages per sheet of paper doublesided + sheets=4, % sheets of paper used per section + horpageshift=0mm] +\stopmode + +%D Let Lua the main work: + +\startluacode + + local report = logs.reporter("Calendar-1-week-per-2-pages") + + function thirddata.diary.year_of_weektables(year, + lat,lon,timeoffset,continent) + + local year = year + local lat = lat + local lon = lon + local timeoffset = timeoffset + local continent = continent + + report("Working in function: diary.year_of_weektables") + + for calendarmonth = 1,12 do + --for calendarmonth = 1,12 do + 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) + + 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) + calcyear = year - 1 + 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) + + --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 + 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})) + + context.setupheadertexts( + {function() + context("\\bf") + context.labeltext(monthname) + return true + end + }, + {function() + context.labeltext("week") + context(": ~") + context(week) + context("\\quad") + context(year) + return true + end + }, + {function() + context("\\bf") + context.labeltext(monthname) + return true + end + }, + {function() + context.labeltext("week") + context(": ~") + context(week) + context("\\quad") + context(year) + return true + end + }) + end + +\stopluacode + +%D Setup the table for the week calendar + +\startsetups[table:week] + \setupTABLE[split=yes] + \setupTABLE[each][each][frame=on] + \setupTABLE + [r] + [each] + [offset=0pt, + loffset=3pt, + roffset=3pt, + height=0.23\textheight] + \setupTABLE[c][1][width=0.5\textwidth] + \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 + {\getvariable{PocketDiary}{Year}} + {\getvariable{PocketDiaryGeoPosition}{lat}} + {\getvariable{PocketDiaryGeoPosition}{lon}} + {\getvariable{PocketDiaryGeoPosition}{timeoffset}} + {"\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] + \startalignment [middle] + {\bfa \labeltext{calendar}} + \vfil + {\bf \getvariable{PocketDiary}{Year}} + \stopalignment + \stopstandardmakeup + + \startstandardmakeup[page=yes,doublesided=no] + \starttabulate[|l|p|] + \NC \translate[en=Title, + nl=Titel, + de=Titel, + fr=Titre, + it=Titolo] + \EQ {\bf \labeltext{calendar}} \NC\NR + \NC \translate[en=Author, + nl=Auteur, + de=Autor, + fr=Auteur, + it=autore, + es=Autor] + \EQ \getvariable{PocketDiaryAddress}{Forename} + \getvariable{PocketDiaryAddress}{Familyname} \NC\NR + \NC \translate[en=Typography, + nl=Typografie, + de=Typographie, + fr=Typographie, + it=Tipografia, + es=Tipografía] + \EQ \CONTEXT\ with \LUAMETATEX \NC\NR + \NC \translate[en=Compilation date, + nl=Compilatie datum, + de=Kompilationsdatum, + fr=Date de compilation, + it=Dato di compilazione, + es=Fecha de compilación] + \EQ \currentdate \NC\NR + \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] + +%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/A6-1week_per_2pages.tex b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A6-1week_per_2pages.tex deleted file mode 100644 index eaee939c4c..0000000000 --- a/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/A6-1week_per_2pages.tex +++ /dev/null @@ -1,387 +0,0 @@ -%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] - -%D Define the modes for the different formats - -\definemode[A5,A6][keep] - -%D Enable the desired format of the calendar - -\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] - [Year=2020, - Week=1, - Day=1, - Month=1, - Nextyear=yes] - -\setvariables - [PocketDiaryFooter] - [Lefttext={\jobname .pdf}, - Centertext=\pagenumber, - Righttext=] - -\setvariables - [PocketDiaryColors] - [Separatorline=blue, - Gridline={s=.75}] - -\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) - -\setvariables - [PocketDiaryAddress] - [Familyname=YourFamilyName, - Forename=YourName, - Street=YourStreet and Number, - Zipcode=YourPostalCode, - City=YourPlace, - Country=YourCountry, - Phone=YourPhoneNumber, - 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] - -%D Make the document doublesided, switch off the page numbering. The latter -%D is done in the PocketDiary footer setup - -\setuppagenumbering[alternative=doublesided,location=] - -\setuplayout - [topspace=.6cm, - backspace=1cm, - header=2\bodyfontsize, - headerdistance=.5\bodyfontsize, - footer=1.2\bodyfontsize, - footerdistance=.5\bodyfontsize, - margin=0pt, - height=middle, - width=middle, - location=middle, - marking=on] - -%D Elaborate the definitions for the A6 format - -\startmode[A6] - \definepapersize[Agenda][width=100mm,height=140mm] - - \setuppapersize[Agenda][A4,portrait] - % \setuppapersize[Agenda][Agenda] - - % The vertical page-shift enables to make a 2.5mm cut at the head of the - % section - \definepageshift - [ver] - [vertical] - [2.5mm,2.5mm,2.5mm,2.5mm,2.5mm,2.5mm,2.5mm,2.5mm, - 2.5mm,2.5mm,2.5mm,2.5mm,2.5mm,2.5mm,2.5mm,2.5mm] - - \setuppageshift[paper][ver] - - \setuparranging[2*4*2] - - \setupMPvariables % for collatingmarks - [pages=8, % pages per sheet of paper doublesided - sheets=2, % sheets of paper used per section - horpageshift=-0.5mm] -\stopmode - -%D Elaborate the definition for the A5 format - -\startmode[A5] - \definepapersize[Agenda][width=148mm,height=210mm] - - \setuppapersize[Agenda][A4,landscape] - - \setuparranging[2SIDE] - %\setuparranging[2*2*4] - - \setupMPvariables % for collatingmarks - [pages=4, % pages per sheet of paper doublesided - sheets=4, % sheets of paper used per section - horpageshift=0mm] -\stopmode - -%D Let Lua the main work: - -\startluacode - - local report = logs.reporter("Calendar-1-week-per-2-pages") - - function thirddata.diary.year_of_weektables(year, - lat,lon,timeoffset,continent) - - local year = year - local lat = lat - local lon = lon - local timeoffset = timeoffset - local continent = continent - - report("Working in function: diary.year_of_weektables") - - for calendarmonth = 1,12 do - --for calendarmonth = 1,12 do - 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) - - 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) - calcyear = year - 1 - 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) - - --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 - 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})) - - context.setupheadertexts( - {function() - context("\\bf") - context.labeltext(monthname) - return true - end - }, - {function() - context.labeltext("week") - context(": ~") - context(week) - context("\\quad") - context(year) - return true - end - }, - {function() - context("\\bf") - context.labeltext(monthname) - return true - end - }, - {function() - context.labeltext("week") - context(": ~") - context(week) - context("\\quad") - context(year) - return true - end - }) - end - -\stopluacode - -%D Setup the table for the week calendar - -\startsetups[table:week] - \setupTABLE[split=yes] - \setupTABLE[each][each][frame=on] - \setupTABLE - [r] - [each] - [offset=0pt, - loffset=3pt, - roffset=3pt, - height=0.23\textheight] - \setupTABLE[c][1][width=0.5\textwidth] - \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 - {\getvariable{PocketDiary}{Year}} - {\getvariable{PocketDiaryGeoPosition}{lat}} - {\getvariable{PocketDiaryGeoPosition}{lon}} - {\getvariable{PocketDiaryGeoPosition}{timeoffset}} - {"\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] - \startalignment [middle] - {\bfa \labeltext{calendar}} - \vfil - {\bf \getvariable{PocketDiary}{Year}} - \stopalignment - \stopstandardmakeup - - \startstandardmakeup[page=yes,doublesided=no] - \starttabulate[|l|p|] - \NC \translate[en=Title, - nl=Titel, - de=Titel, - fr=Titre, - it=Titolo] - \EQ {\bf \labeltext{calendar}} \NC\NR - \NC \translate[en=Author, - nl=Auteur, - de=Autor, - fr=Auteur, - it=autore, - es=Autor] - \EQ \getvariable{PocketDiaryAddress}{Forename} - \getvariable{PocketDiaryAddress}{Familyname} \NC\NR - \NC \translate[en=Typography, - nl=Typografie, - de=Typographie, - fr=Typographie, - it=Tipografia, - es=Tipografía] - \EQ \CONTEXT\ with \LUAMETATEX \NC\NR - \NC \translate[en=Compilation date, - nl=Compilatie datum, - de=Kompilationsdatum, - fr=Date de compilation, - it=Dato di compilazione, - es=Fecha de compilación] - \EQ \currentdate \NC\NR - \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] - -%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.mkiv b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Menu-calendar.mkiv new file mode 100644 index 0000000000..23ae3f7017 --- /dev/null +++ b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Menu-calendar.mkiv @@ -0,0 +1,313 @@ +%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 and setup the desired font + +\setupbodyfont[ibmplex,ss,10pt] + +%D Add a path to the picture placed on page 3: + +\setupexternalfigures + [directory=/Path-to-the-picture/] + +%D Choose the main language which determines the interface: + +\mainlanguage[en] + +%D This document will be doublesided, the pagenumber will be placed in the +%D footer by means of \type{\setupfootertexts}: + +\setuppagenumbering[alternative=doublesided,location=] + +%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] + +%D Invoke the arranging of the pages + +\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] + + +%D Adapt the layout of the page to the size 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=middle, + location=middle] + +%D Setup the variable sets from the PocketDiary module to be set: + +\setvariables + [PocketDiary] + [Year=2023] + +\setvariables + [PocketDiaryFooter] + [Lefttext=\labeltext{menu}-\labeltext{calendar}, + Centertext=\pagenumber, + Righttext=\getvariable{PocketDiary}{Year}] + +\setvariables + [PocketDiaryColors] + [Separatorline=blue, + Gridline={s=.75}] + +%D The data are presented in table form. The setup of the table is +%D as follows: + +\startsetups table:week + \setupTABLE[split=yes] + \setupTABLE[c][1][width=.35\textwidth,frame=off] + \setupTABLE[c][2][width=.65\textwidth,frame=off] + \setupTABLE[r][height=2\lineheight,align=lohi] + \setupTABLE[r][2,3,5,6,8,9,11,12,14,15,17,18,20,21][bottomframe=on] +\stopsetups + +%D There are currently 6 interfaces supported: EN,DE,NL,FR,IT,ES +%D Create some label texts for each language + +%D English interface + +\setuplabeltext[en][menu=Menu] +\setuplabeltext[en][comment=Comment] + +%D German interface + +\setuplabeltext[de][menu=Menü] +\setuplabeltext[de][comment=Kommentar] + +%D French interface + +\setuplabeltext[fr][menu=Menu] +\setuplabeltext[fr][comment=Commentaire] + +%D Dutch interface + +\setuplabeltext[nl][menu=Menu] +\setuplabeltext[nl][comment=Commentaar] + +%D Italian interface + +\setuplabeltext[it][menu=Menu] +\setuplabeltext[it][comment=Commento] + +%D Spanish interface + +\setuplabeltext[es][menu=Menú] +\setuplabeltext[es][comment=Comentario] + + +%D Let lua perform 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 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 + + --report("Day-inloop: %s", day) + + 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 + + if holiday ~= "" then + report("Holiday (before table row): %s", holiday) + report("Day number (before table row): %s", daynumber) + report("Day name (before table row): %s",dayname) + end + + context.bTR() + context.bTD({style="bfa"}) + + if dayname == "sun" or holiday ~= "" and f ~= "ashw" then + local dnu = daynumber + local dna = dayname + context.color({"red"},function() context(dnu) end) + context("~") + context.color({"red"},function() context.labeltext(dna) end) + else + context(daynumber) + context("~") + context.labeltext(dayname) + end + context.eTD() + context.bTD() + context.labeltext(holiday) + context.eTD() + context.eTR() + context.bTR() + context.bTD({nx="2"}) + context.labeltext("menu") + context.eTD() + context.eTR() + context.bTR() + context.bTD({nx="2"}) + context.labeltext("comment") + context.eTD() + context.eTR() + end + context.eTABLE() + context.page({"yes"}) + end + + function thirddata.calendar.myheadertext(monthname,week) + + report("Working in function myheadertext") + + context.setupheadertexts{ + function() + context("\\bgroup\\bfa") + context.labeltext(monthname) + context("\\egroup") + context("\\hfill") + context.labeltext("week") + context(": ") + context(week) + return true + end} + end + + function thirddata.calendar.week(weeknumber,year) + local w = weeknumber + 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 + +\stopluacode + +%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 + +%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] + \startalignment [middle] + {\bfc \labeltext{menu}-\labeltext{calendar}} + \vfill + {\tfa \getvariable{PocketDiary}{Year}} + \stopalignment + \vfil + \stopstandardmakeup + +%D Add a picture on page 3 + + \setupheadertexts[][] + + \strut\vfil + + \startplacefigure + [number=, + title=, + location=middle] + {\externalfigure[YourPicture.jpg][width=0.75\textwidth]} + \stopplacefigure + + \vfill + + \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/Menu-calendar.tex b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Menu-calendar.tex deleted file mode 100644 index 23ae3f7017..0000000000 --- a/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Menu-calendar.tex +++ /dev/null @@ -1,313 +0,0 @@ -%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 and setup the desired font - -\setupbodyfont[ibmplex,ss,10pt] - -%D Add a path to the picture placed on page 3: - -\setupexternalfigures - [directory=/Path-to-the-picture/] - -%D Choose the main language which determines the interface: - -\mainlanguage[en] - -%D This document will be doublesided, the pagenumber will be placed in the -%D footer by means of \type{\setupfootertexts}: - -\setuppagenumbering[alternative=doublesided,location=] - -%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] - -%D Invoke the arranging of the pages - -\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] - - -%D Adapt the layout of the page to the size 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=middle, - location=middle] - -%D Setup the variable sets from the PocketDiary module to be set: - -\setvariables - [PocketDiary] - [Year=2023] - -\setvariables - [PocketDiaryFooter] - [Lefttext=\labeltext{menu}-\labeltext{calendar}, - Centertext=\pagenumber, - Righttext=\getvariable{PocketDiary}{Year}] - -\setvariables - [PocketDiaryColors] - [Separatorline=blue, - Gridline={s=.75}] - -%D The data are presented in table form. The setup of the table is -%D as follows: - -\startsetups table:week - \setupTABLE[split=yes] - \setupTABLE[c][1][width=.35\textwidth,frame=off] - \setupTABLE[c][2][width=.65\textwidth,frame=off] - \setupTABLE[r][height=2\lineheight,align=lohi] - \setupTABLE[r][2,3,5,6,8,9,11,12,14,15,17,18,20,21][bottomframe=on] -\stopsetups - -%D There are currently 6 interfaces supported: EN,DE,NL,FR,IT,ES -%D Create some label texts for each language - -%D English interface - -\setuplabeltext[en][menu=Menu] -\setuplabeltext[en][comment=Comment] - -%D German interface - -\setuplabeltext[de][menu=Menü] -\setuplabeltext[de][comment=Kommentar] - -%D French interface - -\setuplabeltext[fr][menu=Menu] -\setuplabeltext[fr][comment=Commentaire] - -%D Dutch interface - -\setuplabeltext[nl][menu=Menu] -\setuplabeltext[nl][comment=Commentaar] - -%D Italian interface - -\setuplabeltext[it][menu=Menu] -\setuplabeltext[it][comment=Commento] - -%D Spanish interface - -\setuplabeltext[es][menu=Menú] -\setuplabeltext[es][comment=Comentario] - - -%D Let lua perform 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 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 - - --report("Day-inloop: %s", day) - - 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 - - if holiday ~= "" then - report("Holiday (before table row): %s", holiday) - report("Day number (before table row): %s", daynumber) - report("Day name (before table row): %s",dayname) - end - - context.bTR() - context.bTD({style="bfa"}) - - if dayname == "sun" or holiday ~= "" and f ~= "ashw" then - local dnu = daynumber - local dna = dayname - context.color({"red"},function() context(dnu) end) - context("~") - context.color({"red"},function() context.labeltext(dna) end) - else - context(daynumber) - context("~") - context.labeltext(dayname) - end - context.eTD() - context.bTD() - context.labeltext(holiday) - context.eTD() - context.eTR() - context.bTR() - context.bTD({nx="2"}) - context.labeltext("menu") - context.eTD() - context.eTR() - context.bTR() - context.bTD({nx="2"}) - context.labeltext("comment") - context.eTD() - context.eTR() - end - context.eTABLE() - context.page({"yes"}) - end - - function thirddata.calendar.myheadertext(monthname,week) - - report("Working in function myheadertext") - - context.setupheadertexts{ - function() - context("\\bgroup\\bfa") - context.labeltext(monthname) - context("\\egroup") - context("\\hfill") - context.labeltext("week") - context(": ") - context(week) - return true - end} - end - - function thirddata.calendar.week(weeknumber,year) - local w = weeknumber - 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 - -\stopluacode - -%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 - -%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] - \startalignment [middle] - {\bfc \labeltext{menu}-\labeltext{calendar}} - \vfill - {\tfa \getvariable{PocketDiary}{Year}} - \stopalignment - \vfil - \stopstandardmakeup - -%D Add a picture on page 3 - - \setupheadertexts[][] - - \strut\vfil - - \startplacefigure - [number=, - title=, - location=middle] - {\externalfigure[YourPicture.jpg][width=0.75\textwidth]} - \stopplacefigure - - \vfill - - \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.mkiv b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Photocalendar.mkiv new file mode 100644 index 0000000000..59185f3840 --- /dev/null +++ b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Photocalendar.mkiv @@ -0,0 +1,222 @@ +%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 +% installed from: +% https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=132 + +% The calendar is typeset on A4 portrait. The calendar is a flip-over type, +% where in the top-part is a photo and thereunder the month-table with +% indication of the month name and year. +% The pictures to be used are placed in a subdirectory. Each picture gets +% a symbolic name (number) to be used in the \dorecurse loop. +% For completing the calendar we need 13 pictures. The picture 13 is used on +% 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, + header=0pt, + footer=0pt, + height=middle, + width=middle] + +%% Supported languages: EN,DE,NL,FR,IT,ES +\mainlanguage[en] + +%D Setup the path where to find the calendar pictures +\setupexternalfigures + [directory=./MyPhotoDirectory] + +% Give pictures symbolic names for using in a loop +\useexternalfigure + [1] + [A.jpg] + +\useexternalfigure + [2] + [B.jpg] + +\useexternalfigure + [3] + [C.jpg] + +\useexternalfigure + [4] + [D.jpg] + +\useexternalfigure + [5] + [E.jpg] + +\useexternalfigure + [6] + [F.jpg] %[TV-Kasten-Flurin.jpg] + +\useexternalfigure + [7] + [G.jpg] + +\useexternalfigure + [8] + [H.jpg] + +\useexternalfigure + [9] + [I.jpg] + +\useexternalfigure + [10] + [J.jpg] + +\useexternalfigure + [11] + [K.jpg] + +\useexternalfigure + [12] + [L.jpg] + +\useexternalfigure + [13] + [M.jpg] + +%D Setup the variables for the Pocket diary, only year is used for the +%D calculations. + +\setvariables + [PocketDiary] + [Year=2023] + +%D Let the header and the footer be empty: + +\setupheadertexts[][] + +\setupfootertexts[][] + +%D Add some label texts for the international interfaces: + +\setuplabeltext[en][fotocal={Photo Calendar}] +\setuplabeltext[nl][fotocal=Fotokalender] +\setuplabeltext[de][fotocal=Fotokalender] +\setuplabeltext[fr][fotocal={Calendrier photo}] +\setuplabeltext[it][fotocal={Calendario fotografico}] +\setuplabeltext[es][fotocal={Calendario fotográfico}] + +%D Let lua is perform the magic: + +\startluacode + local report = logs.reporter("Photo calendar") + + function thirddata.calendar.Photo_calendar_page(y) + + report("Working in function: calendar.Foto_calendar_page") + + local year = y + --local path = file.dirname("./Fotokalender-fotos/") + for i = 1,12 do + + local monthname = string.lower(os.date("%B", + os.time{year=year,month=i,day=1})) + + context.startplacefigure({number="",title=""}) + context.externalfigure({i}, {width = "0.8\\textwidth"}) + context.stopplacefigure() + context.strut() + context("\\vfill") + context.startalign({"middle"}) + context("\\bfa") + context.labeltext(monthname) + context("~") + context(year) + context.stopalign() + context.blank() + + thirddata.diary.monthtableH(i,year) + + context.page() + end + end +\stopluacode + +% Setup of the month table + +\startsetups table:month + \setupTABLE[c] + [each] + [width=\dimexpr\textwidth/7, + frame=on, + style=\tfa] + \setupTABLE[r][each][height=1.8\lineheight,align={center,lohi}] + \setupTABLE[c][7][foregroundcolor=red] +\stopsetups + +%D Define the macro for calling lua + +\define[1]\Photocalendarpages + {\ctxlua{thirddata.calendar.Photo_calendar_page(#1)}} + +%D Setup the \TEX\ side of the document + +\starttext + +%D Add a title page + +\startstandardmakeup[page=yes,doublesided=yes] + \startplacefigure + [location=middle, + title=, + number=] + {\externalfigure[13][width=\paperwidth]} + \stopplacefigure + \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/Photocalendar.tex b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Photocalendar.tex deleted file mode 100644 index 59185f3840..0000000000 --- a/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Photocalendar.tex +++ /dev/null @@ -1,222 +0,0 @@ -%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 -% installed from: -% https://modules.contextgarden.net/cgi-bin/module.cgi/action=view/id=132 - -% The calendar is typeset on A4 portrait. The calendar is a flip-over type, -% where in the top-part is a photo and thereunder the month-table with -% indication of the month name and year. -% The pictures to be used are placed in a subdirectory. Each picture gets -% a symbolic name (number) to be used in the \dorecurse loop. -% For completing the calendar we need 13 pictures. The picture 13 is used on -% 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, - header=0pt, - footer=0pt, - height=middle, - width=middle] - -%% Supported languages: EN,DE,NL,FR,IT,ES -\mainlanguage[en] - -%D Setup the path where to find the calendar pictures -\setupexternalfigures - [directory=./MyPhotoDirectory] - -% Give pictures symbolic names for using in a loop -\useexternalfigure - [1] - [A.jpg] - -\useexternalfigure - [2] - [B.jpg] - -\useexternalfigure - [3] - [C.jpg] - -\useexternalfigure - [4] - [D.jpg] - -\useexternalfigure - [5] - [E.jpg] - -\useexternalfigure - [6] - [F.jpg] %[TV-Kasten-Flurin.jpg] - -\useexternalfigure - [7] - [G.jpg] - -\useexternalfigure - [8] - [H.jpg] - -\useexternalfigure - [9] - [I.jpg] - -\useexternalfigure - [10] - [J.jpg] - -\useexternalfigure - [11] - [K.jpg] - -\useexternalfigure - [12] - [L.jpg] - -\useexternalfigure - [13] - [M.jpg] - -%D Setup the variables for the Pocket diary, only year is used for the -%D calculations. - -\setvariables - [PocketDiary] - [Year=2023] - -%D Let the header and the footer be empty: - -\setupheadertexts[][] - -\setupfootertexts[][] - -%D Add some label texts for the international interfaces: - -\setuplabeltext[en][fotocal={Photo Calendar}] -\setuplabeltext[nl][fotocal=Fotokalender] -\setuplabeltext[de][fotocal=Fotokalender] -\setuplabeltext[fr][fotocal={Calendrier photo}] -\setuplabeltext[it][fotocal={Calendario fotografico}] -\setuplabeltext[es][fotocal={Calendario fotográfico}] - -%D Let lua is perform the magic: - -\startluacode - local report = logs.reporter("Photo calendar") - - function thirddata.calendar.Photo_calendar_page(y) - - report("Working in function: calendar.Foto_calendar_page") - - local year = y - --local path = file.dirname("./Fotokalender-fotos/") - for i = 1,12 do - - local monthname = string.lower(os.date("%B", - os.time{year=year,month=i,day=1})) - - context.startplacefigure({number="",title=""}) - context.externalfigure({i}, {width = "0.8\\textwidth"}) - context.stopplacefigure() - context.strut() - context("\\vfill") - context.startalign({"middle"}) - context("\\bfa") - context.labeltext(monthname) - context("~") - context(year) - context.stopalign() - context.blank() - - thirddata.diary.monthtableH(i,year) - - context.page() - end - end -\stopluacode - -% Setup of the month table - -\startsetups table:month - \setupTABLE[c] - [each] - [width=\dimexpr\textwidth/7, - frame=on, - style=\tfa] - \setupTABLE[r][each][height=1.8\lineheight,align={center,lohi}] - \setupTABLE[c][7][foregroundcolor=red] -\stopsetups - -%D Define the macro for calling lua - -\define[1]\Photocalendarpages - {\ctxlua{thirddata.calendar.Photo_calendar_page(#1)}} - -%D Setup the \TEX\ side of the document - -\starttext - -%D Add a title page - -\startstandardmakeup[page=yes,doublesided=yes] - \startplacefigure - [location=middle, - title=, - number=] - {\externalfigure[13][width=\paperwidth]} - \stopplacefigure - \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.mkiv b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Sundata-calendar.mkiv new file mode 100644 index 0000000000..81c97e537e --- /dev/null +++ b/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Sundata-calendar.mkiv @@ -0,0 +1,439 @@ +%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] + +%D Setup the main language. This determines the interface to be used + +\mainlanguage[en] + + +% Setup of the variable sets for the PocketDiary module + +\setvariables + [PocketDiary] + [Year=2023, + Week=1, + Day=1, + Month=1, + Nextyear=no, + Place=Koziegłowy, + Country=PL] + +\setvariables + [PocketDiaryFooter] + [Lefttext={\jobname .pdf}, + Centertext=\pagenumber, + Righttext=] + +\setvariables + [PocketDiaryColors] + [Separatorline=blue, + Gridline={s=.75}] + +\setvariables + [PocketDiaryGeoPosition] + [lat=52.464588, + lon=16.981689, + timezoneoffset=1, + continent=EU] %EU, US or empty for no DST + + +%D Choose and setup the desired font to be used + +\setupbodyfont[ibmplex,ss,10pt] + +%D Make the document doublesided and switch off automatic page number placement + +\setuppagenumbering[alternative=doublesided,location=] + +%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] + + +%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 +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) + + 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) + 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 + 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 + context.eTABLE() + context.page() +end + +\stopluacode + +%D Setup the table for the months + +\startsetups[table:monthblock] + \setupTABLE[split=yes] + \setupTABLE[each][each][frame=on] + \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 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}} + {\getvariable{PocketDiaryGeoPosition}{lat}} + {\getvariable{PocketDiaryGeoPosition}{lon}} + {\getvariable{PocketDiaryGeoPosition}{timeoffset}} + {"\getvariable{PocketDiaryGeoPosition}{continent}"} +\stopbuffer + +%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] +\setuplabeltext[fr][title=Titre] +\setuplabeltext[it][title=Titolo] +\setuplabeltext[es][title=Título] + +\setuplabeltext[en][author=Author] +\setuplabeltext[nl][author=Auteur] +\setuplabeltext[de][author=Autor] +\setuplabeltext[fr][author=Auteur] +\setuplabeltext[it][author=autore] +\setuplabeltext[es][author=Autor] + +\setuplabeltext[en][typography=Typography] +\setuplabeltext[nl][typography=Typografie] +\setuplabeltext[de][typography=Typographie] +\setuplabeltext[fr][typography=Typographie] +\setuplabeltext[it][typography=Tipografia] +\setuplabeltext[es][typography=Tipografía] + +\setuplabeltext[en][compilation=Compilation date] +\setuplabeltext[nl][compilation=Compilatie datum] +\setuplabeltext[de][compilation=Kompilationsdatum] +\setuplabeltext[fr][compilation=Date de compilation] +\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] + {\bfc \labeltext{sunstar}- and \labeltext{moon}-\labeltext{calendar}} + \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] + {\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 + \vfil + \stopstandardmakeup + +%D Add an editorial and info page + + \startstandardmakeup[page=yes,doublesided=no] + \starttabulate[|l|p|] + \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 + +%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-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 deleted file mode 100644 index 81c97e537e..0000000000 --- a/macros/context/contrib/context-calendar-examples/tex/context/third/calendar-examples/Sundata-calendar.tex +++ /dev/null @@ -1,439 +0,0 @@ -%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] - -%D Setup the main language. This determines the interface to be used - -\mainlanguage[en] - - -% Setup of the variable sets for the PocketDiary module - -\setvariables - [PocketDiary] - [Year=2023, - Week=1, - Day=1, - Month=1, - Nextyear=no, - Place=Koziegłowy, - Country=PL] - -\setvariables - [PocketDiaryFooter] - [Lefttext={\jobname .pdf}, - Centertext=\pagenumber, - Righttext=] - -\setvariables - [PocketDiaryColors] - [Separatorline=blue, - Gridline={s=.75}] - -\setvariables - [PocketDiaryGeoPosition] - [lat=52.464588, - lon=16.981689, - timezoneoffset=1, - continent=EU] %EU, US or empty for no DST - - -%D Choose and setup the desired font to be used - -\setupbodyfont[ibmplex,ss,10pt] - -%D Make the document doublesided and switch off automatic page number placement - -\setuppagenumbering[alternative=doublesided,location=] - -%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] - - -%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 -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) - - 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) - 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 - 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 - context.eTABLE() - context.page() -end - -\stopluacode - -%D Setup the table for the months - -\startsetups[table:monthblock] - \setupTABLE[split=yes] - \setupTABLE[each][each][frame=on] - \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 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}} - {\getvariable{PocketDiaryGeoPosition}{lat}} - {\getvariable{PocketDiaryGeoPosition}{lon}} - {\getvariable{PocketDiaryGeoPosition}{timeoffset}} - {"\getvariable{PocketDiaryGeoPosition}{continent}"} -\stopbuffer - -%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] -\setuplabeltext[fr][title=Titre] -\setuplabeltext[it][title=Titolo] -\setuplabeltext[es][title=Título] - -\setuplabeltext[en][author=Author] -\setuplabeltext[nl][author=Auteur] -\setuplabeltext[de][author=Autor] -\setuplabeltext[fr][author=Auteur] -\setuplabeltext[it][author=autore] -\setuplabeltext[es][author=Autor] - -\setuplabeltext[en][typography=Typography] -\setuplabeltext[nl][typography=Typografie] -\setuplabeltext[de][typography=Typographie] -\setuplabeltext[fr][typography=Typographie] -\setuplabeltext[it][typography=Tipografia] -\setuplabeltext[es][typography=Tipografía] - -\setuplabeltext[en][compilation=Compilation date] -\setuplabeltext[nl][compilation=Compilatie datum] -\setuplabeltext[de][compilation=Kompilationsdatum] -\setuplabeltext[fr][compilation=Date de compilation] -\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] - {\bfc \labeltext{sunstar}- and \labeltext{moon}-\labeltext{calendar}} - \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] - {\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 - \vfil - \stopstandardmakeup - -%D Add an editorial and info page - - \startstandardmakeup[page=yes,doublesided=no] - \starttabulate[|l|p|] - \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 - -%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/VERSION b/macros/context/contrib/context-collatingmarks/VERSION index faab976b2f..4689b28be5 100644 --- a/macros/context/contrib/context-collatingmarks/VERSION +++ b/macros/context/contrib/context-collatingmarks/VERSION @@ -1 +1 @@ -2023.04.15 +2023.04.25 diff --git a/macros/context/contrib/context-collatingmarks/__MACOSX/._VERSION b/macros/context/contrib/context-collatingmarks/__MACOSX/._VERSION new file mode 100644 index 0000000000..c2f1b0c1b5 Binary files /dev/null and b/macros/context/contrib/context-collatingmarks/__MACOSX/._VERSION differ diff --git a/macros/context/contrib/context-collatingmarks/tex/context/third/collating-marks/t-collatingmarks.mkiv b/macros/context/contrib/context-collatingmarks/tex/context/third/collating-marks/t-collatingmarks.mkiv new file mode 100644 index 0000000000..c0f13da3d0 --- /dev/null +++ b/macros/context/contrib/context-collatingmarks/tex/context/third/collating-marks/t-collatingmarks.mkiv @@ -0,0 +1,174 @@ +%D \module +%D [ file=t-collatingmarks, +%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, +%D copyright={W. Egger}, +%D email=w.egger@boede.nl, +%D license=Public Domain] +%D +%D The documentation can be generated with: +%D mtxrun --script modules --process t-collatingmarks.tex + +\startmodule[collatingmarks] + +\writestatus{loading}{Context Module for Collating Marks} + +%D\enablemode[demo] + +%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. +%D +%D If a book consists of multiple sections, each section should be marked +%D along the spine with a collating mark. This mark moves down along the spine +%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 \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 +%D collating marks-setup needs to know how many pages are placed on a +%D doublesided printed sheet of paper and how many such sheets result in a +%D section i.e. these values depend on the \type{\setuparranging} command. The +%D shift-option is 0mm if no horizontal page shifting is issued during +%D imposition. If a horizontal page shifting is used, then the shift option is +%D used to position the collating mark precisely on the spine. +%D +%D The two keys \quotation{frenchdoors} and \quotation{wickel} are used for +%D special purposes. These are not intended for general use. +%D For the preparation of a binding called +%D French doors, where there is a left (normal) and a right book, which opens +%D from left to right the MPvariable \quotation{frenchdoors} must be set to true +%D (boolean). +%D For preparing a section with parallelfolding/letterfolding/Wickelfalz the +%D MPvariable \quotation{wickel} must be set to true (boolean). +%D\stopsubject + +%D \startsubject[title={Vocabulary}] +%D +%D EN: Collating mark, DE: Kollationiermarke, NL: collationeerblokje +%D \stopsubject + + +\unprotect + +\setupmodule[Collatingmarks=yes] + +\setupMPvariables + [Collatingmarks] + [pages=16, %pages per sheet doublesided + sheets=1,% number of sheets forming one section + horpageshift=0, + frenchdoors=false, + wickel=false] + +%D We prepare collating marks: + +\processaction[\currentmoduleparameter{Collatingmarks}] + [yes=>\def\Collatingmarks{Collatingmarks}, + no=>\def\Collatingmarks{}, + \v!unknown=>\def\Collatingmarks{}, + \v!default=>\def\Collatingmarks{}] + +%D The newly prepared macros go into the page background: + +\setupbackgrounds[page][state=repeat,background={\Collatingmarks}] + +%D We define an overlay for the collating marks. + +\defineoverlay[Collatingmarks][\useMPgraphic{Collatingmarks}] + +%D We let \METAPOST do the calculations and draw de collating marks. + +\startusableMPgraphic{Collatingmarks} +StartPage; + +numeric offset, sectionno, pages, sheets, factor, correction, offset, pageshift; +path p,q; +boolean frenchdoors,wickel; + +pages := \MPvar{pages}; +sheets := \MPvar{sheets}; +pageshift := \MPvar{horpageshift}; +frenchdoors := \MPvar{frenchdoors}; +wickel := \MPvar{wickel}; + +z5colm = ulcorner Page; +z6colm = (x5colm, y5colm-10mm); + +p := unitsquare xscaled 1mm yscaled 7mm; + +if \realpagenumber mod 2 = 1 : % on uneven pages only + sectionno := \realpagenumber div (sheets*pages)+1; + label.lrt(textext("\switchtobodyfont[5pt]"& decimal sectionno &""),llcorner Page shifted (1mm,-2mm)); + if \realpagenumber mod (sheets*pages) = 1 : % on the first page of a section only + nofmarkings := (y6colm-7mm) div 7mm; + offset := y6colm-sectionno*7mm; + if sectionno > nofmarkings : + correction := sectionno div nofmarkings; + offset := y6colm-(sectionno-correction*nofmarkings)*7mm; + fi; + if frenchdoors or wickel : + p := p shifted ((PaperWidth),offset); + else : + p := p shifted (-1mm-2pageshift,offset); + fi; + fill p withcolor black; + if sectionno < 9 : + label.rt(textext("\switchtobodyfont[3pt] \white "& decimal sectionno &""), center p shifted (-1.3mm,0)); + else : + label.rt(textext("\switchtobodyfont[3pt] \white "& decimal sectionno &""), center p shifted (-1.5mm,0)); + fi; + fi; +fi; +\stopusableMPgraphic + +\protect +\stopmodule + +\doifnotmode{demo}{\endinput} + + + +%D Example: +%D \usemodule[collatingmarks][Collatingmarks=yes] +%D \setuppapersize[A5][A2] +%D \setuplayout[location=middle,marking=on] +%D \setuppagenumbering[alternative=doublesided] +%D \setuparranging[2*4] +%D +%D \setupMPvariables +%D [pages=8, % pages per sheet of paper doublesided +%D sheets=1, % sheets of paper used per section +%D horpageshift=0mm, % used for correction if horizontal page-shifting is used +%D frenchdoors=false, +%D wickel=false] +%D +%D \starttext +%D \dorecurse{10}{\section{Text \recurselevel}\input tufte \par\subject{Ward} \input ward\par} +%D \stoptext + + +\usemodule[collatingmarks][Collatingmarks=yes] +\setuppapersize[A5][A2] +\setuplayout[location=middle,marking=on] +\setuppagenumbering[alternative=doublesided] +\setuparranging[2*4*2] + +\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 + frenchdoors=false, + wickel=false] + +\starttext + \dorecurse{10}{\section{Text \recurselevel}\input tufte \par\subject{Ward} \input ward\par} +\stoptext diff --git a/macros/context/contrib/context-collatingmarks/tex/context/third/collating-marks/t-collatingmarks.tex b/macros/context/contrib/context-collatingmarks/tex/context/third/collating-marks/t-collatingmarks.tex deleted file mode 100644 index c0f13da3d0..0000000000 --- a/macros/context/contrib/context-collatingmarks/tex/context/third/collating-marks/t-collatingmarks.tex +++ /dev/null @@ -1,174 +0,0 @@ -%D \module -%D [ file=t-collatingmarks, -%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, -%D copyright={W. Egger}, -%D email=w.egger@boede.nl, -%D license=Public Domain] -%D -%D The documentation can be generated with: -%D mtxrun --script modules --process t-collatingmarks.tex - -\startmodule[collatingmarks] - -\writestatus{loading}{Context Module for Collating Marks} - -%D\enablemode[demo] - -%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. -%D -%D If a book consists of multiple sections, each section should be marked -%D along the spine with a collating mark. This mark moves down along the spine -%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 \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 -%D collating marks-setup needs to know how many pages are placed on a -%D doublesided printed sheet of paper and how many such sheets result in a -%D section i.e. these values depend on the \type{\setuparranging} command. The -%D shift-option is 0mm if no horizontal page shifting is issued during -%D imposition. If a horizontal page shifting is used, then the shift option is -%D used to position the collating mark precisely on the spine. -%D -%D The two keys \quotation{frenchdoors} and \quotation{wickel} are used for -%D special purposes. These are not intended for general use. -%D For the preparation of a binding called -%D French doors, where there is a left (normal) and a right book, which opens -%D from left to right the MPvariable \quotation{frenchdoors} must be set to true -%D (boolean). -%D For preparing a section with parallelfolding/letterfolding/Wickelfalz the -%D MPvariable \quotation{wickel} must be set to true (boolean). -%D\stopsubject - -%D \startsubject[title={Vocabulary}] -%D -%D EN: Collating mark, DE: Kollationiermarke, NL: collationeerblokje -%D \stopsubject - - -\unprotect - -\setupmodule[Collatingmarks=yes] - -\setupMPvariables - [Collatingmarks] - [pages=16, %pages per sheet doublesided - sheets=1,% number of sheets forming one section - horpageshift=0, - frenchdoors=false, - wickel=false] - -%D We prepare collating marks: - -\processaction[\currentmoduleparameter{Collatingmarks}] - [yes=>\def\Collatingmarks{Collatingmarks}, - no=>\def\Collatingmarks{}, - \v!unknown=>\def\Collatingmarks{}, - \v!default=>\def\Collatingmarks{}] - -%D The newly prepared macros go into the page background: - -\setupbackgrounds[page][state=repeat,background={\Collatingmarks}] - -%D We define an overlay for the collating marks. - -\defineoverlay[Collatingmarks][\useMPgraphic{Collatingmarks}] - -%D We let \METAPOST do the calculations and draw de collating marks. - -\startusableMPgraphic{Collatingmarks} -StartPage; - -numeric offset, sectionno, pages, sheets, factor, correction, offset, pageshift; -path p,q; -boolean frenchdoors,wickel; - -pages := \MPvar{pages}; -sheets := \MPvar{sheets}; -pageshift := \MPvar{horpageshift}; -frenchdoors := \MPvar{frenchdoors}; -wickel := \MPvar{wickel}; - -z5colm = ulcorner Page; -z6colm = (x5colm, y5colm-10mm); - -p := unitsquare xscaled 1mm yscaled 7mm; - -if \realpagenumber mod 2 = 1 : % on uneven pages only - sectionno := \realpagenumber div (sheets*pages)+1; - label.lrt(textext("\switchtobodyfont[5pt]"& decimal sectionno &""),llcorner Page shifted (1mm,-2mm)); - if \realpagenumber mod (sheets*pages) = 1 : % on the first page of a section only - nofmarkings := (y6colm-7mm) div 7mm; - offset := y6colm-sectionno*7mm; - if sectionno > nofmarkings : - correction := sectionno div nofmarkings; - offset := y6colm-(sectionno-correction*nofmarkings)*7mm; - fi; - if frenchdoors or wickel : - p := p shifted ((PaperWidth),offset); - else : - p := p shifted (-1mm-2pageshift,offset); - fi; - fill p withcolor black; - if sectionno < 9 : - label.rt(textext("\switchtobodyfont[3pt] \white "& decimal sectionno &""), center p shifted (-1.3mm,0)); - else : - label.rt(textext("\switchtobodyfont[3pt] \white "& decimal sectionno &""), center p shifted (-1.5mm,0)); - fi; - fi; -fi; -\stopusableMPgraphic - -\protect -\stopmodule - -\doifnotmode{demo}{\endinput} - - - -%D Example: -%D \usemodule[collatingmarks][Collatingmarks=yes] -%D \setuppapersize[A5][A2] -%D \setuplayout[location=middle,marking=on] -%D \setuppagenumbering[alternative=doublesided] -%D \setuparranging[2*4] -%D -%D \setupMPvariables -%D [pages=8, % pages per sheet of paper doublesided -%D sheets=1, % sheets of paper used per section -%D horpageshift=0mm, % used for correction if horizontal page-shifting is used -%D frenchdoors=false, -%D wickel=false] -%D -%D \starttext -%D \dorecurse{10}{\section{Text \recurselevel}\input tufte \par\subject{Ward} \input ward\par} -%D \stoptext - - -\usemodule[collatingmarks][Collatingmarks=yes] -\setuppapersize[A5][A2] -\setuplayout[location=middle,marking=on] -\setuppagenumbering[alternative=doublesided] -\setuparranging[2*4*2] - -\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 - frenchdoors=false, - wickel=false] - -\starttext - \dorecurse{10}{\section{Text \recurselevel}\input tufte \par\subject{Ward} \input ward\par} -\stoptext diff --git a/macros/context/contrib/context-interval-calendar/VERSION b/macros/context/contrib/context-interval-calendar/VERSION index faab976b2f..cbc3a74224 100644 --- a/macros/context/contrib/context-interval-calendar/VERSION +++ b/macros/context/contrib/context-interval-calendar/VERSION @@ -1 +1 @@ -2023.04.15 +2023-.04.25 diff --git a/macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/Interval-calendar.mkiv b/macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/Interval-calendar.mkiv new file mode 100644 index 0000000000..36feee934f --- /dev/null +++ b/macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/Interval-calendar.mkiv @@ -0,0 +1,71 @@ +%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] + +%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] + \setupTABLE[r][1][style=bold,align={lohi,middle}] + \setupTABLE[c][1][width=0.2\textwidth] + \setupTABLE[c][2,3,4][width=0.15\textwidth] + \setupTABLE[c][5][width=0.3\textwidth] +\stopsetups + +%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] + \Checklist{"2022/8/10"}{"2023/05/31"}{5}{30} % startdate,enddate,columns,interval + \stopmode + + \stoptext \ No newline at end of file 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 deleted file mode 100644 index 36feee934f..0000000000 --- a/macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/Interval-calendar.tex +++ /dev/null @@ -1,71 +0,0 @@ -%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] - -%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] - \setupTABLE[r][1][style=bold,align={lohi,middle}] - \setupTABLE[c][1][width=0.2\textwidth] - \setupTABLE[c][2,3,4][width=0.15\textwidth] - \setupTABLE[c][5][width=0.3\textwidth] -\stopsetups - -%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] - \Checklist{"2022/8/10"}{"2023/05/31"}{5}{30} % startdate,enddate,columns,interval - \stopmode - - \stoptext \ No newline at end of file diff --git a/macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/t-intervalcalendar.mkiv b/macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/t-intervalcalendar.mkiv new file mode 100644 index 0000000000..b55e545224 --- /dev/null +++ b/macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/t-intervalcalendar.mkiv @@ -0,0 +1,265 @@ +%D \module +%D [ file=t-interval-calender, +%D version=2023.04.15, +%D title=Interval calendar \CONTEXT\ User Module, +%D subtitle=Interval Calendar, +%D author=Willi Egger, +%D date=\currentdate, +%D copyright=Willi Egger, +%D email=w.egger@boede.nl, +%D license=Public Domain] + +\startmodule[intervalcalendar] + +\writestatus{loading}{ConTeXt User Module / Interval Calendar} + +%D \startsubject[title=Introduction] +%D After announcing a presentation for the 16th \CONTEXT -Meeting in Dreifelden, +%D Germany, over a new version of the PocketDiary module, Taco Hoekwater asked +%D whether the PocketDiary module might also be +%D able to produce lists with calendar-dates in intervals like \quote{weekly}, +%D \quote{twoweekly} or \quote{monthly} for the purpose of taking notes for +%D checks on a regular base. -- The lists should be configurable for the length +%D of the list, the number of columns and the possibility to assign an +%D individual +%D column-header. -- Quickly it appeared, that the use of the PocketDiary module +%D is not necessary. In order to be able to do math on dates it is the easiest +%D to convert a date to a timestamp in seconds or what is used by the +%D operating-system. -- Due to the fact that there are repeating calculations +%D done it is easiest to keep as much as possible at the lua end. Therefore the +%D out-put is prepared as a \CONTEXT -LUA-document (cld). +%D \stopsubject + +%D \startsubject[title=One Mode for Each List] +%D +%D The module can be used for the production of different lists. For each +%D list we define a mode. + +\definemode[weekly][keep] +\definemode[twoweekly][keep] +\definemode[monthly][keep] + +%D None of the modes are activated. + +%D \stopsubject + +%D \startsubject[title=General Setups] + +\setupbodyfont[dejavu,ss,12pt] +\setuppagenumbering[location=] + +\setuppapersize[A4,portrait][A4,portrait] + +\setuplayout + [topspace=20mm, + backspace=12mm, + header=10mm, + footer=2\bodyfontsize, + height=middle, + width=middle] + +\setupfootertexts + [\jobname .pdf] + [\pagenumber\ / \totalnumberofpages] + +%D \stopsubject + +%D \startsubject[title=LUA-Code] + +\startluacode + + thirddata = thirddata or { } + thirddata.calendar = { } + local calendar = thirddata.calendar + + local report = logs.reporter("Interval Checks") + + local interval_dates = {} + + function calendar.interval_checks(startdate,stopdate,cols,intval) + + local startdate_string =startdate + local stopdate_string =stopdate + local columns=cols + local intervaldays = intval + + local year,month,day = calendar.date(startdate_string) + local start_time_stamp = os.time({year=year,month=month,day=day}) + + --report("Starttimestamp: %s", start_time_stamp) + + local year,month,day = calendar.date(stopdate_string) + local end_time_stamp = os.time{year=year,month=month,day=day} + + local interval = intervaldays * 24 * 60 * 60 + + for i = start_time_stamp, end_time_stamp, interval do + local interval_date = os.date("%d-%m-%Y",i) + table.insert(interval_dates,interval_date) + report("%s",interval_date) + end + + calendar.print_interval_checks(columns) + end + + function calendar.print_interval_checks(cols) + + local columns = cols + + context.bTABLE({setups="table:interval_check"}) + context.bTABLEhead() + context.bTR() + for i = 1,columns do + context.bTH() + context.labeltext("c"..i) + context.eTH() + end + context.eTR() + context.eTABLEhead() + context.bTABLEbody() + for k,v in ipairs(interval_dates) do + context.bTR() + context.bTD() + context(v) + context.eTD() + for i=1,columns-1 do + context.bTD() + context.strut() + context.eTD() + end + context.eTR() + end + context.eTABLEbody() + context.eTABLE() + end + + function calendar.date(inputstr) + + --report("Input : %s",inputstr) + + local sep = "%-%s/" + if sep == nil then + sep = "%s" + end + local t={} + i=1 + for str in string.gmatch(inputstr, "([^"..sep.."]+)") do + t[i] = str + --report("Actual string %s", str) + i = i + 1 + end + + --report("Datum strings: %s, %s, %s", t[1],t[2],t[3]) + + return t[1],t[2],t[3] + end +\stopluacode + +%D The main function is the \quote{calendar.interval_ckecks} function +%D with 4 parameters. The function needs a start-date, an end-date, +%D the number of columns for the table in the out-put and the interval +%D in days. The function calculates all dates fitting into the start +%D and end dates based on the epoch-time. It converts the timestamp +%D into a human readable date format and puts the values into a +%D table \quote{interval_dates}. +%D +%D The second function is called from within the first function and +%D gets the number of columns as parameter. This function creates the +%D out-put table. It is a flexible setup, which is based on the +%D number of the columns provided as a parameter. Label-texts are used +%D for the column heads and the column heads are repeated at the top +%D of each following page. +%D +%D The third function is there to deal with the preparation of the dates, +%D which are sent to LUA as strings. It extracts the year (yyyy) the +%D month (m) and day (d). The extracted values are put into a table. The dates +%D can be entered in the format 2022-8-21 or as 2022/8/21. + +%D \stopsubject + +%D \startsubject[title=Macro for Calling the List Generator] +%D The command needs 4 parameters: Start-date, stop-date, number of +%D columns in the table and the interval in days. + +\define[4]\Checklist{\ctxlua{thirddata.calendar.interval_checks(#1,#2,#3,#4)}} + +%D \stopsubject + +%D \startsubject[title=Setups for the Out-Put Table] + +%D The layout of the out-put table is organized at the \TEX\ end. If +%D the table design changes in terms of more or less columns, this +%D setup has to be adapted. + +\startsetups table:interval_check + \setupTABLE[split=repeat] + \setupTABLE[r][each][height=12mm,align=lohi] + \setupTABLE[r][1][style=bold,align={lohi,middle}] + \setupTABLE[c][1][width=0.2\textwidth] + \setupTABLE[c][2,3,4][width=0.15\textwidth] + \setupTABLE[c][5][width=0.3\textwidth] +\stopsetups + +%D \stopsubject + +%D \startsubject[title=Column Head Texts] +%D It has been chosen to use the label-text mechanism to implement +%D the head texts of the columns. Depending on the design of the +%D out-put table the names can be adapted, the list can be made longer +%D or shorter according to the needs. + +\setuplabeltext[en][c1=Datum] +\setuplabeltext[en][c2=Gas] +\setuplabeltext[en][c3=Electricity] +\setuplabeltext[en][c4=Water] +\setuplabeltext[en][c5=Observation] + +%D \stopsubject + +%D \startsubject[title=Header Texts of Out-Put] +%D +%D Also for the header texts the label text mechanism is used. Now only three +%D intervals are defined, but this mechanism allows easily to extend the list +%D of possible header texts. It also allows to implement other languages. +%D Depending on the setting of the \type{\mainlanguage[]} the correct labels +%D are picked up and typeset. + +\setuplabeltext[en][weekly={Weekly Checks}] +\setuplabeltext[en][twoweekly={Two-weekly Checks}] +\setuplabeltext[en][monthly={Monthly Checks}] + +\setuplabeltext[de][weekly={Wochen Checks}] +\setuplabeltext[de][twoweekly={Zwei Wochen Checks}] +\setuplabeltext[de][monthly={Monatliche Checks}] + +\setuplabeltext[nl][weekly={Weekelijkse Checks}] +\setuplabeltext[nl][twoweekly={Twee-weekelijkse Checks}] +\setuplabeltext[nl][monthly={Maandelijkse Checks}] + +%D \stopsubject + +%D \startsubject[title=Header Text Setup] + +%D Each list gets a header text fitting the purpose of the list. + +\startmode[weekly] + \setupheadertexts + [\midaligned{\bfc \labeltext{weekly}}] + [] +\stopmode + +\startmode[twoweekly] + \setupheadertexts + [\midaligned{\bfc \labeltext{twoweekly}}] + [] +\stopmode + +\startmode[monthly] + \setupheadertexts + [\midaligned{\bfc \labeltext{monthly}}] + [] +\stopmode + +%D \stopsubject + +\stopmodule \ 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 deleted file mode 100644 index b55e545224..0000000000 --- a/macros/context/contrib/context-interval-calendar/tex/context/third/interval-calendar/t-intervalcalendar.tex +++ /dev/null @@ -1,265 +0,0 @@ -%D \module -%D [ file=t-interval-calender, -%D version=2023.04.15, -%D title=Interval calendar \CONTEXT\ User Module, -%D subtitle=Interval Calendar, -%D author=Willi Egger, -%D date=\currentdate, -%D copyright=Willi Egger, -%D email=w.egger@boede.nl, -%D license=Public Domain] - -\startmodule[intervalcalendar] - -\writestatus{loading}{ConTeXt User Module / Interval Calendar} - -%D \startsubject[title=Introduction] -%D After announcing a presentation for the 16th \CONTEXT -Meeting in Dreifelden, -%D Germany, over a new version of the PocketDiary module, Taco Hoekwater asked -%D whether the PocketDiary module might also be -%D able to produce lists with calendar-dates in intervals like \quote{weekly}, -%D \quote{twoweekly} or \quote{monthly} for the purpose of taking notes for -%D checks on a regular base. -- The lists should be configurable for the length -%D of the list, the number of columns and the possibility to assign an -%D individual -%D column-header. -- Quickly it appeared, that the use of the PocketDiary module -%D is not necessary. In order to be able to do math on dates it is the easiest -%D to convert a date to a timestamp in seconds or what is used by the -%D operating-system. -- Due to the fact that there are repeating calculations -%D done it is easiest to keep as much as possible at the lua end. Therefore the -%D out-put is prepared as a \CONTEXT -LUA-document (cld). -%D \stopsubject - -%D \startsubject[title=One Mode for Each List] -%D -%D The module can be used for the production of different lists. For each -%D list we define a mode. - -\definemode[weekly][keep] -\definemode[twoweekly][keep] -\definemode[monthly][keep] - -%D None of the modes are activated. - -%D \stopsubject - -%D \startsubject[title=General Setups] - -\setupbodyfont[dejavu,ss,12pt] -\setuppagenumbering[location=] - -\setuppapersize[A4,portrait][A4,portrait] - -\setuplayout - [topspace=20mm, - backspace=12mm, - header=10mm, - footer=2\bodyfontsize, - height=middle, - width=middle] - -\setupfootertexts - [\jobname .pdf] - [\pagenumber\ / \totalnumberofpages] - -%D \stopsubject - -%D \startsubject[title=LUA-Code] - -\startluacode - - thirddata = thirddata or { } - thirddata.calendar = { } - local calendar = thirddata.calendar - - local report = logs.reporter("Interval Checks") - - local interval_dates = {} - - function calendar.interval_checks(startdate,stopdate,cols,intval) - - local startdate_string =startdate - local stopdate_string =stopdate - local columns=cols - local intervaldays = intval - - local year,month,day = calendar.date(startdate_string) - local start_time_stamp = os.time({year=year,month=month,day=day}) - - --report("Starttimestamp: %s", start_time_stamp) - - local year,month,day = calendar.date(stopdate_string) - local end_time_stamp = os.time{year=year,month=month,day=day} - - local interval = intervaldays * 24 * 60 * 60 - - for i = start_time_stamp, end_time_stamp, interval do - local interval_date = os.date("%d-%m-%Y",i) - table.insert(interval_dates,interval_date) - report("%s",interval_date) - end - - calendar.print_interval_checks(columns) - end - - function calendar.print_interval_checks(cols) - - local columns = cols - - context.bTABLE({setups="table:interval_check"}) - context.bTABLEhead() - context.bTR() - for i = 1,columns do - context.bTH() - context.labeltext("c"..i) - context.eTH() - end - context.eTR() - context.eTABLEhead() - context.bTABLEbody() - for k,v in ipairs(interval_dates) do - context.bTR() - context.bTD() - context(v) - context.eTD() - for i=1,columns-1 do - context.bTD() - context.strut() - context.eTD() - end - context.eTR() - end - context.eTABLEbody() - context.eTABLE() - end - - function calendar.date(inputstr) - - --report("Input : %s",inputstr) - - local sep = "%-%s/" - if sep == nil then - sep = "%s" - end - local t={} - i=1 - for str in string.gmatch(inputstr, "([^"..sep.."]+)") do - t[i] = str - --report("Actual string %s", str) - i = i + 1 - end - - --report("Datum strings: %s, %s, %s", t[1],t[2],t[3]) - - return t[1],t[2],t[3] - end -\stopluacode - -%D The main function is the \quote{calendar.interval_ckecks} function -%D with 4 parameters. The function needs a start-date, an end-date, -%D the number of columns for the table in the out-put and the interval -%D in days. The function calculates all dates fitting into the start -%D and end dates based on the epoch-time. It converts the timestamp -%D into a human readable date format and puts the values into a -%D table \quote{interval_dates}. -%D -%D The second function is called from within the first function and -%D gets the number of columns as parameter. This function creates the -%D out-put table. It is a flexible setup, which is based on the -%D number of the columns provided as a parameter. Label-texts are used -%D for the column heads and the column heads are repeated at the top -%D of each following page. -%D -%D The third function is there to deal with the preparation of the dates, -%D which are sent to LUA as strings. It extracts the year (yyyy) the -%D month (m) and day (d). The extracted values are put into a table. The dates -%D can be entered in the format 2022-8-21 or as 2022/8/21. - -%D \stopsubject - -%D \startsubject[title=Macro for Calling the List Generator] -%D The command needs 4 parameters: Start-date, stop-date, number of -%D columns in the table and the interval in days. - -\define[4]\Checklist{\ctxlua{thirddata.calendar.interval_checks(#1,#2,#3,#4)}} - -%D \stopsubject - -%D \startsubject[title=Setups for the Out-Put Table] - -%D The layout of the out-put table is organized at the \TEX\ end. If -%D the table design changes in terms of more or less columns, this -%D setup has to be adapted. - -\startsetups table:interval_check - \setupTABLE[split=repeat] - \setupTABLE[r][each][height=12mm,align=lohi] - \setupTABLE[r][1][style=bold,align={lohi,middle}] - \setupTABLE[c][1][width=0.2\textwidth] - \setupTABLE[c][2,3,4][width=0.15\textwidth] - \setupTABLE[c][5][width=0.3\textwidth] -\stopsetups - -%D \stopsubject - -%D \startsubject[title=Column Head Texts] -%D It has been chosen to use the label-text mechanism to implement -%D the head texts of the columns. Depending on the design of the -%D out-put table the names can be adapted, the list can be made longer -%D or shorter according to the needs. - -\setuplabeltext[en][c1=Datum] -\setuplabeltext[en][c2=Gas] -\setuplabeltext[en][c3=Electricity] -\setuplabeltext[en][c4=Water] -\setuplabeltext[en][c5=Observation] - -%D \stopsubject - -%D \startsubject[title=Header Texts of Out-Put] -%D -%D Also for the header texts the label text mechanism is used. Now only three -%D intervals are defined, but this mechanism allows easily to extend the list -%D of possible header texts. It also allows to implement other languages. -%D Depending on the setting of the \type{\mainlanguage[]} the correct labels -%D are picked up and typeset. - -\setuplabeltext[en][weekly={Weekly Checks}] -\setuplabeltext[en][twoweekly={Two-weekly Checks}] -\setuplabeltext[en][monthly={Monthly Checks}] - -\setuplabeltext[de][weekly={Wochen Checks}] -\setuplabeltext[de][twoweekly={Zwei Wochen Checks}] -\setuplabeltext[de][monthly={Monatliche Checks}] - -\setuplabeltext[nl][weekly={Weekelijkse Checks}] -\setuplabeltext[nl][twoweekly={Twee-weekelijkse Checks}] -\setuplabeltext[nl][monthly={Maandelijkse Checks}] - -%D \stopsubject - -%D \startsubject[title=Header Text Setup] - -%D Each list gets a header text fitting the purpose of the list. - -\startmode[weekly] - \setupheadertexts - [\midaligned{\bfc \labeltext{weekly}}] - [] -\stopmode - -\startmode[twoweekly] - \setupheadertexts - [\midaligned{\bfc \labeltext{twoweekly}}] - [] -\stopmode - -\startmode[monthly] - \setupheadertexts - [\midaligned{\bfc \labeltext{monthly}}] - [] -\stopmode - -%D \stopsubject - -\stopmodule \ No newline at end of file diff --git a/macros/context/contrib/context-pocketdiary/VERSION b/macros/context/contrib/context-pocketdiary/VERSION index faab976b2f..4689b28be5 100644 --- a/macros/context/contrib/context-pocketdiary/VERSION +++ b/macros/context/contrib/context-pocketdiary/VERSION @@ -1 +1 @@ -2023.04.15 +2023.04.25 diff --git a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Moonphase/moons-MP.mkiv b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Moonphase/moons-MP.mkiv new file mode 100644 index 0000000000..f5817bd2eb --- /dev/null +++ b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Moonphase/moons-MP.mkiv @@ -0,0 +1,86 @@ +%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] + +\defineMPinstance + [Moon] + [metafun] + [] + +\startMPinclusions[]{Moon} + numeric w,h; + path p[]; + pair ip[]; + + w = OverlayWidth; + h = OverlayHeight; + + p[1] := fullcircle scaled h; + p[2] := p[1] shifted (0.2 w,0); + + ip[1] := p[1] intersectionpoint p[2]; + ip[2] := reverse p[1] intersectionpoint p[2]; + + p[3] := p[1] cutbefore ip[1] cutafter ip[2]; + p[4] := p[2] cutbefore ip[1] cutafter ip[2]; + + drawoptions (withpen pencircle scaled 2pt); + +\stopMPinclusions + +\startuniqueMPgraphic{Moon::Waning_moon} + draw p[3] ; + draw p[4] ; +\stopuniqueMPgraphic + +\startuniqueMPgraphic{Moon::Growing_moon} + draw p[3] ; + draw p[4] ; + currentpicture := (currentpicture reflectedabout (ip[1],ip[2])); +\stopuniqueMPgraphic + +\startuniqueMPgraphic{Moon::Fullmoon} + draw p[1]; +\stopuniqueMPgraphic + +\startuniqueMPgraphic{Moon::Newmoon} + fill p[1] withcolor 0.625 white; + draw p[1]; +\stopuniqueMPgraphic + + +\defineoverlay[waningmoon][\useMPgraphic{Moon::Waning_moon}] +\defineoverlay[growingmoon][\useMPgraphic{Moon::Growing_moon}] +\defineoverlay[newmoon][\useMPgraphic{Moon::Newmoon}] +\defineoverlay[fullmoon][\useMPgraphic{Moon::Fullmoon}] + +\defineframed + [Moon] + [height=\bodyfontsize, + width=\bodyfontsize, + frame=off] + + +% \starttext +% Results with \type{framed} +% +% \blank +% +% Heute ist abnehmender Mond {\Moon[background=waningmoon]{\strut}} +% +% Heute ist Vollmond \Moon[background=fullmoon]{} +% +% Heute haben wir Neumond \Moon[background=newmoon]{} +% +% Und heute haben wir zunehmenden Mond \Moon[background=growingmoon]{} +% +% \stoptext \ No newline at end of file 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 deleted file mode 100644 index f5817bd2eb..0000000000 --- a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Moonphase/moons-MP.tex +++ /dev/null @@ -1,86 +0,0 @@ -%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] - -\defineMPinstance - [Moon] - [metafun] - [] - -\startMPinclusions[]{Moon} - numeric w,h; - path p[]; - pair ip[]; - - w = OverlayWidth; - h = OverlayHeight; - - p[1] := fullcircle scaled h; - p[2] := p[1] shifted (0.2 w,0); - - ip[1] := p[1] intersectionpoint p[2]; - ip[2] := reverse p[1] intersectionpoint p[2]; - - p[3] := p[1] cutbefore ip[1] cutafter ip[2]; - p[4] := p[2] cutbefore ip[1] cutafter ip[2]; - - drawoptions (withpen pencircle scaled 2pt); - -\stopMPinclusions - -\startuniqueMPgraphic{Moon::Waning_moon} - draw p[3] ; - draw p[4] ; -\stopuniqueMPgraphic - -\startuniqueMPgraphic{Moon::Growing_moon} - draw p[3] ; - draw p[4] ; - currentpicture := (currentpicture reflectedabout (ip[1],ip[2])); -\stopuniqueMPgraphic - -\startuniqueMPgraphic{Moon::Fullmoon} - draw p[1]; -\stopuniqueMPgraphic - -\startuniqueMPgraphic{Moon::Newmoon} - fill p[1] withcolor 0.625 white; - draw p[1]; -\stopuniqueMPgraphic - - -\defineoverlay[waningmoon][\useMPgraphic{Moon::Waning_moon}] -\defineoverlay[growingmoon][\useMPgraphic{Moon::Growing_moon}] -\defineoverlay[newmoon][\useMPgraphic{Moon::Newmoon}] -\defineoverlay[fullmoon][\useMPgraphic{Moon::Fullmoon}] - -\defineframed - [Moon] - [height=\bodyfontsize, - width=\bodyfontsize, - frame=off] - - -% \starttext -% Results with \type{framed} -% -% \blank -% -% Heute ist abnehmender Mond {\Moon[background=waningmoon]{\strut}} -% -% Heute ist Vollmond \Moon[background=fullmoon]{} -% -% Heute haben wir Neumond \Moon[background=newmoon]{} -% -% Und heute haben wir zunehmenden Mond \Moon[background=growingmoon]{} -% -% \stoptext \ No newline at end of file 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 2c6e5c3ba8..e0f2a5c537 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 = 2023.04.15, + 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.mkiv b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/PocketDiary.mkiv new file mode 100644 index 0000000000..fb2172fc6c --- /dev/null +++ b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/PocketDiary.mkiv @@ -0,0 +1,119 @@ +%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] + +%D Set the main language, which sets the interface to be used. Supported interfaces: EN,DE,NL,FR,IT,ES,PL + +\mainlanguage[en] + +%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] + [WeekDay=1, + Week=15, + Month=4, + Year=2023, + Nextyear=yes, + Daybyday=no] + +%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] + [Page1=Dayplan, + Page2=Weekendplan, + Page3=Weekcurrentplan, + Page4=Weeknextplan, + Page5=Monthcurrentplan, + Page6=Monthnextplan, + Page7=Yearcurrentplan, + Page8=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={YourFamilyName}, + Forename={YourFirstName}, + Street=Pine Lane + Zipcode=2080, + City=YourTown, + Country=YourCountry, + Phone={\dots}, + Mobile={\dots}, + E-mail={\dots}, + Web={\dots}] + +\setvariables + [PocketDiaryFooter] + [Lefttext={\getvariable{PocketDiaryAddress}{Forename}~ + \getvariable{PocketDiaryAddress}{Familyname}}, + Centertext=, + Righttext=\pagenumber] + +\setvariables + [PocketDiaryColors] + [Separatorline=blue, + Gridline={s=0.55}] + +\setvariables %Dreifelden + [PocketDiaryGeoPosition] + [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/PocketDiary.tex b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/PocketDiary.tex deleted file mode 100644 index fb2172fc6c..0000000000 --- a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/PocketDiary.tex +++ /dev/null @@ -1,119 +0,0 @@ -%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] - -%D Set the main language, which sets the interface to be used. Supported interfaces: EN,DE,NL,FR,IT,ES,PL - -\mainlanguage[en] - -%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] - [WeekDay=1, - Week=15, - Month=4, - Year=2023, - Nextyear=yes, - Daybyday=no] - -%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] - [Page1=Dayplan, - Page2=Weekendplan, - Page3=Weekcurrentplan, - Page4=Weeknextplan, - Page5=Monthcurrentplan, - Page6=Monthnextplan, - Page7=Yearcurrentplan, - Page8=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={YourFamilyName}, - Forename={YourFirstName}, - Street=Pine Lane - Zipcode=2080, - City=YourTown, - Country=YourCountry, - Phone={\dots}, - Mobile={\dots}, - E-mail={\dots}, - Web={\dots}] - -\setvariables - [PocketDiaryFooter] - [Lefttext={\getvariable{PocketDiaryAddress}{Forename}~ - \getvariable{PocketDiaryAddress}{Familyname}}, - Centertext=, - Righttext=\pagenumber] - -\setvariables - [PocketDiaryColors] - [Separatorline=blue, - Gridline={s=0.55}] - -\setvariables %Dreifelden - [PocketDiaryGeoPosition] - [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.nkiv b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Solar/sun-MP.nkiv new file mode 100644 index 0000000000..0ccd8923cc --- /dev/null +++ b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Solar/sun-MP.nkiv @@ -0,0 +1,137 @@ +%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] + +\defineMPinstance + [Sun] + [metafun] + [] + +\startMPinclusions[]{Sun} + numeric w,h; + path p[]; + pair ip[]; + + w = OverlayWidth; + h = OverlayHeight; + + p[1] := fullcircle scaled h; + p[100] := tcircle scaled 0.5h; %h + p[2] := tcircle scaled 0.6h; %1.2h; + p[3] := tcircle scaled 0.75h; %1.6h; + p[4] := tcircle scaled h; %2h; + p[5] := (0,0)--point 1 of p[4] ; + p[6] := p[5] cutbefore point .3 of p[5]; + p[7] := p[6] rotatedaround (center p[1],18); + + ip[1] := p[2] intersectionpoint p[7]; + ip[2] := p[3] intersectionpoint p[7]; + + p[10] := ip[1]--ip[2]; + + ip[3] := ip[1]; + ip[4] := point 1 of p[7]; + + p[11] := ip[3]--ip[4]; + + drawoptions (withpen pencircle scaled 0.25pt withcolor red); + +\stopMPinclusions + +\startreusableMPgraphic{Sun::Sunrise} + drawoptions (withpen pencircle scaled 0.25pt withcolor red); + draw p[100]; + for i = 36 step 36 until 154 : + draw p[10] rotatedaround (center p[1],i-18); + endfor; + for i = 18 step 36 until 180 : + draw p[11] rotatedaround (center p[1],i-18); + endfor; + drawarrow ((0,0)--(0,h)) shifted (0,-0.05h); +\stopreusableMPgraphic + +\startreusableMPgraphic{Sun::Sunset} + drawoptions (withpen pencircle scaled 0.25pt withcolor red); + draw p[100]; + for i = 36 step 36 until 154 : + draw p[10] rotatedaround (center p[1],i-18); + endfor; + for i = 18 step 36 until 180 : + draw p[11] rotatedaround (center p[1],i-18); + endfor; + drawarrow ((0,h)--(0,0)) shifted (0,-0.05h) xscaled 0.5; +\stopreusableMPgraphic + +\startreusableMPgraphic{Sun::Light} + h := OverlayHeight; + w := OverlayWidth; + drawoptions (withpen pencircle scaled 0.15pt withcolor red); + + p[11] := ip[3]--ip[4]; + p[1] := fullcircle scaled 0.25h; + p[2] := tcircle scaled 0.35h; + p[3] := tcircle scaled 0.5h; + p[4] := tcircle scaled 0.8h; + p[5] := (0,0)--point 1 of p[4] ; + p[6] := p[5] cutbefore point .3 of p[5]; + p[7] := p[6] rotatedaround (center p[1],18); + + ip[1] := p[2] intersectionpoint p[7]; + ip[2] := p[3] intersectionpoint p[7]; + + p[10] := ip[1]--ip[2]; + + ip[3] := ip[1]; + ip[4] := point 1 of p[7]; + + p[11] := ip[3]--ip[4]; + + draw p[1]; + for i = 36 step 36 until 360 : + draw p[10] rotatedaround (center p[1],i-18); + endfor; + for i = 18 step 36 until 360 : + draw p[11] rotatedaround (center p[1],i-18); + endfor; + + currentpicture := currentpicture rotatedaround(center p[1],18); +\stopreusableMPgraphic + +\defineoverlay[Sunrise][\useMPgraphic{Sun::Sunrise}] +\defineoverlay[Sunset][\useMPgraphic{Sun::Sunset}] +\defineoverlay[Light][\useMPgraphic{Sun::Light}] + +\defineframed + [SunA] + [strut=yes, + height=\lineheight, + width=\emwidth, + frame=off, + offset=0pt] + +\defineframed + [SunB] + [strut=yes, + height=\lineheight, + width=\emwidth, + frame=off, + offset=0pt, + location=depth] + +% \starttext +% \setupbodyfont[8pt] % This is the minimal size which looks still ok. +% +% Sunrise: {\SunA[background=Sunrise]{\strut}} +% Sunset: \SunA[background=Sunset]{\strut} +% Light hours: \SunB[background=Light]{\strut} Sunshine +% +% \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 deleted file mode 100644 index 0ccd8923cc..0000000000 --- a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/Solar/sun-MP.tex +++ /dev/null @@ -1,137 +0,0 @@ -%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] - -\defineMPinstance - [Sun] - [metafun] - [] - -\startMPinclusions[]{Sun} - numeric w,h; - path p[]; - pair ip[]; - - w = OverlayWidth; - h = OverlayHeight; - - p[1] := fullcircle scaled h; - p[100] := tcircle scaled 0.5h; %h - p[2] := tcircle scaled 0.6h; %1.2h; - p[3] := tcircle scaled 0.75h; %1.6h; - p[4] := tcircle scaled h; %2h; - p[5] := (0,0)--point 1 of p[4] ; - p[6] := p[5] cutbefore point .3 of p[5]; - p[7] := p[6] rotatedaround (center p[1],18); - - ip[1] := p[2] intersectionpoint p[7]; - ip[2] := p[3] intersectionpoint p[7]; - - p[10] := ip[1]--ip[2]; - - ip[3] := ip[1]; - ip[4] := point 1 of p[7]; - - p[11] := ip[3]--ip[4]; - - drawoptions (withpen pencircle scaled 0.25pt withcolor red); - -\stopMPinclusions - -\startreusableMPgraphic{Sun::Sunrise} - drawoptions (withpen pencircle scaled 0.25pt withcolor red); - draw p[100]; - for i = 36 step 36 until 154 : - draw p[10] rotatedaround (center p[1],i-18); - endfor; - for i = 18 step 36 until 180 : - draw p[11] rotatedaround (center p[1],i-18); - endfor; - drawarrow ((0,0)--(0,h)) shifted (0,-0.05h); -\stopreusableMPgraphic - -\startreusableMPgraphic{Sun::Sunset} - drawoptions (withpen pencircle scaled 0.25pt withcolor red); - draw p[100]; - for i = 36 step 36 until 154 : - draw p[10] rotatedaround (center p[1],i-18); - endfor; - for i = 18 step 36 until 180 : - draw p[11] rotatedaround (center p[1],i-18); - endfor; - drawarrow ((0,h)--(0,0)) shifted (0,-0.05h) xscaled 0.5; -\stopreusableMPgraphic - -\startreusableMPgraphic{Sun::Light} - h := OverlayHeight; - w := OverlayWidth; - drawoptions (withpen pencircle scaled 0.15pt withcolor red); - - p[11] := ip[3]--ip[4]; - p[1] := fullcircle scaled 0.25h; - p[2] := tcircle scaled 0.35h; - p[3] := tcircle scaled 0.5h; - p[4] := tcircle scaled 0.8h; - p[5] := (0,0)--point 1 of p[4] ; - p[6] := p[5] cutbefore point .3 of p[5]; - p[7] := p[6] rotatedaround (center p[1],18); - - ip[1] := p[2] intersectionpoint p[7]; - ip[2] := p[3] intersectionpoint p[7]; - - p[10] := ip[1]--ip[2]; - - ip[3] := ip[1]; - ip[4] := point 1 of p[7]; - - p[11] := ip[3]--ip[4]; - - draw p[1]; - for i = 36 step 36 until 360 : - draw p[10] rotatedaround (center p[1],i-18); - endfor; - for i = 18 step 36 until 360 : - draw p[11] rotatedaround (center p[1],i-18); - endfor; - - currentpicture := currentpicture rotatedaround(center p[1],18); -\stopreusableMPgraphic - -\defineoverlay[Sunrise][\useMPgraphic{Sun::Sunrise}] -\defineoverlay[Sunset][\useMPgraphic{Sun::Sunset}] -\defineoverlay[Light][\useMPgraphic{Sun::Light}] - -\defineframed - [SunA] - [strut=yes, - height=\lineheight, - width=\emwidth, - frame=off, - offset=0pt] - -\defineframed - [SunB] - [strut=yes, - height=\lineheight, - width=\emwidth, - frame=off, - offset=0pt, - location=depth] - -% \starttext -% \setupbodyfont[8pt] % This is the minimal size which looks still ok. -% -% Sunrise: {\SunA[background=Sunrise]{\strut}} -% Sunset: \SunA[background=Sunset]{\strut} -% Light hours: \SunB[background=Light]{\strut} Sunshine -% -% \stoptext \ No newline at end of file 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 98f4c585aa..4b3c03589a 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 = 2023.04.15, + 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 7f94397351..f72cabc8e4 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 = 2023.04.15, + 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 fe893d3f7e..efd15a26dd 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,5 +1,5 @@ if not modules then modules = { } end modules ['t-pocketdiary'] = { - version = 2023.04.15, + version = "2023.04.15", comment = "Layouts of diary pages", author = "Willi Egger", copyright = "Willi Egger", diff --git a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-pocketdiary.mkiv b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-pocketdiary.mkiv new file mode 100644 index 0000000000..4ca5f86989 --- /dev/null +++ b/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-pocketdiary.mkiv @@ -0,0 +1,1507 @@ +%D \module +%D [ file=t-pocketdiary, +%D version="2023-04-15", +%D title=PocketDiary \CONTEXT\ User Module, +%D subtitle=PocketDiary, +%D author=Willi Egger, +%D date=\currentdate, +%D copyright=Willi Egger, +%D email=w.egger@boede.nl, +%D license=Public Domain] + +\startmodule[pocketdiary] + +\writestatus{loading}{ConTeXt User Module / PocketDiary} + +%D \startsubject[title={Introduction}] +%D +%D It is already some time ago, that my brother Heinz asked me to prepare him a +%D special page-arrangement scheme. +%D This scheme is suitable to form a section with a single-sided printed sheet +%D of paper. +%D He wanted to use it for special kind of greeting-cards. By coincidence I +%D detected an article by U. Ziegenhagen in de \TEX nische +%D Kommödie nr. 3/2010. This article deals with the preparation of a PocketMod, +%D which is a personal organizer +%D based on the mentioned arranging scheme. In the article there is also a +%D link mentioned to an online +%D version of the PocketMod. (http://www.pocketmod.com/). +%D -- After reading the article and visiting the web-site I got +%D intrigued by the fact, that \CONTEXT\ has built in arranging capabilities +%D and +%D due to the \LUATEX\ engine and herewith the possibility to perform +%D calculations in Lua it +%D should be possible to build such a personal organizer in \CONTEXT. +%D +%D The result is contained in this module. I would like to thank Hans Hagen +%D and Taco Hoekwater for the great +%D \LUATEX\ machinery and Wolfgang Schuster for supporting me in tackling +%D the multi-lingual interface. +%D +%D After the first version in 2011, we are now 11 years older, a lot +%D has changed in and around the \CONTEXT +%D -machinery. We are now using \LMTX\ (\LUAMETATEX ) the latest development. +%D +%D During the \CONTEXT -meeting 2021 Thomáš Hála presented his solution +%D for generating an agenda, while the shops were closed during the Covid-19 +%D pandemic. Discussing issues with calendars revealed, that it could be +%D interesting to integrate into a calendar also data concerning the moon +%D phase and possibly information on the sun rise and sun set time. +%D +%D I thought, that I would like to do such calculations and give it a try. +%D After having found information how to perform such astronomical +%D calculations, slowly two new modules appeared. The calculations of the +%D moon phases is quite straight forward and this can be considered the +%D easy part of the new development. The only remark must be made, that +%D those calculations are not super accurate. A deviation of about 1 day has +%D to be accepted. +%D +%D Finding a way to calculate the sun rise and sun set times is much more +%D tedious. Collecting articles on such calculations and building the +%D formulas in Lua is not the issue, but that the given information in those +%D articles looks +%D incomplete for a layman like me. -- Finally I found a Lua-module written for +%D an +%D application for presenting the required data on screen (the reference +%D to the authors is given in the Lua-file for the sun data calculations). +%D I adapted +%D this to Lua/\CONTEXT\ and it looks like it works fine. -- I have a Raspberry +%D Pi Nano with a screen attached where I display weather information together +%D with the sun data, which are fetched from the Open Weather Map +%D (https://openweathermap.org). Due to the fact that the development of the +%D solar data module took a long time I was able to compare the calculated +%D results with those displayed on the Raspberry Pi screen. Happily they are +%D completely congruent. +%D +%D \blank[big] +%D +%D Without the help of Hans Hagen, this module would not have been finished. I +%D would like to thank him for all the support and patience with my struggles! +%D \stopsubject + +%D \startsubject[title={Subpaths}] + +%D In order to keep the hole module clearly organized the moon phase +%D as well as the sun rise/set calculation files are situated in +%D separate folders. +%D We tell \CONTEXT\ where to find the requested files + +\usepath[{Moonphase,Solar}] + +%D \stopsubject + +%D \startsubject[title={Lua-files}] +%D All calculations for dates are performed with Lua functions. +%D The functions are contained in \type{t-calendar.lua} + +%\ctxloadluafile{t-calendar}{} +\ctxloadluafile{t-calendar}{} + +%D The calculations for the moon phase are done by Lua functions. +%D The functions are contained in \type{t-moonphase.lua} +%D in the folder \quotation{Moonphase} + +\ctxloadluafile{t-moonphase}{} + +%D The calculations for the sun rise and set time are calculated in Lua too. +%D The +%D functions are contained in the file \type{t-solar.lua} in the folder +%D \quotation{Solar} + +\ctxloadluafile{t-solar}{} +%D \stopsubject + +%D \startsubject[title={International interface}] +%D +%D The PocketDiary is aware of different languages. The language to be used is +%D selected with \type{\mainlanguage[en]}. The following interfaces +%D are available +%D +%D \startitemize[2,packed] +%D \item Englisch interface +%D \item Dutch interface +%D \item German interface +%D \item Italian interface +%D \item French interface +%D \item Spanish interface +%D \item Polish interface +%D \stopitemize +%D \stopsubject + +%D English interface +\setuplabeltext[en][calendar=Calendar] +\setuplabeltext[en][weekagenda=Week calendar] +\setuplabeltext[en][week=Week] +\setuplabeltext[en][month=Month] +\setuplabeltext[en][contact=Contact] +\setuplabeltext[en][name=Name] +\setuplabeltext[en][address=Address] +\setuplabeltext[en][zip=Zip] +\setuplabeltext[en][place=Place] +\setuplabeltext[en][country=Country] +\setuplabeltext[en][phone=Phone] +\setuplabeltext[en][mail=e-mail] +\setuplabeltext[en][notes=Notes] +\setuplabeltext[en][todo=Todo] +\setuplabeltext[en][found={If found\textcomma\ please return to:}] + +\setuplabeltext[en][nyd={New Year's Day}] +\setuplabeltext[en][epi={Epiphany}] +\setuplabeltext[en][ashw={Ash Wednesday}] +\setuplabeltext[en][palms={Palm Sunday} ] +\setuplabeltext[en][gfri={Good Friday} ] +\setuplabeltext[en][esun={Easter Sunday}] +\setuplabeltext[en][esmo={Easter Monday}] +\setuplabeltext[en][ascd={Ascension Day}] +\setuplabeltext[en][pcst=Pentecost] +\setuplabeltext[en][pcstmo={Pentecost Monday}] +\setuplabeltext[en][xmas=Christmas] +\setuplabeltext[en][bxd={Boxing Day}] +\setuplabeltext[en][day=Day] +\setuplabeltext[en][mon=Mon] +\setuplabeltext[en][tue=Tue] +\setuplabeltext[en][wed=Wed] +\setuplabeltext[en][thu=Thu] +\setuplabeltext[en][fri=Fri] +\setuplabeltext[en][sat=Sat] +\setuplabeltext[en][sun=Sun] + +\setuplabeltext[en][january=January] +\setuplabeltext[en][february=February] +\setuplabeltext[en][march=March] +\setuplabeltext[en][april=April] +\setuplabeltext[en][may=May] +\setuplabeltext[en][june=June] +\setuplabeltext[en][july=July] +\setuplabeltext[en][august=August] +\setuplabeltext[en][september=September] +\setuplabeltext[en][october=October] +\setuplabeltext[en][november=November] +\setuplabeltext[en][december=December] + +\setuplabeltext[en][moondays=Lunar days] +\setuplabeltext[en][moon=Moon] +\setuplabeltext[en][sunrise=Sunrise] +\setuplabeltext[en][sunset=Sunset] +\setuplabeltext[en][lighthours=Lighthours] +\setuplabeltext[en][sunstar=Sun] + +%D German interface +\setuplabeltext[de][calendar=Planer] % Terminkalender, Kalender +\setuplabeltext[de][weekagenda=Wochenagenda] +\setuplabeltext[de][week=Woche] +\setuplabeltext[de][month=Monat] +\setuplabeltext[de][contact=Kontakt] +\setuplabeltext[de][name=Name] +\setuplabeltext[de][address=Adresse] +\setuplabeltext[de][zip=Postleitzahl] +\setuplabeltext[de][place=Ort] +\setuplabeltext[de][country=Land] +\setuplabeltext[de][phone=Telefon] +\setuplabeltext[de][mail=e-Mail] +\setuplabeltext[de][notes=Notizen] +\setuplabeltext[de][todo={Zu erledigen}] +\setuplabeltext[de][found={Wenn gefunden\textcomma\ bitte retournieren an:}] + +\setuplabeltext[de][nyd=Neujahr] +\setuplabeltext[de][epi=Dreikönigstag] +\setuplabeltext[de][ashw=Aschermittwoch] +\setuplabeltext[de][palms=Palmsonntag] +\setuplabeltext[de][gfri=Karfreitag] +\setuplabeltext[de][esun=Ostern] +\setuplabeltext[de][esmo=Ostermontag] +\setuplabeltext[de][ascd=Himmelfahrt] +\setuplabeltext[de][pcst=Pfingsten] +\setuplabeltext[de][pcstmo=Pfingstmontag] +\setuplabeltext[de][xmas=Weihnachten] +\setuplabeltext[de][bxd=Stephanstag] +\setuplabeltext[de][day=Tag] +\setuplabeltext[de][mon=Mo] +\setuplabeltext[de][tue=Di] +\setuplabeltext[de][wed=Mi] +\setuplabeltext[de][thu=Do] +\setuplabeltext[de][fri=Fr] +\setuplabeltext[de][sat=Sa] +\setuplabeltext[de][sun=So] + +\setuplabeltext[de][january=Januar] +\setuplabeltext[de][february=Februar] +\setuplabeltext[de][march=März] +\setuplabeltext[de][april=April] +\setuplabeltext[de][may=Mai] +\setuplabeltext[de][june=Juni] +\setuplabeltext[de][july=Juli] +\setuplabeltext[de][august=August] +\setuplabeltext[de][september=September] +\setuplabeltext[de][october=Oktober] +\setuplabeltext[de][november=November] +\setuplabeltext[de][december=Dezember] + +\setuplabeltext[de][moondays=Mondtage] +\setuplabeltext[de][moon=Mond] +\setuplabeltext[de][sunrise=Sonnenaufgang] +\setuplabeltext[de][sunset=Sonnenuntergang] +\setuplabeltext[de][lighthours=Taglichtstunden] +\setuplabeltext[de][sunstar=Sonne] + +%D Dutch interface +\setuplabeltext[nl][calendar=Kalender] +\setuplabeltext[nl][weekagenda=Weekagenda] +\setuplabeltext[nl][week=Week] +\setuplabeltext[nl][month=Maand] +\setuplabeltext[nl][contact=Kontakt] +\setuplabeltext[nl][name=Naam] +\setuplabeltext[nl][address=Adres] +\setuplabeltext[nl][zip=Postcode] +\setuplabeltext[nl][place=Plaats] +\setuplabeltext[nl][country=Land] +\setuplabeltext[nl][phone=Tel.] +\setuplabeltext[nl][mail=e-mail] +\setuplabeltext[nl][notes=Notities] +\setuplabeltext[nl][todo=Todo] +\setuplabeltext[nl][found={Wanneer gevonden\textcomma\ aub sturen naar:}] + +\setuplabeltext[nl][nyd={Nieuw jaar}] +\setuplabeltext[nl][epi=Driekoningen] +\setuplabeltext[nl][ashw=Aswoensdag] +\setuplabeltext[nl][palms=Palmpasen] +\setuplabeltext[nl][gfri={Goede vrijdag}] +\setuplabeltext[nl][esun=Pasen] +\setuplabeltext[nl][esmo={2\high{de} Paasdag}] +\setuplabeltext[nl][ascd=Hemelvaart] +\setuplabeltext[nl][pcst=Pinksteren] +\setuplabeltext[nl][pcstmo={2\high{de} Pinksterdag}] +\setuplabeltext[nl][xmas=Kerst] +\setuplabeltext[nl][bxd={2\high{de} Kerstdag}] +\setuplabeltext[nl][day=Dag] +\setuplabeltext[nl][mon=Ma] +\setuplabeltext[nl][tue=Di] +\setuplabeltext[nl][wed=Woe] +\setuplabeltext[nl][thu=Do] +\setuplabeltext[nl][fri=Fr] +\setuplabeltext[nl][sat=Za] +\setuplabeltext[nl][sun=Zo] + +\setuplabeltext[nl][january=Januari] +\setuplabeltext[nl][february=Febrari] +\setuplabeltext[nl][march=Maart] +\setuplabeltext[nl][april=April] +\setuplabeltext[nl][may=Mei] +\setuplabeltext[nl][june=Juni] +\setuplabeltext[nl][july=Juli] +\setuplabeltext[nl][august=Augustus] +\setuplabeltext[nl][september=September] +\setuplabeltext[nl][october=October] +\setuplabeltext[nl][november=November] +\setuplabeltext[nl][december=December] + +\setuplabeltext[nl][moondays=Maandagen] +\setuplabeltext[nl][moon=Maan] +\setuplabeltext[nl][sunrise=Zonsopg.] +\setuplabeltext[nl][sunset=Zonsonderg.] +\setuplabeltext[nl][lighthours=Lichturen] +\setuplabeltext[nl][sunstar=Zon] + +%D French interface +\setuplabeltext[fr][calendar=Calendrier] +\setuplabeltext[fr][weekagenda={Cal. de la semaine}] +\setuplabeltext[fr][week=Sem.] +\setuplabeltext[fr][month=Mois] +\setuplabeltext[fr][contact=Contact] +\setuplabeltext[fr][name=Nom] +\setuplabeltext[fr][address=Adresse] +\setuplabeltext[fr][zip=CP] +\setuplabeltext[fr][place=Lieu] +\setuplabeltext[fr][country=Pays] +\setuplabeltext[fr][phone=Tél.] +\setuplabeltext[fr][mail=e-mail] +\setuplabeltext[fr][notes=Observations] +\setuplabeltext[fr][todo=Tâches] +\setuplabeltext[fr][found={Si trouvé\textcomma\ retourner s.v.p. à: }] + +\setuplabeltext[fr][nyd={Jour de l'an}] +\setuplabeltext[fr][epi={Épiphany}] +\setuplabeltext[fr][ashw={Mercredi des Cendres}] +\setuplabeltext[fr][palms={Dimanche des Rameaux}] +\setuplabeltext[fr][gfri={Vendredi saint}] +\setuplabeltext[fr][esun={Pâques}] +\setuplabeltext[fr][esmo={Lundi de Pâques}] +\setuplabeltext[fr][ascd={Jour de l'ascension}] +\setuplabeltext[fr][pcst=Pentecôte] +\setuplabeltext[fr][pcstmo={Lundi de Pentecôte}] +\setuplabeltext[fr][xmas=Noël] +\setuplabeltext[fr][bxd=] +\setuplabeltext[fr][day=Jour] +\setuplabeltext[fr][mon=Lun] +\setuplabeltext[fr][tue=Mar] +\setuplabeltext[fr][wed=Mer] +\setuplabeltext[fr][thu=Jeu] +\setuplabeltext[fr][fri=Ven] +\setuplabeltext[fr][sat=Sam] +\setuplabeltext[fr][sun=Dim] + +\setuplabeltext[fr][january=Janvier] +\setuplabeltext[fr][february=Février] +\setuplabeltext[fr][march=Mars] +\setuplabeltext[fr][april=Avril] +\setuplabeltext[fr][may=Mai] +\setuplabeltext[fr][june=Juin] +\setuplabeltext[fr][july=Juillet] +\setuplabeltext[fr][august=Août] +\setuplabeltext[fr][september=Septembre] +\setuplabeltext[fr][october=Octobre] +\setuplabeltext[fr][november=Novembre] +\setuplabeltext[fr][december=Décembre] + +\setuplabeltext[fr][moondays=Jours lun.] % jours lunaires +\setuplabeltext[fr][moon=Lune] +\setuplabeltext[fr][sunrise=Lever du s.] %soleil +\setuplabeltext[fr][sunset=Coucher du s.] %soleil +\setuplabeltext[fr][lighthours=Heures de l.] %lumière +\setuplabeltext[fr][sunstar=Soleil] + +% Italian interface +\setuplabeltext[it][calendar=Calendario] +\setuplabeltext[it][weekagenda=Calendario di settimana] +\setuplabeltext[it][week=Sett.] %Settimana +\setuplabeltext[it][month=Mese] +\setuplabeltext[it][contact=Contatto] +\setuplabeltext[it][name=Nome] +\setuplabeltext[it][address=Indirizzo] +\setuplabeltext[it][zip=C.A.P.] +\setuplabeltext[it][place=Luogo] +\setuplabeltext[it][country=Paese] +\setuplabeltext[it][phone=Tel.] +\setuplabeltext[it][mail=e-mail] +\setuplabeltext[it][notes=Osservazioni] +\setuplabeltext[it][todo=Compiti] +\setuplabeltext[it][found={Se trovato\textcomma\ prego speditelo à:}] + +%D Italian interface +\setuplabeltext[it][nyd=Capodanno] +\setuplabeltext[it][epi={Epifania}] +\setuplabeltext[it][ashw={Giorno delle Ceneri}] +\setuplabeltext[it][palms={Domenica delle Palme}] +\setuplabeltext[it][gfri={Venerdi santo}] +\setuplabeltext[it][esun=Pasqua] +\setuplabeltext[it][esmo={Lunedì dell'Angelo}] +\setuplabeltext[it][ascd=Ascensione] +\setuplabeltext[it][pcst=Pentecoste] +\setuplabeltext[it][pcstmo={Lunedì di Pentecoste}] +\setuplabeltext[it][xmas=Natale] +\setuplabeltext[it][bxd={Giorno di S. Stefano}] +\setuplabeltext[it][day=Giorno] +\setuplabeltext[it][mon=Lun] +\setuplabeltext[it][tue=Mar] +\setuplabeltext[it][wed=Mer] +\setuplabeltext[it][thu=Gio] +\setuplabeltext[it][fri=Ven] +\setuplabeltext[it][sat=Sab] +\setuplabeltext[it][sun=Dom] + +\setuplabeltext[it][january=Gennaio] +\setuplabeltext[it][february=Febbraio] +\setuplabeltext[it][march=Marzo] +\setuplabeltext[it][april=Aprile] +\setuplabeltext[it][may=Maggio] +\setuplabeltext[it][june=Giugno] +\setuplabeltext[it][july=Luglio] +\setuplabeltext[it][august=Agosto] +\setuplabeltext[it][september=Settembre] +\setuplabeltext[it][october=Ottobre] +\setuplabeltext[it][november=Novembre] +\setuplabeltext[it][december=Dicembre] + +\setuplabeltext[it][moondays=Giorni lun.] %Giorni lunari +\setuplabeltext[it][moon=Luna] +\setuplabeltext[it][sunrise=Albo] +\setuplabeltext[it][sunset=Tramonto] +\setuplabeltext[it][lighthours={O. di luce}] %Ore di luce +\setuplabeltext[it][sunstar=Sole] + +%D Spanish interface +\setuplabeltext[es][calendar=Agenda] +\setuplabeltext[es][weekagenda=Agenda semanal] +\setuplabeltext[es][week=Sem.] %Semana +\setuplabeltext[es][month=Mes] +\setuplabeltext[es][contact=Contacto] +\setuplabeltext[es][name=Nombre] +\setuplabeltext[es][address=Dirección] +\setuplabeltext[es][zip=C.P.] +\setuplabeltext[es][place=Población] +\setuplabeltext[es][country=País] +\setuplabeltext[es][phone=Tel.] +\setuplabeltext[es][mail=Correo-e] +\setuplabeltext[es][notes=Observaciones] +\setuplabeltext[es][todo=Pendiente] +\setuplabeltext[es][found={Por favor\textcomma\ devuélvalo a:}] + +\setuplabeltext[es][nyd=Año Nuevo] +\setuplabeltext[es][epi={Reyes Magos}] +\setuplabeltext[es][ashw={Miércoles de Ceniza}] +\setuplabeltext[es][palms={Domingo de Palmas}] +\setuplabeltext[es][gfri={Viernes santo}] +\setuplabeltext[es][esun=Domingo de Pascua] +\setuplabeltext[es][esmo={Lunes de Pascua}] +\setuplabeltext[es][ascd=Ascensión] +\setuplabeltext[es][pcst=Pentecostes] +\setuplabeltext[es][pcstmo={Lunes de Pentecostes}] +\setuplabeltext[es][xmas=Navidad] +\setuplabeltext[es][bxd={San Esteban}] +\setuplabeltext[es][day=Día] +\setuplabeltext[es][mon=Lu] +\setuplabeltext[es][tue=Ma] +\setuplabeltext[es][wed=Mi] +\setuplabeltext[es][thu=Ju] +\setuplabeltext[es][fri=Vi] +\setuplabeltext[es][sat=Sá] +\setuplabeltext[es][sun=Do] + +\setuplabeltext[es][january=Enero] +\setuplabeltext[es][february=Febrero] +\setuplabeltext[es][march=Marzo] +\setuplabeltext[es][april=Abril] +\setuplabeltext[es][may=Mayo] +\setuplabeltext[es][june=Junio] +\setuplabeltext[es][july=Julio] +\setuplabeltext[es][august=Agosto] +\setuplabeltext[es][september=Septiembre] +\setuplabeltext[es][october=Octubre] +\setuplabeltext[es][november=Noviembre] +\setuplabeltext[es][december=Diciembre] + +\setuplabeltext[es][moondays=Días lunares] +\setuplabeltext[es][moon=Luna] +\setuplabeltext[es][sunrise=Alba] +\setuplabeltext[es][sunset=Ocaso] +\setuplabeltext[es][lighthours={Horas de luz}] +\setuplabeltext[es][sunstar=Sol] + +%D Polish interface +\setuplabeltext[pl][calendar=Kalendarz] +\setuplabeltext[pl][weekagenda={Kalendarz tygodniowy}] +\setuplabeltext[pl][week=Tydzień] +\setuplabeltext[pl][month=Miesiąc] +\setuplabeltext[pl][contact=Kontakt] +\setuplabeltext[pl][name=Nazwisko] +\setuplabeltext[pl][address=Adres] +\setuplabeltext[pl][zip=Kod pocztowy] +\setuplabeltext[pl][place=Miejsce zamieszkania] +\setuplabeltext[pl][country=Kraj] +\setuplabeltext[pl][phone=Telefon] +\setuplabeltext[pl][mail=e-mail] +\setuplabeltext[pl][notes=Notatki] +\setuplabeltext[pl][todo=Do zrobienia] +\setuplabeltext[pl][found={W przypadku znalezienia proszę o odesłanie na adres}] + +\setuplabeltext[pl][nyd={Nowy Rok}] +\setuplabeltext[pl][epi={Trzech Króli}] +\setuplabeltext[pl][ashw={Środa Popielcowa}] +\setuplabeltext[pl][palms={Niedziela Palmowa} ] +\setuplabeltext[pl][gfri={Wielki Piątek} ] +\setuplabeltext[pl][esun={Niedziela Wielkanocna}] +\setuplabeltext[pl][esmo={Pn. Wielkanocny}] +\setuplabeltext[pl][ascd={Wniebowstąpienie}] +\setuplabeltext[pl][pcst={Zesłanie Ducha Świętego}] +\setuplabeltext[pl][pcstmo={}] +\setuplabeltext[pl][xmas=Święta] %Święta Bożego Narodzenia . +\setuplabeltext[pl][bxd={Drugi dzień świąt}] +\setuplabeltext[pl][day=Dzień] +\setuplabeltext[pl][mon=Pn.] +\setuplabeltext[pl][tue=Wt.] +\setuplabeltext[pl][wed=Śr.] +\setuplabeltext[pl][thu=Czw.] +\setuplabeltext[pl][fri=Pt.] +\setuplabeltext[pl][sat=Sob.] +\setuplabeltext[pl][sun=Ndz.] + +\setuplabeltext[pl][january=Styczeń] +\setuplabeltext[pl][february=Luty] +\setuplabeltext[pl][march=Marzec] +\setuplabeltext[pl][april=Kwiecień] +\setuplabeltext[pl][may=Maj] +\setuplabeltext[pl][june=Czerwiec] +\setuplabeltext[pl][july=Lipiec] +\setuplabeltext[pl][august=Sierpień] +\setuplabeltext[pl][september=Wrzesień] +\setuplabeltext[pl][october=Październik] +\setuplabeltext[pl][november=Listopad] +\setuplabeltext[pl][december=Grudzień] + +\setuplabeltext[pl][moondays=Dzień lunarny] +\setuplabeltext[pl][moon=Księżyc] +\setuplabeltext[pl][sunrise={Wschód słońca}] +\setuplabeltext[pl][sunset={Zachód słońca}] +\setuplabeltext[pl][lighthours=Długość dnia] +\setuplabeltext[pl][sunstar=Słońce] + +%D \startsubject[title={PocketDiary layout}] +%D +%D This module uses different page templates, whereof one uses a symbol +%D out of the set 2 of the Martin Vogel collection. So we load these symbols: + +\usesymbols[mvs] +\setupsymbolset[martinvogel 2] + +%D The placement of the page numbers is switched off for the moment. + +\setuppagenumbering[location=] + +%D Because we will place 8 pages on an A4 landscape, we define our own pagesize + +\definepapersize[Arrangingformat][width=7.42cm, height=10.5cm] +\setuppapersize[Arrangingformat][A4,landscape] + +%D In the templates a light gray color for (grid)lines is used. Separator +%D lines can have +%D an individual color too. We define the two colors with arbitrary values. +%D These preset colors can be adjusted in the user file \type{PocketDiary.tex}. + +\definecolor[Grid][s=.75] +\definecolor[Separatorline][blue] + +%D The page of the PocketDiary has a fairly simple layout. We use a +%D header- and a footer-space. +%D The header has a rule beneath and the footer one on top. +%D +%D The preset body-font is Pagella at 10pt +%D +%D We will also use tabular figures throughout the typesetting: +%D \stopsubject + +\setuplayout + [topspace=.6cm, + backspace=.6cm, + header=3\bodyfontsize, + headerdistance=.5\bodyfontsize, + footer=1.2\bodyfontsize, + footerdistance=.5\bodyfontsize, + margin=0pt, + height=middle, + width=middle] + +\setupbackgrounds + [header] + [text] + [state=repeat, + frame=off, + bottomframe=on, + framecolor=\getvariable{PocketDiaryColors}{Separatorline}] + +\setupbackgrounds + [footer] + [text] + [state=repeat, + frame=off, + topframe=on, + framecolor=\getvariable{PocketDiaryColors}{Separatorline}] + +\setupbodyfont[pagella,rm,10pt] +\definefontfeature[f:tabular] [tnum=yes] +\definefontfeature[f:smallcaps][smcp=yes] + +\addfeature[f:tabular] + +%D \startsubject[title={\METAFUN\ drawings}] +%D +%D There are three templates which are made up in \METAPOST. The drawings are +%D used as backgrounds to the typesetting area in the form of an overlay. So the +%D drawings adapt themselves to the actual dimensions +%D \stopsubject + +\startuniqueMPgraphic{Caro} + numeric w; w:= floor(OverlayWidth/4mm); + numeric h; h:= floor((OverlayHeight)/4mm); + path p,q; + p := unitsquare xscaled (4mm*w) yscaled (4mm*h); + q:= ulcorner p -- llcorner p; + for i = 0 upto w : + draw q shifted (i*4mm,0) withpen pencircle scaled .5pt + withcolor \MPcolor{Grid}; + endfor; + q:= llcorner p -- lrcorner p; + for i = 0 upto h : + draw q shifted (0,i*4mm) withpen pencircle scaled .5pt + withcolor \MPcolor{Grid}; + endfor; +\stopuniqueMPgraphic + +\startuniqueMPgraphic{Lines} + numeric w; w:= OverlaytWidth; + numeric h; h:= floor(OverlayHeight/7mm); + path p,q; + p := unitsquare xscaled OverlayWidth yscaled (7mm*(h-1)); + q:= llcorner p -- lrcorner p; + for i = 1 upto (h-1) : + draw q shifted (0,i*7mm) withpen pencircle scaled .5pt + withcolor \MPcolor{Grid}; + endfor; +\stopuniqueMPgraphic + +\startuniqueMPgraphic{Todo} + numeric w; w:= OverlayWidth; + numeric h; h:= floor(OverlayHeight/8mm); + path p,q; + p := unitsquare xscaled OverlayWidth yscaled OverlayHeight; + q:= llcorner p -- lrcorner p; + for i = 0 upto h : + draw q shifted (0,i*7mm) withpen pencircle scaled .5pt + withcolor \MPcolor{Grid}; + label.top(textext("\tfd \symbol[HollowBox]"), point 0 of q + shifted (2mm,i*7mm)); + endfor; +\stopuniqueMPgraphic + +%D \startsubject[title={The moon phase}] +%D +%D The moon phase calculation from SubsySTEMs, an American education institute, +%D for this module is based on a simple calculation. +%D The consequence is, that the results give a good idea only of the moon phase +%D but this is most probably precise enough for the purpose of the diary. +%D The return value of the moon phase calculation can be either a number, +%D representing the day number in the lunar month, or a command to put a +%D \METAFUN -graphic (New moon, growing moon, full moon, waning moon). +%D These little graphics are stored in the file \type{moons-MP.tex}. + +\input moons-MP + +%D In this file 4 overlays are defined which are used in a dedicated +%D \type{\framed[]{}} to typeset the pictograms. +%D +%M \input ./Moonphase/moons-MP +%M \defineoverlay[waningmoon][\useMPgraphic{Moon::Waning_moon}] +%M \defineoverlay[growingmoon][\useMPgraphic{Moon::Growing_moon}] +%M \defineoverlay[newmoon][\useMPgraphic{Moon::Newmoon}] +%M \defineoverlay[fullmoon][\useMPgraphic{Moon::Fullmoon}] +%M \defineframed +%M [Moon] +%M [height=1.5\bodyfontsize, +%M width=1.5\bodyfontsize, +%M frame=off] +%D +%D \starttabulate[|l|r|l|] +%D \NC \bf Moon phase +%D \NC \bf Lunar day +%D \NC \bf Macro +%D \NC \bf Pictogram \NC\NR +%D \NC New moon +%D \NC 0 +%D \NC \type{\Moon[background=newmoon]{}} +%D \NC \Moon[background=newmoon]{} \NC\NR +%D \NC Growing moon +%D \NC 7 +%D \NC \type{\Moon[background=growingmoon]{}} +%D \NC \Moon[background=growingmoon]{} \NC\NR +%D \NC Full moon +%D \NC 15 +%D \NC \type{\Moon[background=fullmoon]{}} +%D \NC \Moon[background=fullmoon]{} \NC\NR +%D \NC Waning moon +%D \NC 22 +%D \NC \type{\Moon[background=waningmoon]{}} +%D \NC \Moon[background=waningmoon]{} \NC\NR +%D \stoptabulate +%D \stopsubject + +%D \startsubject[title=Sun pictograms] +%D +%D The calculations for the sun rise and sun set times is based on work of +%D Alexander Yakushev. The results of his calculations nicely correspond with +%D results obtained from the Open Weather Map website. +%D +%D For sunrise, sunset and light hours exist three \METAFUN\ drawings. +%D These are included in the directory \type{Solar} in the file +%D \type{sun-MP.tex}. + +\input sun-MP + +%D In this file 3 overlays are defined which can then be used as a +%D background in a dedicated framed environment. +%M \input ./solar/sun-MP +%M \defineoverlay[Sunrise][\useMPgraphic{Sun::Sunrise}] +%M \defineoverlay[Sunset][\useMPgraphic{Sun::Sunset}] +%M \defineoverlay[Light][\useMPgraphic{Sun::Light}] +%M \defineframed +%M [SunA] +%M [strut=yes, +%M height=\lineheight, +%M width=\emwidth, +%M frame=off, +%M offset=0pt] +%M +%M \defineframed +%M [SunB] +%M [strut=yes, +%M height=\lineheight, +%M width=\emwidth, +%M frame=off, +%M offset=0pt, +%M location=depth] +%D +%D \starttabulate[|l|l|l|] +%D \NC \bf Sun +%D \NC \bf Macro +%D \NC \bf Pictogram \NC\NR +%D \NC Sunrise +%D \NC \type{\SunA[background=Sunrise,height=8pt]{\strut}} +%D \NC \SunA[background=Sunrise,height=8pt]{\strut} \NC\NR +%D \NC Sunset +%D \NC \type{\SunA[background=Sunset,height=8pt]{\strut}} +%D \NC \SunA[background=Sunset,height=8pt]{\strut} \NC\NR +%D \NC Light hours +%D \NC \type{\SunB[background=Light,height=8pt]{\strut}} +%D \NC \SunB[background=Light,height=8pt]{\strut} \NC\NR +%D \stoptabulate +%D \stopsubject + +%D \startsubject[title={The variable sets}] +%D +%D The module uses six sets of variables. The first set contains +%D the information on the +%D calendars to be calculated. + +%D First of all it has to be stated, that the whole idea behind +%D this module is to prepare a personal organizer with as few +%D parameters as possible. After the initial setup of the variables +%D it is sufficient to adapt the values in the first set and once +%D every year the information on the dates of the Day Light Saving +%D Time in the last set must be adjusted. +%D +%D \startsubsubject[title={Variable set \bf PocketDiary}] +%D +%D \starttabulate[|l|l|p|] +%D \NC \bf Variable \NC \bf Value \NC \bf Comment \NC\NR +%D \NC WeekDay \NC number \NC Values between 1 and 7. \NC\NR +%D \NC Week \NC number \NC Values between 1 and 53 \NC\NR +%D \NC Month \NC number \NC Values between 1 and 12 \NC\NR +%D \NC Year \NC number \NC Year numbers in the range 1900 and 4099. +%D The lower limit is computer dependent (OS-timestamp), the upper limit +%D is depending on the Easter Sunday calculation.\crlf +%D (http://www.assa.org.au/edm.html, R.W. Mallen, 1985).\NC\NR +%D \NC Nextyear \NC yes/no \NC The testing is done on \quote{yes}. If set +%D to \quote{yes} the next year instead of the current year is used for +%D the calculation of the year calendar. \NC\NR +%D \NC Daybyday \NC yes/no \NC The testing is done on \quote{yes}. If this +%D variable is set to \quote{yes} then a diary is typeset with 1 page per +%D day and the weekend is typeset with Saturday and Sunday on one page. +%D This uses 6 pages and we can freely choose what should be typeset on +%D the pages 7 and 8. \NC\NR +%D \stoptabulate +%D \stopsubsubject + +\setvariables + [PocketDiary] + [WeekDay=1, + Week=17, + Month=5, + Year=2011, + Nextyear=no, + Daybyday=no] + +%D \startsubsubject[title={Variable set \bf PocketDiaryLayout}] +%D +%D The PocketDiary can be given a layout according to your own ideas. +%D There are 8 variables (Page1 up to Page +%D 8) which can be given different values. +%D +%D \starttabulate[|l|p|] +%D \NC \bf Variable \NC \bf Comment \NC\NR +%D \NC Dayplan \NC The weekday indicated in the variable \quote{WeekDay} +%D in the previous section is used to make a PocketDiary page. \NC\NR +%D \NC Weekendplan \NC The weekend of the chosen week (variable \quote{Week}) +%D is typeset on a single page \NC\NR +%D \NC Weekcurrentplan \NC A week calendar based on the variable +%D \quote{Week} +%D in the previous section is used for the presentation of a week table. +%D \NC\NR +%D \NC Weeknextplan \NC A week calendar based on the variable \quote{Week} +%D $+$ 1 in the previous section is used for the presentation of the nexts +%D week's table. \NC\NR +%D \NC Monthcurrentplan \NC A month table based on the value in the variable +%D \quote{Month} in the previous section is typeset. \NC\NR +%D \NC Monthnextplan \NC A month table of the next month based on the +%D value +%D in the variable \quote{Month} of the previous section is typeset. +%D \NC\NR +%D \NC Yearcurrentplan \NC A complete year calendar of the year given in the +%D variable \quote{Year} in the previous section is typeset. \NC\NR +%D \NC Yearnextplan \NC If the \quote{Nextyear} +%D variable in the previous section is \quote{yes}, then a complete year +%D calendar for the next year indicated in the +%D variable \quote{Year} of the previous section is typeset. \NC\NR +%D \NC Lost-Returnto \NC A page with the indicated information in the +%D PocketDiaryAddress variable set is used to compose and typeset +%D a lost and return page (see next section). \NC\NR +%D \NC Blank \NC This page carries a header and a footer but is +%D empty for the rest. \NC\NR +%D \NC Todo \NC A todo-list template is typeset. \NC\NR +%D \NC Caro \NC A page with full-grid-paper is typeset. \NC\NR +%D \NC Lines \NC A page with grid lines is typeset. \NC\NR +%D \NC Contact \NC A form with two sets of preprinted fields +%D for marking down contact information is typeset. \NC\NR +%D \stoptabulate +%D +%D A basic setup could look as follows: + +\setvariables + [PocketDiaryLayout] + [Page1=Lost-Returnto, + Page2=Weekplan, + Page3=Dayplan, + Page4=Monthcurrentplan, + Page5=Blank, + Page6=Lines, + Page7=Caro, + Page8=Contact] + +%D \stopsubsubject +%D +%D \startsubsubject[title={Variable set \bf PocketDiaryAddress}] +%D +%D The third section of variables contains information used for the footer +%D and the lost-return form. +%D \stopsubsubject + +\setvariables + [PocketDiaryAddress] + [Familyname=Egger, + Forename=Willi, + Street={Townstreet 3B}, + Zipcode=5000, + City={New Beach}, + Country=TEX-world, + Phone={+22 444 55 88 66}, + Mobile={+22 6 19 19 1717}, + E-mail={info at pocketdiary.org}, + Web=www.pocketdiary.org] + +%D \startsubsubject[title={Variable set \bf PocketDiaryColors}] +%D +%D The PocketDiary uses some color. The header and footer separator lines can +%D be given a color. Standard color is blue. +%D +%D For those who want gridlines other than light gray can set a +%D color for the gridlines too. +%D \stopsubsubject + +\setvariables + [PocketDiaryColors] + [Separatorline=blue, + Gridline={s=.55}] + +%D \startsubsubject[title={Variable set \bf PocketDiaryFooter}] +%D +%D The footer is filled with three fields. These fields may contain the contents +%D of variables or \TEX\ commands. The setup of the footer is done with a buffer +%D in order to be able to call it later on. +%D \stopsubsubject +%D \stopsubject +%D +%D \startsubject[title={Footer setup}] +%D \stopsubject + +\setvariables + [PocketDiaryFooter] + [Lefttext=PocketDiary, + Centertext=\pagenumber, + Righttext={\getvariable{PocketDiaryAddress}{Forename},~\currentdate[year]}] %{\currentdate[year]} + +\startbuffer[Footertext] + \setupfootertexts[% + \tfx + \getvariable{PocketDiaryFooter}{Lefttext} + \hfill + \getvariable{PocketDiaryFooter}{Centertext} + \hfill + \getvariable{PocketDiaryFooter}{Righttext}] +\stopbuffer + +\getbuffer[Footertext] + +%D \startsubject[title={Variable set \bf PocketDiaryGeoPosition}] +%D +%D For the sun data calculations you need to know the latitude and longitude of +%D your location. +%D +%D For correct calculations you need also to pass the timezone offset to Lua. +%D +%D The dates for the begin and end of the day light saving time (DST) +%D are calculated based on the continent information. Possible values are +%D \quote{EU} and \quote{US}. If the field is empty, then no DST is calculated. +%D +%D For the US (except for Arizona and Hawaii) currently the DST starts on the +%D second Sunday of March and ends on the first Sunday of November. +%D +%D for Europe currently the DST starts on the last Sunday of March and ends on +%D the last Sunday of October. +%D +%D Sun data are typeset on the \quote{Dayplan} and \quote{Weekendplan} as well +%D as on Tuesdays in the week-calendar. +%D \stopsubject + +\setvariables %Koziegłowy + [PocketDiaryGeoPosition] + [lat=52.467860, + lon=16.981240, + timeoffset=1, + continent=EU] + +%D \startsubject[title={The various calendar pages}] +%D +%D Most of the activities for creating the contents and layout of the +%D different pages like day, weekend, week, month and year calendars +%D is delegated to Lua. Those pages are made-up as +%D \CONTEXT -Lua-documents (cld). +%D We preload the Lua -file with + +\ctxloadluafile{t-pocketdiary}{} + +%D \startsubsubject[title={Day plan}] +%D +%D \startplacefigure +%D [location={middle,here}, +%D reference=fig:Singleday, +%D title={Example Day-calendar}] +%D {\externalfigure[docu-figures][page=1,width=.4\textwidth,frame=on]} +%D \stopplacefigure +%D +%D The day calendar looks as in \in{figure}[fig:Singleday]. +%D +%D Next to the day number of the selected month the day name is given. If the +%D day is a christian feast day, its name is following after the day name. +%D To the right the week number and the year is typeset. +%D +%D The configuration of the page looks as follows: + +\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,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 +\stopsetups + +\startsetups table:topweekplan + \setupTABLE[each][each][frame=off] + \setupTABLE[r][1][offset=0pt,loffset=3pt,roffset=3pt,align=lohi] % Date row + \setupTABLE[c][1][style=bold,width=0.5\textwidth,align=lohi] % Name + \setupTABLE[c][2][style={\switchtobodyfont[6pt]},width=0.5\textwidth, + align={flushright,lohi}] % Week, year +\stopsetups + +%D For the creation of the page a command with 8 parameters is defined: + +\define[8]\Dayplan{\ctxlua{thirddata.diary.dayplan(#1,#2,#3,#4,#5,#6,#7,#8)}} + +%D The Dayplan-command with the collected parameters is placed in a buffer. This buffer is later called from the user-file \type{PocketDiary.tex} . + +\startbuffer[Dayplan] + \Dayplan %Weekday,Week,Month,Year,lat,lon,timeoffset,continent + {\getvariable{PocketDiary}{WeekDay}} + {\getvariable{PocketDiary}{Week}} + {\getvariable{PocketDiary}{Month}} + {\getvariable{PocketDiary}{Year}} + {\getvariable{PocketDiaryGeoPosition}{lat}} + {\getvariable{PocketDiaryGeoPosition}{lon}} + {\getvariable{PocketDiaryGeoPosition}{timeoffset}} + {"\getvariable{PocketDiaryGeoPosition}{continent}"} +\stopbuffer + +%D \stopsubsubject + +%D \startsubsubject[title={Weekend}] +%D +%D The weekend calendar shows Saturday and Sunday on one page +%D (see \in{figure}[fig:Weekend]). +%D +%D The typeset data are identical to those of the \quote{Dayplan} +%D +%D \startplacefigure +%D [location={middle,here}, +%D reference=fig:Weekend, +%D title={Example Weekend-calendar}] +%D {\externalfigure[docu-figures][page=2,width=.4\textwidth,frame=on]} +%D \stopplacefigure + +%D Comparable to the Dayplan the Weekendplan command is defined with 8 parameters. + +\define[8]\Weekendplan{\ctxlua{thirddata.diary.weekendplan(#1,#2,#3,#4,#5,#6,#7,#8)}} + +%D Again this command with the collected information of the 8 parameters is placed in a buffer which is called then from the user-file \type{PocketDiary.tex} . + +\startbuffer[Weekendplan] + \Weekendplan %Weekday,Week,Month,Year,lat,lon,timeoffset,continent + {6} + {\getvariable{PocketDiary}{Week}} + {\getvariable{PocketDiary}{Month}} + {\getvariable{PocketDiary}{Year}} + {\getvariable{PocketDiaryGeoPosition}{lat}} + {\getvariable{PocketDiaryGeoPosition}{lon}} + {\getvariable{PocketDiaryGeoPosition}{timeoffset}} + {"\getvariable{PocketDiaryGeoPosition}{continent}"} +\stopbuffer + +%D \stopsubsubject + +%D \startsubsubject[title={Week plan and next week plan}] +%D +%D The week calendar is a one-column table for working days. +%D Saturday and Sunday are placed next to each other in the last table row. An +%D example is given +%D in \in{figure}[fig:Week]. +%D +%D In the \quote{Weekplan} header appears \quote{Weeek agenda} or its +%D correspondent name in the supported languages. To the right the month's +%D number, weeknumber and year are typeset. + +%D \startplacefigure +%D [location={middle,here}, +%D reference=fig:Week, +%D title={Example Week-calendar}] +%D {\externalfigure[docu-figures][page=3,width=.4\textwidth,frame=on]} +%D \stopplacefigure +%D By means of a setups-sequence the table is defined as follows: + +\startsetups table:week + \setupTABLE[r][each][height=.158\textheight,align=flushleft] %.165 + \setupTABLE[r][even][background=color,backgroundcolor=.5s] + \setupTABLE[c][1][width=.5\textwidth] + \setupTABLE[c][2][width=.5\textwidth] +\stopsetups + +%D Again the Weekcurrentplan-command is defined with 8 parameters + +\define[8]\Weekcurrentplan{\ctxlua{thirddata.diary.weekplan(#1,#2,#3,#4,#5,#6,#7,#8)}} + +%D And the command together with the gathered parameters is stored in a buffer, which will be used by the user-file \type{PocketDiary.tex} . + +\startbuffer[Weekcurrentplan] + \Weekcurrentplan %Weekday,Week,Month,Year,lat,lon,timeoffset,continent + {1} + {\getvariable{PocketDiary}{Week}} + {\getvariable{PocketDiary}{Month}} + {\getvariable{PocketDiary}{Year}} + {\getvariable{PocketDiaryGeoPosition}{lat}} + {\getvariable{PocketDiaryGeoPosition}{lon}} + {\getvariable{PocketDiaryGeoPosition}{timeoffset}} + {"\getvariable{PocketDiaryGeoPosition}{continent}"} + \page[yes] +\stopbuffer + +%D Similar to the week plan the next week plan is built. + +\define[8]\Weeknextplan{\ctxlua{thirddata.diary.weekplan(#1,#2,#3,#4,#5,#6,#7,#8)}} + +\startbuffer[Weeknextplan] + \Weeknextplan %Weekday,Week,Month,Year,lat,lon,timeoffset,dst_start,dst_stop + {1} + {\directlua{tex.print{\getvariable{PocketDiary}{Week}+1}}} + {\getvariable{PocketDiary}{Month}} + {\getvariable{PocketDiary}{Year}} + {\getvariable{PocketDiaryGeoPosition}{lat}} + {\getvariable{PocketDiaryGeoPosition}{lon}} + {\getvariable{PocketDiaryGeoPosition}{timeoffset}} + {"\getvariable{PocketDiaryGeoPosition}{continent}"} + \page[yes] +\stopbuffer + +%D \stopsubsubject + +%D \startsubsubject[title={Month current and month next}] +%D +%D The month calendar looks as in \in{figure}[fig:Month]. +%D +%D Left in the header appears the month name in the chosen language. To the +%D right the year is typeset. +%D +%D \startplacefigure +%D [location={middle,here}, +%D reference=fig:Month, +%D title={Example Month-calendar}] +%D {\externalfigure[docu-figures][page=4,width=.4\textwidth,frame=on]} +%D \stopplacefigure +%D In the same fashion as the previous items also the month and +%D next month calendars are defined respectively setup: + +\startsetups table:month + \setupTABLE[column][each][width=.143\textwidth,align=flushright,offset=3pt] + \setupTABLE[column][7][style=\red] +\stopsetups + +%D For the Month-calendars we need only two parameters: month and year. + +\define[2]\Monthcurrentplan{\ctxlua{thirddata.diary.monthcurrentplan(#1,#2)}} + +%D The command is kept together with the gathered parameters in a buffer again. +%D This will be called from the user-file \type{PocketDiary.tex} . + +\startbuffer[Monthcurrentplan] + \Monthcurrentplan + {\getvariable{PocketDiary}{Month}} + {\getvariable{PocketDiary}{Year}} +\stopbuffer + +\define[2]\Monthnextplan{\ctxlua{thirddata.diary.monthnextplan(#1,#2)}} + +\startbuffer[Monthnextplan] + \Monthnextplan + {\getvariable{PocketDiary}{Month}} + {\getvariable{PocketDiary}{Year}} +\stopbuffer + +%D \stopsubsubject + + +%D \startsubsubject[title={Year current and year next}] +%D +%D The year calendar looks as in \in{figure}[fig:Year]. +%D +%D In the header the year only is typeset. +%D +%D \startplacefigure +%D [location=middle, +%D reference=fig:Year, +%D title={Example Year-calendar}] +%D {\externalfigure[docu-figures][page=5,width=.4\textwidth,frame=on]} +%D \stopplacefigure +%D The year table(s) are prepared as the week tables with a table-setup +%D sequence, a custom command which resides with the parameters assigned in a +%D buffer, which will again be called from the user-file \type{PocketDiary.tex} + +\startsetups table:year + \setupTABLE[column] + [each] + [width=.032\textwidth,align=flushright,offset=1pt,frame=off] + \setupTABLE[column][1][width=.052\textwidth,align=flushleft] + \setupTABLE[row][each][offset=1pt,height=1.5\bodyfontsize] +\stopsetups + +\define[2]\Yearcurrentplan{\ctxlua{thirddata.diary.yearplan(#1,#2)}} +\define[2]\Yearnextplan{\ctxlua{thirddata.diary.yearplan(#1,#2)}} + +\startbuffer[Yearcurrentplan] + \Yearcurrentplan + {\getvariable{PocketDiary}{Year}} + {"no"} +\stopbuffer + +\startbuffer[Yearnextplan] + \Yearnextplan + {\getvariable{PocketDiary}{Year}} + {"\getvariable{PocketDiary}{Nextyear}"} +\stopbuffer + +%D \stopsubsubject + +%D \startsubsubject[title= {One week\dots}] +%D +%D As mentioned before, the result will be 5 pages with one working day per +%D page and the weekend on one page i.e. 6 pages. For the pages 7 and 8 the +%D values defined in the \quote{PocketDiaryLayout} variable set is used. +%D As for the Dayplan we need a command carrying 8 parameters: + +\define[8]\Daybyday{\ctxlua{thirddata.diary.daybydayplan(#1,#2,#3,#4,#5,#6,#7,#8)}} + +%D A buffer contains the command just defined with the gathered information for the parameters. The buffer then is called from the user-file \type{PocketDiary.tex} . + +\startbuffer[Daybyday] + \Daybyday + {1} %Weekday + {\getvariable{PocketDiary}{Week}} + {\getvariable{PocketDiary}{Month}} + {\getvariable{PocketDiary}{Year}} + {\getvariable{PocketDiaryGeoPosition}{lat}} + {\getvariable{PocketDiaryGeoPosition}{lon}} + {\getvariable{PocketDiaryGeoPosition}{timeoffset}} + {"\getvariable{PocketDiaryGeoPosition}{continent}"} +\stopbuffer + +%D \stopsubsubject + +%D \startsubsubject[title={Templates}] +%D +%D The PocketDiary comes with a couple of templates for writing down +%D information: + +%D For the pages with (grid)lines we use an overlay in the background of +%D the text area which will contain the \METAPOST -graphic. +%D +%D \startplacefigure +%D [location={middle,here}, +%D title={The set of available templates}] +%D {\startcombination[3*2] +%D {\externalfigure +%D [docu-figures] +%D [page=6,width=.25\textwidth,frame=on]}{The blank page} +%D {\externalfigure +%D [docu-figures] +%D [page=7,width=.25\textwidth,frame=on]}{Caro paper} +%D {\externalfigure +%D [docu-figures] +%D [page=8,width=.25\textwidth,frame=on]}{Lines} +%D {\externalfigure +%D [docu-figures] +%D [page=9,width=.25\textwidth,frame=on]}{Todo} +%D {\externalfigure +%D [docu-figures] +%D [page=10,width=.25\textwidth,frame=on]}{Contact information} +%D {\externalfigure +%D [docu-figures] +%D [page=11,width=.25\textwidth,frame=on]}{Lost-return-to information} +%D \stopcombination} +%D \stopplacefigure +%D \stopsubsubject +%D The setups for the Contacts page look as follows: + +\startsetups table:contacts + \setupTABLE[r][each][frame=off,bottomframe=on,height=2\lineheight] + \setupTABLE[c][1][width=.3\textwidth] + \setupTABLE[c][2][width=.5\textwidth] + \setupTABLE[c][3][width=.2\textwidth] +\stopsetups + +%D The setups for the Lost-Returnto page is setup in the following way: + +\startsetups table:returnto + \setupTABLE[r][each][frame=off] + \setupTABLE[c][each][width=\textwidth] +\stopsetups + +%D Another setups covers the reset of the used Background + +\startsetups Background:stop + \defineoverlay + [Textarea] + [\resetMPdrawing] + \setupbackgrounds[text][text][background=] +\stopsetups + +%D All templates for these pages are contained in buffers in order to call them from the user-file \type{PocketDiary.tex} + +\startbuffer[Contact] + \setupheadertexts[{\bf \labeltext{contact}\hfill}] + \switchtobodyfont[6pt] + \dorecurse{2}{\bTABLE[setups=table:contacts] + \bTR + \bTD \labeltext{name}: \eTD + \bTD \eTD + \bTD \eTD + \eTR + \bTR + \bTD \labeltext{address}:\eTD + \bTD \eTD + \bTD \eTD + \eTR + \bTR + \bTD \strut\eTD + \bTD \eTD + \bTD \eTD + \eTR + \bTR + \bTD \labeltext{zip}:\eTD + \bTD \labeltext{place}:\eTD + \bTD \labeltext{country}:\eTD + \eTR + \bTR + \bTD \labeltext{phone}:\eTD + \bTD \eTD + \bTD \eTD + \eTR + \bTR + \bTD \labeltext{mail}:\eTD + \bTD \eTD + \bTD \eTD + \eTR + \eTABLE + \blank} + \page[yes] +\stopbuffer + +\startbuffer[Caro] + \setupheadertexts[{\bf \labeltext{notes}\hfill}] + \defineoverlay + [Textarea] + [\useMPgraphic{Caro}] + \setupbackgrounds[text][background=Textarea] + \strut + \page[yes] + \setups{Background:stop} +\stopbuffer + +\startbuffer[Lines] + \setupheadertexts[{\bf \labeltext{notes}\hfill}] + \defineoverlay + [Textarea] + [\useMPgraphic{Lines}] + \setupbackgrounds[text][text][background=Textarea] + \strut + \page[yes] + \setups{Background:stop} +\stopbuffer + +\startbuffer[Todo] + \defineoverlay + [Textarea] + [\useMPgraphic{Todo}] + \setupbackgrounds[text][text][background=Textarea] + \setupheadertexts[\bf \labeltext{todo}\hfill] + \strut + \page[yes] + \setups{Background:stop} +\stopbuffer + +\startbuffer[Blank] + \setupheadertexts[{\bf \labeltext{notes}\hfill}] + \strut + \page[yes] +\stopbuffer + +\startbuffer[Lost-Returnto] + \strut + \setupheadertexts[{\bf \labeltext{calendar}}] + \setupfooter[state=empty] + \setupbackgrounds[footer][text][topframe=off] + \setups{Background:stop} + \strut + \blank[2*line] + \framed[width=\textwidth, + frame=off, + bottomframe=on, + align=flushleft, + rulethickness=1pt, + foregroundcolor=\getvariable{PocketDiaryColors}{Separatorline}, + framecolor=\getvariable{PocketDiaryColors}{Separatorline}] + {\labeltext{found}} + \bTABLE[setups=table:returnto] + \bTR + \bTD \getvariable{PocketDiaryAddress}{Forename}~ + \getvariable{PocketDiaryAddress}{Familyname} \eTD + \eTR + \bTR + \bTD \getvariable{PocketDiaryAddress}{Street} \eTD + \eTR + \bTR + \bTD \getvariable{PocketDiaryAddress}{Zipcode} + {\addff{f:smallcaps}\getvariable{PocketDiaryAddress}{City}}\eTD + \eTR + \bTR + \bTD Tel: \getvariable{PocketDiaryAddress}{Phone}\eTD + \eTR + \bTR + \bTD Mob: \getvariable{PocketDiaryAddress}{Mobile}\eTD + \eTR + \bTR + \bTD E-mail: \getvariable{PocketDiaryAddress}{E-mail} \eTD + \eTR + \bTR + \bTD Web: \getvariable{PocketDiaryAddress}{Web} \eTD + \eTR + \eTABLE + \page[yes] + \getbuffer[Footertext] + \setupbackgrounds[footer][text][topframe=on] +\stopbuffer + +%D \stopsubject +%D +%D \startsubject[title={The setup of the PocketDiary}] +%D +%D When filling the 8 pages we can do two things. Either we let \CONTEXT\ +%D typeset the pages as we choose them in the section \quote{PocketDiaryLayout} +%D or we set the variable \quote{Daybyday} in the variable set +%D \quote{PocketDiary} to \quote{yes}. This leads to the typesetting of 5 pages +%D with each a working day and the weekend on one page. The remaining two pages +%D are typeset according to the values given in \quote{PocketDiaryLayout.} + +\startbuffer[Pocketdiary] + \definecolor[Grid][\getvariable{PocketDiaryColors}{Gridline}] + \definecolor[Separatorline][\getvariable{PocketDiaryColors}{Separatorline}] + + \doifelse{\getvariable{PocketDiary}{Daybyday}}{yes} + {\Daybyday %creates 6 pages + {1} + {\getvariable{PocketDiary}{Week}} + {\getvariable{PocketDiary}{Month}} + {\getvariable{PocketDiary}{Year}} + {\getvariable{PocketDiaryGeoPosition}{lat}} + {\getvariable{PocketDiaryGeoPosition}{lon}} + {\getvariable{PocketDiaryGeoPosition}{timeoffset}} + {"\getvariable{PocketDiaryGeoPosition}{continent}"} + \getbuffer[\getvariable{PocketDiaryLayout}{Page7}] + \getbuffer[\getvariable{PocketDiaryLayout}{Page8}] + } + {\getbuffer[\getvariable{PocketDiaryLayout}{Page1}] + \getbuffer[\getvariable{PocketDiaryLayout}{Page2}] + \getbuffer[\getvariable{PocketDiaryLayout}{Page3}] + \getbuffer[\getvariable{PocketDiaryLayout}{Page4}] + \getbuffer[\getvariable{PocketDiaryLayout}{Page5}] + \getbuffer[\getvariable{PocketDiaryLayout}{Page6}] + \getbuffer[\getvariable{PocketDiaryLayout}{Page7}] + \getbuffer[\getvariable{PocketDiaryLayout}{Page8}] + } +\stopbuffer + +%D \stopsubject + +%D \startsubject[title={Arranging the pages}] +%D +%D For the arrangement of the 8 pages on the paper we need a +%D special arranging scheme, which is included in the distribution. +%D Invoking the scheme is performed with +%D +%D \type{\setuparranging[1*8]} +%D +%D The arrangement of the 8 pages is not switched on in this file. For the +%D purpose of experimenting it is better to keep this command in the user file +%D \type{\type{PocketDiary.tex} } +%D +%D \stopsubject + +%D \startsubject[title={How to fold the PocketDiary}] +%D +%D The eight printed pages are folded in such a way, that the PocketDiary +%D presents itself as a small booklet. +%D There are no empty pages visible. +%D +%D \startplacefigure +%D [location=middle, +%D reference=fig:schemeA, +%D title={The basic folding scheme}] +%D {\externalfigure[docu-figures][page=12,width=.6\textwidth]} +%D \stopplacefigure +%D +%D First make two mountain-folds as indicated with the straight lines in +%D \in{figure}[fig:schemeA]. +%D Unfold the paper and turn it face up and \unit{90 Degrees} to the left. +%D Make a valley-fold with the lower part +%D of the sheet on the previously made mountain-fold. Unfold and turn the +%D sheet \unit{180 Degrees}. +%D Make another valley-fold as described before. Unfold the sheet. +%D +%D Take a sharp knife and a ruler. Slit the paper open between Cuttingpoint A +%D and B (see \in{figure}[fig:schemeA]). +%D +%D Now we can fold the booklet. First fold the paper again in the length. Then +%D hold the double folded paper +%D with the mountain-fold up. Push from both sides towards the center in order +%D to get a form similar +%D to \in{figure}[fig:schemeB]. Fold then the upper double-page in direction B, +%D the lower double-page +%D in direction C and finally the lefthand double-sided page in direction D. +%D +%D \startplacefigure +%D [location=middle, +%D reference=fig:schemeB, +%D title={The basic folding scheme}] +%D {\externalfigure[docu-figures][page=13,width=.6\textwidth]} +%D \stopplacefigure +%D +%D Before creasing the booklet at the spine it is worthwhile to put the section +%D on table and adjust +%D folds where needed. Finally the spine is creased with preference with a +%D bone-folder. +%D \stopsubject + +\stopmodule \ No newline at end of file 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 deleted file mode 100644 index 0c84937223..0000000000 --- a/macros/context/contrib/context-pocketdiary/tex/context/third/pocketdiary/t-pocketdiary.tex +++ /dev/null @@ -1,1507 +0,0 @@ -%D \module -%D [ file=t-pocketdiary, -%D version=2023-04-15, -%D title=PocketDiary \CONTEXT\ User Module, -%D subtitle=PocketDiary, -%D author=Willi Egger, -%D date=\currentdate, -%D copyright=Willi Egger, -%D email=w.egger@boede.nl, -%D license=Public Domain] - -\startmodule[pocketdiary] - -\writestatus{loading}{ConTeXt User Module / PocketDiary} - -%D \startsubject[title={Introduction}] -%D -%D It is already some time ago, that my brother Heinz asked me to prepare him a -%D special page-arrangement scheme. -%D This scheme is suitable to form a section with a single-sided printed sheet -%D of paper. -%D He wanted to use it for special kind of greeting-cards. By coincidence I -%D detected an article by U. Ziegenhagen in de \TEX nische -%D Kommödie nr. 3/2010. This article deals with the preparation of a PocketMod, -%D which is a personal organizer -%D based on the mentioned arranging scheme. In the article there is also a -%D link mentioned to an online -%D version of the PocketMod. (http://www.pocketmod.com/). -%D -- After reading the article and visiting the web-site I got -%D intrigued by the fact, that \CONTEXT\ has built in arranging capabilities -%D and -%D due to the \LUATEX\ engine and herewith the possibility to perform -%D calculations in Lua it -%D should be possible to build such a personal organizer in \CONTEXT. -%D -%D The result is contained in this module. I would like to thank Hans Hagen -%D and Taco Hoekwater for the great -%D \LUATEX\ machinery and Wolfgang Schuster for supporting me in tackling -%D the multi-lingual interface. -%D -%D After the first version in 2011, we are now 11 years older, a lot -%D has changed in and around the \CONTEXT -%D -machinery. We are now using \LMTX\ (\LUAMETATEX ) the latest development. -%D -%D During the \CONTEXT -meeting 2021 Thomáš Hála presented his solution -%D for generating an agenda, while the shops were closed during the Covid-19 -%D pandemic. Discussing issues with calendars revealed, that it could be -%D interesting to integrate into a calendar also data concerning the moon -%D phase and possibly information on the sun rise and sun set time. -%D -%D I thought, that I would like to do such calculations and give it a try. -%D After having found information how to perform such astronomical -%D calculations, slowly two new modules appeared. The calculations of the -%D moon phases is quite straight forward and this can be considered the -%D easy part of the new development. The only remark must be made, that -%D those calculations are not super accurate. A deviation of about 1 day has -%D to be accepted. -%D -%D Finding a way to calculate the sun rise and sun set times is much more -%D tedious. Collecting articles on such calculations and building the -%D formulas in Lua is not the issue, but that the given information in those -%D articles looks -%D incomplete for a layman like me. -- Finally I found a Lua-module written for -%D an -%D application for presenting the required data on screen (the reference -%D to the authors is given in the Lua-file for the sun data calculations). -%D I adapted -%D this to Lua/\CONTEXT\ and it looks like it works fine. -- I have a Raspberry -%D Pi Nano with a screen attached where I display weather information together -%D with the sun data, which are fetched from the Open Weather Map -%D (https://openweathermap.org). Due to the fact that the development of the -%D solar data module took a long time I was able to compare the calculated -%D results with those displayed on the Raspberry Pi screen. Happily they are -%D completely congruent. -%D -%D \blank[big] -%D -%D Without the help of Hans Hagen, this module would not have been finished. I -%D would like to thank him for all the support and patience with my struggles! -%D \stopsubject - -%D \startsubject[title={Subpaths}] - -%D In order to keep the hole module clearly organized the moon phase -%D as well as the sun rise/set calculation files are situated in -%D separate folders. -%D We tell \CONTEXT\ where to find the requested files - -\usepath[{Moonphase,Solar}] - -%D \stopsubject - -%D \startsubject[title={Lua-files}] -%D All calculations for dates are performed with Lua functions. -%D The functions are contained in \type{t-calendar.lua} - -%\ctxloadluafile{t-calendar}{} -\ctxloadluafile{t-calendar}{} - -%D The calculations for the moon phase are done by Lua functions. -%D The functions are contained in \type{t-moonphase.lua} -%D in the folder \quotation{Moonphase} - -\ctxloadluafile{t-moonphase}{} - -%D The calculations for the sun rise and set time are calculated in Lua too. -%D The -%D functions are contained in the file \type{t-solar.lua} in the folder -%D \quotation{Solar} - -\ctxloadluafile{t-solar}{} -%D \stopsubject - -%D \startsubject[title={International interface}] -%D -%D The PocketDiary is aware of different languages. The language to be used is -%D selected with \type{\mainlanguage[en]}. The following interfaces -%D are available -%D -%D \startitemize[2,packed] -%D \item Englisch interface -%D \item Dutch interface -%D \item German interface -%D \item Italian interface -%D \item French interface -%D \item Spanish interface -%D \item Polish interface -%D \stopitemize -%D \stopsubject - -%D English interface -\setuplabeltext[en][calendar=Calendar] -\setuplabeltext[en][weekagenda=Week calendar] -\setuplabeltext[en][week=Week] -\setuplabeltext[en][month=Month] -\setuplabeltext[en][contact=Contact] -\setuplabeltext[en][name=Name] -\setuplabeltext[en][address=Address] -\setuplabeltext[en][zip=Zip] -\setuplabeltext[en][place=Place] -\setuplabeltext[en][country=Country] -\setuplabeltext[en][phone=Phone] -\setuplabeltext[en][mail=e-mail] -\setuplabeltext[en][notes=Notes] -\setuplabeltext[en][todo=Todo] -\setuplabeltext[en][found={If found\textcomma\ please return to:}] - -\setuplabeltext[en][nyd={New Year's Day}] -\setuplabeltext[en][epi={Epiphany}] -\setuplabeltext[en][ashw={Ash Wednesday}] -\setuplabeltext[en][palms={Palm Sunday} ] -\setuplabeltext[en][gfri={Good Friday} ] -\setuplabeltext[en][esun={Easter Sunday}] -\setuplabeltext[en][esmo={Easter Monday}] -\setuplabeltext[en][ascd={Ascension Day}] -\setuplabeltext[en][pcst=Pentecost] -\setuplabeltext[en][pcstmo={Pentecost Monday}] -\setuplabeltext[en][xmas=Christmas] -\setuplabeltext[en][bxd={Boxing Day}] -\setuplabeltext[en][day=Day] -\setuplabeltext[en][mon=Mon] -\setuplabeltext[en][tue=Tue] -\setuplabeltext[en][wed=Wed] -\setuplabeltext[en][thu=Thu] -\setuplabeltext[en][fri=Fri] -\setuplabeltext[en][sat=Sat] -\setuplabeltext[en][sun=Sun] - -\setuplabeltext[en][january=January] -\setuplabeltext[en][february=February] -\setuplabeltext[en][march=March] -\setuplabeltext[en][april=April] -\setuplabeltext[en][may=May] -\setuplabeltext[en][june=June] -\setuplabeltext[en][july=July] -\setuplabeltext[en][august=August] -\setuplabeltext[en][september=September] -\setuplabeltext[en][october=October] -\setuplabeltext[en][november=November] -\setuplabeltext[en][december=December] - -\setuplabeltext[en][moondays=Lunar days] -\setuplabeltext[en][moon=Moon] -\setuplabeltext[en][sunrise=Sunrise] -\setuplabeltext[en][sunset=Sunset] -\setuplabeltext[en][lighthours=Lighthours] -\setuplabeltext[en][sunstar=Sun] - -%D German interface -\setuplabeltext[de][calendar=Planer] % Terminkalender, Kalender -\setuplabeltext[de][weekagenda=Wochenagenda] -\setuplabeltext[de][week=Woche] -\setuplabeltext[de][month=Monat] -\setuplabeltext[de][contact=Kontakt] -\setuplabeltext[de][name=Name] -\setuplabeltext[de][address=Adresse] -\setuplabeltext[de][zip=Postleitzahl] -\setuplabeltext[de][place=Ort] -\setuplabeltext[de][country=Land] -\setuplabeltext[de][phone=Telefon] -\setuplabeltext[de][mail=e-Mail] -\setuplabeltext[de][notes=Notizen] -\setuplabeltext[de][todo={Zu erledigen}] -\setuplabeltext[de][found={Wenn gefunden\textcomma\ bitte retournieren an:}] - -\setuplabeltext[de][nyd=Neujahr] -\setuplabeltext[de][epi=Dreikönigstag] -\setuplabeltext[de][ashw=Aschermittwoch] -\setuplabeltext[de][palms=Palmsonntag] -\setuplabeltext[de][gfri=Karfreitag] -\setuplabeltext[de][esun=Ostern] -\setuplabeltext[de][esmo=Ostermontag] -\setuplabeltext[de][ascd=Himmelfahrt] -\setuplabeltext[de][pcst=Pfingsten] -\setuplabeltext[de][pcstmo=Pfingstmontag] -\setuplabeltext[de][xmas=Weihnachten] -\setuplabeltext[de][bxd=Stephanstag] -\setuplabeltext[de][day=Tag] -\setuplabeltext[de][mon=Mo] -\setuplabeltext[de][tue=Di] -\setuplabeltext[de][wed=Mi] -\setuplabeltext[de][thu=Do] -\setuplabeltext[de][fri=Fr] -\setuplabeltext[de][sat=Sa] -\setuplabeltext[de][sun=So] - -\setuplabeltext[de][january=Januar] -\setuplabeltext[de][february=Februar] -\setuplabeltext[de][march=März] -\setuplabeltext[de][april=April] -\setuplabeltext[de][may=Mai] -\setuplabeltext[de][june=Juni] -\setuplabeltext[de][july=Juli] -\setuplabeltext[de][august=August] -\setuplabeltext[de][september=September] -\setuplabeltext[de][october=Oktober] -\setuplabeltext[de][november=November] -\setuplabeltext[de][december=Dezember] - -\setuplabeltext[de][moondays=Mondtage] -\setuplabeltext[de][moon=Mond] -\setuplabeltext[de][sunrise=Sonnenaufgang] -\setuplabeltext[de][sunset=Sonnenuntergang] -\setuplabeltext[de][lighthours=Taglichtstunden] -\setuplabeltext[de][sunstar=Sonne] - -%D Dutch interface -\setuplabeltext[nl][calendar=Kalender] -\setuplabeltext[nl][weekagenda=Weekagenda] -\setuplabeltext[nl][week=Week] -\setuplabeltext[nl][month=Maand] -\setuplabeltext[nl][contact=Kontakt] -\setuplabeltext[nl][name=Naam] -\setuplabeltext[nl][address=Adres] -\setuplabeltext[nl][zip=Postcode] -\setuplabeltext[nl][place=Plaats] -\setuplabeltext[nl][country=Land] -\setuplabeltext[nl][phone=Tel.] -\setuplabeltext[nl][mail=e-mail] -\setuplabeltext[nl][notes=Notities] -\setuplabeltext[nl][todo=Todo] -\setuplabeltext[nl][found={Wanneer gevonden\textcomma\ aub sturen naar:}] - -\setuplabeltext[nl][nyd={Nieuw jaar}] -\setuplabeltext[nl][epi=Driekoningen] -\setuplabeltext[nl][ashw=Aswoensdag] -\setuplabeltext[nl][palms=Palmpasen] -\setuplabeltext[nl][gfri={Goede vrijdag}] -\setuplabeltext[nl][esun=Pasen] -\setuplabeltext[nl][esmo={2\high{de} Paasdag}] -\setuplabeltext[nl][ascd=Hemelvaart] -\setuplabeltext[nl][pcst=Pinksteren] -\setuplabeltext[nl][pcstmo={2\high{de} Pinksterdag}] -\setuplabeltext[nl][xmas=Kerst] -\setuplabeltext[nl][bxd={2\high{de} Kerstdag}] -\setuplabeltext[nl][day=Dag] -\setuplabeltext[nl][mon=Ma] -\setuplabeltext[nl][tue=Di] -\setuplabeltext[nl][wed=Woe] -\setuplabeltext[nl][thu=Do] -\setuplabeltext[nl][fri=Fr] -\setuplabeltext[nl][sat=Za] -\setuplabeltext[nl][sun=Zo] - -\setuplabeltext[nl][january=Januari] -\setuplabeltext[nl][february=Febrari] -\setuplabeltext[nl][march=Maart] -\setuplabeltext[nl][april=April] -\setuplabeltext[nl][may=Mei] -\setuplabeltext[nl][june=Juni] -\setuplabeltext[nl][july=Juli] -\setuplabeltext[nl][august=Augustus] -\setuplabeltext[nl][september=September] -\setuplabeltext[nl][october=October] -\setuplabeltext[nl][november=November] -\setuplabeltext[nl][december=December] - -\setuplabeltext[nl][moondays=Maandagen] -\setuplabeltext[nl][moon=Maan] -\setuplabeltext[nl][sunrise=Zonsopg.] -\setuplabeltext[nl][sunset=Zonsonderg.] -\setuplabeltext[nl][lighthours=Lichturen] -\setuplabeltext[nl][sunstar=Zon] - -%D French interface -\setuplabeltext[fr][calendar=Calendrier] -\setuplabeltext[fr][weekagenda={Cal. de la semaine}] -\setuplabeltext[fr][week=Sem.] -\setuplabeltext[fr][month=Mois] -\setuplabeltext[fr][contact=Contact] -\setuplabeltext[fr][name=Nom] -\setuplabeltext[fr][address=Adresse] -\setuplabeltext[fr][zip=CP] -\setuplabeltext[fr][place=Lieu] -\setuplabeltext[fr][country=Pays] -\setuplabeltext[fr][phone=Tél.] -\setuplabeltext[fr][mail=e-mail] -\setuplabeltext[fr][notes=Observations] -\setuplabeltext[fr][todo=Tâches] -\setuplabeltext[fr][found={Si trouvé\textcomma\ retourner s.v.p. à: }] - -\setuplabeltext[fr][nyd={Jour de l'an}] -\setuplabeltext[fr][epi={Épiphany}] -\setuplabeltext[fr][ashw={Mercredi des Cendres}] -\setuplabeltext[fr][palms={Dimanche des Rameaux}] -\setuplabeltext[fr][gfri={Vendredi saint}] -\setuplabeltext[fr][esun={Pâques}] -\setuplabeltext[fr][esmo={Lundi de Pâques}] -\setuplabeltext[fr][ascd={Jour de l'ascension}] -\setuplabeltext[fr][pcst=Pentecôte] -\setuplabeltext[fr][pcstmo={Lundi de Pentecôte}] -\setuplabeltext[fr][xmas=Noël] -\setuplabeltext[fr][bxd=] -\setuplabeltext[fr][day=Jour] -\setuplabeltext[fr][mon=Lun] -\setuplabeltext[fr][tue=Mar] -\setuplabeltext[fr][wed=Mer] -\setuplabeltext[fr][thu=Jeu] -\setuplabeltext[fr][fri=Ven] -\setuplabeltext[fr][sat=Sam] -\setuplabeltext[fr][sun=Dim] - -\setuplabeltext[fr][january=Janvier] -\setuplabeltext[fr][february=Février] -\setuplabeltext[fr][march=Mars] -\setuplabeltext[fr][april=Avril] -\setuplabeltext[fr][may=Mai] -\setuplabeltext[fr][june=Juin] -\setuplabeltext[fr][july=Juillet] -\setuplabeltext[fr][august=Août] -\setuplabeltext[fr][september=Septembre] -\setuplabeltext[fr][october=Octobre] -\setuplabeltext[fr][november=Novembre] -\setuplabeltext[fr][december=Décembre] - -\setuplabeltext[fr][moondays=Jours lun.] % jours lunaires -\setuplabeltext[fr][moon=Lune] -\setuplabeltext[fr][sunrise=Lever du s.] %soleil -\setuplabeltext[fr][sunset=Coucher du s.] %soleil -\setuplabeltext[fr][lighthours=Heures de l.] %lumière -\setuplabeltext[fr][sunstar=Soleil] - -% Italian interface -\setuplabeltext[it][calendar=Calendario] -\setuplabeltext[it][weekagenda=Calendario di settimana] -\setuplabeltext[it][week=Sett.] %Settimana -\setuplabeltext[it][month=Mese] -\setuplabeltext[it][contact=Contatto] -\setuplabeltext[it][name=Nome] -\setuplabeltext[it][address=Indirizzo] -\setuplabeltext[it][zip=C.A.P.] -\setuplabeltext[it][place=Luogo] -\setuplabeltext[it][country=Paese] -\setuplabeltext[it][phone=Tel.] -\setuplabeltext[it][mail=e-mail] -\setuplabeltext[it][notes=Osservazioni] -\setuplabeltext[it][todo=Compiti] -\setuplabeltext[it][found={Se trovato\textcomma\ prego speditelo à:}] - -%D Italian interface -\setuplabeltext[it][nyd=Capodanno] -\setuplabeltext[it][epi={Epifania}] -\setuplabeltext[it][ashw={Giorno delle Ceneri}] -\setuplabeltext[it][palms={Domenica delle Palme}] -\setuplabeltext[it][gfri={Venerdi santo}] -\setuplabeltext[it][esun=Pasqua] -\setuplabeltext[it][esmo={Lunedì dell'Angelo}] -\setuplabeltext[it][ascd=Ascensione] -\setuplabeltext[it][pcst=Pentecoste] -\setuplabeltext[it][pcstmo={Lunedì di Pentecoste}] -\setuplabeltext[it][xmas=Natale] -\setuplabeltext[it][bxd={Giorno di S. Stefano}] -\setuplabeltext[it][day=Giorno] -\setuplabeltext[it][mon=Lun] -\setuplabeltext[it][tue=Mar] -\setuplabeltext[it][wed=Mer] -\setuplabeltext[it][thu=Gio] -\setuplabeltext[it][fri=Ven] -\setuplabeltext[it][sat=Sab] -\setuplabeltext[it][sun=Dom] - -\setuplabeltext[it][january=Gennaio] -\setuplabeltext[it][february=Febbraio] -\setuplabeltext[it][march=Marzo] -\setuplabeltext[it][april=Aprile] -\setuplabeltext[it][may=Maggio] -\setuplabeltext[it][june=Giugno] -\setuplabeltext[it][july=Luglio] -\setuplabeltext[it][august=Agosto] -\setuplabeltext[it][september=Settembre] -\setuplabeltext[it][october=Ottobre] -\setuplabeltext[it][november=Novembre] -\setuplabeltext[it][december=Dicembre] - -\setuplabeltext[it][moondays=Giorni lun.] %Giorni lunari -\setuplabeltext[it][moon=Luna] -\setuplabeltext[it][sunrise=Albo] -\setuplabeltext[it][sunset=Tramonto] -\setuplabeltext[it][lighthours={O. di luce}] %Ore di luce -\setuplabeltext[it][sunstar=Sole] - -%D Spanish interface -\setuplabeltext[es][calendar=Agenda] -\setuplabeltext[es][weekagenda=Agenda semanal] -\setuplabeltext[es][week=Sem.] %Semana -\setuplabeltext[es][month=Mes] -\setuplabeltext[es][contact=Contacto] -\setuplabeltext[es][name=Nombre] -\setuplabeltext[es][address=Dirección] -\setuplabeltext[es][zip=C.P.] -\setuplabeltext[es][place=Población] -\setuplabeltext[es][country=País] -\setuplabeltext[es][phone=Tel.] -\setuplabeltext[es][mail=Correo-e] -\setuplabeltext[es][notes=Observaciones] -\setuplabeltext[es][todo=Pendiente] -\setuplabeltext[es][found={Por favor\textcomma\ devuélvalo a:}] - -\setuplabeltext[es][nyd=Año Nuevo] -\setuplabeltext[es][epi={Reyes Magos}] -\setuplabeltext[es][ashw={Miércoles de Ceniza}] -\setuplabeltext[es][palms={Domingo de Palmas}] -\setuplabeltext[es][gfri={Viernes santo}] -\setuplabeltext[es][esun=Domingo de Pascua] -\setuplabeltext[es][esmo={Lunes de Pascua}] -\setuplabeltext[es][ascd=Ascensión] -\setuplabeltext[es][pcst=Pentecostes] -\setuplabeltext[es][pcstmo={Lunes de Pentecostes}] -\setuplabeltext[es][xmas=Navidad] -\setuplabeltext[es][bxd={San Esteban}] -\setuplabeltext[es][day=Día] -\setuplabeltext[es][mon=Lu] -\setuplabeltext[es][tue=Ma] -\setuplabeltext[es][wed=Mi] -\setuplabeltext[es][thu=Ju] -\setuplabeltext[es][fri=Vi] -\setuplabeltext[es][sat=Sá] -\setuplabeltext[es][sun=Do] - -\setuplabeltext[es][january=Enero] -\setuplabeltext[es][february=Febrero] -\setuplabeltext[es][march=Marzo] -\setuplabeltext[es][april=Abril] -\setuplabeltext[es][may=Mayo] -\setuplabeltext[es][june=Junio] -\setuplabeltext[es][july=Julio] -\setuplabeltext[es][august=Agosto] -\setuplabeltext[es][september=Septiembre] -\setuplabeltext[es][october=Octubre] -\setuplabeltext[es][november=Noviembre] -\setuplabeltext[es][december=Diciembre] - -\setuplabeltext[es][moondays=Días lunares] -\setuplabeltext[es][moon=Luna] -\setuplabeltext[es][sunrise=Alba] -\setuplabeltext[es][sunset=Ocaso] -\setuplabeltext[es][lighthours={Horas de luz}] -\setuplabeltext[es][sunstar=Sol] - -%D Polish interface -\setuplabeltext[pl][calendar=Kalendarz] -\setuplabeltext[pl][weekagenda={Kalendarz tygodniowy}] -\setuplabeltext[pl][week=Tydzień] -\setuplabeltext[pl][month=Miesiąc] -\setuplabeltext[pl][contact=Kontakt] -\setuplabeltext[pl][name=Nazwisko] -\setuplabeltext[pl][address=Adres] -\setuplabeltext[pl][zip=Kod pocztowy] -\setuplabeltext[pl][place=Miejsce zamieszkania] -\setuplabeltext[pl][country=Kraj] -\setuplabeltext[pl][phone=Telefon] -\setuplabeltext[pl][mail=e-mail] -\setuplabeltext[pl][notes=Notatki] -\setuplabeltext[pl][todo=Do zrobienia] -\setuplabeltext[pl][found={W przypadku znalezienia proszę o odesłanie na adres}] - -\setuplabeltext[pl][nyd={Nowy Rok}] -\setuplabeltext[pl][epi={Trzech Króli}] -\setuplabeltext[pl][ashw={Środa Popielcowa}] -\setuplabeltext[pl][palms={Niedziela Palmowa} ] -\setuplabeltext[pl][gfri={Wielki Piątek} ] -\setuplabeltext[pl][esun={Niedziela Wielkanocna}] -\setuplabeltext[pl][esmo={Pn. Wielkanocny}] -\setuplabeltext[pl][ascd={Wniebowstąpienie}] -\setuplabeltext[pl][pcst={Zesłanie Ducha Świętego}] -\setuplabeltext[pl][pcstmo={}] -\setuplabeltext[pl][xmas=Święta] %Święta Bożego Narodzenia . -\setuplabeltext[pl][bxd={Drugi dzień świąt}] -\setuplabeltext[pl][day=Dzień] -\setuplabeltext[pl][mon=Pn.] -\setuplabeltext[pl][tue=Wt.] -\setuplabeltext[pl][wed=Śr.] -\setuplabeltext[pl][thu=Czw.] -\setuplabeltext[pl][fri=Pt.] -\setuplabeltext[pl][sat=Sob.] -\setuplabeltext[pl][sun=Ndz.] - -\setuplabeltext[pl][january=Styczeń] -\setuplabeltext[pl][february=Luty] -\setuplabeltext[pl][march=Marzec] -\setuplabeltext[pl][april=Kwiecień] -\setuplabeltext[pl][may=Maj] -\setuplabeltext[pl][june=Czerwiec] -\setuplabeltext[pl][july=Lipiec] -\setuplabeltext[pl][august=Sierpień] -\setuplabeltext[pl][september=Wrzesień] -\setuplabeltext[pl][october=Październik] -\setuplabeltext[pl][november=Listopad] -\setuplabeltext[pl][december=Grudzień] - -\setuplabeltext[pl][moondays=Dzień lunarny] -\setuplabeltext[pl][moon=Księżyc] -\setuplabeltext[pl][sunrise={Wschód słońca}] -\setuplabeltext[pl][sunset={Zachód słońca}] -\setuplabeltext[pl][lighthours=Długość dnia] -\setuplabeltext[pl][sunstar=Słońce] - -%D \startsubject[title={PocketDiary layout}] -%D -%D This module uses different page templates, whereof one uses a symbol -%D out of the set 2 of the Martin Vogel collection. So we load these symbols: - -\usesymbols[mvs] -\setupsymbolset[martinvogel 2] - -%D The placement of the page numbers is switched off for the moment. - -\setuppagenumbering[location=] - -%D Because we will place 8 pages on an A4 landscape, we define our own pagesize - -\definepapersize[Arrangingformat][width=7.42cm, height=10.5cm] -\setuppapersize[Arrangingformat][A4,landscape] - -%D In the templates a light gray color for (grid)lines is used. Separator -%D lines can have -%D an individual color too. We define the two colors with arbitrary values. -%D These preset colors can be adjusted in the user file \type{PocketDiary.tex}. - -\definecolor[Grid][s=.75] -\definecolor[Separatorline][blue] - -%D The page of the PocketDiary has a fairly simple layout. We use a -%D header- and a footer-space. -%D The header has a rule beneath and the footer one on top. -%D -%D The preset body-font is Pagella at 10pt -%D -%D We will also use tabular figures throughout the typesetting: -%D \stopsubject - -\setuplayout - [topspace=.6cm, - backspace=.6cm, - header=3\bodyfontsize, - headerdistance=.5\bodyfontsize, - footer=1.2\bodyfontsize, - footerdistance=.5\bodyfontsize, - margin=0pt, - height=middle, - width=middle] - -\setupbackgrounds - [header] - [text] - [state=repeat, - frame=off, - bottomframe=on, - framecolor=\getvariable{PocketDiaryColors}{Separatorline}] - -\setupbackgrounds - [footer] - [text] - [state=repeat, - frame=off, - topframe=on, - framecolor=\getvariable{PocketDiaryColors}{Separatorline}] - -\setupbodyfont[pagella,rm,10pt] -\definefontfeature[f:tabular] [tnum=yes] -\definefontfeature[f:smallcaps][smcp=yes] - -\addfeature[f:tabular] - -%D \startsubject[title={\METAFUN\ drawings}] -%D -%D There are three templates which are made up in \METAPOST. The drawings are -%D used as backgrounds to the typesetting area in the form of an overlay. So the -%D drawings adapt themselves to the actual dimensions -%D \stopsubject - -\startuniqueMPgraphic{Caro} - numeric w; w:= floor(OverlayWidth/4mm); - numeric h; h:= floor((OverlayHeight)/4mm); - path p,q; - p := unitsquare xscaled (4mm*w) yscaled (4mm*h); - q:= ulcorner p -- llcorner p; - for i = 0 upto w : - draw q shifted (i*4mm,0) withpen pencircle scaled .5pt - withcolor \MPcolor{Grid}; - endfor; - q:= llcorner p -- lrcorner p; - for i = 0 upto h : - draw q shifted (0,i*4mm) withpen pencircle scaled .5pt - withcolor \MPcolor{Grid}; - endfor; -\stopuniqueMPgraphic - -\startuniqueMPgraphic{Lines} - numeric w; w:= OverlaytWidth; - numeric h; h:= floor(OverlayHeight/7mm); - path p,q; - p := unitsquare xscaled OverlayWidth yscaled (7mm*(h-1)); - q:= llcorner p -- lrcorner p; - for i = 1 upto (h-1) : - draw q shifted (0,i*7mm) withpen pencircle scaled .5pt - withcolor \MPcolor{Grid}; - endfor; -\stopuniqueMPgraphic - -\startuniqueMPgraphic{Todo} - numeric w; w:= OverlayWidth; - numeric h; h:= floor(OverlayHeight/8mm); - path p,q; - p := unitsquare xscaled OverlayWidth yscaled OverlayHeight; - q:= llcorner p -- lrcorner p; - for i = 0 upto h : - draw q shifted (0,i*7mm) withpen pencircle scaled .5pt - withcolor \MPcolor{Grid}; - label.top(textext("\tfd \symbol[HollowBox]"), point 0 of q - shifted (2mm,i*7mm)); - endfor; -\stopuniqueMPgraphic - -%D \startsubject[title={The moon phase}] -%D -%D The moon phase calculation from SubsySTEMs, an American education institute, -%D for this module is based on a simple calculation. -%D The consequence is, that the results give a good idea only of the moon phase -%D but this is most probably precise enough for the purpose of the diary. -%D The return value of the moon phase calculation can be either a number, -%D representing the day number in the lunar month, or a command to put a -%D \METAFUN -graphic (New moon, growing moon, full moon, waning moon). -%D These little graphics are stored in the file \type{moons-MP.tex}. - -\input moons-MP - -%D In this file 4 overlays are defined which are used in a dedicated -%D \type{\framed[]{}} to typeset the pictograms. -%D -%M \input ./Moonphase/moons-MP -%M \defineoverlay[waningmoon][\useMPgraphic{Moon::Waning_moon}] -%M \defineoverlay[growingmoon][\useMPgraphic{Moon::Growing_moon}] -%M \defineoverlay[newmoon][\useMPgraphic{Moon::Newmoon}] -%M \defineoverlay[fullmoon][\useMPgraphic{Moon::Fullmoon}] -%M \defineframed -%M [Moon] -%M [height=1.5\bodyfontsize, -%M width=1.5\bodyfontsize, -%M frame=off] -%D -%D \starttabulate[|l|r|l|] -%D \NC \bf Moon phase -%D \NC \bf Lunar day -%D \NC \bf Macro -%D \NC \bf Pictogram \NC\NR -%D \NC New moon -%D \NC 0 -%D \NC \type{\Moon[background=newmoon]{}} -%D \NC \Moon[background=newmoon]{} \NC\NR -%D \NC Growing moon -%D \NC 7 -%D \NC \type{\Moon[background=growingmoon]{}} -%D \NC \Moon[background=growingmoon]{} \NC\NR -%D \NC Full moon -%D \NC 15 -%D \NC \type{\Moon[background=fullmoon]{}} -%D \NC \Moon[background=fullmoon]{} \NC\NR -%D \NC Waning moon -%D \NC 22 -%D \NC \type{\Moon[background=waningmoon]{}} -%D \NC \Moon[background=waningmoon]{} \NC\NR -%D \stoptabulate -%D \stopsubject - -%D \startsubject[title=Sun pictograms] -%D -%D The calculations for the sun rise and sun set times is based on work of -%D Alexander Yakushev. The results of his calculations nicely correspond with -%D results obtained from the Open Weather Map website. -%D -%D For sunrise, sunset and light hours exist three \METAFUN\ drawings. -%D These are included in the directory \type{Solar} in the file -%D \type{sun-MP.tex}. - -\input sun-MP - -%D In this file 3 overlays are defined which can then be used as a -%D background in a dedicated framed environment. -%M \input ./solar/sun-MP -%M \defineoverlay[Sunrise][\useMPgraphic{Sun::Sunrise}] -%M \defineoverlay[Sunset][\useMPgraphic{Sun::Sunset}] -%M \defineoverlay[Light][\useMPgraphic{Sun::Light}] -%M \defineframed -%M [SunA] -%M [strut=yes, -%M height=\lineheight, -%M width=\emwidth, -%M frame=off, -%M offset=0pt] -%M -%M \defineframed -%M [SunB] -%M [strut=yes, -%M height=\lineheight, -%M width=\emwidth, -%M frame=off, -%M offset=0pt, -%M location=depth] -%D -%D \starttabulate[|l|l|l|] -%D \NC \bf Sun -%D \NC \bf Macro -%D \NC \bf Pictogram \NC\NR -%D \NC Sunrise -%D \NC \type{\SunA[background=Sunrise,height=8pt]{\strut}} -%D \NC \SunA[background=Sunrise,height=8pt]{\strut} \NC\NR -%D \NC Sunset -%D \NC \type{\SunA[background=Sunset,height=8pt]{\strut}} -%D \NC \SunA[background=Sunset,height=8pt]{\strut} \NC\NR -%D \NC Light hours -%D \NC \type{\SunB[background=Light,height=8pt]{\strut}} -%D \NC \SunB[background=Light,height=8pt]{\strut} \NC\NR -%D \stoptabulate -%D \stopsubject - -%D \startsubject[title={The variable sets}] -%D -%D The module uses six sets of variables. The first set contains -%D the information on the -%D calendars to be calculated. - -%D First of all it has to be stated, that the whole idea behind -%D this module is to prepare a personal organizer with as few -%D parameters as possible. After the initial setup of the variables -%D it is sufficient to adapt the values in the first set and once -%D every year the information on the dates of the Day Light Saving -%D Time in the last set must be adjusted. -%D -%D \startsubsubject[title={Variable set \bf PocketDiary}] -%D -%D \starttabulate[|l|l|p|] -%D \NC \bf Variable \NC \bf Value \NC \bf Comment \NC\NR -%D \NC WeekDay \NC number \NC Values between 1 and 7. \NC\NR -%D \NC Week \NC number \NC Values between 1 and 53 \NC\NR -%D \NC Month \NC number \NC Values between 1 and 12 \NC\NR -%D \NC Year \NC number \NC Year numbers in the range 1900 and 4099. -%D The lower limit is computer dependent (OS-timestamp), the upper limit -%D is depending on the Easter Sunday calculation.\crlf -%D (http://www.assa.org.au/edm.html, R.W. Mallen, 1985).\NC\NR -%D \NC Nextyear \NC yes/no \NC The testing is done on \quote{yes}. If set -%D to \quote{yes} the next year instead of the current year is used for -%D the calculation of the year calendar. \NC\NR -%D \NC Daybyday \NC yes/no \NC The testing is done on \quote{yes}. If this -%D variable is set to \quote{yes} then a diary is typeset with 1 page per -%D day and the weekend is typeset with Saturday and Sunday on one page. -%D This uses 6 pages and we can freely choose what should be typeset on -%D the pages 7 and 8. \NC\NR -%D \stoptabulate -%D \stopsubsubject - -\setvariables - [PocketDiary] - [WeekDay=1, - Week=17, - Month=5, - Year=2011, - Nextyear=no, - Daybyday=no] - -%D \startsubsubject[title={Variable set \bf PocketDiaryLayout}] -%D -%D The PocketDiary can be given a layout according to your own ideas. -%D There are 8 variables (Page1 up to Page -%D 8) which can be given different values. -%D -%D \starttabulate[|l|p|] -%D \NC \bf Variable \NC \bf Comment \NC\NR -%D \NC Dayplan \NC The weekday indicated in the variable \quote{WeekDay} -%D in the previous section is used to make a PocketDiary page. \NC\NR -%D \NC Weekendplan \NC The weekend of the chosen week (variable \quote{Week}) -%D is typeset on a single page \NC\NR -%D \NC Weekcurrentplan \NC A week calendar based on the variable -%D \quote{Week} -%D in the previous section is used for the presentation of a week table. -%D \NC\NR -%D \NC Weeknextplan \NC A week calendar based on the variable \quote{Week} -%D $+$ 1 in the previous section is used for the presentation of the nexts -%D week's table. \NC\NR -%D \NC Monthcurrentplan \NC A month table based on the value in the variable -%D \quote{Month} in the previous section is typeset. \NC\NR -%D \NC Monthnextplan \NC A month table of the next month based on the -%D value -%D in the variable \quote{Month} of the previous section is typeset. -%D \NC\NR -%D \NC Yearcurrentplan \NC A complete year calendar of the year given in the -%D variable \quote{Year} in the previous section is typeset. \NC\NR -%D \NC Yearnextplan \NC If the \quote{Nextyear} -%D variable in the previous section is \quote{yes}, then a complete year -%D calendar for the next year indicated in the -%D variable \quote{Year} of the previous section is typeset. \NC\NR -%D \NC Lost-Returnto \NC A page with the indicated information in the -%D PocketDiaryAddress variable set is used to compose and typeset -%D a lost and return page (see next section). \NC\NR -%D \NC Blank \NC This page carries a header and a footer but is -%D empty for the rest. \NC\NR -%D \NC Todo \NC A todo-list template is typeset. \NC\NR -%D \NC Caro \NC A page with full-grid-paper is typeset. \NC\NR -%D \NC Lines \NC A page with grid lines is typeset. \NC\NR -%D \NC Contact \NC A form with two sets of preprinted fields -%D for marking down contact information is typeset. \NC\NR -%D \stoptabulate -%D -%D A basic setup could look as follows: - -\setvariables - [PocketDiaryLayout] - [Page1=Lost-Returnto, - Page2=Weekplan, - Page3=Dayplan, - Page4=Monthcurrentplan, - Page5=Blank, - Page6=Lines, - Page7=Caro, - Page8=Contact] - -%D \stopsubsubject -%D -%D \startsubsubject[title={Variable set \bf PocketDiaryAddress}] -%D -%D The third section of variables contains information used for the footer -%D and the lost-return form. -%D \stopsubsubject - -\setvariables - [PocketDiaryAddress] - [Familyname=Egger, - Forename=Willi, - Street={Townstreet 3B}, - Zipcode=5000, - City={New Beach}, - Country=TEX-world, - Phone={+22 444 55 88 66}, - Mobile={+22 6 19 19 1717}, - E-mail={info at pocketdiary.org}, - Web=www.pocketdiary.org] - -%D \startsubsubject[title={Variable set \bf PocketDiaryColors}] -%D -%D The PocketDiary uses some color. The header and footer separator lines can -%D be given a color. Standard color is blue. -%D -%D For those who want gridlines other than light gray can set a -%D color for the gridlines too. -%D \stopsubsubject - -\setvariables - [PocketDiaryColors] - [Separatorline=blue, - Gridline={s=.55}] - -%D \startsubsubject[title={Variable set \bf PocketDiaryFooter}] -%D -%D The footer is filled with three fields. These fields may contain the contents -%D of variables or \TEX\ commands. The setup of the footer is done with a buffer -%D in order to be able to call it later on. -%D \stopsubsubject -%D \stopsubject -%D -%D \startsubject[title={Footer setup}] -%D \stopsubject - -\setvariables - [PocketDiaryFooter] - [Lefttext=PocketDiary, - Centertext=\pagenumber, - Righttext={\getvariable{PocketDiaryAddress}{Forename},~\currentdate[year]}] %{\currentdate[year]} - -\startbuffer[Footertext] - \setupfootertexts[% - \tfx - \getvariable{PocketDiaryFooter}{Lefttext} - \hfill - \getvariable{PocketDiaryFooter}{Centertext} - \hfill - \getvariable{PocketDiaryFooter}{Righttext}] -\stopbuffer - -\getbuffer[Footertext] - -%D \startsubject[title={Variable set \bf PocketDiaryGeoPosition}] -%D -%D For the sun data calculations you need to know the latitude and longitude of -%D your location. -%D -%D For correct calculations you need also to pass the timezone offset to Lua. -%D -%D The dates for the begin and end of the day light saving time (DST) -%D are calculated based on the continent information. Possible values are -%D \quote{EU} and \quote{US}. If the field is empty, then no DST is calculated. -%D -%D For the US (except for Arizona and Hawaii) currently the DST starts on the -%D second Sunday of March and ends on the first Sunday of November. -%D -%D for Europe currently the DST starts on the last Sunday of March and ends on -%D the last Sunday of October. -%D -%D Sun data are typeset on the \quote{Dayplan} and \quote{Weekendplan} as well -%D as on Tuesdays in the week-calendar. -%D \stopsubject - -\setvariables %Koziegłowy - [PocketDiaryGeoPosition] - [lat=52.467860, - lon=16.981240, - timeoffset=1, - continent=EU] - -%D \startsubject[title={The various calendar pages}] -%D -%D Most of the activities for creating the contents and layout of the -%D different pages like day, weekend, week, month and year calendars -%D is delegated to Lua. Those pages are made-up as -%D \CONTEXT -Lua-documents (cld). -%D We preload the Lua -file with - -\ctxloadluafile{t-pocketdiary}{} - -%D \startsubsubject[title={Day plan}] -%D -%D \startplacefigure -%D [location={middle,here}, -%D reference=fig:Singleday, -%D title={Example Day-calendar}] -%D {\externalfigure[docu-figures][page=1,width=.4\textwidth,frame=on]} -%D \stopplacefigure -%D -%D The day calendar looks as in \in{figure}[fig:Singleday]. -%D -%D Next to the day number of the selected month the day name is given. If the -%D day is a christian feast day, its name is following after the day name. -%D To the right the week number and the year is typeset. -%D -%D The configuration of the page looks as follows: - -\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,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 -\stopsetups - -\startsetups table:topweekplan - \setupTABLE[each][each][frame=off] - \setupTABLE[r][1][offset=0pt,loffset=3pt,roffset=3pt,align=lohi] % Date row - \setupTABLE[c][1][style=bold,width=0.5\textwidth,align=lohi] % Name - \setupTABLE[c][2][style={\switchtobodyfont[6pt]},width=0.5\textwidth, - align={flushright,lohi}] % Week, year -\stopsetups - -%D For the creation of the page a command with 8 parameters is defined: - -\define[8]\Dayplan{\ctxlua{thirddata.diary.dayplan(#1,#2,#3,#4,#5,#6,#7,#8)}} - -%D The Dayplan-command with the collected parameters is placed in a buffer. This buffer is later called from the user-file \type{PocketDiary.tex} . - -\startbuffer[Dayplan] - \Dayplan %Weekday,Week,Month,Year,lat,lon,timeoffset,continent - {\getvariable{PocketDiary}{WeekDay}} - {\getvariable{PocketDiary}{Week}} - {\getvariable{PocketDiary}{Month}} - {\getvariable{PocketDiary}{Year}} - {\getvariable{PocketDiaryGeoPosition}{lat}} - {\getvariable{PocketDiaryGeoPosition}{lon}} - {\getvariable{PocketDiaryGeoPosition}{timeoffset}} - {"\getvariable{PocketDiaryGeoPosition}{continent}"} -\stopbuffer - -%D \stopsubsubject - -%D \startsubsubject[title={Weekend}] -%D -%D The weekend calendar shows Saturday and Sunday on one page -%D (see \in{figure}[fig:Weekend]). -%D -%D The typeset data are identical to those of the \quote{Dayplan} -%D -%D \startplacefigure -%D [location={middle,here}, -%D reference=fig:Weekend, -%D title={Example Weekend-calendar}] -%D {\externalfigure[docu-figures][page=2,width=.4\textwidth,frame=on]} -%D \stopplacefigure - -%D Comparable to the Dayplan the Weekendplan command is defined with 8 parameters. - -\define[8]\Weekendplan{\ctxlua{thirddata.diary.weekendplan(#1,#2,#3,#4,#5,#6,#7,#8)}} - -%D Again this command with the collected information of the 8 parameters is placed in a buffer which is called then from the user-file \type{PocketDiary.tex} . - -\startbuffer[Weekendplan] - \Weekendplan %Weekday,Week,Month,Year,lat,lon,timeoffset,continent - {6} - {\getvariable{PocketDiary}{Week}} - {\getvariable{PocketDiary}{Month}} - {\getvariable{PocketDiary}{Year}} - {\getvariable{PocketDiaryGeoPosition}{lat}} - {\getvariable{PocketDiaryGeoPosition}{lon}} - {\getvariable{PocketDiaryGeoPosition}{timeoffset}} - {"\getvariable{PocketDiaryGeoPosition}{continent}"} -\stopbuffer - -%D \stopsubsubject - -%D \startsubsubject[title={Week plan and next week plan}] -%D -%D The week calendar is a one-column table for working days. -%D Saturday and Sunday are placed next to each other in the last table row. An -%D example is given -%D in \in{figure}[fig:Week]. -%D -%D In the \quote{Weekplan} header appears \quote{Weeek agenda} or its -%D correspondent name in the supported languages. To the right the month's -%D number, weeknumber and year are typeset. - -%D \startplacefigure -%D [location={middle,here}, -%D reference=fig:Week, -%D title={Example Week-calendar}] -%D {\externalfigure[docu-figures][page=3,width=.4\textwidth,frame=on]} -%D \stopplacefigure -%D By means of a setups-sequence the table is defined as follows: - -\startsetups table:week - \setupTABLE[r][each][height=.158\textheight,align=flushleft] %.165 - \setupTABLE[r][even][background=color,backgroundcolor=.5s] - \setupTABLE[c][1][width=.5\textwidth] - \setupTABLE[c][2][width=.5\textwidth] -\stopsetups - -%D Again the Weekcurrentplan-command is defined with 8 parameters - -\define[8]\Weekcurrentplan{\ctxlua{thirddata.diary.weekplan(#1,#2,#3,#4,#5,#6,#7,#8)}} - -%D And the command together with the gathered parameters is stored in a buffer, which will be used by the user-file \type{PocketDiary.tex} . - -\startbuffer[Weekcurrentplan] - \Weekcurrentplan %Weekday,Week,Month,Year,lat,lon,timeoffset,continent - {1} - {\getvariable{PocketDiary}{Week}} - {\getvariable{PocketDiary}{Month}} - {\getvariable{PocketDiary}{Year}} - {\getvariable{PocketDiaryGeoPosition}{lat}} - {\getvariable{PocketDiaryGeoPosition}{lon}} - {\getvariable{PocketDiaryGeoPosition}{timeoffset}} - {"\getvariable{PocketDiaryGeoPosition}{continent}"} - \page[yes] -\stopbuffer - -%D Similar to the week plan the next week plan is built. - -\define[8]\Weeknextplan{\ctxlua{thirddata.diary.weekplan(#1,#2,#3,#4,#5,#6,#7,#8)}} - -\startbuffer[Weeknextplan] - \Weeknextplan %Weekday,Week,Month,Year,lat,lon,timeoffset,dst_start,dst_stop - {1} - {\directlua{tex.print{\getvariable{PocketDiary}{Week}+1}}} - {\getvariable{PocketDiary}{Month}} - {\getvariable{PocketDiary}{Year}} - {\getvariable{PocketDiaryGeoPosition}{lat}} - {\getvariable{PocketDiaryGeoPosition}{lon}} - {\getvariable{PocketDiaryGeoPosition}{timeoffset}} - {"\getvariable{PocketDiaryGeoPosition}{continent}"} - \page[yes] -\stopbuffer - -%D \stopsubsubject - -%D \startsubsubject[title={Month current and month next}] -%D -%D The month calendar looks as in \in{figure}[fig:Month]. -%D -%D Left in the header appears the month name in the chosen language. To the -%D right the year is typeset. -%D -%D \startplacefigure -%D [location={middle,here}, -%D reference=fig:Month, -%D title={Example Month-calendar}] -%D {\externalfigure[docu-figures][page=4,width=.4\textwidth,frame=on]} -%D \stopplacefigure -%D In the same fashion as the previous items also the month and -%D next month calendars are defined respectively setup: - -\startsetups table:month - \setupTABLE[column][each][width=.143\textwidth,align=flushright,offset=3pt] - \setupTABLE[column][7][style=\red] -\stopsetups - -%D For the Month-calendars we need only two parameters: month and year. - -\define[2]\Monthcurrentplan{\ctxlua{thirddata.diary.monthcurrentplan(#1,#2)}} - -%D The command is kept together with the gathered parameters in a buffer again. -%D This will be called from the user-file \type{PocketDiary.tex} . - -\startbuffer[Monthcurrentplan] - \Monthcurrentplan - {\getvariable{PocketDiary}{Month}} - {\getvariable{PocketDiary}{Year}} -\stopbuffer - -\define[2]\Monthnextplan{\ctxlua{thirddata.diary.monthnextplan(#1,#2)}} - -\startbuffer[Monthnextplan] - \Monthnextplan - {\getvariable{PocketDiary}{Month}} - {\getvariable{PocketDiary}{Year}} -\stopbuffer - -%D \stopsubsubject - - -%D \startsubsubject[title={Year current and year next}] -%D -%D The year calendar looks as in \in{figure}[fig:Year]. -%D -%D In the header the year only is typeset. -%D -%D \startplacefigure -%D [location=middle, -%D reference=fig:Year, -%D title={Example Year-calendar}] -%D {\externalfigure[docu-figures][page=5,width=.4\textwidth,frame=on]} -%D \stopplacefigure -%D The year table(s) are prepared as the week tables with a table-setup -%D sequence, a custom command which resides with the parameters assigned in a -%D buffer, which will again be called from the user-file \type{PocketDiary.tex} - -\startsetups table:year - \setupTABLE[column] - [each] - [width=.032\textwidth,align=flushright,offset=1pt,frame=off] - \setupTABLE[column][1][width=.052\textwidth,align=flushleft] - \setupTABLE[row][each][offset=1pt,height=1.5\bodyfontsize] -\stopsetups - -\define[2]\Yearcurrentplan{\ctxlua{thirddata.diary.yearplan(#1,#2)}} -\define[2]\Yearnextplan{\ctxlua{thirddata.diary.yearplan(#1,#2)}} - -\startbuffer[Yearcurrentplan] - \Yearcurrentplan - {\getvariable{PocketDiary}{Year}} - {"no"} -\stopbuffer - -\startbuffer[Yearnextplan] - \Yearnextplan - {\getvariable{PocketDiary}{Year}} - {"\getvariable{PocketDiary}{Nextyear}"} -\stopbuffer - -%D \stopsubsubject - -%D \startsubsubject[title= {One week\dots}] -%D -%D As mentioned before, the result will be 5 pages with one working day per -%D page and the weekend on one page i.e. 6 pages. For the pages 7 and 8 the -%D values defined in the \quote{PocketDiaryLayout} variable set is used. -%D As for the Dayplan we need a command carrying 8 parameters: - -\define[8]\Daybyday{\ctxlua{thirddata.diary.daybydayplan(#1,#2,#3,#4,#5,#6,#7,#8)}} - -%D A buffer contains the command just defined with the gathered information for the parameters. The buffer then is called from the user-file \type{PocketDiary.tex} . - -\startbuffer[Daybyday] - \Daybyday - {1} %Weekday - {\getvariable{PocketDiary}{Week}} - {\getvariable{PocketDiary}{Month}} - {\getvariable{PocketDiary}{Year}} - {\getvariable{PocketDiaryGeoPosition}{lat}} - {\getvariable{PocketDiaryGeoPosition}{lon}} - {\getvariable{PocketDiaryGeoPosition}{timeoffset}} - {"\getvariable{PocketDiaryGeoPosition}{continent}"} -\stopbuffer - -%D \stopsubsubject - -%D \startsubsubject[title={Templates}] -%D -%D The PocketDiary comes with a couple of templates for writing down -%D information: - -%D For the pages with (grid)lines we use an overlay in the background of -%D the text area which will contain the \METAPOST -graphic. -%D -%D \startplacefigure -%D [location={middle,here}, -%D title={The set of available templates}] -%D {\startcombination[3*2] -%D {\externalfigure -%D [docu-figures] -%D [page=6,width=.25\textwidth,frame=on]}{The blank page} -%D {\externalfigure -%D [docu-figures] -%D [page=7,width=.25\textwidth,frame=on]}{Caro paper} -%D {\externalfigure -%D [docu-figures] -%D [page=8,width=.25\textwidth,frame=on]}{Lines} -%D {\externalfigure -%D [docu-figures] -%D [page=9,width=.25\textwidth,frame=on]}{Todo} -%D {\externalfigure -%D [docu-figures] -%D [page=10,width=.25\textwidth,frame=on]}{Contact information} -%D {\externalfigure -%D [docu-figures] -%D [page=11,width=.25\textwidth,frame=on]}{Lost-return-to information} -%D \stopcombination} -%D \stopplacefigure -%D \stopsubsubject -%D The setups for the Contacts page look as follows: - -\startsetups table:contacts - \setupTABLE[r][each][frame=off,bottomframe=on,height=2\lineheight] - \setupTABLE[c][1][width=.3\textwidth] - \setupTABLE[c][2][width=.5\textwidth] - \setupTABLE[c][3][width=.2\textwidth] -\stopsetups - -%D The setups for the Lost-Returnto page is setup in the following way: - -\startsetups table:returnto - \setupTABLE[r][each][frame=off] - \setupTABLE[c][each][width=\textwidth] -\stopsetups - -%D Another setups covers the reset of the used Background - -\startsetups Background:stop - \defineoverlay - [Textarea] - [\resetMPdrawing] - \setupbackgrounds[text][text][background=] -\stopsetups - -%D All templates for these pages are contained in buffers in order to call them from the user-file \type{PocketDiary.tex} - -\startbuffer[Contact] - \setupheadertexts[{\bf \labeltext{contact}\hfill}] - \switchtobodyfont[6pt] - \dorecurse{2}{\bTABLE[setups=table:contacts] - \bTR - \bTD \labeltext{name}: \eTD - \bTD \eTD - \bTD \eTD - \eTR - \bTR - \bTD \labeltext{address}:\eTD - \bTD \eTD - \bTD \eTD - \eTR - \bTR - \bTD \strut\eTD - \bTD \eTD - \bTD \eTD - \eTR - \bTR - \bTD \labeltext{zip}:\eTD - \bTD \labeltext{place}:\eTD - \bTD \labeltext{country}:\eTD - \eTR - \bTR - \bTD \labeltext{phone}:\eTD - \bTD \eTD - \bTD \eTD - \eTR - \bTR - \bTD \labeltext{mail}:\eTD - \bTD \eTD - \bTD \eTD - \eTR - \eTABLE - \blank} - \page[yes] -\stopbuffer - -\startbuffer[Caro] - \setupheadertexts[{\bf \labeltext{notes}\hfill}] - \defineoverlay - [Textarea] - [\useMPgraphic{Caro}] - \setupbackgrounds[text][background=Textarea] - \strut - \page[yes] - \setups{Background:stop} -\stopbuffer - -\startbuffer[Lines] - \setupheadertexts[{\bf \labeltext{notes}\hfill}] - \defineoverlay - [Textarea] - [\useMPgraphic{Lines}] - \setupbackgrounds[text][text][background=Textarea] - \strut - \page[yes] - \setups{Background:stop} -\stopbuffer - -\startbuffer[Todo] - \defineoverlay - [Textarea] - [\useMPgraphic{Todo}] - \setupbackgrounds[text][text][background=Textarea] - \setupheadertexts[\bf \labeltext{todo}\hfill] - \strut - \page[yes] - \setups{Background:stop} -\stopbuffer - -\startbuffer[Blank] - \setupheadertexts[{\bf \labeltext{notes}\hfill}] - \strut - \page[yes] -\stopbuffer - -\startbuffer[Lost-Returnto] - \strut - \setupheadertexts[{\bf \labeltext{calendar}}] - \setupfooter[state=empty] - \setupbackgrounds[footer][text][topframe=off] - \setups{Background:stop} - \strut - \blank[2*line] - \framed[width=\textwidth, - frame=off, - bottomframe=on, - align=flushleft, - rulethickness=1pt, - foregroundcolor=\getvariable{PocketDiaryColors}{Separatorline}, - framecolor=\getvariable{PocketDiaryColors}{Separatorline}] - {\labeltext{found}} - \bTABLE[setups=table:returnto] - \bTR - \bTD \getvariable{PocketDiaryAddress}{Forename}~ - \getvariable{PocketDiaryAddress}{Familyname} \eTD - \eTR - \bTR - \bTD \getvariable{PocketDiaryAddress}{Street} \eTD - \eTR - \bTR - \bTD \getvariable{PocketDiaryAddress}{Zipcode} - {\addff{f:smallcaps}\getvariable{PocketDiaryAddress}{City}}\eTD - \eTR - \bTR - \bTD Tel: \getvariable{PocketDiaryAddress}{Phone}\eTD - \eTR - \bTR - \bTD Mob: \getvariable{PocketDiaryAddress}{Mobile}\eTD - \eTR - \bTR - \bTD E-mail: \getvariable{PocketDiaryAddress}{E-mail} \eTD - \eTR - \bTR - \bTD Web: \getvariable{PocketDiaryAddress}{Web} \eTD - \eTR - \eTABLE - \page[yes] - \getbuffer[Footertext] - \setupbackgrounds[footer][text][topframe=on] -\stopbuffer - -%D \stopsubject -%D -%D \startsubject[title={The setup of the PocketDiary}] -%D -%D When filling the 8 pages we can do two things. Either we let \CONTEXT\ -%D typeset the pages as we choose them in the section \quote{PocketDiaryLayout} -%D or we set the variable \quote{Daybyday} in the variable set -%D \quote{PocketDiary} to \quote{yes}. This leads to the typesetting of 5 pages -%D with each a working day and the weekend on one page. The remaining two pages -%D are typeset according to the values given in \quote{PocketDiaryLayout.} - -\startbuffer[Pocketdiary] - \definecolor[Grid][\getvariable{PocketDiaryColors}{Gridline}] - \definecolor[Separatorline][\getvariable{PocketDiaryColors}{Separatorline}] - - \doifelse{\getvariable{PocketDiary}{Daybyday}}{yes} - {\Daybyday %creates 6 pages - {1} - {\getvariable{PocketDiary}{Week}} - {\getvariable{PocketDiary}{Month}} - {\getvariable{PocketDiary}{Year}} - {\getvariable{PocketDiaryGeoPosition}{lat}} - {\getvariable{PocketDiaryGeoPosition}{lon}} - {\getvariable{PocketDiaryGeoPosition}{timeoffset}} - {"\getvariable{PocketDiaryGeoPosition}{continent}"} - \getbuffer[\getvariable{PocketDiaryLayout}{Page7}] - \getbuffer[\getvariable{PocketDiaryLayout}{Page8}] - } - {\getbuffer[\getvariable{PocketDiaryLayout}{Page1}] - \getbuffer[\getvariable{PocketDiaryLayout}{Page2}] - \getbuffer[\getvariable{PocketDiaryLayout}{Page3}] - \getbuffer[\getvariable{PocketDiaryLayout}{Page4}] - \getbuffer[\getvariable{PocketDiaryLayout}{Page5}] - \getbuffer[\getvariable{PocketDiaryLayout}{Page6}] - \getbuffer[\getvariable{PocketDiaryLayout}{Page7}] - \getbuffer[\getvariable{PocketDiaryLayout}{Page8}] - } -\stopbuffer - -%D \stopsubject - -%D \startsubject[title={Arranging the pages}] -%D -%D For the arrangement of the 8 pages on the paper we need a -%D special arranging scheme, which is included in the distribution. -%D Invoking the scheme is performed with -%D -%D \type{\setuparranging[1*8]} -%D -%D The arrangement of the 8 pages is not switched on in this file. For the -%D purpose of experimenting it is better to keep this command in the user file -%D \type{\type{PocketDiary.tex} } -%D -%D \stopsubject - -%D \startsubject[title={How to fold the PocketDiary}] -%D -%D The eight printed pages are folded in such a way, that the PocketDiary -%D presents itself as a small booklet. -%D There are no empty pages visible. -%D -%D \startplacefigure -%D [location=middle, -%D reference=fig:schemeA, -%D title={The basic folding scheme}] -%D {\externalfigure[docu-figures][page=12,width=.6\textwidth]} -%D \stopplacefigure -%D -%D First make two mountain-folds as indicated with the straight lines in -%D \in{figure}[fig:schemeA]. -%D Unfold the paper and turn it face up and \unit{90 Degrees} to the left. -%D Make a valley-fold with the lower part -%D of the sheet on the previously made mountain-fold. Unfold and turn the -%D sheet \unit{180 Degrees}. -%D Make another valley-fold as described before. Unfold the sheet. -%D -%D Take a sharp knife and a ruler. Slit the paper open between Cuttingpoint A -%D and B (see \in{figure}[fig:schemeA]). -%D -%D Now we can fold the booklet. First fold the paper again in the length. Then -%D hold the double folded paper -%D with the mountain-fold up. Push from both sides towards the center in order -%D to get a form similar -%D to \in{figure}[fig:schemeB]. Fold then the upper double-page in direction B, -%D the lower double-page -%D in direction C and finally the lefthand double-sided page in direction D. -%D -%D \startplacefigure -%D [location=middle, -%D reference=fig:schemeB, -%D title={The basic folding scheme}] -%D {\externalfigure[docu-figures][page=13,width=.6\textwidth]} -%D \stopplacefigure -%D -%D Before creasing the booklet at the spine it is worthwhile to put the section -%D on table and adjust -%D folds where needed. Finally the spine is creased with preference with a -%D bone-folder. -%D \stopsubject - -\stopmodule \ No newline at end of file -- cgit v1.2.3