![在情节中倾斜文本](https://linux22.com/image/457978/%E5%9C%A8%E6%83%85%E8%8A%82%E4%B8%AD%E5%80%BE%E6%96%9C%E6%96%87%E6%9C%AC.png)
使用 PSFRAG+INKSCAPE 和以下代码:
% !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}
我可以生成以下图纸:
特别要注意倾斜的文本。
但是,我知道 PSFRAG 有点过时了,我想从 LATEX -> DVI -> PS -> PDF 路线切换到 PDFLATEX 或 XELATEX。因此,我想使用最新版本的 INKSCAPE 找到替代方案。
我努力了:
\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}
但结果不是我想要的:
TikZ 不是一个选项。我已经非常熟练使用 INKSCAPE 了。
答案1
使用 INKSCAPE 1.1
(1)加载方程Extension > Render > Mathematics > LaTex {pdflatex)...
(2)保存类型 Latex with PsTricks macros (*.tex)
使用 xelatex 或 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}
(我是使用 INKSCAPE 的新手,因此我猜测您如何倾斜文本框并绘制路径。)
答案2
我能找到的唯一可行方法是使用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}