# autolatex - svg2pdf+tex_inkscape.transdef2 # -*- coding: utf-8 -*- # # Copyright (C) 1998-2026 Stephane Galland # # This program is free library; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; see the file COPYING. If not, # write to the Free Software Foundation, Inc., 59 Temple Place - Suite # 330, Boston, MA 02111-1307, USA. --- input_extensions: - '.svgt' - '.svg_t' - '.svgtex' - '.svg+tex' - '.tex.svg' - '+tex.svg' - '.svgzt' - '.svgz_t' - '.svgztex' - '.svgz+tex' - '.tex.svgz' - '+tex.svgz' output_extensions for pdf: - .pdf output_extensions for eps: - .eps all_output_files: - ${outwoext}.pdftex_t - ${outwoext}.pstex_t - $out translator_python_dependencies: - shutil - import autolatex2.utils.utilfunctions as genutils translator_function: | if _pdfmode: ext1 = '.pdf_tex' ext2 = '.pdftex_t' opt = '--export-type=pdf' else: ext1 = '.eps_tex' ext2 = '.pstex_t' opt = '--export-type=eps' pdftexfile = genutils.basename2(_out, _outexts) + ext1 pdftexfile2 = genutils.basename2(_out, _outexts) + ext2 runner_output = Runner.run_command('inkscape', '--export-area-page', opt, '--export-filename=' + _out, '--export-latex', _in) Runner.check_runner_status(runner_output) shutil.move(pdftexfile, pdftexfile2) ...