Making templates for 1st and 2nd cycle theses

Even better than simply using the LaTeX and DOCX templates found at Templates for 1st and 2nd cycle theses - some templates it is possible to reconfigure the template for a student (or students)!

Creating a JSON file of customization data

If the student is in a Canvas degree project course that has been set up as I indicated at What can be done to make admin of degree projects easier

then it is possible to create a JSON file of configuration data for the LaTeX or DOCX template using a program (available from https://github.com/gqmaguirejr/E-learning Links to an external site.) with a command-line as simple as:

./create_customized_JSON_file.py --canvas_course_id 22156 --author aaaaaa --language eng --programCode TCOMK  

In the above case, the actual student behind the obscured user name 'aaaaaa' was in a two-person first cycle degree project and the code will correctly find the other student (if they are in a project group together in the course)!

Note that it is also possible to pass additional information on the command line, if this information is not yet available in the Canvas course. For example, you can explicitly specify the course code, examiner, supervisors.:

./create_customized_JSON_file.py --canvas_course_id 32733 --author aaaaaa --language eng --programCode TCOMK --courseCode EA275X --Examiner maguire --Supervisor vastberg --Supervisor2 xxx

This customization program is still a work in progress, as it has a lot of hand-tuned code and should be more table-driven. It utilizes various sources of information (such as the Canvas course and the KTH API); hence, so parts will not work unless you have an API key for the KTH API. It also tries to guess what national subject categories a thesis is likely to be based on the course code, in some cases, this may need to be manually adjusted.

On an experimental basis: students who want the customization data produced for them --- can send me mail providing the relevant command line arguments and their values and I will send a JSON file back. I have things (mostly) working for students in EECS but have some support for students in the other schools of KTH.

NB Note that this template customization is not available if you are a student in the Media Technology (TIMTM) and Media Management (TMMTM) programmes - for these there is another LaTeX template  (see https://canvas.kth.se/courses/33514/pages/manage-the-ongoing-project). Unfortunately, this other template was not designed to work with the customization described on this page.

Customizing the LaTeX or DOCX with the customization data

You can now create a customize LaTeX project from a ZIP file of the LaTeX template from in Overleaf (use for example the project at https://www.overleaf.com/read/qxvttmmqbgdt Links to an external site. saved locally as zl1a.zip) then you can run the program  customize_LaTeX_project.py using the command line as:

./customize_LaTeX_project.py --json custom_values.json --file zl1a.zip

This will produce a new ZIP file (zl1a-modfied.zip) that you can use either locally or import as a new project in Overleaf. You should use either XeLaTeX or LuaLaTeX as the LaTeX engine.compiler.

Similarly, there is a customize_DOCX_file.py that can be used with a DOCX template file that has been set up for customization, see Template-thesis-English-2022-with-for-DiVA.docx in my E-learning github.

Understanding what can be customized

The DOCX file named above has an appendix that explains how to adjust the customization data. This is also explained in a document Integrating_DOCX_cover_with_thesis_template.docx/pdf in my E-learning github. This last document also explains the LaTeX macros that are used together with how the DOCX DOCPROPERTIES are used.

For DOCX files the custom DOCPROPERTIES are in docProps/custom.xml while for LaTeX the macros that various values are divided between custom_configuration.tex and examplethesis.tex. The values put into custom_configuration.tex file are those values that I thought might be known or knowable at the start of the project based on information from the Canvas course room or guessed based on that information. In contrast, those defined in the examplethesis.tex file are likely to change during the degree project. One value that I thought about having the custom_configuration.tex custom_configuration.tex file was the TRITA number, but it turns out that this cannot be known until after the thesis is accepted by the examiner [so this location will change] (for background on this see TRITA numbers).