{ "info": { "author": "D Evans", "author_email": "evansd8@cf.ac.uk", "bugtrack_url": null, "classifiers": [], "description": "# The `latextree` Package\n\nCreates a document object model for LaTeX and provides some useful functions. The parser understands the syntax of most common macros but is NOT a replacement for a full LaTeX engine. The parser should only be invoked only after the input has been successfully compiled under LaTeX.\n\nExample:\n```python\n>>> from latextree.parser import LatexParser\n>>> pa = LatexParser()\n>>> filename = \"/path/to/main.tex\"\"\n>>> doc = pa.parse_latex_file(filename)\n>>> doc.make_website()\t\t\t# create website\n>>> bbqs = doc.bbq()\t\t\t# extract mc/ma questions in Blackboard format (plain text)\n>>> docx = doc.root.get_xml()\t# create xml document\n>>> from lxml import etree\n>>> print(etree.tostring(docx, pretty_print=True))\n```\n\nIf `latextree` is installed as a package:\n```python\n>>> import latextree\n>>> filename = \"/path/to/main.tex\"\"\n>>> doc = load(filename)\n>>> doc.make_website()\t# create website\n>>> bbqs = doc.bbq()\t# extract mc/ma questions in Blackboard format (plain text)\n>>> exit()\n```\n\n---\n## Standards\n\nThe following are yet to be implemented properly.\n\n* Exception handling\n* Testing\n* Logging\n* Documentation\n\n---\n## `make_website`\n```python\n>>> doc.make_website(copy_static=True, copy_figures=True, WEB_ROOT=None)\n```\n\nBy default, the website is created in a folder called `web-latexmainfilename` in the directory containing the main latex source file. . The output directory can be changed by setting the WEB_ROOT variable.\n\n* html files are written to WEB_ROOT\n* style files are copied to WEB_ROOT/static/css. These can be modified post-production.\n* figures are copied to WEB_ROOT/static/img\n* urls are constructed from chapter and/or section numbers (if any)\n\n### Templates\nThe `LatexDocument.make_website()` function uses `jinja2` templates.\n\n* `scripts.html` loads the `MathJax` and `jquery` CDNs from cloudflare.\n* `node.html` does most of the work. This needs to be broken up.\n\n### Static files\n\n* `css/`: The stylesheets are rough-and-ready and need a lot of work (especially for phones and tablets).\n* `img/`: Image files are copied into here.\n* `js/`: Currently contains only a simple show/hide function.\n\n---\n## Modules\n\n* `bibliography`: wrapper for `bibtexparser`\n* `content`: content nodes\n* `document`: `LatexDocument` class and output functions\n* `factory`: creates node classes and objects\n* `ltree`: command line tools\n* `macrosdef`: macro definitions for `pylatexenc.latexwalker`\n* `node`: base class for `LatexTreeNode` objects.\n* `parser`: `LatexParser` class. Creates `LatexDocument` objects.\n* `preprocessor`: prepare latex source for `pylatexenc.latexwalker`(replace $$...$$ etc.)\n* `reader`: input functions and utilities\n* `settings`: website settings (e.g. mathjax cdn)\n* `tabular`: parse tabular environments.\n* `taxonomy`: register of species (e.g. `list`) and genera (e.g. `itemize`).\n* `walker`: wrapper for `pylatexenc.latexwalker`.\n\n### Dependencies\n\n* `bibtexparser`\n* `jinja2`\n* `lxml`\n* `pylatexenc`\n\n## Test files\nThe `tex` directory contains:\n* `LatexTreeTestBook` for testing the `book` document class\n* `LatexTreeTestArticle` for testing the `article` document class\n* `LatexTreeTestExam` for testing the `exam` document class\n\n\n## Existing software for Latex processing\n\n* pylatexenc\n\t- LaTeX -> Unicode\n\t- python package\n\n* plasTeX\n\t- LaTeX -> XML and XHTML\n\t- python package\n\n* tex4ht\n\t- LaTeX -> XML, HTML and Braille!\n\t- java and c libraries\n\t- provides a `htlatex` cmd to replace latex.\n\n* pandoc\n\t- LaTeX -> HTML\n\t- haskell library\n\n* tralics (INRIA)\n\t- LaTeX -> XML", "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/cardiffmaths/latextree", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "latextree", "package_url": "https://pypi.org/project/latextree/", "platform": "", "project_url": "https://pypi.org/project/latextree/", "project_urls": { "Homepage": "http://github.com/cardiffmaths/latextree" }, "release_url": "https://pypi.org/project/latextree/0.2/", "requires_dist": null, "requires_python": "", "summary": "A document object model and related tools for Latex", "version": "0.2" }, "last_serial": 4065196, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "311430e157e1bc65ea52d3ed70eff4b9", "sha256": "b5e084fac37421f2513bf93a56336855bc55bcef5553609af01bc9d411d08bc3" }, "downloads": -1, "filename": "latextree-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "311430e157e1bc65ea52d3ed70eff4b9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 41446, "upload_time": "2018-07-16T10:23:10", "url": "https://files.pythonhosted.org/packages/6a/07/379c8363d9b6926147e947ebd97dbdfa8cb55b76b66b2ca7b2d8da7e314c/latextree-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9d28d939921dc5cfef63988a0f11278f", "sha256": "a33738f469e5759730526291050a9e2f45b658be64850262c1fd236ed82f3de3" }, "downloads": -1, "filename": "latextree-0.2.tar.gz", "has_sig": false, "md5_digest": "9d28d939921dc5cfef63988a0f11278f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35389, "upload_time": "2018-07-16T10:22:24", "url": "https://files.pythonhosted.org/packages/19/18/f9b118866e38e3829f96dab632f2e6b8eac5db74ace0ce8e59492e3426d8/latextree-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "311430e157e1bc65ea52d3ed70eff4b9", "sha256": "b5e084fac37421f2513bf93a56336855bc55bcef5553609af01bc9d411d08bc3" }, "downloads": -1, "filename": "latextree-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "311430e157e1bc65ea52d3ed70eff4b9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 41446, "upload_time": "2018-07-16T10:23:10", "url": "https://files.pythonhosted.org/packages/6a/07/379c8363d9b6926147e947ebd97dbdfa8cb55b76b66b2ca7b2d8da7e314c/latextree-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9d28d939921dc5cfef63988a0f11278f", "sha256": "a33738f469e5759730526291050a9e2f45b658be64850262c1fd236ed82f3de3" }, "downloads": -1, "filename": "latextree-0.2.tar.gz", "has_sig": false, "md5_digest": "9d28d939921dc5cfef63988a0f11278f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35389, "upload_time": "2018-07-16T10:22:24", "url": "https://files.pythonhosted.org/packages/19/18/f9b118866e38e3829f96dab632f2e6b8eac5db74ace0ce8e59492e3426d8/latextree-0.2.tar.gz" } ] }