Thank you for considering contributing to this repository!
✍️ Create new notes: see the section below.
🔧 Improve existing ones: fork the repository and create a pull request.
❗Report errors or 💡make suggestions:
- Contact the project manager, or
- Create a GitHub Issue, or
- Fork the repository and create a pull request
- Choose a course for which you will take notes.
- Tell the project manager
- The project manager will create a branch and tell you to fork it.
Inside notes/:
- delete the
.gitkeepfile; - create a folder
<notes-name>/with the same name as your branch.
From this points on, this guide only applies to LaTeX notes.
You will organize your notes inside it using the following structure:
notes/
└── <notes-name>/
├── chapters/
├── res/
│ ├── drawio/
│ ├── ggb/
│ ├── py/
│ ├── svg/
│ └── ...
└── main.tex
-
main.texwill be the main file that gathers the various chapters. See below for the template. -
chapters/contains the.texfiles that make up your chapters. Give these files appropriate names. If necessary, you can further organize them into subfolders. See below for the template. -
res/and its subfolders are all optional and contain files associated with images you’ll include in your notes. In particular:drawio/will contain Draw.io images in.drawio.svgformat.ggb/will contain GeoGebra projects (.ggbextension).py/will contain Python scripts (.pyextension), for example for figures made with Matplotlib.svg/will contain SVG images, e.g. exported from GeoGebra.
You can freely create other subfolders for different image types (e.g. PNG); just try to maintain good organization.
See below for more help with inserting figures.
When compiling the PDF, a build/ folder will be automatically generated, and if you’ve used SVG files, also an svg-inkscape/ folder.
The output PDF will be located at build/main.pdf.
This is the template for main.tex:
% !TEX root = main.tex
\documentclass[italian]{HKNdocument}
% Add here your custom packages and commands
\courseinfo{
code = AB1CDE2,
name = {Nome del corso},
teacher = {Prof.\ Name Surname},
program_level = bachelor,
program = {Nome del corso di studi},
program_en = {Name of Degree Program},
start_academic_year = 2025,
semester = 2
}
\author{Name Surname}
\begin{document}
\include{chapters/first-chapter}
\include{chapters/second-chapter}
\end{document}-
The comment
% !TEX root = main.texon the first line is not just a comment, but it indicates that this is the main file of the folder and the one that should be compiled. -
Set the language (
italianorenglish) as an option in\documentclass. -
Where indicated, you can import your own packages and define your commands.
-
Fill in the fields in
\courseinfoas needed. In particular:nameandprogramare the course name and program name in their respective languages.teacheris the main course teacher (use the appropriate title).program_levelis eitherbachelorormaster.program_enis the name of the degree program in English (it is optional, only include it if the program is in Italian).semesteris either 1 or 2.
-
Fill in
\author. There can be as many authors and editors as needed (editors are added with the\editorcommand). Initially there will typically be one author and no editors. -
The actual content will be included using lines like
\include{chapters/first-chapter}(replacefirst-chapterwith your chapter's.texfilename, extension optional).If some chapters are inside subfolders of
chapters/, specify the correct path, for example\include{chapters/subdirectory/first-chapter}.
Chapter files begin with the following line:
\chapter[Short chapter title]{Full chapter title}The option in [ ] is only needed for chapters with long titles and can be omitted if unnecessary.
After that comes the actual content, divided into \section, etc.
Besides self-generated figures, you can also use figures from external resources in the following cases:
-
their licenses allow redistribution under CC BY-NC-ND 4.0, or
-
they are low quality versions of figures in copyrighted material (see License).
In both cases, it is mandatory that any required attribution is included in the figure captions.
The preamble includes three useful commands to insert figures: \addfigure, \addsvg, and \adddrawio.
Their syntax is similar.
Here are two examples using \addfigure.
-
To add a certain figure with width
0.6\textwidth:\addfigure{path/to/figure}{0.6} -
To also add a caption 'Caption' (default is empty):
\addfigure[Caption]{path/to/figure}{0.6}
In particular, path/to/figure is as follows
-
\addfigure: forres/dir/filename.png, it isdir/filename.Use it for figure formats like PNG and JPG, which must be somewhere inside
res/.The file extension (for example,
.png) is usually unnecessary. -
\addsvg: forres/svg/filename.svg, it isfilename.Use it for
.svgfiles, which must be inres/svg. -
\adddrawio: forres/drawio/filename.drawio.svg, it isfilename.Use it for
.drawio.svgfiles, which must be inres/drawio.
The command also defines the label fig:path/to/figure so that you can later reference to it as, e.g., \ref{fig:path/to/figure}.
Warning
The extension we use (Draw.io Integration) is unofficial, and differently from the Draw.io desktop app it doesn't allow to export as .drawio.pdf.
-
Enable the mathematical typesetting in the Draw.io editor:
Draw.io menu (top-left) > Extras > Mathematical Typesetting
-
Add text
Draw.io bar (top) > Insert (the big +) > Text
and enclose the LaTeX text in
\( ... \). In facts,- using
$ ... $doesn't trigger the mathematical typesetting; - using
$$ ... $$gives errors (they arise in the.pdf_texfiles of thesvg-inkscapefolder).
- using
-
Make sure that, when the source of the text is shown (e.g., when you are editing it), it doesn't wrap, otherwise other errors with the
.pdf_texfiles will occur.
The package float, loaded in the preamble, provides the H placement option.
It is used with figures and tables and it means that the figure or table must be added exactly 'here'.
The !h option may be disregarded if LaTeX chooses so, so using H can sometimes provide better spacing in the document.
The three commands above use the H option by default.
Note
This section is intended for maintainers.
The repository workflow is designed to address the following goals:
- The students who write notes should be able not to care about the repository if not for the commits, the maintainers should manage everything.
- The students should work in a clean branch.
- Updates to the released PDFs should not be too frequent.
main: branch with all the notes, the index, and the compiled PDFs.structure: just as the main, but without notes, index, and PDFs (only repository structure and templates)feat/*andfix/*feature branches: created fromstructure, merge intostructurenotes/*notes branches: created fromstructure, do not contain the notes of other courses
- feature branches
$\to$ structure -
structure$\to$ main(to update templates, etc.) - notes branches
$\to$ main(to update the notes content) -
structure$\to$ notes branches (preferably rarely, case *)
Some commits of main may be tagged and correspond to published versions.
Publication is not automated.
-
Develop in
structure, possibly through feature branches -
Manage all merges
-
Create the notes branches
Naming convention:
notes/<course-name>-<teacher-surname>, where the course name is in the appropriate language, lowercase, with words joined by hyphens and with numbers instead of I, II, etc.Examples:
notes/fisica-2-pirri,notes/fisica-dello-stato-solido-di-fabrizio -
Tell those writing notes to perform a
git pull(case *)
- Only use their own notes branch
- Perform a
git pullwhen asked (case *)
Commits should be atomic and focused on single changes.
For commit messages:
- Please follow Conventional Commits 1.0.0, but
- omit the scope
- introduce the commit type
notes:for addition of notes content.
- Consider following the 50/72 Rule