stix 软件包混合了字体

stix 软件包混合了字体

我正在尝试使我的文章图片与使用 stix 包的期刊字体兼容。为此,我使用独立包。问题是,使用一组选项,我可以得到我需要的“H”字符,而使用另一组选项,我可以得到我需要的“w”字符。为什么无论我为 STIX 包选择什么选项,我都无法同时获得这两个字符?代码是

\documentclass[border=10pt, convert={size=640x}]{standalone}
%\usepackage{capt-of}
\usepackage{varwidth}
\usepackage{graphicx}
\usepackage[dvipsnames,svgnames,table]{xcolor} % use color
\usepackage{amsmath} % AMS Math Package
\usepackage{mathptmx} % Use the Adobe Times Roman as the default text font together with math symbols from the Sym­bol, Chancery and Com­puter Modern fonts
\usepackage{tikz}
\usepackage[customcolors]{hf-tikz}
\hfsetfillcolor{black!10}
\hfsetbordercolor{black!0}
\usepackage{pgfplots}
\usetikzlibrary{plotmarks, calc, spy, pgfplots.polar}
%\tikzexternalize[prefix=./figures/tikz/]
\usepgflibrary{shapes.geometric}
%\usepackage[notext, nomath]{stix}
\usepackage[notext, nomath, lcgreekalpha]{stix}
\usepackage[safe]{tipa}
\newcommand{\scOmega}{\text{\textscomega}} % small omega
\newcommand{\heavis}{\mathcal{H}}

\begin{document}
\begin{tikzpicture}[scale=1]
    \begin{axis}[
        ymin=-0.2,ymax=1.2,
    unit vector ratio*=1 1 1,
    yticklabel style={text width=3em,align=right},
    xtick={0,1.25,2},
    xticklabels={$0$, $w$, $1$},
        ytick={0., 1.},
        width = 6cm,
        domain=0:1,
        y domain=-0.75:0.75,
        legend style={at={(0.01,1.)}, anchor=north west,draw=none},
    cycle list name=black white,
        every axis y label/.style={at={(current axis.north west)},xshift=-0pt}
          ]

\addplot [thick,color=black,mark=none,fill=black, 
            fill opacity=0.05] coordinates {
    (2., 0)
    (2., 1)
    (1.25, 1) 
    (1.25, 0)};
\addplot [thick,color=black,mark=none] coordinates {
    (1.25, 0)
    (0, 0)};

% add x axis
\draw[ultra thin] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},0) -- (axis cs:\pgfkeysvalueof{/pgfplots/xmax},0);   

\node at (axis cs:1.47,0.5) [anchor=west] {$\heavis$};    

% add square representing standard dofs
\addplot [mark=*, mark size=3, mark options={solid, fill=red}] coordinates {
    (0, 0)
    (2, 0) };

% add x axis
\draw[ultra thin] (axis cs:\pgfkeysvalueof{/pgfplots/xmin},0) -- (axis cs:\pgfkeysvalueof{/pgfplots/xmax},0);   

   \end{axis}
\end{tikzpicture}
\end{document}

‘w’ 字符在这里: 在此处输入图片描述

这里的‘H’字符:

在此处输入图片描述

更新 添加的 MWE:

\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage[]{stix}

\begin{document}
%    \input{cracked_potato.pdf_tex}

\begin{tikzpicture}[scale=1]
    \begin{axis}[
    xmin=0,xmax=2,ymin=-0.5,ymax=0.5,
    xtick={1.25},
    xticklabels={$w$},
          ]  
\node at (axis cs:1.47,0) [anchor=west] {$\mathcal{H}$};    

   \end{axis}
\end{tikzpicture}
\end{document}

答案1

H,安H,我的王国H-向莎士比亚道歉

根据 OP 的评论,“我需要上面第一个图中的‘w’和第二个图中的‘H’”,我最初主张加载mathptmx 正在加载stix。但是,这会破坏数学模式中的减号。因此,我只需使用 加载字母即可mathptmx\DeclareSymbolFont{letters}{OML}{ztmcm}{m}{it}此行摘自mathptmx.sty

根据 OP 评论,编辑以添加bm调用\DeclareSymbolFont

\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage[]{stix}
%\usepackage{mathptmx}
\DeclareSymbolFont{letters}     {OML}{ztmcm}{m}{it}
\usepackage{bm}

\begin{document}
%    \input{cracked_potato.pdf_tex}

\begin{tikzpicture}[scale=1]
    \begin{axis}[
    xmin=0,xmax=2,ymin=-0.5,ymax=0.5,
    xtick={1.25},
    xticklabels={$-w$},
          ]  
\node at (axis cs:1.47,0) [anchor=west] {$\bm{w}\cdot\mathcal{H}$};    

   \end{axis}
