{ "info": { "author": "Lee Gao", "author_email": "lg342@cornell.edu", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Topic :: Text Processing :: Markup :: LaTeX" ], "description": "readme2tex\n==========\n\nRenders LaTeX for Github Readmes\n\n.. math::\n\n\n \\huge\\text{Hello \\LaTeX}\n\n\\ *Make sure that pdflatex is installed.*\\ \n\n--------------\n\n``readme2tex`` is a Python script that \"texifies\" your readme. It takes\nin Github Markdown and replaces anything enclosed between dollar signs\nwith rendered :math:`\\text{\\LaTeX}`.\n\nIn addition, unlike the other Github TeX renderers, ``readme2tex``\nensures that inline mathematical expressions are properly aligned with\nthe rest of the text to avoid giving a \"jumpy\" look to the document.\n\nExamples:\n~~~~~~~~~\n\nHere's a display level equation\n\n.. math::\n\n\n \\frac{n!}{k!(n-k)!} = {n \\choose k}\n\nThe code that was used to render this equation is just\n\n::\n\n $$\n \\frac{n!}{k!(n-k)!} = {n \\choose k}\n $$\n\n\\ *Note: you can escape \\$ so that they don't render.*\\\n\nHere's an inline equation.\n\n It is well known that if :math:`ax^2 + bx + c =0`, then\n :math:`x = \\frac{-b \\pm \\sqrt{b^2- 4ac}}{2a}`.\n\nThe code that was used to render this is:\n\n::\n\n It is well know that if $ax^2 + bx + c = 0$, then $x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$.\n\nNotice that the equations line up with the baseline of the text, even\nwhen the height of these two images are different.\n\nSometimes, you might run into equations that are bottom-heavy, like\n:math:`x^2\\sum\\limits_{3^{n^{n^{n}}}}`. Here, ``readme2tex`` can compute\nthe correct offset to align this equation to the baseline of your\nparagraph of text as well.\n\nInstallation\n~~~~~~~~~~~~\n\nCurrently, you just need to have ``readme2tex`` on your python-path, and\nyou can call\n\nUsage\n~~~~~\n\n::\n\n python -m readme2tex --output README.md\n\nIt will then look for a file called ``readother.md`` and compile it down\nto a readable Github-ready document.\n\nIn addition, you can specify other arguments to ``render.py``, such as:\n\n- ``--readme READOTHER.md`` The raw readme to process. Defaults to\n ``READOTHER.md``.\n- ``--output README.md`` The processed readme.md file. Defaults to\n ``README_GH.md``.\n- ``--packages ...`` A list of addition packages to use during\n :math:`\\text{\\LaTeX}` compilation. This is optional.\n- ``--svgdir svgs/`` The directory to store the output svgs. The\n default is ``svgs/``\n- ``--branch master`` *Experimental* Which branch to store the svgs\n into, the default is just master.\n- ``--username username`` Your github username. This is optional, and\n ``render.py`` will try to infer this for you.\n- ``--project project`` The current github project. This is also\n optional.\n- ``--nocdn True`` Ticking this will use relative paths for the output\n images. Defaults to False.\n- ``--htmlize False`` Ticking this will output a ``X.md.html`` file so\n you can preview what the output looks like. Defaults to False.\n- ``--valign False`` Ticking this will use the ``valign`` trick\n (detailed below) instead. See the caveats section for tradeoffs.\n\nTechnical Tricks\n~~~~~~~~~~~~~~~~\n\nHow can you tell where the baseline of an image is?\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nBy prepending every inline equation with an anchor. During\npost-processing, we can isolate the anchor, which is fixed at the\nbaseline, and crop it out. It's super clowny, but it does the job.\n\nCaveats\n^^^^^^^\n\nGithub does not allow you to pass in custom style attributes to your\nimages. While this is useful for security purposes, it makes it\nincredibly difficult to ensure that images will align correctly to the\ntext. ``readme2tex`` circumvents this using one of two tricks:\n\n1. In Chrome, the attribute ``valign=offset`` works for ``img`` tags as\n well. This allows us to shift the image directly. Unfortunately, this\n is not supported within any of the other major browsers, therefore\n this mode is not enabled by default.\n2. In every (reasonably modern) browser, the ``align=middle`` attribute\n will vertically center an image. However, the definition of the\n vertical \"center\" is different. In particular, for Chrome, Firefox,\n (and probably Safari), that center is the exact middle of the image.\n For IE and Edge however, the center is about 5 pixels (the height of\n a lower-case character) above the exact center. Since this looks\n great for non-IE browsers, and reasonably good on Edge, this is the\n default rendering method. The trick here is to pad either the top or\n the bottom of the image with extra spaces until the baseline of the\n equation is at the center. For most equations, this works great.\n However, if you have a tall equation, like\n :math:`\\frac{~}{\\sum\\limits_{x^{x^{x^{x}}}}^{x^{x^{x^{x}}}} f(x)}`,\n you'll notice that there might be a lot of slack vertical spacing\n between these lines. If this is a deal-breaker for you, you can\n always try the ``--valign True`` mode. For most inline equations,\n this is usually a non-issue.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/leegao/readme2tex", "keywords": "github readme markdown latex tex equations math svg markup", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "readme2tex", "package_url": "https://pypi.org/project/readme2tex/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/readme2tex/", "project_urls": { "Homepage": "http://github.com/leegao/readme2tex" }, "release_url": "https://pypi.org/project/readme2tex/0.0.1b2/", "requires_dist": [ "markdown", "pygments" ], "requires_python": "", "summary": "Render LaTeX within your Github Readmes", "version": "0.0.1b2" }, "last_serial": 2538892, "releases": { "0.0.1a0": [ { "comment_text": "", "digests": { "md5": "8456ef9ee94cb9f0691cf770d19c2249", "sha256": "472a1eb9fed6f1d9b0bd55377eb75576cf2e9a11cfe92cddabe7b124c4684b50" }, "downloads": -1, "filename": "readme2tex-0.0.1a0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "8456ef9ee94cb9f0691cf770d19c2249", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11277, "upload_time": "2016-12-08T07:57:25", "url": "https://files.pythonhosted.org/packages/b8/a6/4a4f8c0592e893152dd888f8711b77bb73833b93704564ffd0f4e6fbf535/readme2tex-0.0.1a0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "361c232c8b304a8710be0f43f343cc99", "sha256": "4bfcdf21305f0b014fcfbce37135fd0b54ed359258ae3093e4094bd6fc21e260" }, "downloads": -1, "filename": "readme2tex-0.0.1a0.tar.gz", "has_sig": false, "md5_digest": "361c232c8b304a8710be0f43f343cc99", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10398, "upload_time": "2016-12-08T07:57:27", "url": "https://files.pythonhosted.org/packages/2e/4d/2a140fe8544a1af8adbfc56af2503cf4cf6c7d5aca1fdbc27efcf413eb9b/readme2tex-0.0.1a0.tar.gz" } ], "0.0.1b0": [ { "comment_text": "", "digests": { "md5": "e860d04e9ea33642795f3906e0e7427d", "sha256": "ea9b1a402a606fe7d1c5ec5ee06b2adaf233ee2fe2a7f257197cd43b09c57c68" }, "downloads": -1, "filename": "readme2tex-0.0.1b0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e860d04e9ea33642795f3906e0e7427d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14256, "upload_time": "2016-12-09T08:53:10", "url": "https://files.pythonhosted.org/packages/c3/60/7804f1d3e96676a8a532e3a215003e4cd0cd1de12babc5f872dce7fed136/readme2tex-0.0.1b0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6bb13764588f343594f50ad5b1b693a5", "sha256": "c6ea22fa7cd32c7a6716d3b55fac526d15b12b8aa32f0e08d39458386ea956d5" }, "downloads": -1, "filename": "readme2tex-0.0.1b0.tar.gz", "has_sig": false, "md5_digest": "6bb13764588f343594f50ad5b1b693a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15312, "upload_time": "2016-12-09T08:53:12", "url": "https://files.pythonhosted.org/packages/5b/22/728a851b76c3600ba7563b0cbe1c1b93e0b9c61b243def40a4fb90d4020e/readme2tex-0.0.1b0.tar.gz" } ], "0.0.1b1": [ { "comment_text": "", "digests": { "md5": "bb545437875396c3ba0aa65486b687ea", "sha256": "62b71ec851ebcaaf31dd541203df5ed8a9e7ba672c6acfc227c582d114cb8127" }, "downloads": -1, "filename": "readme2tex-0.0.1b1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "bb545437875396c3ba0aa65486b687ea", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14349, "upload_time": "2016-12-17T03:08:41", "url": "https://files.pythonhosted.org/packages/3a/d6/f1f6d6e36fb9b1d9f5e3ca1dee806b0fe4e5bbaba200580b6eb652b750e4/readme2tex-0.0.1b1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "98733decc85518de65d60995d88f538a", "sha256": "84ccfaf6a10c9f414dc333a863edf3d1757550ebe8f8f3633fe547e44ca30a2a" }, "downloads": -1, "filename": "readme2tex-0.0.1b1.tar.gz", "has_sig": false, "md5_digest": "98733decc85518de65d60995d88f538a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15360, "upload_time": "2016-12-17T03:08:44", "url": "https://files.pythonhosted.org/packages/84/39/7f94bcc1d405aeb57a2658f6e961ae985a5147d58b85af166e543a3a93a7/readme2tex-0.0.1b1.tar.gz" } ], "0.0.1b2": [ { "comment_text": "", "digests": { "md5": "f7ea928ee9cb27dae415083498265026", "sha256": "097ee424fc3a6f89ea0ccbe04e2be5fce8d3e1fd86e91412061252a8c03b03dd" }, "downloads": -1, "filename": "readme2tex-0.0.1b2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f7ea928ee9cb27dae415083498265026", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14430, "upload_time": "2016-12-25T20:16:58", "url": "https://files.pythonhosted.org/packages/f3/28/641370c253d60e6555177a0559c2129568ec722bce5154398cddda6fdda4/readme2tex-0.0.1b2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8704ef445a7a1cc93dca1fdb316f2e4f", "sha256": "d4194617624d41957b9cf139951806be0320cedfd2906a6c18e4b27cc40a9064" }, "downloads": -1, "filename": "readme2tex-0.0.1b2.tar.gz", "has_sig": false, "md5_digest": "8704ef445a7a1cc93dca1fdb316f2e4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15654, "upload_time": "2016-12-25T20:17:00", "url": "https://files.pythonhosted.org/packages/55/84/f3247cd888143ecc02838c3dc58d439eda49c5326ca725c40c214055ccad/readme2tex-0.0.1b2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f7ea928ee9cb27dae415083498265026", "sha256": "097ee424fc3a6f89ea0ccbe04e2be5fce8d3e1fd86e91412061252a8c03b03dd" }, "downloads": -1, "filename": "readme2tex-0.0.1b2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f7ea928ee9cb27dae415083498265026", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14430, "upload_time": "2016-12-25T20:16:58", "url": "https://files.pythonhosted.org/packages/f3/28/641370c253d60e6555177a0559c2129568ec722bce5154398cddda6fdda4/readme2tex-0.0.1b2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8704ef445a7a1cc93dca1fdb316f2e4f", "sha256": "d4194617624d41957b9cf139951806be0320cedfd2906a6c18e4b27cc40a9064" }, "downloads": -1, "filename": "readme2tex-0.0.1b2.tar.gz", "has_sig": false, "md5_digest": "8704ef445a7a1cc93dca1fdb316f2e4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15654, "upload_time": "2016-12-25T20:17:00", "url": "https://files.pythonhosted.org/packages/55/84/f3247cd888143ecc02838c3dc58d439eda49c5326ca725c40c214055ccad/readme2tex-0.0.1b2.tar.gz" } ] }