我想水平对齐如下所示的两个 chemfig 结构,但我不明白该怎么做。
\documentclass{article}
\usepackage{chemfig}
\begin{document}
\begingroup
\centering
\setatomsep{3em}\chemname{\chemfig{C(-[:180]H)*6(-C(-H)=C(-H)-C(-H)=C(-H)-C(-H)=)}}{Lewis
structure\\of benzene}
\qquad
\setatomsep{3em}\chemname{\chemfig{**6(------)}}{Cyclic compound\\of benzene}
\endgroup
\end{document}
答案1
将化学无花果放入\raisebox{\depth-\totalheight/2}{...}
中心,通过将盒子参考点移动到总高度的一半来垂直放置。需要calc
LaTeX 包:
\documentclass{article}
\usepackage{chemfig}
\usepackage{calc}
\begin{document}
\begingroup
\centering
\setatomsep{3em}\chemname{\raisebox{\depth-\totalheight/2}{\chemfig{C(-[:180]H)*6(-C(-H)=C(-H)-C(-H)=C(-H)-C(-H)=)}}}{Lewis
structure\\of benzene}
\qquad
\setatomsep{3em}\chemname{\raisebox{\depth-\totalheight/2}{\chemfig{**6(------)}}}{Cyclic compound\\of benzene}
\endgroup
\end{document}