在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):gillescastel/inkscape-figures开源软件地址(OpenSource Url):https://github.com/gillescastel/inkscape-figures开源编程语言(OpenSource Language):Python 100.0%开源软件介绍(OpenSource Introduction):Inkscape figure manager.A script I use to manage figures for my LaTeX documents. More information in this blog post. RequirementsYou need Python >= 3.7, as well as a picker. Current supported pickers are: InstallationYou can install it using pip:
This package currently works on Linux and MacOS. If you're interested in porting it to Windows, feel free to make a pull request. SetupAdd 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 The settings above assume the following directory structure:
Usage
Vim mappingsThis 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
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. ConfigurationYou can change the default LaTeX template by creating 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}")) |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论