profound-labs / wallcalendar

Wallcalendar LaTeX documentclass
Other
91 stars 24 forks source link

Allow setting parameters outside of `documentclass` #11

Closed norbusan closed 6 years ago

norbusan commented 6 years ago

I am generating several variants of a single calendar, with different setting for the documentclass. I would like to have one common file that does most of the work, and adjust these setting outside of the documentclass options.

Is it possible to say something like

\setCalendarLanguage{japanese}
\setEventsCSV{./data/holidays-jp-2019.csv}
...

Thanks

gambhiro commented 6 years ago

This is problematic. LaTeX is not very suitable for this kind of abstract API.

This would go into the document body, and at that point the preamble has already loaded everything, for example babel with a language option, page layout sizes, etc. It would be a lot of trouble to repeat that reliably, and for not much benefit.

I would rather recommend to write a small script which generates the .tex files for each calendar from an array of values and a template string.