我正在尝试编写玻璃电极的线路图来测量 pH 值。我有一个工作代码:
\documentclass{article}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage[version=4]{mhchem}
\begin{document}
\begin{equation*}
\overbrace{\underbrace{\ce{Ag (\textit{s}) | AgCl (\textit{s}) | KCl (\textit{aq, sat}) }}_{E_{ref1}} \underbrace{||}_{E_j}}^{\text{Electrodo de referencia 1}} \overbrace{\ce{H^+ (\textit{aq}, a_1)}}^{\text{Analito}} \overbrace{\underbrace{|}_{E_1} \text{Membrana de vidrio} \underbrace{|}_{E_2} \textcolor{blue}{\ce{H^+ (\textit{aq}, 0,1M), }} \underbrace{\textcolor{blue}{\ce{Cl^- (\textit{aq}, 0,1 M)}}\ce{|AgCl (\textit{s})|Ag (\textit{s})}}_{\text{Electrodo de referencia 2, }E_{ref2}}}^{\text{Electrodo de vidrio}}
\end{equation*}
\end{document}
结果如下: 我需要在不丢失信息的情况下使其稍微窄一些,而我的最佳选择是将括号中的空白处留给接口(Ej、E1 和 E2)。
有没有办法做到这一点?
答案1
为了真正节省空间,我会放弃\underbrace
机器,而是采用垂直箭头作为指针,将解释性内容引导至正在解释的项目。
\documentclass{article}
\usepackage[margin=2.5cm]{geometry} % set page parameters suitably
\usepackage{xcolor}
\usepackage{mathtools}
\usepackage[version=4]{mhchem}
\begin{document}
\small % so that formula fits within the textblock
\begin{equation*}
\overbrace{%
\underbrace{\ce{Ag (\textit{s})} \mid
\ce{AgCl (\textit{s})} \mid
\ce{KCl^{\vphantom{+}} (\textit{aq, sat})}
}_{E_{\textrm{ref1}}}
%\underbrace{||}_{E_j}
\underset{\substack{\uparrow\\\mathclap{E_j}}}{\mathrel{\Vert}}
}^{\text{Electrodo de referencia 1}}
\overbrace{\ce{H^+ (\textit{aq}, a_1)}}^{\text{Analito}}
\overbrace{%
%\underbrace{|}_{E_1}
\underset{\substack{\uparrow\\\mathclap{E_1}}}{\mid}
\text{Membrana de vidrio}
%\underbrace{|}_{E_2}
\underset{\substack{\uparrow\\\mathclap{E_2}}}{\mid}
\textcolor{blue}{\ce{H^+ (\textit{aq}, 0,1M), }}
\underbrace{%
\textcolor{blue}{\ce{Cl^- (\textit{aq}, 0,1 M)}} \mid
\ce{AgCl (\textit{s})}\mid
\ce{Ag (\textit{s})}
}_{\text{Electrodo de referencia 2, $E_{\textrm{ref2}}$}}
}^{\text{Electrodo de vidrio}}
\end{equation*}
\end{document}