{ "info": { "author": "James W. Kennington", "author_email": "jameswkennington@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# pelican-render-math\nPelican plugin for rendering LaTeX\n\n\n## Math Render Plugin For Pelican\n\nThis plugin gives pelican the ability to render mathematics. It accomplishes\nthis by using the [MathJax](http://www.mathjax.org/) javascript engine.\n\nThe plugin also ensures that Typogrify and recognized math \"play\" nicely together, by\nensuring [Typogrify](https://github.com/mintchaos/typogrify) does not alter math content.\n\nBoth Markdown and reStructuredText is supported.\n\n## Requirements\n\n * Pelican version *3.6* or above is required.\n * Typogrify version *2.0.7* or higher is needed for Typogrify to play\n \"nicely\" with this plugin. If this version is not available, Typogrify\n will be disabled for the entire site.\n * BeautifulSoup4 is required to correct summaries. If BeautifulSoup4 is\n not installed, summary processing will be ignored, even if specified\n in user settings.\n\n## Installation\n\nTo enable, ensure that `render_math` plugin is accessible.\nThen add the following to settings.py:\n\n PLUGINS = [\"pelican_render_math\"]\n\nYour site is now capable of rendering math math using the mathjax JavaScript\nengine. No alterations to the template is needed, just use and enjoy!\n\nHowever, if you wish, you can set the `auto_insert` setting to `False` which\nwill disable the mathjax script from being automatically inserted into the\ncontent. You would only want to do this if you had control over the template\nand wanted to insert the script manually.\n\n### Typogrify\nIn the past, using [Typgogrify](https://github.com/mintchaos/typogrify) would\nalter the math contents resulting in math that could not be rendered by MathJax.\nThe only option was to ensure that Typogrify was disabled in the settings.\n\nThe problem has been rectified in this plugin, but it requires at a minimum\n[Typogrify version 2.0.7](https://pypi.python.org/pypi/typogrify) (or higher).\nIf this version is not present, the plugin will disable Typogrify for the entire\nsite.\n\n### BeautifulSoup4\nPelican creates summaries by truncating the contents to a specified user length.\nThe truncation process is oblivious to any math and can therefore destroy\nthe math output in the summary.\n\nTo restore math, [BeautifulSoup4](https://pypi.python.org/pypi/beautifulsoup4/4.4.0)\nis used. If it is not installed, no summary processing will happen.\n\n## Usage\n### Templates\nNo alteration is needed to a template for this plugin to work. Just install\nthe plugin and start writing your Math. \n\n### Settings\nCertain MathJax rendering options can be set. These options \nare in a dictionary variable called `MATH_JAX` in the pelican\nsettings file.\n\nThe dictionary can be set with the following keys:\n\n * `align`: [string] controls how displayed math will be aligned. Can be set to either\n`'left'`, `'right'` or `'center'`. **Default Value**: `'center'`.\n * `auto_insert`: [boolean] will insert the mathjax script into content that it is\ndetected to have math in it. Setting it to false is not recommended.\n**Default Value**: `True`\n * `indent`: [string] if `align` not set to `'center'`, then this controls the indent\nlevel. **Default Value**: `'0em'`.\n * `show_menu`: [boolean] controls whether the mathjax contextual menu is shown.\n**Default Value**: `True`\n * `process_escapes`: [boolean] controls whether mathjax processes escape sequences.\n**Default Value**: `True`\n * `mathjax_font`: [string] will force mathjax to use the chosen font. Current choices\nfor the font is `sanserif`, `typewriter` or `fraktur`. If this is not set, it will\nuse the default font settings. **Default Value**: `default`\n * `latex_preview`: [string] controls the preview message users are shown while mathjax is\nrendering LaTex. If set to `'Tex'`, then the TeX code is used as the preview \n(which will be visible until it is processed by MathJax). **Default Value**: `'Tex'`\n * `color`: [string] controls the color of the mathjax rendered font. **Default Value**: `'inherit'`\n * `linebreak_automatic`: [boolean] If set, Mathjax will try to *intelligently* break up displayed math\n(Note: It will not work for inline math). This is very useful for a responsive site. It\nis turned off by default due to it potentially being CPU expensive. **Default Value**: `False`\n * `tex_extensions`: [list] a list of [latex extensions](http://docs.mathjax.org/en/latest/tex.html#tex-and-latex-extensions)\naccepted by mathjax. **Default Value**: `[]` (empty list)\n * `responsive`: [boolean] tries to make displayed math render responsively. It does by determining if the width\nis less than `responsive_break` (see below) and if so, sets `align` to `left`, `indent` to `0em` and `linebreak_automatic` to `True`.\n**Default Value**: `False` (defaults to `False` for backward compatibility)\n * `responsive_break`: [integer] a number (in pixels) representing the width breakpoint that is used\nwhen setting `responsive_align` to `True`. **Default Value**: 768\n * `process_summary`: [boolean] ensures math will render in summaries and fixes math in that were cut off.\nRequires [BeautifulSoup4](http://www.crummy.com/software/BeautifulSoup/bs4/doc/) be installed. **Default Value**: `True`\n * `message_style`: [string] This value controls the verbosity of the messages in the lower left-hand corner. Set it to `None` to eliminate all messages.\n**Default Value**: normal\n\n#### Settings Examples\nMake math render in blue and displaymath align to the left:\n\n MATH_JAX = {'color':'blue','align':left}\n\nUse the [color](http://docs.mathjax.org/en/latest/tex.html#color) and\n[mhchem](http://docs.mathjax.org/en/latest/tex.html#mhchem) extensions:\n\n MATH_JAX = {'tex_extensions': ['color.js','mhchem.js']}\n\n#### Resulting HTML\nInlined math is wrapped in `span` tags, while displayed math is wrapped in `div` tags.\nThese tags will have a class attribute that is set to `math` which \ncan be used by template designers to alter the display of the math.\n\n## Markdown\n\nThis plugin implements a custom extension for markdown resulting in math\nbeing a \"first class citizen\" for Pelican. \n\n### Inlined Math\nMath between `$`..`$`, for example, `$`x^2`$`, will be rendered inline\nwith respect to the current html block. Note: To use inline math, there\nmust *not* be any whitespace before the ending `$`. So for example:\n\n * **Relevant inline math**: `$e=mc^2$`\n * **Will not render as inline math**: `$40 vs $50`\n\n### Displayed Math\nMath between `$$`..`$$` will be rendered \"block style\", for example, `$$`x^2`$$`, will be rendered centered in a\nnew paragraph.\n\n#### Other Latex Display Math commands\nThe other LaTeX commands which usually invoke display math mode from text mode\nare supported,\nand are automatically treated like `$$`-style displayed math \nin that they are rendered \"block\" style on their own lines.\nFor example, `\\begin{equation}` x^2 `\\end{equation}`,\nwill be rendered in its own block with a right justified equation number\nat the top of the block. This equation number can be referenced in the document.\nTo do this, use a `label` inside of the equation format and then refer to that label\nusing `ref`. For example: `\\begin{equation}` `\\label{eq}` X^2 `\\end{equation}`. \nNow refer to that equation number by `$`\\ref{eq}`$`.\n\n## reStructuredText\n\nIf there is math detected in reStructuredText document, the plugin will automatically\nset the [math_output](http://docutils.sourceforge.net/docs/user/config.html#math-output) configuration setting to `MathJax`.\n\n### Inlined Math\nInlined math needs to use the [math role](http://docutils.sourceforge.net/docs/ref/rst/roles.html#math):\n\n```\nThe area of a circle is :math:`A_\\text{c} = (\\pi/4) d^2`.\n```\n\n### Displayed Math\nDisplayed math uses the [math block](http://docutils.sourceforge.net/docs/ref/rst/directives.html#math):\n\n```\n.. math::\n\n \u03b1_t(i) = P(O_1, O_2, \u2026 O_t, q_t = S_i \u03bb)\n```\n\n## Acknowledgments\n\nThis package is based closely by one built by [Justin Mayer](https://github.com/justinmayer) in \n[render_math](https://github.com/getpelican/pelican-plugins/blob/master/render_math/math.py). \n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/JWKennington/pelican-render-math", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pelican-render-math", "package_url": "https://pypi.org/project/pelican-render-math/", "platform": "", "project_url": "https://pypi.org/project/pelican-render-math/", "project_urls": { "Homepage": "http://github.com/JWKennington/pelican-render-math" }, "release_url": "https://pypi.org/project/pelican-render-math/0.3.1/", "requires_dist": null, "requires_python": "", "summary": "Pelican math rendering plugin modified to work with nice-blog theme", "version": "0.3.1" }, "last_serial": 5581040, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "24f9ab43446586b727893589cebc50ae", "sha256": "802866f7ab6e2abdda94a3447245bb8aec45300a2d67863d354b680cf0b3b4e0" }, "downloads": -1, "filename": "pelican_render_math-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "24f9ab43446586b727893589cebc50ae", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12477, "upload_time": "2019-04-23T04:46:49", "url": "https://files.pythonhosted.org/packages/21/df/af87e8f381e0090f6820c7affbcbb96118159d12f44276770061a571032f/pelican_render_math-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4cd2b463a9467466f493593c422dccb2", "sha256": "37dcdb5cb6830f1203241c5ba70effd0239d962d28d46eddda6e190589a376a7" }, "downloads": -1, "filename": "pelican_render_math-0.2.0.tar.gz", "has_sig": false, "md5_digest": "4cd2b463a9467466f493593c422dccb2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13476, "upload_time": "2019-04-23T04:46:51", "url": "https://files.pythonhosted.org/packages/33/3d/c6a8dbdd5a64cef969734870031f5daf41fa894506c4184aac19f2a7d2f4/pelican_render_math-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "1695a660b62c7b78b6b2672a22e24ee0", "sha256": "2d5f3bd71541c551a30ffd2b74946d1baad310600583cb1b05baba7da3c3b8e2" }, "downloads": -1, "filename": "pelican_render_math-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1695a660b62c7b78b6b2672a22e24ee0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13651, "upload_time": "2019-04-23T04:58:38", "url": "https://files.pythonhosted.org/packages/54/e2/674d39ae25400af43e61611631a1ece1c76e7967eae28ddea22e9051bfb5/pelican_render_math-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1a041f3abd151964005b60814f4bb0f8", "sha256": "efa90edaeb07347ea67b30fd25fa093d2f3a01639dd2ac5200b50e7e4c4d0c73" }, "downloads": -1, "filename": "pelican_render_math-0.3.0.tar.gz", "has_sig": false, "md5_digest": "1a041f3abd151964005b60814f4bb0f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14474, "upload_time": "2019-04-23T04:58:40", "url": "https://files.pythonhosted.org/packages/94/fa/7a4fec8d605d705e39e2b73616e89de4fcc81d348af8c673cd209017a0ed/pelican_render_math-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "9bbd9b620ce7b64b2d94eff8e66eccf1", "sha256": "ca58a1af73f6f723f420d632f6b3992289fe258256462ee4af63fcb32abfe1ae" }, "downloads": -1, "filename": "pelican_render_math-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9bbd9b620ce7b64b2d94eff8e66eccf1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13670, "upload_time": "2019-07-25T03:49:12", "url": "https://files.pythonhosted.org/packages/e1/91/b195a7b27cf1e942fcf6991c6bd99f76c514d22a751b0b5c3948dd81de60/pelican_render_math-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "399f7d38f347c619accf1f6c8f8bfa0c", "sha256": "00412250bd4b83a7e00f507810c3bc48a213ef4e4a11f9293b3885fa81f7064d" }, "downloads": -1, "filename": "pelican_render_math-0.3.1.tar.gz", "has_sig": false, "md5_digest": "399f7d38f347c619accf1f6c8f8bfa0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14495, "upload_time": "2019-07-25T03:49:13", "url": "https://files.pythonhosted.org/packages/27/d8/34a30add539196e359c4e1366bd1c9b3ab810b525e04d35cfb41946d3368/pelican_render_math-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9bbd9b620ce7b64b2d94eff8e66eccf1", "sha256": "ca58a1af73f6f723f420d632f6b3992289fe258256462ee4af63fcb32abfe1ae" }, "downloads": -1, "filename": "pelican_render_math-0.3.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9bbd9b620ce7b64b2d94eff8e66eccf1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13670, "upload_time": "2019-07-25T03:49:12", "url": "https://files.pythonhosted.org/packages/e1/91/b195a7b27cf1e942fcf6991c6bd99f76c514d22a751b0b5c3948dd81de60/pelican_render_math-0.3.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "399f7d38f347c619accf1f6c8f8bfa0c", "sha256": "00412250bd4b83a7e00f507810c3bc48a213ef4e4a11f9293b3885fa81f7064d" }, "downloads": -1, "filename": "pelican_render_math-0.3.1.tar.gz", "has_sig": false, "md5_digest": "399f7d38f347c619accf1f6c8f8bfa0c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14495, "upload_time": "2019-07-25T03:49:13", "url": "https://files.pythonhosted.org/packages/27/d8/34a30add539196e359c4e1366bd1c9b3ab810b525e04d35cfb41946d3368/pelican_render_math-0.3.1.tar.gz" } ] }