2

TL;DR: I want to write (basic) custom macros that VS Code can render in markdown files

I use VS Code with the Markdown Preview Enchanced extension to write mathematical documents in Markdown. I often include basic (La)TeX commands in them, eg $\bar x = \tfrac1n \sum_i x_i$. In the past, I was able to include custom macros, such as \eps in place of \varepsilon. VS Code's preview then renders these correctly. I can't for the life of me remember how I did this, though, and I've moved to a new computer.

I still have a file on my old computer called config.js, which consists of a whole list of these. But, it's just in a documents folder. I presume I made a copy of it, to remember what macros I'd made, in case some update deleted it. I just can't see where I should put that file on my new computer. Here's an abbreviated copy of the file.

({
  katexConfig: {
  "macros": {}
},
  mathjaxConfig: {
  "tex": { macros: {
    ...
    eps: "\\varepsilon",
    ...
  }},
  "options": {},
  "loader": {}
},
})

Also, I'd slightly prefer to use KaTeX to MathJax, but that's far from a deal-breaker.

Incidentally, I know you can do things like add $\newcommand{\eps}{\varepsilon}$, but that isn't what I'm looking for.

1
  • Downvoter care to share feedback? Seems like a reasonable question to me... You had upvoted, but then changed it to a downvote (I can see the change in rep) Commented Jun 20 at 10:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.