Skip to content

Commit

Permalink
Added LaTeX page compiler plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Jan 14, 2017
1 parent 2fc1fb6 commit bff18eb
Show file tree
Hide file tree
Showing 13 changed files with 3,654 additions and 0 deletions.
42 changes: 42 additions & 0 deletions v7/latex/README.md
@@ -0,0 +1,42 @@
This plugin allows to write posts and pages in a LaTeX-like syntax.

For Python before 3.4, you need to install the [`enum34` library](https://pypi.python.org/pypi/enum34). From Python 3.4 on, it is part of the language.


Formulae
--------

There are two available formulae backends:

* one based on the [`latex_formula_renderer` plugin](https://plugins.getnikola.com/v7/latex_formula_renderer/);
* one based on [MathJax](https://www.mathjax.org/).

The first plugin allows special features the second doesn't:

* `align` environments (see the [AMSMath documentation](ftp://ftp.ams.org/ams/doc/amsmath/amsldoc.pdf));
* XY-pic diagrams (see the [XY-Pic user guide](http://texdoc.net/texmf-dist/doc/generic/xypic/xyguide.pdf));
* PSTricks graphics (see [here](https://en.wikipedia.org/wiki/PSTricks) for more information);
* TikZ pictures (see [here](https://en.wikibooks.org/wiki/LaTeX/PGF/TikZ) for more information).

You need an installed LaTeX distribution for this to work, with some extra tools. See the `latex_formula_renderer` plugin for details.


Required Translations
---------------------

You need to add the following translations to your theme if you use theorem environments:
``` .py
MESSAGES = {
'math_thm_name': 'Theorem',
'math_prop_name': 'Proposition',
'math_cor_name': 'Corollary',
'math_lemma_name': 'Lemma',
'math_def_name': 'Definition',
'math_defs_name': 'Definitions',
'math_proof_name': 'Proof',
'math_example_name': 'Example',
'math_examples_name': 'Examples',
'math_remark_name': 'Remark',
'math_remarks_name': 'Remarks',
}
```
16 changes: 16 additions & 0 deletions v7/latex/conf.py.sample
@@ -0,0 +1,16 @@
# Determines how the formulae are rendered. Possibilities:
# - "latex_formula_image_renderer": renders formulae as graphics and includes them.
# - "latex_formula_mathjax": inserts MathJax code.
LATEX_FORMULA_RENDERER = "latex_formula_image_renderer"

# When "latex_formula_image_renderer" is selected as the formula renderer,
# the formulae colors and scale can be set here:
#
# The color must be given as an RGB triple with components in range [0, 1].
# Here, (0, 0, 0) is black and (1, 1, 1) is white.
LATEX_FORMULA_COLOR = (0., 0., 0.)
#
# The formula scale determines the effective size of the formulae.
# Check what looks good with your theme's main font.
LATEX_FORMULA_SCALE = 1.25

12 changes: 12 additions & 0 deletions v7/latex/latex.plugin
@@ -0,0 +1,12 @@
[Core]
Name = latex
Module = latex

[Nikola]
PluginCategory = PageCompiler

[Documentation]
Author = Felix Fontein
Version = 0.1
Website = https://felix.fontein.de
Description = Compile LaTeX-similar text to HTML

0 comments on commit bff18eb

Please sign in to comment.