How to use LaTeX in Ghost
The Markdown parser in Ghost does not parse , but you can parse it separately using other tools and post them on your Ghost blog.
In this tutorial, I'll show you how to use with Ghost. is a fast typesetting library that helps you print on the web.
#
Easy wayThe easiest way to publish in Ghost is to use the Append Editor. Paste your Markdown in the Append Editor, open the menu in the top right, then under Share, click Copy rendered HTML. Then paste the HTML in an HTML card in Ghost.
Then copy the following link into the header or footer of your website or post as a code injection:
The latest links are available on GitHub.
#
The Hard Way#
Set up- Install Node.js
- Create a
package.json
with this content:
- Run
sudo npm install -g npm-check-updates
. - Run
ncu -u
. - Run
npm install
.
#
Create a CompilerCreate a compilers.js
file with the following content:
#
Command Line ApproachTo run the compiler without specifying your .md
and .html
files within compiler.js
, add this code to the bottom of compiler.js
:
To compile your Markdown to HTML, run this command:
warning
This approach will overwrite your ./path/to/BlogPost.html
file if it already exists.
#
File System ApproachTo specify the .md
and .html
files within compiler.js
, add this code to the bottom of compiler.js
:
To compile your Markdown to HTML, run this command:
warning
This approach will overwrite your ./path/to/BlogPost.html
file if it already exists.
#
StylesheetsFinally, add the stylesheets to your Ghost blog as a code injection to the header. You can add it globally if you need to use it often, or to the code injection for each individual post. You can find the latest links to the CDN on GitHub:
#
Examples#
Further Resources#
Give backThe techniques described in this tutorial depend heavily on free and open-source plugins developed by the Unifiedjs Collective. If you think their plugins are useful, please support their work on Open Collective.