# autolatex - svg2pdf+layers_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: - '.svgl' - '.svg_l' - '.svglayers' - '.svg+layers' - '.layers.svg' - '+layers.svg' - '.svgzl' - '.svgz_l' - '.svgzlayers' - '.svgz+layers' - '.layers.svgz' - '+layers.svgz' output_extensions for pdf: - .pdftex_t output_extensions for eps: - .pstex_t all_output_files: - ${outwoext}.pdftex_t - ${outwoext}.pstex_t - ${outwoext}_*.pdf - ${outwoext}_*.eps translator_python_dependencies: - from autolatex2.translators.svg.svgutils import SvgUtils translator_function: | if _pdfmode: opt = '--export-type=pdf' else: opt = '--export-type=eps' SvgUtils.create_pdftex_for_layered_svg( _in, _out, _outwoext, _outdir, _outexts, _pdfmode, False, # not TeX mode lambda ink_identifier, ink_svg_file, ink_output_file, opt: \ Runner.run_command( 'inkscape', '--export-id', ink_identifier, '--export-id-only', '--export-area-page', opt, '--export-filename=' + ink_output_file, '--export-overwrite', "--file=" + ink_svg_file), opt) ...