Cuti-cuti Malaysia: Customisable state-by-state holiday calendar for 2024

Use the \event command to insert custom events of your own

Annual cuti-cuti Malaysia calendar! This year I’ve made quite a lot of updates to the underlying code for cdcalendar; the documentation has been shaken up quite a bit too.

The Cuti-cuti Malaysia 2024 calendar LaTeX files is available as an Overleaf read-only project here. By default, this generates an A4 landscape calendar that highlights national and Penang state public holidays and school holidays, along with the nongli (Chinese lunisolar) calendar.

Cuti-cuti Malaysia January 2024 for Penang, A4 landscape without mini calendars
Cuti-cuti Malaysia January 2024 for Penang, A4 landscape without mini calendars ([giantsolo, landscape])
If you’d like to generate a calendar for a different state, or choose a different layout or size, or use your own pictures, or add/mark your own events, you can clone that Overleaf project to edit your own copy; or download the source files to edit on your own local LaTeX installation.

So, a quick recap of what this is: depending on which state (negeri) or federal territory (wilayah persekutuan) you’re in, the public holidays and school holidays would differ. It can get really hard to keep up with which holiday your local bank or your kid’s school is observing… so I decided to make my own calendar that would mark the holidays with different colours, depending on which state you’re in.

Generating for different states and layout options

The screenshots below show how holidays are highlighted differently, by changing \def\mylocation{Penang} to \def\mylocation{Kuala Lumpur} or \def\mylocation{Kedah}. Essentially holidays marked with solid colours are holidays that are observed in the state you’re in: National holidays are in solid pink; state holidays are in solid purple. Holidays observed in other states are marked with empty purple circles.

Cuti-cuti Malaysia February 2024 for Penang Cuti-cuti Malaysia February 2024 for Kuala Lumpur

Cuti-cuti Malaysia February 2024 for Kedah

Holidays are marked differently depending on which state name \mylocation is set to.
  • Instead of giantsolo, these three calendars use the giant class option, so will also generate two mini calendars on each page for the previous and next months.
  • For the Kedah calendar we also used the sundayweek document class option, to make the weeks start with Sunday instead of Monday.
  • Using giant or giantsolo without the landscape class option will generate A4-sized portrait calendars.

There are two variants of smaller sizes:

  • Without any particular class options (i.e. the default output size for cdcalendar actually), each calendar page is 11.7cm × 13.65cm and would fit a CD case
  • With the small class option, each calendar page is 9cm × 7.5cm, similar to a 3.5″ floppy disk.

Without any document class options, each calendar page is 11.7cm × 13.65cm and fits a CD case.
Without any document class options, each calendar page is 11.7cm × 13.65cm and fits a CD case.

With [small] class option, each calendar page is 9cm × 7.5cm
With [small] class option, each calendar page is 9cm × 7.5cm like a 3.5″ floppy disk

At such small sizes, it may be better to turn off the nongli calendars by changing \toggletrue{chinese-nongli} in the .tex file preamble to \togglefalse{chinese-nongli}.

Changing the pictures

For convenience the images are numbered 01–12. You can create a folder with a different name and place your own image files in it, and then update the \graphicspath{{.../}}. Images of 9:16 or 1:2 aspect ratio work best.

Adding your own events

The public holidays are listed in the tab-separated values files 2024-my-holidays.tsv; and school holidays in 2024-my-school.tsv. If you would like to add your own custom events, you can use the \event command in the .tex files themselves. The mark styles can be customised too. Here’s an example adding 1-day and 5-day events to the monthly of July, 2024:

\begin{monthCalendar}{2024}{07}
%% This is a 1-day event
\event{2024-07-03}{}{Birthday!}
%% This is a 5-day event starting July 15th
\event{2024-07-15}{5}{Exam week}
%% You could also write equivalently
%\event{2024-07-15}{2024-07-19}{Exam week}
\end{monthCalendar}
Use the \event command to insert custom events of your own
Use the \event command to insert custom events of your own

Data sources

