Skip to content

Tosuma/AAU-Latex-Template-English

Repository files navigation

Local LaTeX installation guide

Disclaimer

This guide is for how to install LaTeX and how to compile LaTeX using VS Code as the IDE.

This guide assumes the system uses the apt or brew package manager, and that Windows systems uses a terminal within WSL.

Installation

  1. Install VS Code and the extension

  2. Also Install extension LaTeX Workshop in VS Code

    1. Windows also need the Remote Development extension.
  3. Run installation script:

    1. Windows:

      • Must be runned in WSL
      sh ./_Scripts/setupWSL.sh
    2. Mac:

      sh ./_Scripts/setupMac.sh
    3. Ubuntu:

      sh ./_Scripts/setupUbuntu.sh

    You may need to enter your password for the user

    sudo chmod u+x $script && $script
  4. Ready to use

How to open a project

  1. Enter the path in the shell / Navigate to the project in the shell

  2. Enter the following command to launch VS Code (If using other IDE use its launch command)

code .

How to compile the project

Remember to make the Project Settings

When a .tex file is open, LaTeX-Workshop will present a green playbutton in the upper right corner to compile the current file.

The project most likely contain either a master.tex or main.tex which makes setup and inclusion of all the different .tex files. In general you want to compile that file, however, the explanation of how to compile has been abstracted to how compile in general.

Using VS Code

  1. Press the green button to compile

  2. The file has been compiled into a pdf with the same name

  3. A small icon next to the compile button, opens a preview of the pdf next to the editor, which updates upon re-compiling

Project settings

General settings for Latex

Place the following file in /.vscode/ (create if it does not exist)

settings.json :

{
    "latex-workshop.view.pdf.viewer": "tab",
    "latex-workshop.latex.outDir": "out",
    "latex-workshop.latex.autoClean.run": "onBuilt",
        "latex-workshop.latex.clean.fileTypes": ["chapters*/", "setup*/", "specials*/"],
    "latex-workshop.latex.clean.fileTypes": [
        "chapters*/",
        "setup*/",
        "specials*/"
    ],
    "latex-workshop.latex.tools": [
        {
            "name": "latexmk",
            "command": "latexmk",
            "args": [
                "--shell-escape",
                "-synctex=1",
                "-interaction=nonstopmode",
                "-file-line-error",
                "-output-directory=%OUTDIR%",
                "-pdf",
                "%DOC%"
            ]
        },
        {
            "name": "biber",
            "command": "biber",
            "args": [
                "%DOC%"
            ]
        },
        {
            "name": "makeglossaries",
            "command": "makeglossaries",
            "args": [
                "%DOCFILE%"
            ]
        }
    ]
}

Settings for MakeGlossaries package

This file should be at the same directory level as main.tex or master.tex

.latexmkrc :

add_cus_dep('glo', 'gls', 0, 'run_makeglossaries');
add_cus_dep('acn', 'acr', 0, 'run_makeglossaries');

sub run_makeglossaries {
    my ($base_name, $path) = fileparse( $_[0] ); #handle -outdir param by splitting path and file, ...
    pushd $path; # ... cd-ing into folder first, then running makeglossaries ...

    if ( $silent ) {
        system "makeglossaries -q '$base_name'"; #unix
        # system "makeglossaries", "-q", "$base_name"; #windows
    }
    else {
        system "makeglossaries '$base_name'"; #unix
        # system "makeglossaries", "$base_name"; #windows
    };

    popd; # ... and cd-ing back again
}

About

This is an english template for reports on AAU

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published