![在绘制命令环境中设置 Palatino Linotype](https://linux22.com/image/418985/%E5%9C%A8%E7%BB%98%E5%88%B6%E5%91%BD%E4%BB%A4%E7%8E%AF%E5%A2%83%E4%B8%AD%E8%AE%BE%E7%BD%AE%20Palatino%20Linotype%20.png)
这是我的代码。我不知道如何在绘图环境中为“原始系统”和“MTMD”设置 palatino linotype。
谢谢
\documentclass{standalone}
\usepackage{tikz}
\usepackage{newpxtext,newpxmath}
\tikzset{every picture/.style={/utils/exec={\sffamily}}}
\usetikzlibrary{calc,patterns,decorations.pathmorphing,decorations.markings,positioning}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
\tikzset{spring/.style={thick,decorate,decoration={zigzag,pre length=0.3cm,post
length=0.3cm,segment length=6}},
short spring/.style={thick,decorate,decoration={zigzag,pre length=0.05cm,post
length=0.05cm,segment length=6}},
damper/.style={thick,decoration={markings,
mark connection node=dmp,
mark=at position 0.5 with
{
\node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
width=15pt,minimum height=3pt,draw=none] {};
\draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
\draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);
}
}, decorate},
damper_small/.style={thick,decoration={markings,
mark connection node=dmp,
mark=at position 0.5 with
{
\node (dmp) [thick,inner sep=0pt,transform shape,rotate=-90,minimum
width=12pt,minimum height=3pt,draw=none] {};
\draw [thick] ($(dmp.north east)+(2pt,0)$) -- (dmp.south east) -- (dmp.south west) -- ($(dmp.north west)+(2pt,0)$);
\draw [thick] ($(dmp.north)+(0,-5pt)$) -- ($(dmp.north)+(0,5pt)$);
}
}, decorate},
ground/.style={fill,pattern=north east lines,draw=none,minimum
width=0.75cm,minimum height=0.3cm},
ground_big/.style={fill,pattern=north east lines,draw=none,minimum
width=5cm,minimum height=0.3cm},
ground_magenta/.style={fill,pattern=north east lines,pattern color=magenta,draw=none,minimum
width=0.75cm,minimum height=0.3cm}}
\begin{tikzpicture}[every node/.style={draw,outer sep=0pt,thick}]
%ORIGINAL SYSTEM
\node (m_1) [minimum width=2cm,minimum height=5cm]{$m$};
\node (ground1) at (m_1.west) [ground_big,xshift=-2cm,rotate=90,anchor=north] {};
\draw (ground1.south west) -- (ground1.south east);
\coordinate (punto_aux1) at ($(m_1.north west)!0.5!(m_1.west)$);
\coordinate (punto_aux2) at ($(ground1.south)!0.5!(ground1.south east)$);
\draw [spring] (punto_aux1) -- (punto_aux2) node[midway,yshift=4mm,draw=none]{$k$};
\coordinate (punto_aux3) at ($(m_1.south west)!0.5!(m_1.west)$);
\coordinate (punto_aux4) at ($(ground1.south)!0.5!(ground1.south west)$);
\draw [damper] (punto_aux3) -- (punto_aux4) node[midway,yshift=6mm,draw=none]{$c$};
%TMDs
\coordinate (punto_aux5) at ($(m_1.east)!0.5!(m_1.north east)$);
\node (m_a1)[right of= punto_aux5,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]{$m_{a_1}$};
\coordinate (punto_aux6) at ($(m_1.east)!0.58!(m_1.north east)$);
\coordinate (punto_aux7) at ($(m_a1.north west)!0.5!(m_a1.west)$);
\draw [spring] (punto_aux6) -- (punto_aux7) node[midway,above=1mm,draw=none]{$k_{a_1}$};
\coordinate (punto_aux8) at ($(m_1.east)!0.42!(m_1.north east)$);
\coordinate (punto_aux9) at ($(m_a1.south west)!0.5!(m_a1.west)$);
\draw [damper_small] (punto_aux8) -- (punto_aux9) node[midway,below=2mm,draw=none]{$c_{a_1}$};
\coordinate (punto_aux10) at ($(m_1.east)!0.5!(m_1.south east)$);
\node (m_a2)[right of= punto_aux10,node distance=2.5cm,minimum width=1cm,minimum height=0.8cm]{$m_{a_n}$};
\coordinate (punto_aux11) at ($(m_1.east)!0.42!(m_1.south east)$);
\coordinate (punto_aux12) at ($(m_a2.north west)!0.5!(m_a2.west)$);
\draw [spring] (punto_aux11) -- (punto_aux12) node[midway,above=1mm,draw=none]{$k_{a_n}$};
\coordinate (punto_aux13) at ($(m_1.east)!0.58!(m_1.south east)$);
\coordinate (punto_aux14) at ($(m_a2.south west)!0.5!(m_a2.west)$);
\draw [damper_small] (punto_aux13) -- (punto_aux14) node[midway,below=2mm,draw=none]{$c_{a_n}$};
\node[circle,fill=black,inner sep=0pt,minimum size=3pt] (dot1) at (3.5,-0.3) {};
\node[circle,fill=black,inner sep=0pt,minimum size=3pt] (dot2) at (3.5,0) {};
\node[circle,fill=black,inner sep=0pt,minimum size=3pt] (dot3) at (3.5,0.3) {};
\draw [-latex,thick] (m_1.north) ++(0.2cm,0.3cm) -- +(1,0cm) node[midway,above=0.3mm,draw=none]{$x$};
\draw [-latex,thick] (m_a1.north) ++(0.2cm,0.3cm) -- +(1,0cm) node[midway,above=0.3mm,draw=none]{$x_{a_1}$};
\draw [-latex,thick] (m_a2.north) ++(0.2cm,0.3cm) -- +(1,0cm) node[midway,above=0.3mm,draw=none]{$x_{a_n}$};
\draw [thick,decorate,decoration={brace,amplitude=10pt,mirror,raise=4pt},yshift=0pt]
(-3,-3) -- (1.1,-3) node [draw=none,black,midway,yshift=-1cm] {Original system};
\draw [thick,decorate,decoration={brace,amplitude=10pt,mirror,raise=4pt},yshift=0pt]
(1.2,-3) -- (4.6,-3) node [draw=none,black,midway,yshift=-1cm] {MTMD};
\end{tikzpicture}
\end{document} ```
答案1
您已在代码的第 5 行中设置了sffamily
第一个。\tikzset
只需删除或者注释掉第 5 行:
% \tikzset{every picture/.style={/utils/exec={\sffamily}}}