Introduction
I like to build LaTeX documents using the LaTeX Workshop extension in VSCode. I'm using MiKTeX as a package manager. I know I can add a particular TDS compliant folder as a texmf directory by adding it through the MiKTeX console or running initexmf --register-root="path\to\texmf" in the command prompt.
However, I don't want to do this for every project, and I read here that I can add a local texmf folder by adding the following to settings.json:
{ "latex-workshop.latex.tools": [ { "name": "latexmk", "command": "latexmk", "args": [ "-synctex=1", "-interaction=nonstopmode", "-file-line-error", "-pdf", "-outdir=%OUTDIR%", "%DOC%" ], "env": { "TEXMFHOME": "%DIR%/texmf" } } ] } Minimal working example
This is my local folder structure:
home/ main.tex settings.json texmf/ tex/ latex/ myclass/ myclass.cls The content of settings.json is exactly what's displayed above. Content of main.tex:
\documentclass{myclass} \begin{document} Hello! \end{document} Content of myclass.cls:
\NeedsTeXFormat{LaTeX2e} \ProvidesClass{yomama}[2014/08/16 Example LaTeX class] \LoadClass[a4paper]{article} Problem statement
I'm trying to compile main.tex but it doesn't succeed. Whatever's in my local texmf folder cannot be found when I compile a document. The output file states ! LaTeX Error: File 'myclass.cls' not found.
Why? Do I misunderstand what I'm supposed to do? Am I required to do something else as well?
.texfile and the compiler will find it.