The calendar data used in this sample were obtained from the following sources.

  1. Malaysian public holiday data was sourced from the Google Calendar here using the Google Calendars API, then converted to a tab-separated values file.
  2. Malaysian school holiday data was sourced from the Malaysian Ministry of Education’s portal (2023/2024) (2024/2025).
  3. Chinese lunar calendar data was generated from here, converted to a CSV file and Simplified Chinese and some minor editing for typesetting purposes (inserting \\ for line breaks.
  4. Photos in the sample calendar are sourced from Pexels and provided under the Pexels License.

Did you know — you can now use CSL reference styles in LaTeX

(I like this so much that I’ll repost it here after writing about it on the Overleaf blog!)

It’s now possible to use Citation Style Language stylesheets (.csl files) to format citations and reference lists in LaTeX documents! Make sure your LaTeX packages are reasonably up-to-date for this to work.

You can find .csl styles here (let’s use uoy-archaeology-jsm.csl as an example); and put it in the same folder as your .tex file. Load the citation-style-language package in the preamble:

\documentclass[12pt]{article}
\usepackage{citation-style-language}
\cslsetup{style = uoy-archaeology-jsm}
\addbibresource{researchDesign.bib}
 
\begin{document}
... This combination of data from multiple sources may present problems 
in the categorisation and comparison of sites across the region as a 
whole, in particular the Scottish region where few radiocarbon dates are
available and many site not been classified by date 
\cite{elliot-email-2023,beckensall-northumberland-2005}
 
\printbibliography
 
\end{document}

Then after compiling with latex/pdflatex/xelatex, instead of running bibtex to process the citations and .bib file, run the citeproc-lua command instead. Follow up with the usual one or two more runs of latex/pdflatex/xelatex, and watch your citations and references appear. A .bbl file will be generated, which you can include in your manuscript submissions to journals.

But if you’re compiling with LuaLaTeX, things will “just work” with just a single compile.

This will be useful if your institution or journal requires a particular reference style that doesn’t have a corresponding BibTeX or biblatex style file, but does have a CSL style file.

Cuti-cuti Malaysia: Customisable State-by-state Holidays Calendar for 2023

I’ll cut to the chase: Cuti-cuti Malaysia calendar for 2023!

PDF for Penang version: download here.

For other states download the .zip or clone this Overleaf project to your own Overleaf account. Change

\def\mylocation{Penang}

to e.g.

\def\mylocation{Selangor}

If you would just like a calendar without the Malaysian holidays and/or Chinese lunisolar calendars, see this Github repo or this Overleaf template.

See this post for instructions on how to customise your calendar.

Data sources

The calendar data used in this sample were obtained from the following sources, and I cannot guarantee their accuracy and correctness.

  1. Malaysian public holiday data was sourced from the Google Calendar here using the Google Calendars API, then converted to a tab-separated values file.
  2. Malaysian school holiday data was sourced from the Malaysian Ministry of Education’s webpage.
  3. Chinese lunar calendar data was sourced from here, converted to a CSV file and Simplified Chinese and some minor editing for typesetting purposes (inserting \\ for line breaks.
  4. Photos in the sample calendar are sourced from Pexels and provided under the Pexels License.

Using APA7 with usmthesis

Following up from the previous post Using APA7 with umalayathesis, but about usmsthesis. Likewise, I am hoping (against hope?) that one day, apacite package will be updated to support APA7, so that usmthesis.cls won’t need to undergo overhauling either.

But until that day comes, if you need to use APA7 with usmthesis now, then it may actually be easier to make the following changes within usmthesis.tex itself (don’t modify usmthesis.cls).

Add these lines before \documentclass.

\RequirePackage{scrlfile}
\PreventPackageFromLoading{apacite,multibib}
\AfterClass{book}{
  \RequirePackage[style=apa,natbib]{biblatex}
  \let\bibsep\bibitemsep
  \addbibresource{mybib.bib}
}

Remove these lines from usmthesis.tex: (They may be far away from each other; look carefully for each line in your .tex)

\newcites{own}{List of Publications}
\bibliographystyle{apacite}
\bibliographystyleown{apacite}
\bibliography{mybib}

Where you had \bibliography{mybib}, write instead:

\printbibliography[heading=bibintoc]

If you have lists of your own publications, remove these lines too:

\nociteown{lim:2007,lim:latextypesetting}
\bibliographyown{mybib}

and write instead:

\begin{refsection}
\nocite{lim:2007,lim:latextypesetting}
\printbibliography[title={List of Publications},heading=bibintoc]
\end{refsection}

After making these changes, delete the previously generated .bbl files (if any) in the directory.

Then run pdflatex, biber, pdflatex, pdflatex. Note that the biber processor must be used instead of bibtex now.

(If compiling on Overleaf, it should all “just work” because the build tool knows which processor to use.)

Using APA7 with umalayathesis

Currently the umalayathesis class uses apacite to implement the bibliography style, but apacite supports only APA6. For full APA7 it would be necessary to use biblatex-apa; no BibTeX style for full APA7 exists yet.

I’m still hoping (against hope?) that one day, the apacite package will be updated to support APA7, so that umalayathesis.cls won’t need to undergo overhauling…

But for now, if you want to use full APA7, it may actually be easier to make the following changes within thesis.tex itself.

Add these lines before \documentclass:

\RequirePackage{scrlfile}
\PreventPackageFromLoading{multibib}
\providecommand{\newcites}[2]{}

Make sure to add the custombib option in the \documentclass declaration:

\documentclass[english,singlespacedlisttitles,custombib]{umalayathesis}

And then add these lines after \documentclass:

\usepackage[natbib,style=apa]{biblatex}
\addbibresource{myrefs.bib}
\setlength\bibitemsep{2\onelineskip}
\setlength\bibhang{0.5in}
\renewcommand{\bibfont}{\SingleSpacing}

Next remove or comment out these lines:

\bibliography{myrefs}
\nociteown{Lim:2009,Bond:etal:WordNetBahasa:2014}
\bibliographyown{myrefs}

Add instead:

\cftinserthook{toc}{PlainChapTocLines}
\cftinserthook{toc}{disableuppercase}
\printbibliography[heading=bibintoc,title=\refname]
 
\begin{refsection}
\nocite{Lim:2009,Bond:etal:WordNetBahasa:2014}
\printbibliography[heading=bibintoc,title=\listpubname]
\end{refsection}

If you are using the splitpubs environment to separate your publication list for journal articles and conference proceedings, then change your splitpubs in your .tex file to be:

\begin{splitpubs}
\begin{refsection}
\nocite{Bond:etal:WordNetBahasa:2014}
\printbibliography[heading=subbibintoc,title={List of Publications:}]
\end{refsection}
 
\begin{refsection}
\nocite{Lim:2009}
\printbibliography[heading=subbibintoc,title={Papers Presented:}]
\end{refsection}
\end{splitpubs}

After making these changes, delete the previously generated .bbl files (if any) in the directory.

Then run pdflatex, biber, pdflatex, pdflatex. Note that the biber processor must be used instead of bibtex now.

(If compiling on Overleaf, it should all “just work” because the build tool knows which processor to use.)

Cuti-cuti Malaysia: Customisable State-by-state Holidays Calendar for 2022

OK, time for another Cuti-cuti Malaysia calendar for 2022… and yes I’m shamelessly reusing text wholesale from last year’s post 🙂

You can download the PDF customised for Penang here. If you would just like a calendar without the Malaysian holidays and/or Chinese lunisolar calendars, see this Github repo or this Overleaf template.

Preview of first two months in the calendar

Federal public holidays are highlighted in solid shaded pink circles, as in 1–2 February. Public holidays that are applicable for your home state (Penang in the above example) would be highlighted in solid shaded purple circles, as in 1 January. Public holidays in other states (relative to your home state) are also highlighted, but only in a hollow purple circle. See e.g. 14 January (Birthday of Yang di-Pertuan Besar) which is a public holiday in Negeri Sembilan, but not in Penang. School holidays are highlighted in light orange.

If you’d like to generate your own calendar for your own home state, or to change the illustrations/fonts/colours/etc, you can download the source code and compile with XeLaTeX. If you have an Overleaf account, you can also visit my read-only project and clone it to your own Dashboard. See this post for instructions on how to customise your calendar.

Data sources

The calendar data used in this sample were obtained from the following sources, and I cannot guarantee their accuracy and correctness.

  1. Malaysian public holiday data was sourced from the Google Calendar here using the Google Calendars API, then converted to a tab-separated values file.
  2. Malaysian school holiday data was sourced from the Malaysian Ministry of Education’s webpage.
  3. Chinese lunar calendar data was sourced from here, converted to a CSV file and Simplified Chinese and some minor editing for typesetting purposes (inserting \\ for line breaks.
  4. Photos in the sample calendar are sourced from Pexels and provided under the Pexels License.

Happy New Year 2022!

Citations not starting from [1]?

So you’re writing your thesis, and you’ve made very sure to use \bibliographystyle{IEEEtran}, or another style that numbers your citations sequentially throughout your thesis. Of course you would then expect that the first citation in your first chapter is [1], right? Right? So why does it not start from [1] in your own thesis; the first citation is some random number [16] or something??

The most likely cause is that you’ve used a \cite{...} somewhere in your \section, \subsection etc., or in a \caption{...}. So the compiler would see these \cite first when they appear in the table of contents, list of figures and tables: and you would likely see your citations [1], … [16] appearing in those lists.

Citations not starting from [1]
Citations not starting from [1] in “main text” despite using IEEEtran bibliography style
A quick solution to get around this is to load \usepackage{notoccite} in your preamble: this would ensure that the sequential numbering of citations will not start in \tableofcontents, \listoffigures, \listoftables.

Demo using notoccite package
Sample code and output when using notoccite with citations

Happy LaTeXing!