[Tex/LaTex] how to add a default path to texmaker LaTeX

texinputstexmaker

I am trying to add a path to texmaker (Texmaker 4.5 on OSX Sierra).
The reason is that i want to be able to do the same template doc every time so i dont have to re-import everything manually.
I successfully did for org-mode, but i could not find the way to do it in LaTeX directly.

Any lead please?

Best Answer

solution 1: symlink

create this folder structure:

template/
    myTemplateFile.tex
project1/
    myProjectFile.tex
    template->../template
project2/
    myProjectFile.tex
    template->../template

to create the symlinks go into the projectX folders and type
ln -s ../template template

then in myProjectFile.tex reference the template as
\input{template/myTemplateFile.tex}


solution 2: git

  • create a (remote) git repository for your template file. (eg. https://github.com/someuser/template.git)
  • create a new local git repository for your new project.
    git init .
  • checkout the template repository as git submodule:
    git submodule add https://github.com/someuser/template.git template

content of the project main file looks the same in both approaches:
\input{template/myTemplateFile.tex}

single users should prefer the symlink apprach, for multiple users prefer the git approach.