{ "info": { "author": "Andrew Tulloch", "author_email": "andrew@tullo.ch", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Programming Language :: Python", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Software Development :: Documentation", "Topic :: Text Processing :: Markup", "Topic :: Text Processing :: Markup :: HTML", "Topic :: Text Processing :: Markup :: LaTeX" ], "description": "LaTeX2Markdown\n==============\n\nAn `AMS-LaTeX `_ compatible\nconverter from (a subset of) `LaTeX `_ to\n`MathJaX `_ compatible\n`Markdown `_.\n\nAnyone who writes LaTeX documents using the AMS-LaTeX packages\n(``amsmath``, ``amsthm``, ``amssymb``) and wants to convert these\ndocuments to Markdown format to use with MathJaX. These Markdown files\ncan then be easily added to any web platform - Jekyll blogs, Wordpress,\nbasic HTML sites, etc.\n\nIn short, if you seek to use MathJaX to view your LaTeX documents\nonline, then you might be interested in this.\n\nDemonstration\n-------------\n\nCheck out\n`tullo.ch/projects/LaTeX2Markdown `_\nfor a live demonstration of the converter.\n\nGetting Started\n---------------\n\nInstallation\n~~~~~~~~~~~~\n\nThe project is available on PyPI, so getting it is as simple as using\n\n::\n\n pip install latex2markdown\n\nor\n\n::\n\n easy_install latex2markdown\n\nUsage\n~~~~~\n\nThe utility can be called from the command line, or from within a Python\nscript.\n\nFor the command line, the syntax to convert a LaTeX file to a Markdown\nfile is as follows:\n\n::\n\n python -m latex2markdown path/to/latex/file path/to/output/markdown/file\n\nFor example, to compile a LaTeX file ``sample.tex`` into a Markdown file\n``sample.md``, call\n\n::\n\n python -m latex2markdown sample.tex sample.md\n\nTo use it within a Python script (to extend it, modify output, etc.),\nyou can use it as follows:\n\n::\n\n import latex2markdown\n with open(\"latex_file.tex\", \"r\") as f:\n latex_string = f.read()\n\n l2m = latex2markdown.LaTeX2Markdown(latex_string)\n\n markdown_string = l2m.to_markdown()\n\n with open(\"markdown_file.md\", \"w\") as f:\n f.write(markdown_string)\n\nFinally, add the following snippet to your HTML when loading this\ndocument.\n\n::\n\n \n \n\nFor a working example, have a look at the source of the\n`tullo.ch `_ homepage\n`here `_.\n\nWhy not use Pandoc?\n-------------------\n\n`Pandoc `_\nis an excellent document converter for less complex LaTeX documents.\nIndeed, I've used it to convert this README document to a reST version\nfor use on PyPI.\n\nUnfortunately, it is not designed to deal with documents that use the\nAMSTeX extensions - which include the theorem, lemma, proof, and\nexercise environments that are heavily used for typesetting papers,\nlecture notes, and other documents.\n\nAs neither Pandoc nor MathJaX can deal with these documents, I hacked\ntogether a set of regular expressions that can convert a subset of LaTeX\nto Markdown, and used a few more to convert the sMarkdown to\nMathJaX-convertible Markdown.\n\nExample\n-------\n\nAs an example, the following LaTeX code:\n\n::\n\n \\section{Example Section}\n \\begin{thm}[Euclid]\n There are infinitely many primes.\n \\end{thm}\n\n \\begin{proof}\n Suppose that $p_1 < p_2 < \\dots < p_n$ are all of the primes. \n Let $P = 1 + \\prod_{i=1}^n p_i$ and let $p$ be a prime dividing $P$.\n\n Then $p$ can not be any of $p_i$, for otherwise $p$ would divide the \n difference $P - \\left(\\prod_{i=1}^n p_i \\right) - 1$, which is impossible. \n So this prime $p$ is still another prime, and $p_1, p_2, \\dots p_n$ \n cannot be all of the primes.\n \\end{proof}\n\nis converted into the following Markdown:\n\n::\n\n ### Example Section\n #### Theorem 1 (Euclid)\n\n > There are infinitely many primes.\n\n #### Proof\n\n Suppose that $p_1 < p_2 < \\dots < p_n$ are all of the primes. \n Let $P = 1 + \\prod_{i=1}^n p_i$ and let $p$ be a prime dividing $P$.\n\n Then $p$ can not be any of $p_i$, for otherwise $p$ would divide the difference \n $P - \\left(\\prod_{i=1}^n p_i \\right) - 1$, which is impossible. So this prime \n $p$ is still another prime, and $p_1, p_2, \\dots p_n$ cannot be all of the primes.\n\nSupported LaTeX/AMSTeX Environments\n-----------------------------------\n\n- ``emph``, ``textbf``, ``texttt``\n- ``thm``\n- ``prop``\n- ``lem``\n- ``exer``\n- ``proof``\n- ``chapter``\n- ``section``\n- ``subsection``\n- ``itemize``\n- ``enumerate``\n\nalong with everything supported by MathJax - list available\n`online `_.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ajtulloch/LaTeX2Markdown", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "latex2markdown", "package_url": "https://pypi.org/project/latex2markdown/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/latex2markdown/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/ajtulloch/LaTeX2Markdown" }, "release_url": "https://pypi.org/project/latex2markdown/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "An AMS-LaTeX compatible converter that maps a subset of LaTeX to Markdown/MathJaX.", "version": "0.2.1" }, "last_serial": 794061, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "1a989e3b9b156779f71b7f88310031c2", "sha256": "61e288db9b50b979c6c14775ee9416d8f2b158fbb737462435fd3924e976c538" }, "downloads": -1, "filename": "latex2markdown-0.1.tar.gz", "has_sig": false, "md5_digest": "1a989e3b9b156779f71b7f88310031c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4769, "upload_time": "2012-04-01T09:01:59", "url": "https://files.pythonhosted.org/packages/7a/ff/e3fda1e6394f4115cde606e4c5c2a65ad8f360f26fd9be35799f6f14ab9c/latex2markdown-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "8cd2e9b42047749202cbca88be45e19c", "sha256": "e9d3b59648117014875097f0b9125de57b833bf9e79b80dcc4294a7edc85a7b4" }, "downloads": -1, "filename": "latex2markdown-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8cd2e9b42047749202cbca88be45e19c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4815, "upload_time": "2012-04-01T09:03:38", "url": "https://files.pythonhosted.org/packages/b4/08/8b0499d923ffdaf66b5a4fc8133cb66420d2e52ed5ce81169192d8f09fcd/latex2markdown-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "a237125008aa515b594dd162c833e92c", "sha256": "7c5d1b5165b151867bb74235073b32ee09dfa0362c49e17712824941b83be72d" }, "downloads": -1, "filename": "latex2markdown-0.1.2.tar.gz", "has_sig": false, "md5_digest": "a237125008aa515b594dd162c833e92c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5138, "upload_time": "2012-04-01T09:05:18", "url": "https://files.pythonhosted.org/packages/6c/8e/c40b4831520a89f9811005a26cd8721d4d52cf867ba82532b54f23f9464a/latex2markdown-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "88f2ff276a1b2b7c0f7da7d37fec7f29", "sha256": "5bb23bb7ef0c9fbf8b40e57c9b693a614d7795cc9eca2117ed1784673dc0a1e4" }, "downloads": -1, "filename": "latex2markdown-0.2.0.tar.gz", "has_sig": false, "md5_digest": "88f2ff276a1b2b7c0f7da7d37fec7f29", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 161637, "upload_time": "2012-04-03T02:14:22", "url": "https://files.pythonhosted.org/packages/dd/cf/b159347678791801d4434485df458c399bbcbc420a08aff714c31b8c62db/latex2markdown-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "cbc35460a6ec1f5c0ba1b3b5820a637b", "sha256": "beac7a10cc559f723f7fa4cadf501e18ebc8f4c40ca94fde94fff1591961b81e" }, "downloads": -1, "filename": "latex2markdown-0.2.1.tar.gz", "has_sig": false, "md5_digest": "cbc35460a6ec1f5c0ba1b3b5820a637b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 161687, "upload_time": "2012-04-03T05:15:03", "url": "https://files.pythonhosted.org/packages/33/f9/2f450ece27153993f8dd9d543a3b7e0948ec3026ff53dbf65ac3e234a446/latex2markdown-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cbc35460a6ec1f5c0ba1b3b5820a637b", "sha256": "beac7a10cc559f723f7fa4cadf501e18ebc8f4c40ca94fde94fff1591961b81e" }, "downloads": -1, "filename": "latex2markdown-0.2.1.tar.gz", "has_sig": false, "md5_digest": "cbc35460a6ec1f5c0ba1b3b5820a637b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 161687, "upload_time": "2012-04-03T05:15:03", "url": "https://files.pythonhosted.org/packages/33/f9/2f450ece27153993f8dd9d543a3b7e0948ec3026ff53dbf65ac3e234a446/latex2markdown-0.2.1.tar.gz" } ] }