【问题标题】:Different font (size) for text in images from Inkscape to Latex从 Inkscape 到 Latex 的图像中文本的不同字体(大小)
【发布时间】:2018-12-28 20:37:11
【问题描述】:

我正在使用 Inkscape 将图像转换为 Latex,因此文本可以很好地缩放。使用 SaveAs pdf,勾选生成 Latex。 这将创建一个 .pdf_tex 文件,其中包含如下内容:

\begingroup%
\begin{picture}(1,1.18884212)%   
\put(0,0){\includegraphics[width=\unitlength,page=1]{Scapula.pdf}}%  
\put(0.6981335,0.82053681){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{Infraspinous fossa}}}%
\end{picture}%
\endgroup%

我想更改字体大小和可能的字体,所以所有图像中的文本都与正文不同。我认为这是可能的,例如在“图片”中重新定义 \smash,但我不知道如何。这是正确的方法吗?如果是这样,关于如何做到这一点的任何提示?

【问题讨论】:

  • 如果这是可能的,我会感到惊讶,我认为 LaTeX 不能修改 PDF(毕竟它只是一种标记语言)。为什么不在 Inkscape 中定义字体大小和样式?
  • PDF 不包含文本或前导。据我了解,生成的 Latex 代码(包含的示例)在与背景图像匹配的定义位置覆盖文本。我可以轻松地将格式直接添加到代码中,但我想对所有图片进行全局处理。

标签: latex inkscape


【解决方案1】:

使用etoolbox,您可以将字体大小更改添加到picture 环境:

\documentclass{article}

\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{etoolbox}

\AtBeginEnvironment{picture}{\huge}


\begin{document}

\begingroup%
\begin{picture}(1,1.18884212)%   
\put(0,0){\includegraphics[width=\unitlength,page=1]{example-image.pdf}}%  
\put(0.6981335,0.82053681){\color[rgb]{0,0,0}\makebox(0,0)[lb]{\smash{Infraspinous fossa}}}%
\end{picture}%
\endgroup%


\end{document}

【讨论】:

    猜你喜欢
    • 2021-09-20
    • 2021-02-23
    • 2014-09-15
    • 2019-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多