All Projects → gillescastel → Inkscape Figures

gillescastel / Inkscape Figures

Licence: mit
Inkscape figure manager

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Inkscape Figures

Fluentmark
FluentMark -- Eclipse editor for Markdown content
Stars: ✭ 29 (-90.17%)
Mutual labels:  latex
Focus Beamertheme
Focus: a minimalist presentation theme for LaTeX Beamer.
Stars: ✭ 263 (-10.85%)
Mutual labels:  latex
Thuthesis
LaTeX Thesis Template for Tsinghua University
Stars: ✭ 3,272 (+1009.15%)
Mutual labels:  latex
xelatex-guide-book
xelatex book template
Stars: ✭ 59 (-80%)
Mutual labels:  latex
learning-notes
My learning notes.
Stars: ✭ 20 (-93.22%)
Mutual labels:  latex
Mak
A universal notepad. (WIP)
Stars: ✭ 270 (-8.47%)
Mutual labels:  latex
wizpen
A font based on the Pigpen cipher, originally used to help liberate Wraxnia from the Fangs in a D&D campaign. Works in LaTeX.
Stars: ✭ 15 (-94.92%)
Mutual labels:  latex
Openintro Statistics
📚 An open-source textbook written at the college level. OpenIntro also offers a second college-level intro stat textbook and also a high school variant.
Stars: ✭ 283 (-4.07%)
Mutual labels:  latex
acro
acronyms for LaTeX 2e
Stars: ✭ 22 (-92.54%)
Mutual labels:  latex
Paper Tips And Tricks
Best practice and tips & tricks to write scientific papers in LaTeX, with figures generated in Python or Matlab.
Stars: ✭ 3,099 (+950.51%)
Mutual labels:  latex
cryptography
Cryptography course slides at Harbin Institute of Technology
Stars: ✭ 86 (-70.85%)
Mutual labels:  latex
Num-Plus-Plus
A scientific & intutive calculator written in Flutter.
Stars: ✭ 62 (-78.98%)
Mutual labels:  latex
Docx2tex
Converts Microsoft Word docx to LaTeX
Stars: ✭ 271 (-8.14%)
Mutual labels:  latex
redesocial
Projeto do Curso de Sistemas de Informação sobre Rede Social
Stars: ✭ 38 (-87.12%)
Mutual labels:  latex
Begin Latex In Minutes
📜 Brief Intro to LaTeX for beginners that helps you use LaTeX with ease.
Stars: ✭ 3,082 (+944.75%)
Mutual labels:  latex
sympy-paper
Repo for the paper "SymPy: symbolic computing in python"
Stars: ✭ 42 (-85.76%)
Mutual labels:  latex
Angourimath
Open-source symbolic algebra library for C# and F#. One of the most powerful in .NET
Stars: ✭ 266 (-9.83%)
Mutual labels:  latex
Tum Thesis Latex
📔 A LaTeX template for TUM Bachelor/Master theses.
Stars: ✭ 291 (-1.36%)
Mutual labels:  latex
Latexify.jl
Convert julia objects to LaTeX equations, arrays or other environments.
Stars: ✭ 285 (-3.39%)
Mutual labels:  latex
Huxtable
An R package to create styled tables in multiple output formats, with a friendly, modern interface.
Stars: ✭ 277 (-6.1%)
Mutual labels:  latex

Inkscape figure manager.

A script I use to manage figures for my LaTeX documents. More information in this blog post.

Requirements

You need Python >= 3.7, as well as a picker. Current supported pickers are:

Installation

You can install it using pip:

pip3 install inkscape-figures

This package currently works on Linux and MacOS. If you're interested in porting it to Windows, feel free to make a pull request.

Setup

Add the following code to the preamble of your LateX document.

\usepackage{import}
\usepackage{pdfpages}
\usepackage{transparent}
\usepackage{xcolor}

\newcommand{\incfig}[2][1]{%
    \def\svgwidth{#1\columnwidth}
    \import{./figures/}{#2.pdf_tex}
}

\pdfsuppresswarningpagegroup=1

This defines a command \incfig which can be used to include Inkscape figures. By default, \incfig{figure-name} make the figure as wide as the page, but it's also possible to change the width by providing an optional argument: \incfig[0.3]{figure-name}.

The settings above assume the following directory structure:

master.tex
figures/
    figure1.pdf_tex
    figure1.svg
    figure1.pdf
    figure2.pdf_tex
    figure2.svg
    figure2.pdf

Usage

  • Watch for figures: inkscape-figures watch.
  • Creating a figure: inkscape-figures create 'title'. This uses ~/.config/inkscape-figures/template.svg as a template.
  • Creating a figure in a specific directory: inkscape-figures create 'title' path/to/figures/.
  • Select figure and edit it: inkscape-figures edit.
  • Select figure in a specific directory and edit it: inkscape-figures edit path/to/figures/.

Vim mappings

This assumes that you use VimTeX.

inoremap <C-f> <Esc>: silent exec '.!inkscape-figures create "'.getline('.').'" "'.b:vimtex.root.'/figures/"'<CR><CR>:w<CR>
nnoremap <C-f> : silent exec '!inkscape-figures edit "'.b:vimtex.root.'/figures/" > /dev/null 2>&1 &'<CR><CR>:redraw!<CR>

First, run inkscape-figures watch in a terminal to setup the file watcher. Now, to add a figure, type the title on a new line, and press Ctrl+F in insert mode. This does the following:

  1. 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.
  2. Check if there exists a figure with the same name. If there exists one, do nothing; if not, go on.
  3. Copy the figure template to the directory containing the figures.
  4. In Vim: replace the current line – the line containing figure title – with the LaTeX code for including the figure.
  5. Open the newly created figure in Inkscape.
  6. 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.

To 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.

Configuration

You can change the default LaTeX template by creating ~/.config/inkscape-figures/config.py and adding something along the lines of the following:

def latex_template(name, title):
    return '\n'.join((r"\begin{figure}[ht]",
                      r"    This is a custom LaTeX template!",
                      r"    \centering",
                      rf"    \incfig[1]{{{name}}}",
                      rf"    \caption{{{title}}}",
                      rf"    \label{{fig:{name}}}",
                      r"\end{figure}"))
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].