在 Inkscape 中插入 MathTime Pro 2 數學

在 Inkscape 中插入 MathTime Pro 2 數學

我正在使用 Inkscape(以及 TeX Live 2009/Debian,安裝了 MTPro2 字體),並且我想在 Inkscape 創建的圖像中插入 LaTeX 數學程式碼,並以 MTPro2 字體呈現數學。

我知道 Inkscape 擴充Inkscape 乳膠,但我不知道如何使該擴充功能使用 MTPro2 字體進行渲染。

有什麼想法或建議嗎?我知道我可以使用 PGF/TikZ,但我現在根本沒有時間使用它們 --- 特別是因為我以前從未使用過它們。

答案1

你可以嘗試使用文字文字。它允許載入“前導碼檔案”,因此只需使用與您通常在 LaTeX 檔案中所做的相同的前導碼即可使用 MTPro2 字型:可能類似於

\usepackage{mtpro2}

答案2

在我看來上圖這裡應該推薦一下包。它比將字體直接嵌入到原理圖中更通用。您稍後將能夠使用另一種字體編譯同一文檔,而無需額外的努力。

答案3

eqtexsvg.py您可以修改Inkscape 安裝目錄中的Python 檔案。尋找function的定義create_equation_tex並重新定義如下:

def create_equation_tex(filename, equation, add_header=""):
tex = open(filename, 'w')
tex.write("""%% processed with eqtexsvg.py
  \\documentclass{article}
  %\\usepackage{amsmath}
  %\\usepackage{amssymb}
  %\\usepackage{amsfonts}
  \\input{stuff_for_inkscape}% <===== see: c:\texlive\texmf-local\tex\latex\
""")
tex.write(add_header)
tex.write("""
  \\thispagestyle{empty}
  \\begin{document}
""")
tex.write(equation)
tex.write("\n\\end{document}\n")
tex.close()

然後,您可以將以下文件放入stuff_for_inkscape.texTeX 搜尋路徑中:

%-----------------------------
% Mathematics and related stuff
\usepackage{mathtools}

%-----------------------------
% Fonts and related stuff
\usepackage[T1]{fontenc}
\usepackage[final]{microtype}
\usepackage{newtxtext}% replaces the txfonts package;
% MathTime Professional 2
\usepackage[subscriptcorrection,slantedGreek,nofontinfo,%
        mtpcal,%
        mtphbi %% mtpbbi
        ]{mtpro2}

% font for Aspect Ratio
\usepackage[TM]{ar}

透過這些調整,您可以透過選單插入使用 MathTimes Pro 2 排版的 LaTeX 公式擴充|使成為|乳膠配方。若要使用此功能,您必須安裝GhostScript 和 GhostView,編輯,圖像魔術師, 和圖形魔術師。確保這些程式位於作業系統搜尋路徑上。

相關內容