From: Michael Guravage <guravage@literatesolutions.com>
To: ntg-context@ntg.nl
Subject: [NTG-context] Pocket Diary Photo Calendar: how to specify on which day the week begins?
Date: Sat, 15 Jun 2024 18:55:20 +0200 [thread overview]
Message-ID: <CAL-A5LZYBdX6EeMKbszxBYGEyKPwEiU3hv+K6UyEpTau58rXxA@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 583 bytes --]
Hi,
I am trying to use the Pocket Diary
<https://ctan.org/pkg/context-pocketdiary> module to create a photo
calendar as described in the Calendar Examples
<https://ctan.org/pkg/context-calendar-examples>. The examples work fine.
By default weeks begin on Monday. Does anyone know how to specify that
weeks begin on Sunday? I have searched through all the setvariable
assignments, but nothing seems applicable.
I have attached an example file so you needn't retrieve all the examples.
Any help would be appreciated.
--
With kind regards,
Michael
<http://literatesolutions.com>
[-- Attachment #1.2: Type: text/html, Size: 962 bytes --]
[-- Attachment #2: Photocalendar.tex --]
[-- Type: text/x-tex, Size: 3517 bytes --]
\usemodule[pocketdiary]
%D Choose and setup the font to be used
\setupbodyfont[ibmplex,ss,12pt]
% Supported languages: EN,DE,NL,FR,IT,ES
\mainlanguage[nl]
% Switch off the page numbering
\setuppagenumbering[location=]
% Setup the paper size
\setuppapersize[A4,portrait][A4,portrait]
% Adjust the layout of the page
\setuplayout
[topspace=20mm,
backspace=8.6mm,
header=0pt,
footer=0pt,
height=middle,
width=middle]
% Setup the path where to find the calendar pictures
\setupexternalfigures [directory={., ./graphics, ../graphics, ./MyPhotoDirectory}]
\setupexternalfigures [location={local,global,default}]
\def\testimage {cow} % dolly.png
% Give pictures symbolic names for using in a loop
\useexternalfigure [1] [\testimage]
\useexternalfigure [2] [\testimage]
\useexternalfigure [3] [\testimage]
\useexternalfigure [4] [\testimage]
\useexternalfigure [5] [\testimage]
\useexternalfigure [6] [\testimage]
\useexternalfigure [7] [\testimage]
\useexternalfigure [8] [\testimage]
\useexternalfigure [9] [\testimage]
\useexternalfigure [10] [\testimage]
\useexternalfigure [11] [\testimage]
\useexternalfigure [12] [\testimage]
\useexternalfigure [13] [\testimage]
% Setup the variables for the Pocket diary, only year is used for the calculations.
\setvariables
[PocketDiary]
[Year=2025]
% Let the header and the footer be empty:
\setupheadertexts[][]
\setupfootertexts[][]
% 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
% Define the macro for calling lua
\define[1]\Photocalendarpages
{\ctxlua{thirddata.calendar.Photo_calendar_page(#1)}}
% Setup the \TEX\ side of the document
\starttext
% 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
% Call the defined macro
\Photocalendarpages{\getvariable{PocketDiary}{Year}}
\stoptext
[-- Attachment #3: Type: text/plain, Size: 511 bytes --]
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
next reply other threads:[~2024-06-15 16:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-15 16:55 Michael Guravage [this message]
2024-06-15 20:49 ` [NTG-context] " Bruce Horrocks
2024-06-15 21:20 ` Michael Guravage
2024-06-16 11:39 ` Bruce Horrocks
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAL-A5LZYBdX6EeMKbszxBYGEyKPwEiU3hv+K6UyEpTau58rXxA@mail.gmail.com \
--to=guravage@literatesolutions.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).