![chemfig 中分子和名称之间的间距不一致](https://linux22.com/image/325010/chemfig%20%E4%B8%AD%E5%88%86%E5%AD%90%E5%92%8C%E5%90%8D%E7%A7%B0%E4%B9%8B%E9%97%B4%E7%9A%84%E9%97%B4%E8%B7%9D%E4%B8%8D%E4%B8%80%E8%87%B4.png)
为什么苯丙氨酸分子后面全是空白?
\documentclass{article}
\usepackage[dvipsnames, svgnames, x11names, table]{xcolor}
\usepackage[version=4]{mhchem}
\usepackage{chemfig}
\begin{document}
\chemname{\chemfig{[:-30]*5(-[,,,2]\textcolor{Grey}{H}|\textcolor{Grey}{N}>[,,,,Grey](-[:255,,,,Grey]\textcolor{Grey}{H})(-[:-30,,,,Grey](=[:-90,,,,Grey]\textcolor{Grey}{O})-[:30,,,,Grey]\textcolor{Grey}{O}|\textcolor{Grey}{H})---)}}
{Prolina\\Pro, P}
\chemname{\chemfig{\color{Grey}{\ce{H2}}|\textcolor{Grey}{N}>[:60,,,,Grey](-[:195,,,,Grey]\textcolor{Grey}{H})
(-[:90]-[::-60]*6(=-=-=-))
-[:-30,,,,Grey](=[:-90,,,,Grey]\textcolor{Grey}{O})-[:30,,,,Grey]\textcolor{Grey}{O}|\textcolor{Grey}{H}}}{Fenilalanina\\Phe, F}
\end{document}
答案1
chemfig
试图在同一垂直位置绘制连续条目的名称。摘自手动的:“...\chemname
插入 1.5ex +分子的最大深度在每个分子的基线下方...”。删除条目之间的空格,使它们以内联方式显示,会显示以下行为:
基本上,这两个分子位于同一基线上(苯丙氨酸位于 H2N 基线上,脯氨酸位于 5 环基线上),名称位于最大深度以下。脯氨酸基线以下的“物质”比苯丙氨酸多,脯氨酸控制着这一基线,从而形成观察空间。
为了防止这种延续,请\chemnameinit{}
在两者之间添加。
\documentclass{article}
\usepackage[dvipsnames, svgnames, x11names, table]{xcolor}
\usepackage[version=4]{mhchem}
\usepackage{chemfig}
\begin{document}
\chemname{\chemfig{[:-30]*5(-[,,,2]\textcolor{Grey}{H}|\textcolor{Grey}{N}>[,,,,Grey](-[:255,,,,Grey]\textcolor{Grey}{H})(-[:-30,,,,Grey](=[:-90,,,,Grey]\textcolor{Grey}{O})-[:30,,,,Grey]\textcolor{Grey}{O}|\textcolor{Grey}{H})---)}}
{Prolina\\Pro, P}
\chemnameinit{}
\chemname{\chemfig{\color{Grey}{\ce{H2}}|\textcolor{Grey}{N}>[:60,,,,Grey](-[:195,,,,Grey]\textcolor{Grey}{H})
(-[:90]-[::-60]*6(=-=-=-))
-[:-30,,,,Grey](=[:-90,,,,Grey]\textcolor{Grey}{O})-[:30,,,,Grey]\textcolor{Grey}{O}|\textcolor{Grey}{H}}}{Fenilalanina\\Phe, F}
\end{document}