I have a diagram created in Inkscape that I’d like to export to PDF with LaTeX text (so the text keeps the properties of the LaTeX document it’s used in). In this diagram I have several labeled arrows like this:
Unfortunately if I resize the image in the LaTeX document, these will turn into either
or
Now, I’m OK with the arrow itself limiting how much I can resize the image (without making the text span across the entire arrow), but I’d like at least the spacing of the label to be consistent.
Currently the arrows are composed of the left side (straight line), the text, and the right side (straight line with arrow point). I’d like to instead make the arrow just a single straight line (with an arrow point) and give the text a (non-transparent) white background, which would then expand or contract with the text. Is this possible?
Answer
Don’t add the white background in inkscape, just add the text on top of the arrow.
Then export as pdf+tex and open the resulting .pdf_tex
file. There search for your text and replace it with \colorbox{white}{text}
. This box will automatically adjust to the size of the text.
\begin{picture}(1,1.41428571)%
\put(0,0){\includegraphics[width=\unitlength,page=1]{drawing.pdf}}%
\put(0.37047077,0.755){\color[rgb]{0,0,0}\makebox(0,0)[b]{\smash{\colorbox{white}{Text}}}}%
\end{picture}%
Attribution
Source : Link , Question Author : Mate de Vita , Answer Author : samcarter_is_at_topanswers.xyz