\end{tikzpicture}
\end{document}

在此处输入图片描述


附录

在下面的持续评论讨论中,原帖作者哀叹,收到这些mathptmx信件,是通过

\DeclareSymbolFont{letters}{OML}{ztmcm}{m}{it}

还给出了他不想要的希腊符号。问题是mathptmx如何恢复希腊符号。stix

问题在于希腊符号被归类为“字母”,因此更改字母字体会更改希腊符号字体。因此,我向他指出了我的答案方程式中的非斜体文本,其中声明了一种新的符号字体,我称之为greeksymbols。然后,将希腊字母重新分配给该字体。请注意,在引用的答案中,如果您希望使用各种符号和重音符号,也必须重新定义它们,因为通常,这些符号和重音符号的插槽号可能因字体而异。因此,在下面的 MWE 中,我重新分配了希腊字母,但只为符号和重音符号放置了占位符,此方法的任何用户都必须通过检查stix字体表来查找。

\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage[]{stix}
%\usepackage{mathptmx}
\DeclareSymbolFont{letters}{OML}{ztmcm}{m}{it}
\DeclareSymbolFont{greeksymbols}{LS1}{stix}{m}{it}

\DeclareMathSymbol{\alpha}{\mathord}{greeksymbols}{"0B}
\DeclareMathSymbol{\beta}{\mathord}{greeksymbols}{"0C}
\DeclareMathSymbol{\gamma}{\mathord}{greeksymbols}{"0D}
\DeclareMathSymbol{\delta}{\mathord}{greeksymbols}{"0E}
\DeclareMathSymbol{\epsilon}{\mathord}{greeksymbols}{"0F}
\DeclareMathSymbol{\zeta}{\mathord}{greeksymbols}{"10}
\DeclareMathSymbol{\eta}{\mathord}{greeksymbols}{"11}
\DeclareMathSymbol{\theta}{\mathord}{greeksymbols}{"12}
\DeclareMathSymbol{\iota}{\mathord}{greeksymbols}{"13}
\DeclareMathSymbol{\kappa}{\mathord}{greeksymbols}{"14}
\DeclareMathSymbol{\lambda}{\mathord}{greeksymbols}{"15}
\DeclareMathSymbol{\mu}{\mathord}{greeksymbols}{"16}
\DeclareMathSymbol{\nu}{\mathord}{greeksymbols}{"17}
\DeclareMathSymbol{\xi}{\mathord}{greeksymbols}{"18}
\DeclareMathSymbol{\pi}{\mathord}{greeksymbols}{"19}
\DeclareMathSymbol{\rho}{\mathord}{greeksymbols}{"1A}
\DeclareMathSymbol{\sigma}{\mathord}{greeksymbols}{"1B}
\DeclareMathSymbol{\tau}{\mathord}{greeksymbols}{"1C}
\DeclareMathSymbol{\upsilon}{\mathord}{greeksymbols}{"1D}
\DeclareMathSymbol{\phi}{\mathord}{greeksymbols}{"1E}
\DeclareMathSymbol{\chi}{\mathord}{greeksymbols}{"1F}
\DeclareMathSymbol{\psi}{\mathord}{greeksymbols}{"20}
\DeclareMathSymbol{\omega}{\mathord}{greeksymbols}{"21}
\DeclareMathSymbol{\varepsilon}{\mathord}{greeksymbols}{"22}
\DeclareMathSymbol{\vartheta}{\mathord}{greeksymbols}{"23}
\DeclareMathSymbol{\varpi}{\mathord}{greeksymbols}{"24}
\DeclareMathSymbol{\rho}{\mathord}{greeksymbols}{"25}
\DeclareMathSymbol{\varsigma}{\mathord}{greeksymbols}{"26}
\DeclareMathSymbol{\varphi}{\mathord}{greeksymbols}{"27}
%SYMBOLS
%\DeclareMathSymbol{\<macroname>}{\mathrel}{greeksymbols}{"<slot>}
%OTHERS
%\DeclareMathAccent{\vec}{\mathaccent}{greeksymbols}{"<slot>}

\usepackage{bm}

\begin{document}
%    \input{cracked_potato.pdf_tex}

\begin{tikzpicture}[scale=1]
    \begin{axis}[
    xmin=0,xmax=2,ymin=-0.5,ymax=0.5,
    xtick={1.25},
    xticklabels={$-w\chi$},
          ]  
\node at (axis cs:1.47,0) [anchor=west] {$\bm{w}\cdot\mathcal{H}$};    

   \end{axis}
\end{tikzpicture}
\end{document}

在此处输入图片描述

请注意stix \chi,而不是mathptmx版本。

相关内容