when inkscape is used to open pdf or convert pdf to svg, elements of pdf were missed.
Summary:
when inkscape is used to open pdf or convert pdf to svg, elements of pdf were missed. In the MWE provided, the square brackets of the second occurrence were missed.
Steps to reproduce:
\documentclass[10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[fleqn]{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage[version=4]{mhchem}
\usepackage{stmaryrd}
\usepackage{mathrsfs}
\usepackage{graphicx}
\usepackage[export]{adjustbox}
\graphicspath{ {./images/} }
\usepackage{multirow}
\usepackage{tikz}
\usetikzlibrary{external}
\tikzexternalize
\expandafter\gdef\csname c@tikzext@no@\pgfkeysvalueof{/tikz/external/figure name}\endcsname{1}%
\tikzset{%
% Add size information to the .dpth file (png is in density not size)
/pgf/images/external info,
% Use the png export AND the import
use png/.style={png export,png import},
png export/.style={
external/system call=%
{pdflatex \tikzexternalcheckshellescape -halt-on-error -interaction=batchmode -jobname "\image" "\texsource";%
convert -density 150 -transparent white "\image.pdf" "\image.png"; inkscape "\image.pdf" --export-filename="\image.svg"},
},
png import/.code={%
\tikzset{%
/pgf/images/include external/.code={%
% Here you can alter to whatever you want
% \pgfexternalwidth is only available if /pgf/images/external info
% is set
\includegraphics%
[width=\pgfexternalwidth,height=\pgfexternalheight]%
{{##1}.pdf}%
}%
}%
}%
}
\newcounter{pngeq}
\setcounter{pngeq}{0}
\newcommand{\pngequation}[1]{%
\tikzset{use png}
\begin{tikzpicture}
\node (eq) {
\hspace{-1.1\parindent}\begin{minipage}{\textwidth}%
\setcounter{equation}{\number\value{pngeq}}
\begin{equation}
#1
\end{equation}
\end{minipage}
};
\end{tikzpicture}%
\stepcounter{pngeq}
}
\title{THE HARTREE-FOCK APPROXIMATION }
\numberwithin{equation}{section}
\begin{document}
\setcounter{section}{3}
The Hartree-Fock approximation, which is equivalent to the molecular orbital approximation, is central to chemistry.
\pngequation{
\left[h(1)+\sum_{b \neq a} \mathscr{I}_{b}(1)-\sum_{b \neq a} \mathscr{K}_{b}(1)\right] \chi_{a}(1)=\varepsilon_{a} \chi_{a}(1)
}
\pngequation{
\mathscr{K}_{b}(1) \chi_{a}(1)=\left[\int d \mathbf{x}_{2} \chi_{b}^{*}(2) r_{12}^{-1} \chi_{a}(2)\right] \chi_{b}(1)
}
\end{document}
- save mwe.tex attached (or the code above) and run
pdflatex -shell-escape mwe.tex
- open Inkscape
- open mwe-figure1.pdf in both PDF viewer and in Inkscape to see the correct brackets
- open mwe-figure2.pdf in both PDF viewer and in Inkscape to notice the missing brackets
- open mwe-figure2.svg in both web browser and in Inkscape to notice the missing brackets
What happened?
The brackets were missing (and the .svg file seems to be corrupted and not able to view in web browser)
What should have happened?
The brackets should be shown and the .svg should be viewable in the web browser
Sample attachments:
Version info
Inkscape 1.3 (0e150ed6c4, 2023-07-21)
Windows 10; Ubuntu 22.04