First time here? Check out the FAQ!

Ask Your Question
0

LaTeX macros in Markdown on Cocalc

asked 6 years ago

Paul Bryan gravatar image

I'm trying to use some custom macros in sage worksheets and Markdown files. How do I include my own custom macros in a Markdown file? I thought the markdown conversion used pandoc so I tried adding YAML front matter:

---
header-includes: |
    \usepackage[all]{pabmacros}
---

but cocalc just tries to render it rather than treating it as YAML front matter.

I would also like to do something similar in Sage worksheets. It works okay with LaTeX. I have a cell like this

%auto
%latex.add_to_preamble
\usepackage[all]{pabmacros}

Then I can access my macros (such as "\Rm") in LaTeX cells:

%latex
\[
\Rm
\]

Everything works fine there.

If I try to use my macros in Markdown cells however, they do not render properly.

%md

# My heading

\[
\Rm
\]

just produces "\Rm" in red.

Does anyone know how I can use my own custom macros in Markdown?

Preview: (hide)

Comments

For any CoCalc related questions, the best is to contact their support team by clicking "Help" at the top of the document you are working on in CoCalc. This way they can have a look, see exactly what you see and provide help.

slelievre gravatar imageslelievre ( 6 years ago )

1 Answer

Sort by » oldest newest most voted
0

answered 6 years ago

William Stein2 gravatar image

thought the markdown conversion used pandoc so I tried adding YAML front matter:

It's rendered on the frontend using markdown-it.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 6 years ago

Seen: 921 times

Last updated: Jun 05 '18