{ "info": { "author": "Samuel Roeca", "author_email": "samuel.roeca@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Markup :: LaTeX", "Topic :: Utilities" ], "description": "latexbuild\n==========\n\nThis is a recent effort at writing a very light Latex build wrapper for\nPython 3 using Jinja2 templates. It was inspired by the build philosophy\nfound in http://pythonhosted.org/latex/ . However, the original latex\nlibrary made it difficult to do complex, non-pdf builds (such as\ncompiling to HTML). This repository creates simple components that can\nbe used to build Latex from Jinja2 templates without losing control of\nthe lower-level command line tools provided with latex (like pdflatex\nand htlatex). The usefulness of the library is split into two\ncomponents:\n\n1. Rendering Jinja2 templates for Latex\n2. Compiling the rendered template with Latex\n\nCurrently, the following output formats are supported out of the box:\n\n1. .pdf\n2. .html\n3. .docx\n\nThat said, given the granular control offered by this package, as long\nas you stick with formats that are supported by build tools distributed\nwith texlive, you should be able to easily write your own output format\nextensions using this package as a base.\n\nInstallation\n------------\n\nThis project is available at https://pypi.python.org/pypi/latexbuild and\nmay be installed with pip. I strongly recommend the usage of a virtual\nenvironment.\n\n.. code:: bash\n\n # Create a virtual environment\n virtualenv -p python3.4 venv\n\n # Source the virtual environment\n source venv/bin/activate\n\n # Install latexbuild in the virtual environment\n pip install latexbuild\n\nRendering Jinja2 templates for Latex\n------------------------------------\n\nLatex is a great typesetting engine for large, complex projects.\nHowever, its native build tools lack a straightforward templating engine\nwhere multiple people can collaborate on a similar document. For\nexample, imagine a scenario where five professors in the same department\nneed to create a course syllabus. Grading requirements may be\nstandardized at the department level, which individual lessons are up to\nthe professors. If course syllabuses were created using Jinja2\ntemplating and Latex, the department could create a base template that\nlisted the department standards and ask the professors to extend the\nbase template for each course's syllabus. That way, the professors need\nnot worry about cross-course content or department-wide formatting\nrequirements: these would be handled by the base template.\n\nAssume the department saves the following content in *template.tex*:\n\n.. code:: tex\n\n % FILENAME: template.tex\n \\documentclass[12pt]{article}\n\n \\title{Economics Department: \\BLOCK{block title}\\BLOCK{endblock}}\n \\author{\\vspace{-5ex}}\n \\date{\\vspace{-5ex}}\n\n \\begin{document}\n \\maketitle\n\n \\section{Department Introduction}\n This is a standard message from the department\n that will appear in every syllabus in exactly this place.\n Professors shouldn't have to think about this.\n\n \\section{Greatness}\n \\BLOCK{block greatness}\\BLOCK{endblock}\n\n \\section{Boredom}\n \\BLOCK{block boredom}\\BLOCK{endblock}\n\n \\end{document}\n\nNow that the template has been created, the accounting professor can\ncreate his syllabus in the following way:\n\n.. code:: tex\n\n %- extends \"template.tex\"\n\n % FILENAME: accounting.tex\n\n %- block title\n Accounting\n %- endblock\n\n %- block greatness\n This is a great, accounting-specific block\n %- endblock\n\n %- block boredom\n This is a boring, accounting-specific block\n %- endblock\n\nAdditionally, the statistics professor can create her syllabus as\nfollows:\n\n.. code:: tex\n\n %- extends \"template.tex\"\n\n % FILENAME: statistics.tex\n\n %- block title\n Statistics for juggernauts\n %- endblock\n\n %- block greatness\n This is a great, statistics-specific block\n %- endblock\n\n %- block boredom\n This is a boring, statistics-specific block\n %- endblock\n\nMost Jinja2 templating functionality is supported, using the same syntax\nalterations as the latex python package referenced in this README's\nintroduction. For example, if you would like to loop over values and\nplace them in a Latex list, you may use the following code.\n\n.. code:: tex\n\n This snippet provides an ordered list displaying the\n list variable passed from Python:\n\n \\begin{enumerate}\n %- for variable in variable_list\n \\item \\VAR{variable}\n %- endfor\n \\end{enumerate}\n\n Alternatively, this snippet provides an unordered list\n displaying the list variable passed from Python:\n\n \\begin{itemize}\n %- for variable in variable_list\n \\item \\VAR{variable}\n %- endfor\n \\end{itemize}\n\nThis section will continue being updated over time with more examples.\n\nBuilding Latex Output\n---------------------\n\nFor the simplest project, you can build a Jinja2-templated latex source\nrepository with the following code:\n\n.. code:: python\n\n from latexbuild import build_pdf, build_html, build_docx, render_latex_template\n\n PATH_JINJA2 = \"/path/to/your/latex/jinja2/root\"\n PATH_TEMPLATE_RELATIVE_TO_PATH_JINJA2 = \"template/filepath.tex\"\n PATH_OUTPUT_PDF = \"/path/to/your/output/directory/MYOUTPUTFILE.pdf\"\n PATH_OUTPUT_HTML = \"/path/to/your/output/directory/MYOUTPUTFILE.html\"\n PATH_OUTPUT_DOCX = \"/path/to/your/output/directory/MYOUTPUTFILE.docx\"\n\n # Build Jinja2 template, compile result latex, move compiled file to output path,\n # and clean up all intermediate files\n build_pdf(PATH_JINJA2, PATH_TEMPLATE_RELATIVE_TO_PATH_JINJA2, PATH_OUTPUT_PDF)\n build_html(PATH_JINJA2, PATH_TEMPLATE_RELATIVE_TO_PATH_JINJA2, PATH_OUTPUT_HTML)\n build_docx(PATH_JINJA2, PATH_TEMPLATE_RELATIVE_TO_PATH_JINJA2, PATH_OUTPUT_DOCX)\n\n # If you just want the rendered template's text in a python variable,\n # do the following (assuming you have no variables to pass):\n render_latex_template(PATH_JINJA2, PATH_TEMPLATE_RELATIVE_TO_PATH_JINJA2)\n\n # If your template renders Jinja2 variables, most interfaces provide\n # a dictionary parameter. See below for an example for simply\n # rendering the template's text in Python\n DICT_VALS = {\n 'var1': 'my variable 1 value',\n 'list_var': ['item 1 for analysis', 'item 2 for analysis']\n }\n render_latex_template(\n PATH_JINJA2,\n PATH_TEMPLATE_RELATIVE_TO_PATH_JINJA2,\n DICT_VALS,\n )\n\nFor more complex builds, the system is designed to accept whatever\ncommand line arguments you wish to use. Please see the source file\nlatexbuild/build.py and read the LatexBuild class's documentation for\nmore information.\n\nSupported / tested systems\n--------------------------\n\nPython 3, Linux\n\nWritten by\n----------\n\nSamuel Roeca", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pappasam/latexbuild", "keywords": "latex jinja2 build html texlive", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "latexbuild", "package_url": "https://pypi.org/project/latexbuild/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/latexbuild/", "project_urls": { "Homepage": "https://github.com/pappasam/latexbuild" }, "release_url": "https://pypi.org/project/latexbuild/0.2.2/", "requires_dist": [ "Jinja2 (>=2.8)" ], "requires_python": "", "summary": "Building Jinja2 templates with latex", "version": "0.2.2" }, "last_serial": 2756517, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "4706fa33b352929a59958fb75255b018", "sha256": "38c637250bf106419976ddfaef1dcf0c52d5fc4a221fea74c9905d9492165b67" }, "downloads": -1, "filename": "latexbuild-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4706fa33b352929a59958fb75255b018", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12816, "upload_time": "2016-04-14T17:51:23", "url": "https://files.pythonhosted.org/packages/ba/f2/f771e459bf1ffb3386eaf9e33e32bc7a33d8113da88680d403d7070b6eed/latexbuild-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b3f8c1536a0cf4d239935b8a917ef8e2", "sha256": "47a9ec285f021e8b7cc9af2d50ef9d464a787e461bfc20e6ec9cbad790f5d5bf" }, "downloads": -1, "filename": "latexbuild-0.0.1.tar.gz", "has_sig": false, "md5_digest": "b3f8c1536a0cf4d239935b8a917ef8e2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8398, "upload_time": "2016-04-14T17:51:28", "url": "https://files.pythonhosted.org/packages/d1/dd/d8adce7537db7d14fea8cc5608af5b5344de366ce93ef62a2ed01841fb25/latexbuild-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "a5599c411eb9c81d7dcb3ca236c7a24e", "sha256": "91d01236447035fd1a2e20ae07b3821f0d0a66411bc49b785e93478bff07b8f5" }, "downloads": -1, "filename": "latexbuild-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a5599c411eb9c81d7dcb3ca236c7a24e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14272, "upload_time": "2016-04-16T21:29:13", "url": "https://files.pythonhosted.org/packages/b5/6e/2138e640f4ceeba855ed14aaf0ebdcea2796ca8dbe43934f8f7016d6e131/latexbuild-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "efb64feb93b93ffa74eacac1b8cfe2ef", "sha256": "ed03e529d9d654244bbff14357749639fbce017f45f0f3e0d3a3fb62e6011a5e" }, "downloads": -1, "filename": "latexbuild-0.1.0.tar.gz", "has_sig": false, "md5_digest": "efb64feb93b93ffa74eacac1b8cfe2ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9416, "upload_time": "2016-04-16T21:29:18", "url": "https://files.pythonhosted.org/packages/cd/01/a05938512c16d2ab8a5e67e77a63890abc61e9274b554bee5aba4eee3009/latexbuild-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8e5287a7c3c8803d886ccd757976a22d", "sha256": "1c5e392cff53115db38a1d7395de9e35ced8bb069d48b0efca9c9d7ca81b1476" }, "downloads": -1, "filename": "latexbuild-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8e5287a7c3c8803d886ccd757976a22d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14259, "upload_time": "2016-04-17T00:31:19", "url": "https://files.pythonhosted.org/packages/90/c0/1899d8d8eb65518da0ed0703da67af885d0795ca1e6280f77e0f9253dcd8/latexbuild-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c0b04d37047537f2a2f21084fd183ae0", "sha256": "47d29127e4df82eb005098af588420ceeb543bb837dae4dd7c7fdf82bd363240" }, "downloads": -1, "filename": "latexbuild-0.1.1.tar.gz", "has_sig": false, "md5_digest": "c0b04d37047537f2a2f21084fd183ae0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9419, "upload_time": "2016-04-17T00:31:29", "url": "https://files.pythonhosted.org/packages/78/d2/090686c79f8c1a16dedd2dde439ccbfc012f20e90aa1d5d19d652db80403/latexbuild-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "53294e8d9dc00dc493bf259d5e74d8a3", "sha256": "149b6fdca5c52609f083deed1afe9eb6f6e8b4f0042cb8cf2aef9655abf42800" }, "downloads": -1, "filename": "latexbuild-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "53294e8d9dc00dc493bf259d5e74d8a3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14800, "upload_time": "2016-04-24T15:36:37", "url": "https://files.pythonhosted.org/packages/f0/aa/a9ea98d487ae4653f70c0adc51dcd1023e9f1e53bd8be08033ef21a09ce2/latexbuild-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0f91ede2f9963633af2359c6df8f50b6", "sha256": "a4b7dc3381659719da7af5be724aaedc325b1e11a4ce643f08f94fc26772de38" }, "downloads": -1, "filename": "latexbuild-0.2.0.tar.gz", "has_sig": false, "md5_digest": "0f91ede2f9963633af2359c6df8f50b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9879, "upload_time": "2016-04-24T15:36:43", "url": "https://files.pythonhosted.org/packages/70/cc/83022fe42585eaad6b93f7bb0dcf634b90ff77aa39aa016eef222c18dda9/latexbuild-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "435104875aea55d7f37fd000d546ca0e", "sha256": "2d056a70cd9e4e49bb98c58f41a9842b9c81c41d49c4611f6970e559ec465654" }, "downloads": -1, "filename": "latexbuild-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "435104875aea55d7f37fd000d546ca0e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14775, "upload_time": "2016-04-24T16:18:57", "url": "https://files.pythonhosted.org/packages/b0/a8/efa206e74ce8c59855b986d9b19db6a6f1747607aefa4a8d14e36d94bd6c/latexbuild-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4fc03d1b56e25b89ca5c6d7eff912da2", "sha256": "be6c43a858a2cfb85958c9cf01ff73cdf60feec66c22b9f9c413c0c3a9c55cdb" }, "downloads": -1, "filename": "latexbuild-0.2.1.tar.gz", "has_sig": false, "md5_digest": "4fc03d1b56e25b89ca5c6d7eff912da2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9867, "upload_time": "2016-04-24T16:19:18", "url": "https://files.pythonhosted.org/packages/e6/ff/5a5d72f98c115d0acc7e0752fe4f3205397995a651fea8b4416bc8afa6e5/latexbuild-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "ac83f6b5f4b6b7fad9a24d82f98bccde", "sha256": "8e12f423b54f04fa7cc20461598ab31d4314e63ec003fdebe4fb2b03ca0194ec" }, "downloads": -1, "filename": "latexbuild-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "ac83f6b5f4b6b7fad9a24d82f98bccde", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14801, "upload_time": "2017-04-06T01:50:45", "url": "https://files.pythonhosted.org/packages/8d/a9/245729cb8da78211f3603926bc5ca31dbc6188b42746dcdd98344504b84e/latexbuild-0.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2dfd32a97dd55624c9bf1440a0b7dba8", "sha256": "db6458cdc073c23d142ccd9466f8127d5d9e3bb22c1df465f3c1bfa66756d343" }, "downloads": -1, "filename": "latexbuild-0.2.2.tar.gz", "has_sig": false, "md5_digest": "2dfd32a97dd55624c9bf1440a0b7dba8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9873, "upload_time": "2017-04-06T01:50:47", "url": "https://files.pythonhosted.org/packages/78/86/3a700f1dfbed388b9a7f6cd57e0d43da42856aaefc67568a42c5c304a3e1/latexbuild-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ac83f6b5f4b6b7fad9a24d82f98bccde", "sha256": "8e12f423b54f04fa7cc20461598ab31d4314e63ec003fdebe4fb2b03ca0194ec" }, "downloads": -1, "filename": "latexbuild-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "ac83f6b5f4b6b7fad9a24d82f98bccde", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14801, "upload_time": "2017-04-06T01:50:45", "url": "https://files.pythonhosted.org/packages/8d/a9/245729cb8da78211f3603926bc5ca31dbc6188b42746dcdd98344504b84e/latexbuild-0.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2dfd32a97dd55624c9bf1440a0b7dba8", "sha256": "db6458cdc073c23d142ccd9466f8127d5d9e3bb22c1df465f3c1bfa66756d343" }, "downloads": -1, "filename": "latexbuild-0.2.2.tar.gz", "has_sig": false, "md5_digest": "2dfd32a97dd55624c9bf1440a0b7dba8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9873, "upload_time": "2017-04-06T01:50:47", "url": "https://files.pythonhosted.org/packages/78/86/3a700f1dfbed388b9a7f6cd57e0d43da42856aaefc67568a42c5c304a3e1/latexbuild-0.2.2.tar.gz" } ] }