TL; DR: What is the complete setup for VSCode to run XeLaTeX or LuaLaTeX, with working examples using unicode characters with minted? I’ve looked everywhere, finding the latex-workshop.latex.tools
in one spot, the latex-workshop.latex.recipes
in another spot, then example .tex
files elsewhere, and they don’t play nicely together. I am so confused.
So, I am new to the world of programming and spend more than half my time lost trying to understand what on earth everyone is talking about.
In this answer to a Stack Exchange question, Brad gives an example without the need to “define” new unicode characters (as with another answer to that question) because it has a huge variety of them.
In this post, the creator of LaTeX-Workshop discourages the use of the magic comment which is used in the Stack Exchange answer aforementioned, so I’ve deleted it. I also have no idea where the latex-workshop.latex.toolchain
is meant to be copied-and-pasted (or edited).
I’ve learned from here that minted
is better than listings
because the former takes in the syntax highlighting and formatting rules from pygmentize
, which I have installed through the python installer.
I’ve obtained an example of defining the xelatex
tool from here. But it has no example of a recipe.
This guy’s example isn’t specific enough for me, i.e. VSCode settings are unclear to me.
The .tex
file I have is as follows,
\documentclass[12pt]{article}
\usepackage[letterpaper]{geometry}
\usepackage{fontspec,unicode-math}
\usepackage{xunicode}
\usepackage{minted}
\setmonofont{FreeMono}
\begin{document}
\section{Example Code}
Hello, here is some code.
\begin{minted}{julia}
f(x) = x.^2 + π
const ⊗ = kron
const Σ = sum # Although `sum` may be just as good in the code.
# Calculate Σ_{j=1}^5 j^2
Σ([j^2 for j ∈ 1:5])
\end{minted}
\end{document}
With the following as my settings.json
file for VSCode.
{
"latex-workshop.latex.recipes": [
{
"name": "latexmk",
"tools": "latexmk"
}
],
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": [
"-xelatex",
"-synctex=1",
"-interaction=nonstopmode",
"-file-line-error",
"%DOC%"
]
}
]
}
Are these sufficient for a successful run? It doesn’t run successfully for me.