我正在尝试在 LaTeX 中显示 pH 值,但我搞不清楚。我用谷歌搜索的结果只能显示 Latex 材料的 pH 值。有人可以提供一些建议/资源吗?
答案1
更新:带颜色的 pH 值标尺https://en.wikipedia.org/wiki/PH_indicator。 (Paul Gaborit 建议)
\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}[xscale=.6,font=\sffamily]
\fill[left color=red,right color=orange]
(0,0) rectangle (3,1);
\fill[left color=orange,right color=green]
(3,0) rectangle (7.5,1);
\fill[left color=green,right color=blue]
(7.5,0) rectangle (12,1);
\fill[left color=blue,right color=violet]
(12,0) rectangle (15,1);
\draw[white] (0,0) grid (15,1);
\foreach \i in {0,...,14}
\path (\i+.5,0) node[below]{\i};
\path
(0,1) node[above right]{Acidic}
(7.5,1) node[above]{Neutral}
(15,1) node[above left]{Alkaline};
\path (current bounding box.south) node[below=2mm,scale=1.5]{\bfseries pH scale};
\end{tikzpicture}
\end{document}
我选择红色表示酸性,紫色表示中性,青色表示碱性。请告诉我您是否有更好的 pH 值颜色选择。
\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}[xscale=.6,font=\sffamily]
\fill[left color=red,middle color=violet,right color=cyan] (0,0) rectangle (15,1);
\draw[white] (0,0) grid (15,1);
\foreach \i in {0,...,14} \path (\i+.5,0) node[below]{\i};
\path
(0,1) node[above right]{Acidic}
(7.5,1) node[above]{Neutral}
(15,1) node[above left]{Alkaline};
\path (current bounding box.south) node[below=2mm,scale=2]{\bfseries pH scale};
\end{tikzpicture}
\end{document}