From: Vladimír Vondruš Date: Mon, 22 Jan 2018 12:10:04 +0000 (+0100) Subject: m.code: test that backslashes in inline :code: are properly preserved. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=50c9520a826af0e4c7a34a0fcf9de2e852697683;p=blog.git m.code: test that backslashes in inline :code: are properly preserved. They are not. --- diff --git a/pelican-plugins/m/test/code/page.html b/pelican-plugins/m/test/code/page.html index 6e5050d4..16406a9d 100644 --- a/pelican-plugins/m/test/code/page.html +++ b/pelican-plugins/m/test/code/page.html @@ -34,6 +34,7 @@ CONTRIBUTING.rst CREDITS.rst doc pelican-plugins README.rst COPYING css doxygen pelican-theme site
// this language is not highlighted
+

Properly preserve backslashes: \frac{a}{b}

diff --git a/pelican-plugins/m/test/code/page.rst b/pelican-plugins/m/test/code/page.rst index 2850b28c..7cccd0a8 100644 --- a/pelican-plugins/m/test/code/page.rst +++ b/pelican-plugins/m/test/code/page.rst @@ -3,6 +3,8 @@ m.code .. role:: cpp(code) :language: c++ +.. role:: tex(code) + :language: tex .. code:: c++ @@ -26,3 +28,5 @@ Inline code is here: :cpp:`constexpr` .. code:: whatthefuck // this language is not highlighted + +Properly preserve backslashes: :tex:`\frac{a}{b}` diff --git a/pelican-plugins/m/test/math/page.html b/pelican-plugins/m/test/math/page.html index a1efbdf8..7a83b409 100644 --- a/pelican-plugins/m/test/math/page.html +++ b/pelican-plugins/m/test/math/page.html @@ -167,7 +167,7 @@ Y = \sum_{i=0}^{n} B

-

The \cfrac thing doesn't align well: +

The \cfrac thing doesn't align well: LaTeX Math W = \sum_{i=0}^{n} \cfrac{w_i}{h_i} @@ -198,8 +198,6 @@ W = \sum_{i=0}^{n} \cfrac{w_i}{h_i}

-

Huh, apparently backslashes have to be escaped in things like this: -frac

diff --git a/pelican-plugins/m/test/math/page.rst b/pelican-plugins/m/test/math/page.rst index c920d1d0..d5e8c3c2 100644 --- a/pelican-plugins/m/test/math/page.rst +++ b/pelican-plugins/m/test/math/page.rst @@ -3,8 +3,6 @@ m.math :summary: no. -.. role:: tex(code) - :language: tex .. role:: math-primary(math) :class: m-primary @@ -21,7 +19,4 @@ and make sure there's enough space for all the complex :math:`W` things between the lines :math:`W = \sum_{i=0}^{n} \frac{w_i}{h_i}` because :math:`Y = \sum_{i=0}^{n} B` -The :tex:`\\cfrac` thing doesn't align well: :math:`W = \sum_{i=0}^{n} \cfrac{w_i}{h_i}` - -Huh, apparently backslashes have to be escaped in things like this: -:tex:`\frac` +The ``\cfrac`` thing doesn't align well: :math:`W = \sum_{i=0}^{n} \cfrac{w_i}{h_i}`