{ "info": { "author": "Gilles Castel", "author_email": "gilles@castel.dev", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7" ], "description": "# Inkscape figure manager.\n\nA script I use to manage figures for my LaTeX documents.\nMore information in this [blog post](https://castel.dev/post/lecture-notes-2/).\n\n\n## Installation\n\nYou can install it using pip:\n\n```\npip install inkscape-figures\n```\n\nYou'll also need [rofi](https://github.com/davatorium/rofi).\n\nThis script only works on Linux. If you're interested in porting it to Windows/OSX, feel free to make a pull request.\n\n## Setup\n\nAdd the following code to the preamble of your LateX document.\n\n```tex\n\\usepackage{import}\n\\usepackage{pdfpages}\n\\usepackage{transparent}\n\\usepackage{xcolor}\n\n\\newcommand{\\incfig}[1]{%\n \\def\\svgwidth{\\columnwidth}\n \\import{./figures/}{#1.pdf_tex}\n}\n\\pdfsuppresswarningpagegroup=1\n```\n\nThis assumes the following directory structure:\n\n```\nmaster.tex\nfigures/\n figure1.pdf_tex\n figure1.svg\n figure1.pdf\n figure2.pdf_tex\n figure2.svg\n figure2.pdf\n```\n\n## Usage\n\n* Watch for figures: `inkscape-figures watch`.\n* Creating a figure: `inkscape-figures create 'title'`. This uses `~/.config/inkscape-figures/template.svg` as a template.\n* Creating a figure in a specific directory: `inkscape-figures create 'title' path/to/figures/`.\n* Select figure and edit it: `inkscape-figures edit`.\n* Select figure in a specific directory and edit it: `inkscape-figures edit path/to/figures/`.\n\n## Vim mappings\n\nThis assumes that you use [VimTeX](https://github.com/lervag/vimtex).\n\n```vim\ninoremap : silent exec '.!inkscape-figures create \"'.getline('.').'\" \"'.b:vimtex.root.'/figures/\"':w\nnnoremap : silent exec '!inkscape-figures edit \"'.b:vimtex.root.'/figures/\" > /dev/null 2>&1 &':redraw!\n```\n\nNow, to add a figure, type the title on a new line, and press Ctrl+F in insert mode.\nThis does the following:\n\n1. Find the directory where figures should be saved depending on which file you're editing and where the main LaTeX file is located, using `b:vimtex.root`.\n1. Check if there exists a figure with the same name. If there exists one, do nothing; if not, go on.\n1. Copy the figure template to the directory containing the figures.\n1. In Vim: replace the current line \u2013 the line containing figure title \u2013 with the LaTeX code for including the figure.\n1. Open the newly created figure in Inkscape.\n1. Set up a file watcher such that whenever the figure is saved as an svg file by pressing Ctrl + S, it also gets saved as pdf+LaTeX.\n\nTo edit figures, press Ctrl+F in command mode, and a fuzzy search selection dialog will popup allowing you to select the figure you want to edit.\n\n\n## Configuration\n\nYou can change the default LaTeX template by creating `~/.config/inkscape-figures/config.py` and adding something on the lines of the following:\n\n```python\ndef latex_template(name, title):\n return '\\n'.join((r\"\\begin{figure}[ht]\",\n r\" This is a custom LaTeX template!\",\n r\" \\centering\",\n rf\" \\incfig{{{name}}}\",\n rf\" \\caption{{{title}}}\",\n rf\" \\label{{fig:{name}}}\",\n r\"\\end{figure}\"))\n```\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": "https://github.com/gillescastel/inkscape-figures", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "inkscape-figures", "package_url": "https://pypi.org/project/inkscape-figures/", "platform": "", "project_url": "https://pypi.org/project/inkscape-figures/", "project_urls": { "Homepage": "https://github.com/gillescastel/inkscape-figures" }, "release_url": "https://pypi.org/project/inkscape-figures/1.0.4/", "requires_dist": [ "inotify", "pyperclip", "click", "appdirs", "daemonize" ], "requires_python": "", "summary": "Script for managing inkscape figures", "version": "1.0.4" }, "last_serial": 5614132, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "1ff71e6a7998605d2c739b352b1a8a45", "sha256": "c733db15bd7a8ec498f60f8b14e46edca2a210f6af21d7b3601c05eadd8be7ab" }, "downloads": -1, "filename": "inkscape_figures-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "1ff71e6a7998605d2c739b352b1a8a45", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6695, "upload_time": "2019-04-27T15:13:26", "url": "https://files.pythonhosted.org/packages/e4/9c/cc7216a4704a4de5ccdd6e6420607dd14c7ce0031af2e5faccf643bd44a7/inkscape_figures-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "677e266faa1429e47f4812c82876da95", "sha256": "d360229dbc7f6e8c7e98621e22ba062098eb41f6d9becf81e03230881475f5b9" }, "downloads": -1, "filename": "inkscape-figures-1.0.0.tar.gz", "has_sig": false, "md5_digest": "677e266faa1429e47f4812c82876da95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5871, "upload_time": "2019-04-27T15:13:51", "url": "https://files.pythonhosted.org/packages/a5/69/2b0a7e9c4c8788da0b0b4dab90d1f3494783fcd49f15f932d22e00591cf2/inkscape-figures-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "072911e39e17349a082d3d5410096700", "sha256": "f79db0a21565fde349451524ccc666220db64587a7ed8ec6d4843e63afde6775" }, "downloads": -1, "filename": "inkscape_figures-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "072911e39e17349a082d3d5410096700", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7556, "upload_time": "2019-06-12T10:08:39", "url": "https://files.pythonhosted.org/packages/e3/79/b2107af14fa61789081609520f20104b727e537c396a31d1f0ed0bf7a104/inkscape_figures-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "463c35ee69b91bb15ffb4cf10de33e89", "sha256": "3408ba6a57151177ee2f4da213188651a30eda303efb68ed2307ecb175c121d1" }, "downloads": -1, "filename": "inkscape-figures-1.0.1.tar.gz", "has_sig": false, "md5_digest": "463c35ee69b91bb15ffb4cf10de33e89", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7544, "upload_time": "2019-06-12T10:08:41", "url": "https://files.pythonhosted.org/packages/ff/01/fec28a0c9568d09f3e977bec2159fe5f1e7a7483416956f5eae058107c60/inkscape-figures-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "4dfb038648e2c4f959a4c525cae051a4", "sha256": "d94ec7978304baad59947ffd012ebcd1543f64d1a5d89a07dc88e0948398296b" }, "downloads": -1, "filename": "inkscape_figures-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "4dfb038648e2c4f959a4c525cae051a4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7557, "upload_time": "2019-06-13T22:43:28", "url": "https://files.pythonhosted.org/packages/62/af/0f8f4ce15d0e16912e2f39e2280c9b0fe0d2ff31782a198c193c308e2d99/inkscape_figures-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fce97fee456ec417113a6f2b3d332762", "sha256": "784f7fcd9de2a00e8ad5fc835908304e54a597bfbb3f4cd9ae6765f48db904df" }, "downloads": -1, "filename": "inkscape-figures-1.0.2.tar.gz", "has_sig": false, "md5_digest": "fce97fee456ec417113a6f2b3d332762", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7548, "upload_time": "2019-06-13T22:43:30", "url": "https://files.pythonhosted.org/packages/5d/c4/4d81472a23d7870b83edb352fccc7f3c23f88259990a852bb7f82c9e15d3/inkscape-figures-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "3967acecaccef4d6815a40ad95558ad1", "sha256": "34a64025b8f6168b9fa28cd5f70e2b9c0b4bcb00150723e189064fcc7e56a379" }, "downloads": -1, "filename": "inkscape_figures-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "3967acecaccef4d6815a40ad95558ad1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7734, "upload_time": "2019-07-20T11:22:10", "url": "https://files.pythonhosted.org/packages/9a/de/dbfd7c3cf44d4362b372df596872d42bef8cd9cd4632f66472c586e1ab7f/inkscape_figures-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e5182614f3af6fd28a146fcecf14226d", "sha256": "9bf5b62d666ad43818374bcccae69ce8b1bfedb743f75aebf42fbc0e3923aa99" }, "downloads": -1, "filename": "inkscape-figures-1.0.3.tar.gz", "has_sig": false, "md5_digest": "e5182614f3af6fd28a146fcecf14226d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7711, "upload_time": "2019-07-20T11:22:12", "url": "https://files.pythonhosted.org/packages/94/18/df94a554f28c00b5256d7b114f798354f0fcfe31f6867bc8c21fd2edef92/inkscape-figures-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "e06e9a8f195cc56f3a60ca8495ec5e6b", "sha256": "086317a677f1c39da0160e18f959bca63be93ee6953fb662e847771f98c8b5dd" }, "downloads": -1, "filename": "inkscape_figures-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "e06e9a8f195cc56f3a60ca8495ec5e6b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7928, "upload_time": "2019-07-31T15:45:18", "url": "https://files.pythonhosted.org/packages/ab/d8/abd727fe753546378abaae290d85ca9c5052c57d11bf26fe5ad49128140c/inkscape_figures-1.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b6bc00e3d986142cac25225285587cd1", "sha256": "82428efce9759d46d2436b93b637ab33612555a2545fdaeb9648b6b22b124a94" }, "downloads": -1, "filename": "inkscape-figures-1.0.4.tar.gz", "has_sig": false, "md5_digest": "b6bc00e3d986142cac25225285587cd1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7897, "upload_time": "2019-07-31T15:45:19", "url": "https://files.pythonhosted.org/packages/60/2d/a53e0842462a2efa393e71f20beac7e492371bc4a4b8c8482c2b3f3848a0/inkscape-figures-1.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e06e9a8f195cc56f3a60ca8495ec5e6b", "sha256": "086317a677f1c39da0160e18f959bca63be93ee6953fb662e847771f98c8b5dd" }, "downloads": -1, "filename": "inkscape_figures-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "e06e9a8f195cc56f3a60ca8495ec5e6b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7928, "upload_time": "2019-07-31T15:45:18", "url": "https://files.pythonhosted.org/packages/ab/d8/abd727fe753546378abaae290d85ca9c5052c57d11bf26fe5ad49128140c/inkscape_figures-1.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b6bc00e3d986142cac25225285587cd1", "sha256": "82428efce9759d46d2436b93b637ab33612555a2545fdaeb9648b6b22b124a94" }, "downloads": -1, "filename": "inkscape-figures-1.0.4.tar.gz", "has_sig": false, "md5_digest": "b6bc00e3d986142cac25225285587cd1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7897, "upload_time": "2019-07-31T15:45:19", "url": "https://files.pythonhosted.org/packages/60/2d/a53e0842462a2efa393e71f20beac7e492371bc4a4b8c8482c2b3f3848a0/inkscape-figures-1.0.4.tar.gz" } ] }