1

Using PSFRAG+INKSCAPE and this code:

% !TeX document-id = {e6a8e82d-b7ef-4afd-9d07-b0a5e7dd8c48}
% !TeX program = txs:///dvi-ps-pdf-chain

\documentclass[12pt]{article} \usepackage{graphicx} \usepackage{psfrag}

\begin{filecontents}{dibujo.eps} %!PS-Adobe-3.0 EPSF-3.0 %%Creator: 0.46 %%Pages: 1 %%Orientation: Portrait %%BoundingBox: 117 692 247 746 %%HiResBoundingBox: 117.23092 692.06902 246.90458 745.67044 %%EndComments %%Page: 1 1 0 842 translate 0.8 -0.8 scale 0 0 0 setrgbcolor [] 0 setdash 1 setlinewidth 0 setlinejoin 0 setlinecap gsave [3.543307 0 0 3.543307 4.9321338e-06 0] concat gsave [0.9147194 0.4040896 0 1 0 0] concat 0 0 0 setrgbcolor [] 0 setdash 0.3256157 setlinewidth 0 setlinejoin 0 setlinecap newpath 45.382412 15.761183 moveto 70.217659 15.761183 lineto 70.217659 24.323487 lineto 45.382412 24.323487 lineto 45.382412 15.761183 lineto closepath stroke grestore gsave [1 0.4417635 0 1 0 0] concat gsave [1 0 0 -1 43.664242 20.91346] concat gsave /newlatin1font {findfont dup length dict copy dup /Encoding ISOLatin1Encoding put definefont} def /Sans-ISOLatin1 /Sans newlatin1font 4.2333298 scalefont setfont 0 0 0 setrgbcolor newpath 0 0 moveto (text1) show grestore grestore grestore gsave [-1 0.44176347 0 1 128.45891 -23.356394] concat 0 0 0 setrgbcolor [] 0 setdash 0.31142199 setlinewidth 0 setlinejoin 0 setlinecap newpath 41.512173 39.117577 moveto 64.229454 39.117577 lineto 64.229454 47.679881 lineto 41.512173 47.679881 lineto 41.512173 39.117577 lineto closepath stroke grestore gsave [1 -0.4469484 0 1 0 0] concat gsave [1 0 0 -1 64.94355 77.981041] concat gsave /Sans-ISOLatin1 findfont 4.2333298 scalefont setfont 0 0 0 setrgbcolor newpath 0 0 moveto (text2) show grestore grestore grestore grestore showpage %%EOF \end{filecontents}

\begin{document} \begin{figure} \centering \psfrag{text1}{$\displaystyle\int_a^b f(x) + g(x) \mathrm{d}x$} \psfrag{text2}{Some skewed text} \includegraphics[width=0.5\columnwidth]{dibujo} \caption{Notice the skewed text}\end{figure} \end{document}

I am able to generate the following drawing:

enter image description here

In particular notice the nicely skewed text.

However, I know PSFRAG is kind of deprecated, and I would like to switch from the LATEX -> DVI -> PS -> PDF route to PDFLATEX or XELATEX. Therefore, I would like to find an alternative using a recent version of INKSCAPE.

I have tried:

\documentclass[12pt]{article}
\usepackage{graphicx}

\begin{document} \begin{figure} \centering \def\svgwidth{0.5\columnwidth} \input{drawing.pdf_tex} \caption{Notice the skewed text} \end{figure} \end{document}

but the result is not what I want:

enter image description here

TikZ is not an option. I am already very proficient with INKSCAPE.

  • 1
    If you were using Tikz, you could use xslant or yslant (depending on the oreintation) to effect 3D letters. I have no idea whether inkscape implements these effects. See https://tex.stackexchange.com/questions/170244/how-to-compute-xslant-and-yslant – John Kormylo Nov 29 '22 at 15:32

2 Answers2

1

Using INKSCAPE 1.1

(1) Load the equation with Extension > Render > Mathematics > LaTex {pdflatex)...

b

(2) Save as type Latex with PsTricks macros (*.tex)

a

Compile with xelatex or lualatex.

\documentclass[12pt]{article}
\usepackage{graphicx}

\usepackage{pstricks} % added <<<<<<<<<<<<<<

\begin{document} \begin{figure} \centering \input{drawing1} \caption{Notice the skewed text} \end{figure} \end{document}

(I'm being a newbie using INKSCAPE so I'm guessing you how to skew the text boxes and draw the paths.)

Simon Dispa
  • 39,141
0

The only feasible way I was able to find was to use pstool:

% !TeX program = txs:///pdf-chain/[--shell-escape]

\documentclass[12pt]{article} \usepackage[crop=pdfcrop]{pstool}

\begin{document} \begin{figure} \centering \psfragfig[width=0.5\columnwidth]{dibujo}{% \psfrag{text1}{$\displaystyle\int_a^b f(x) + g(x) \mathrm{d}x$} \psfrag{text2}{Some skewed text} } \caption{Notice the skewed text} \end{figure} \end{document}