Specification:

  • macOs Monterey v12.2.1
  • chip Apple M1

Preparation:

  • VSCode
  • MacTex: quickly install by executing command brew install mactex

VS Code Configuration:

  • Install “LaTeX Workshop” extension (James Yu)
  • Press Command+Shift+P, type and choose “Preferences: Open Settings(JSON)” and append these lines:
// ~/Library/Application Support/Code/User/settings.json

{
    // omit...

    // LaTex
    "latex-workshop.latex.tools": [
      {
        "name": "latexmk",
        "command": "latexmk",
        "args": [
          "-synctex=1",
          "-interaction=nonstopmode",
          "-file-line-error",
          "-pdf",
          "-outdir=%OUTDIR%",
          "%DOC%"
        ],
        "env": {
          "PATH": "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin"
        }
      },
    ],
    "latex-workshop.latex.recipes": [
      {
        "name": "latexmk 🔃",
        "tools": [
          "latexmk"
        ],
      },
    ],
    "latex-workshop.latex.clean.fileTypes": [
        "*.aux",
        "*.bbl",
        "*.blg",
        "*.idx",
        "*.ind",
        "*.lof",
        "*.lot",
        "*.out",
        "*.toc",
        "*.acn",
        "*.acr",
        "*.alg",
        "*.glg",
        "*.glo",
        "*.gls",
        "*.ist",
        "*.fls",
        "*.log",
        "*.fdb_latexmk",
        "*.snm",
        "*.nav",
    ],

    // omit...
}
  • NOTE: VSCode retrieve the PATH in the env instead of $PATH from the shell. That’s why we must override the PATH environment variable. Read more.

  • Press Command+Shift+P, type and choose “Developer: Reload Window”

Compile and Preview:

  • For quick test, we’ll using below LaTex script:
\documentclass{article}

\usepackage{amsmath,amsthm,amsfonts}                % AMS Math
\usepackage{thmtools}                               % Theorem Tools
\usepackage{bm}                                     % Bold Math

\title{Another Nobel Prize Level Observation}
\author{Yu Wang (Don't Tell Others Who I Am)}
\date{April 2022}

\begin{document}

\maketitle

\section{Conclusion}
After years of experiments, we provide that the widely accepted Ohm's law (\ref{eq: thesis contribution 1}) is correct only if we did the measurement correct. We think this is a breakthrough in the world of Electric Engineering, and this observation deserves a Nobel Prize.
\begin{align}
    V = IR \label{eq: thesis contribution 1}
\end{align}

Please keep this secret between you and me.

\end{document}
  • Press Command+Option+B to build
  • Press Command+Option+V to preview in PDF