我正在尝试安排一个subfigure
像 1 个大图在左边、1 个在右上角和 4 个在左下角的图。这些图是用自定义框起来的tcolorbox
。
到目前为止,我的所有子图都正常工作,但由于某些原因,这个子图没有按预期工作。
对于我的 MWE,我删除了大分子以使代码更具可读性(我只保留了尿嘧啶,因此您可以看到没有任何东西居中并位于其位置)。
梅威瑟:
\documentclass{article}
\usepackage{subcaption,graphicx}
\usepackage{chemfig}
\usetikzlibrary{shapes.geometric}
\usepackage{lipsum}
\newcommand{\decoRule}{\rule{\textwidth}{0.4pt}}
\renewcommand{\thesubfigure}{\Alph{subfigure}}
\captionsetup[subfigure]{labelformat=simple, labelsep=quad}
\usepackage[showframe]{geometry}
\usepackage{tcolorbox}
\newtcolorbox{mybox}{colback=white,colframe=black,arc=5mm, halign=center}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases
\definesubmol{Abase}{(([:36]\chembelow{N}{H}*5(-(*6(-N=-N=(-NH_2)-=))--N=-)))}
\definesubmol{Gbase}{(([:36]\chembelow{N}{H}*5(-(*6(-N=(-NH_2)-NH-(=O)-=))--N=-)))}
\definesubmol{Cbase}{*6(-\chembelow{N}{H}-(=O)-N=(-NH_2)-=)}
\definesubmol{Ubase}{*6(-\chembelow{N}{H}-(=O)-NH-(=O)-=)}
\definesubmol{a}{-P(=[::90,0.75]O)(-[::-90,0.75]OH)-}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sugar-backbone
\definesubmol{backB}{[:-54]*5((-[:90]-[:180]O([:180]!a\charge{135:3pt=$\scriptstyle\ominus$}{O}))<(-HO)-[,,,,line width=2pt](-OH)>(-R)-O-)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sugar-backbone
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases for RNA assembly
\definesubmol{ARbase}{((-[:90]N*5(-(*6(-N=-N=(-NH_2)-=))--N=-)))}
\definesubmol{GRbase}{((-[:90]N*5(-(*6(-N=(-NH_2)-[,,,1]NH-[,,1](=O)-=))--N=-)))}
\definesubmol{CRbase}{-[:90]N*6(-(=O)-N=(-NH_2)-=-)}
\definesubmol{URbase}{-[:90]N*6(-(=O)-NH=(=O)-=-)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases for RNA assembly
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RNA nucleotide assembly
\definesubmol{4th}{-[:180]O-[:180]X(=[:-90]O)(-[:180]\charge{135:3pt=$\scriptstyle\ominus$}{O})-[:90]O-[:90]([:54]*5(-[,,,,line width=4pt](-[:-90]OH)>(!{CRbase})-O-(-[:90]-[:180]O-[:180]P(-[:90]\charge{135:3pt=$\scriptstyle\ominus$}{O})(-[:180]\charge{135:3pt=$\scriptstyle\ominus$}{O})(=[:-90]O))<))} % upper end segment
\definesubmol{3rd}{-[:180]O-[:180]P(=[:-90]O)(-[:180]\charge{135:3pt=$\scriptstyle\ominus$}{O})-[:90]O-[:90]([:54]*5(-[,,,,line width=4pt](-[:-90]OH)>(!{GRbase})-O-(-[:90]!{4th})<))} % third middle segment
\definesubmol{2nd}{O-[:90]([:54]*5(-[,,,,line width=4pt](-[:-90]OH)>(!{ARbase})-O-(-[:90]!{3rd})<))} % second middle segment
\definesubmol{RNA}{[:-54]*5((-[:90]-[:180]O([:180]-P(-\charge{135:3pt=$\scriptstyle\ominus$}{O})(=[:-90]O)(-[::-90]!{2nd})))<(-[:-90]HO)-[,,,,line width=4pt](-[:-90]OH)>(!{URbase})-O-)} % bottom end segment
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RNA nucleotide assembly
\setchemfig{scheme debug=true}
\begin{figure}[h]
\captionsetup[subfigure]{justification=centering}
\begin{subfigure}[t]{.6\textwidth}
\begin{mybox}
\scalebox{0.45}{
\chemfig{!{RNA}}
\chemmove{%
\node[at=(cyclecenter4),fill=red,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=48](){};
}
\chemmove{%
\node[at=(cyclecenter3),fill=red,opacity=0.2,inner sep=13.5pt,regular polygon, regular polygon sides=5,rotate=180](){};
}
\chemmove{%
\node[at=(cyclecenter10),fill=yellow,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\chemmove{%
\node[at=(cyclecenter9),fill=green,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\chemmove{%
\node[at=(cyclecenter7),fill=cyan,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=48](){};
}
\chemmove{%
\node[at=(cyclecenter6),fill=cyan,opacity=0.2,inner sep=13.5pt,regular polygon, regular polygon sides=5,rotate=180](){};
}
}
\end{mybox}
\caption[RNA]{RNA chain}
\end{subfigure}
\hfill
\begin{minipage}[b]{.37\textwidth}
\begin{subfigure}[t]{\textwidth}
\begin{mybox}
\scalebox{0.6}{\chemfig{!{backB}}}
\end{mybox}
\caption{sugar backbone}
\end{subfigure}
\par\bigskip
\begin{subfigure}[b]{.475\textwidth}
\begin{mybox}
\scalebox{0.30}{\chemfig{[:72]!{Abase}}
\chemmove{%
\node[at=(cyclecenter2),fill=red,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\chemmove{%
\node[at=(cyclecenter1),fill=red,opacity=0.2,inner sep=13.5pt,regular polygon, regular polygon sides=5,rotate=90](){};
}}
\end{mybox}
\caption{adenine}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.475\textwidth}
\begin{mybox}
\scalebox{0.30}{\chemfig{[:72]!{Gbase}}
\chemmove{%
\node[at=(cyclecenter2),fill=cyan,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\chemmove{%
\node[at=(cyclecenter1),fill=cyan,opacity=0.2,inner sep=13.5pt,regular polygon, regular polygon sides=5,rotate=90](){};
} }
\end{mybox}
\caption{guanine}
\end{subfigure}
\par\bigskip
\begin{subfigure}[b]{.475\textwidth}
\begin{mybox}
\scalebox{0.30}{\chemfig{!{Cbase}}
\chemmove{%
\node[at=(cyclecenter1),fill=green,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}}
\end{mybox}
\caption{cytosine}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.475\textwidth}
\begin{mybox}
\scalebox{0.30}{
%\setchemfig{scheme debug=true}
%\schemestart
\chemfig{!{Ubase}}
\chemmove{%
\node[at=(cyclecenter1),fill=yellow,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
%\schemestop
}
\end{mybox}
\caption{uracil}
\end{subfigure}
\end{minipage}
\par\bigskip
\decoRule
\caption{RNA structural organisation: \lipsum[1]}\label{reduced}
\end{figure}
\end{document}
答案1
以下应导致更接近预期的输出:
\documentclass{article}
\usepackage{subcaption,graphicx}
\usepackage{chemfig}
\usetikzlibrary{shapes.geometric}
\usepackage{lipsum}
\newcommand{\decoRule}{\rule{\textwidth}{0.4pt}}
\renewcommand{\thesubfigure}{\Alph{subfigure}}
\captionsetup[subfigure]{labelformat=simple, labelsep=quad}
\usepackage[showframe]{geometry}
\usepackage{tcolorbox}
\newtcolorbox{mybox}{colback=white,colframe=black,arc=5mm, halign=center}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases
\definesubmol{Ubase}{*6(-\chembelow{N}{H}-(=O)-NH-(=O)-=)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases
\setchemfig{scheme debug=true}
\begin{figure}[h]
\captionsetup[subfigure]{justification=centering}
\begin{subfigure}[b]{.6\textwidth}
\begin{mybox}
\scalebox{0.45}{
\chemfig[scale=0.45]{!{Ubase}}
}
\end{mybox}
\caption[RNA]{RNA chain}
\end{subfigure}
\hfill
\begin{minipage}[b]{.37\textwidth}
\begin{subfigure}[t]{\textwidth}
\begin{mybox}
\scalebox{0.6}{\chemfig{!{Ubase}}}
\end{mybox}
\caption{sugar backbone}
\end{subfigure}
\par\bigskip
\begin{subfigure}[b]{.475\textwidth}
\begin{mybox}
\scalebox{0.30}{\chemfig{!{Ubase}}}
\end{mybox}
\caption{adenine}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.475\textwidth}
\begin{mybox}
\scalebox{0.30}{\chemfig{!{Ubase}}}
\end{mybox}
\caption{guanine}
\end{subfigure}
\par\bigskip
\begin{subfigure}[b]{.475\textwidth}
\begin{mybox}
\scalebox{0.30}{\chemfig{!{Ubase}}}
\end{mybox}
\caption{cytosine}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.475\textwidth}
\begin{mybox}
\scalebox{0.30}{
\setchemfig{scheme debug=true}
\schemestart
\chemfig{!{Ubase}}
\chemmove{%
\node[at=(cyclecenter1),fill=yellow,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\schemestop
}
\end{mybox}
\caption{uracil}
\end{subfigure}
\end{minipage}
\par\bigskip
\decoRule
\caption{RNA structural organisation: \lipsum[1]}\label{reduced}
\end{figure}
\end{document}
应用于整个图像,这是输出和相应的 MWE:
\documentclass{article}
\usepackage{subcaption,graphicx}
\usepackage{chemfig}
\usetikzlibrary{shapes.geometric}
\usepackage{lipsum}
\newcommand{\decoRule}{\rule{\textwidth}{0.4pt}}
\renewcommand{\thesubfigure}{\Alph{subfigure}}
\captionsetup[subfigure]{labelformat=simple, labelsep=quad}
\usepackage[showframe]{geometry}
\usepackage{tcolorbox}
\newtcolorbox{mybox}{colback=white,colframe=black,arc=5mm, halign=center}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases
\definesubmol{Abase}{(([:36]\chembelow{N}{H}*5(-(*6(-N=-N=(-NH_2)-=))--N=-)))}
\definesubmol{Gbase}{(([:36]\chembelow{N}{H}*5(-(*6(-N=(-NH_2)-NH-(=O)-=))--N=-)))}
\definesubmol{Cbase}{*6(-\chembelow{N}{H}-(=O)-N=(-NH_2)-=)}
\definesubmol{Ubase}{*6(-\chembelow{N}{H}-(=O)-NH-(=O)-=)}
\definesubmol{a}{-P(=[::90,0.75]O)(-[::-90,0.75]OH)-}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sugar-backbone
\definesubmol{backB}{[:-54]*5((-[:90]-[:180]O([:180]!a\charge{135:3pt=$\scriptstyle\ominus$}{O}))<(-HO)-[,,,,line width=2pt](-OH)>(-R)-O-)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sugar-backbone
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases for RNA assembly
\definesubmol{ARbase}{((-[:90]N*5(-(*6(-N=-N=(-NH_2)-=))--N=-)))}
\definesubmol{GRbase}{((-[:90]N*5(-(*6(-N=(-NH_2)-[,,,1]NH-[,,1](=O)-=))--N=-)))}
\definesubmol{CRbase}{-[:90]N*6(-(=O)-N=(-NH_2)-=-)}
\definesubmol{URbase}{-[:90]N*6(-(=O)-NH=(=O)-=-)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases for RNA assembly
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RNA nucleotide assembly
\definesubmol{4th}{-[:180]O-[:180]X(=[:-90]O)(-[:180]\charge{135:3pt=$\scriptstyle\ominus$}{O})-[:90]O-[:90]([:54]*5(-[,,,,line width=4pt](-[:-90]OH)>(!{CRbase})-O-(-[:90]-[:180]O-[:180]P(-[:90]\charge{135:3pt=$\scriptstyle\ominus$}{O})(-[:180]\charge{135:3pt=$\scriptstyle\ominus$}{O})(=[:-90]O))<))} % upper end segment
\definesubmol{3rd}{-[:180]O-[:180]P(=[:-90]O)(-[:180]\charge{135:3pt=$\scriptstyle\ominus$}{O})-[:90]O-[:90]([:54]*5(-[,,,,line width=4pt](-[:-90]OH)>(!{GRbase})-O-(-[:90]!{4th})<))} % third middle segment
\definesubmol{2nd}{O-[:90]([:54]*5(-[,,,,line width=4pt](-[:-90]OH)>(!{ARbase})-O-(-[:90]!{3rd})<))} % second middle segment
\definesubmol{RNA}{[:-54]*5((-[:90]-[:180]O([:180]-P(-\charge{135:3pt=$\scriptstyle\ominus$}{O})(=[:-90]O)(-[::-90]!{2nd})))<(-[:-90]HO)-[,,,,line width=4pt](-[:-90]OH)>(!{URbase})-O-)} % bottom end segment
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RNA nucleotide assembly
\begin{document}
\setchemfig{scheme debug=true}
\begin{figure}[h]
\captionsetup[subfigure]{justification=centering}
\begin{subfigure}[b]{.6\textwidth}
\begin{mybox}
\scalebox{0.45}{
\chemfig{!{RNA}}
\chemmove{%
\node[at=(cyclecenter4),fill=red,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=48](){};
}
\chemmove{%
\node[at=(cyclecenter3),fill=red,opacity=0.2,inner sep=13.5pt,regular polygon, regular polygon sides=5,rotate=180](){};
}
\chemmove{%
\node[at=(cyclecenter10),fill=yellow,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\chemmove{%
\node[at=(cyclecenter9),fill=green,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\chemmove{%
\node[at=(cyclecenter7),fill=cyan,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=48](){};
}
\chemmove{%
\node[at=(cyclecenter6),fill=cyan,opacity=0.2,inner sep=13.5pt,regular polygon, regular polygon sides=5,rotate=180](){};
}
}
\end{mybox}
\caption[RNA]{RNA chain}
\end{subfigure}
\hfill
\begin{minipage}[b]{.37\textwidth}
\begin{subfigure}[t]{\textwidth}
\begin{mybox}
\scalebox{0.6}{
\chemfig{!{backB}}
}
\end{mybox}
\caption{sugar backbone}
\end{subfigure}
\par\bigskip
\begin{subfigure}[b]{.475\textwidth}
\begin{mybox}
\scalebox{0.30}{
\chemfig{[:72]!{Abase}}
\chemmove{%
\node[at=(cyclecenter2),fill=red,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\chemmove{%
\node[at=(cyclecenter1),fill=red,opacity=0.2,inner sep=13.5pt,regular polygon, regular polygon sides=5,rotate=90](){};
}
}
\end{mybox}
\caption{adenine}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.475\textwidth}
\begin{mybox}
\scalebox{0.30}{
\chemfig{[:72]!{Gbase}}
\chemmove{%
\node[at=(cyclecenter2),fill=cyan,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\chemmove{%
\node[at=(cyclecenter1),fill=cyan,opacity=0.2,inner sep=13.5pt,regular polygon, regular polygon sides=5,rotate=90](){};
}
}
\end{mybox}
\caption{guanine}
\end{subfigure}
\par\bigskip
\begin{subfigure}[b]{.475\textwidth}
\begin{mybox}
\scalebox{0.30}{
\chemfig{!{Cbase}}
\chemmove{%
\node[at=(cyclecenter1),fill=green,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
}
\end{mybox}
\caption{cytosine}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.475\textwidth}
\begin{mybox}
\scalebox{0.30}{
\chemfig{!{Ubase}}
\chemmove{%
\node[at=(cyclecenter1),fill=yellow,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
}
\end{mybox}
\caption{uracil}
\end{subfigure}
\end{minipage}
\par\bigskip
\decoRule
\caption{RNA structural organisation: \lipsum[1]}\label{reduced}
\end{figure}
\end{document}
这里有另一种方法,它在各个子图周围使用更浅更薄的边框,并且对所有分子使用均匀的比例因子,以获得不那么忙碌的外观:
\documentclass{article}
\usepackage{subcaption,graphicx}
\usepackage{chemfig}
\usetikzlibrary{shapes.geometric}
\usepackage{lipsum}
\newcommand{\decoRule}{\rule{\textwidth}{0.4pt}}
\renewcommand{\thesubfigure}{\Alph{subfigure}}
\captionsetup[subfigure]{labelformat=simple, labelsep=quad}
\usepackage[showframe]{geometry}
\usepackage{tcolorbox}
\newtcolorbox{mybox}{colback=white,colframe=gray!50!white,arc=5mm, halign=center, boxrule=1pt, left=0pt, right=0pt, top=7.25pt, bottom=7.25pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases
\definesubmol{Abase}{(([:36]\chembelow{N}{H}*5(-(*6(-N=-N=(-NH_2)-=))--N=-)))}
\definesubmol{Gbase}{(([:36]\chembelow{N}{H}*5(-(*6(-N=(-NH_2)-NH-(=O)-=))--N=-)))}
\definesubmol{Cbase}{*6(-\chembelow{N}{H}-(=O)-N=(-NH_2)-=)}
\definesubmol{Ubase}{*6(-\chembelow{N}{H}-(=O)-NH-(=O)-=)}
\definesubmol{a}{-P(=[::90,0.75]O)(-[::-90,0.75]OH)-}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sugar-backbone
\definesubmol{backB}{[:-54]*5((-[:90]-[:180]O([:180]!a\charge{135:3pt=$\scriptstyle\ominus$}{O}))<(-HO)-[,,,,line width=2pt](-OH)>(-R)-O-)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sugar-backbone
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases for RNA assembly
\definesubmol{ARbase}{((-[:90]N*5(-(*6(-N=-N=(-NH_2)-=))--N=-)))}
\definesubmol{GRbase}{((-[:90]N*5(-(*6(-N=(-NH_2)-[,,,1]NH-[,,1](=O)-=))--N=-)))}
\definesubmol{CRbase}{-[:90]N*6(-(=O)-N=(-NH_2)-=-)}
\definesubmol{URbase}{-[:90]N*6(-(=O)-NH=(=O)-=-)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases for RNA assembly
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RNA nucleotide assembly
\definesubmol{4th}{-[:180]O-[:180]X(=[:-90]O)(-[:180]\charge{135:3pt=$\scriptstyle\ominus$}{O})-[:90]O-[:90]([:54]*5(-[,,,,line width=4pt](-[:-90]OH)>(!{CRbase})-O-(-[:90]-[:180]O-[:180]P(-[:90]\charge{135:3pt=$\scriptstyle\ominus$}{O})(-[:180]\charge{135:3pt=$\scriptstyle\ominus$}{O})(=[:-90]O))<))} % upper end segment
\definesubmol{3rd}{-[:180]O-[:180]P(=[:-90]O)(-[:180]\charge{135:3pt=$\scriptstyle\ominus$}{O})-[:90]O-[:90]([:54]*5(-[,,,,line width=4pt](-[:-90]OH)>(!{GRbase})-O-(-[:90]!{4th})<))} % third middle segment
\definesubmol{2nd}{O-[:90]([:54]*5(-[,,,,line width=4pt](-[:-90]OH)>(!{ARbase})-O-(-[:90]!{3rd})<))} % second middle segment
\definesubmol{RNA}{[:-54]*5((-[:90]-[:180]O([:180]-P(-\charge{135:3pt=$\scriptstyle\ominus$}{O})(=[:-90]O)(-[::-90]!{2nd})))<(-[:-90]HO)-[,,,,line width=4pt](-[:-90]OH)>(!{URbase})-O-)} % bottom end segment
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RNA nucleotide assembly
\begin{document}
\setchemfig{scheme debug=true}
\begin{figure}[h]
\captionsetup[subfigure]{justification=centering}
\begin{subfigure}[b]{.525\textwidth}
\begin{mybox}
\scalebox{0.5}{
\chemfig{!{RNA}}
\chemmove{%
\node[at=(cyclecenter4),fill=red,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=48](){};
}
\chemmove{%
\node[at=(cyclecenter3),fill=red,opacity=0.2,inner sep=13.5pt,regular polygon, regular polygon sides=5,rotate=180](){};
}
\chemmove{%
\node[at=(cyclecenter10),fill=yellow,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\chemmove{%
\node[at=(cyclecenter9),fill=green,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\chemmove{%
\node[at=(cyclecenter7),fill=cyan,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=48](){};
}
\chemmove{%
\node[at=(cyclecenter6),fill=cyan,opacity=0.2,inner sep=13.5pt,regular polygon, regular polygon sides=5,rotate=180](){};
}
}
\end{mybox}
\caption[RNA]{RNA chain}
\end{subfigure}
\hfill
\begin{minipage}[b]{.45\textwidth}
\begin{subfigure}[t]{\textwidth}
\begin{mybox}
\scalebox{0.5}{
\chemfig{!{backB}}
}
\end{mybox}
\caption{sugar backbone}
\end{subfigure}
\par\bigskip
\begin{subfigure}[b]{.475\textwidth}
\begin{mybox}
\scalebox{0.5}{
\chemfig{[:72]!{Abase}}
\chemmove{%
\node[at=(cyclecenter2),fill=red,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\chemmove{%
\node[at=(cyclecenter1),fill=red,opacity=0.2,inner sep=13.5pt,regular polygon, regular polygon sides=5,rotate=90](){};
}
}
\end{mybox}
\caption{adenine}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.475\textwidth}
\begin{mybox}
\scalebox{0.5}{
\chemfig{[:72]!{Gbase}}
\chemmove{%
\node[at=(cyclecenter2),fill=cyan,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\chemmove{%
\node[at=(cyclecenter1),fill=cyan,opacity=0.2,inner sep=13.5pt,regular polygon, regular polygon sides=5,rotate=90](){};
}
}
\end{mybox}
\caption{guanine}
\end{subfigure}
\par\bigskip
\begin{subfigure}[b]{.475\textwidth}
\begin{mybox}
\scalebox{0.5}{
\chemfig{!{Cbase}}
\chemmove{%
\node[at=(cyclecenter1),fill=green,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
}
\end{mybox}
\caption{cytosine}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.475\textwidth}
\begin{mybox}
\scalebox{0.5}{
\chemfig{!{Ubase}}
\chemmove{%
\node[at=(cyclecenter1),fill=yellow,opacity=0.2,inner sep=17.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
}
\end{mybox}
\caption{uracil}
\end{subfigure}
\end{minipage}
\par\bigskip
\decoRule
\caption{RNA structural organisation: \lipsum[1]}\label{reduced}
\end{figure}
\end{document}
这是键长较短的版本。如您所见,原子的字体大小现在比标题的字体大小略小。如果将其与前两幅图进行比较,这一点尤其明显,前两幅图中,与标题的字体大小相比,分子的字体大小几乎小得难以辨认。我还重新排列了子图 C 至 F 中的核碱基,以便并排显示较宽和较窄的碱基。
\documentclass{article}
\usepackage{subcaption,graphicx}
\usepackage{chemfig}
\usetikzlibrary{shapes.geometric}
\usepackage{lipsum}
\newcommand{\decoRule}{\rule{\textwidth}{0.4pt}}
\renewcommand{\thesubfigure}{\Alph{subfigure}}
\captionsetup[subfigure]{labelformat=simple, labelsep=quad}
\usepackage[showframe]{geometry}
\usepackage{tcolorbox}
\newtcolorbox{mybox}{colback=white,colframe=gray!50!white,arc=5mm, halign=center, boxrule=1pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases
\definesubmol{Abase}{(([:36]\chembelow{N}{H}*5(-(*6(-N=-N=(-NH_2)-=))--N=-)))}
\definesubmol{Gbase}{(([:36]\chembelow{N}{H}*5(-(*6(-N=(-NH_2)-NH-(=O)-=))--N=-)))}
\definesubmol{Cbase}{*6(-\chembelow{N}{H}-(=O)-N=(-NH_2)-=)}
\definesubmol{Ubase}{*6(-\chembelow{N}{H}-(=O)-NH-(=O)-=)}
\definesubmol{a}{-P(=[::90,0.75]O)(-[::-90,0.75]OH)-}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sugar-backbone
\definesubmol{backB}{[:-54]*5((-[:90]-[:180]O([:180]!a\charge{135:3pt=$\scriptstyle\ominus$}{O}))<(-HO)-[,,,,line width=2pt](-OH)>(-R)-O-)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sugar-backbone
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases for RNA assembly
\definesubmol{ARbase}{((-[:90]N*5(-(*6(-N=-N=(-NH_2)-=))--N=-)))}
\definesubmol{GRbase}{((-[:90]N*5(-(*6(-N=(-NH_2)-[,,,1]NH-[,,1](=O)-=))--N=-)))}
\definesubmol{CRbase}{-[:90]N*6(-(=O)-N=(-NH_2)-=-)}
\definesubmol{URbase}{-[:90]N*6(-(=O)-NH=(=O)-=-)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% nucleobases for RNA assembly
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RNA nucleotide assembly
\definesubmol{4th}{-[:180]O-[:180]X(=[:-90]O)(-[:180]\charge{135:3pt=$\scriptstyle\ominus$}{O})-[:90]O-[:90]([:54]*5(-[,,,,line width=4pt](-[:-90]OH)>(!{CRbase})-O-(-[:90]-[:180]O-[:180]P(-[:90]\charge{135:3pt=$\scriptstyle\ominus$}{O})(-[:180]\charge{135:3pt=$\scriptstyle\ominus$}{O})(=[:-90]O))<))} % upper end segment
\definesubmol{3rd}{-[:180]O-[:180]P(=[:-90]O)(-[:180]\charge{135:3pt=$\scriptstyle\ominus$}{O})-[:90]O-[:90]([:54]*5(-[,,,,line width=4pt](-[:-90]OH)>(!{GRbase})-O-(-[:90]!{4th})<))} % third middle segment
\definesubmol{2nd}{O-[:90]([:54]*5(-[,,,,line width=4pt](-[:-90]OH)>(!{ARbase})-O-(-[:90]!{3rd})<))} % second middle segment
\definesubmol{RNA}{[:-54]*5((-[:90]-[:180]O([:180]-P(-\charge{135:3pt=$\scriptstyle\ominus$}{O})(=[:-90]O)(-[::-90]!{2nd})))<(-[:-90]HO)-[,,,,line width=4pt](-[:-90]OH)>(!{URbase})-O-)} % bottom end segment
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% RNA nucleotide assembly
\begin{document}
\setchemfig{scheme debug=true}
\setchemfig{atom sep=2em}
\begin{figure}[h]
\captionsetup[subfigure]{justification=centering}
\begin{subfigure}[b]{.525\textwidth}
\begin{mybox}
\scalebox{0.725}{
\chemfig{!{RNA}}
\chemmove{%
\node[at=(cyclecenter4),fill=red,opacity=0.2,inner sep=12.5pt,regular polygon, regular polygon sides=6,rotate=48](){};
}
\chemmove{%
\node[at=(cyclecenter3),fill=red,opacity=0.2,inner sep=9.5pt,regular polygon, regular polygon sides=5,rotate=180](){};
}
\chemmove{%
\node[at=(cyclecenter10),fill=yellow,opacity=0.2,inner sep=12.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\chemmove{%
\node[at=(cyclecenter9),fill=green,opacity=0.2,inner sep=12.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\chemmove{%
\node[at=(cyclecenter7),fill=cyan,opacity=0.2,inner sep=12.5pt,regular polygon, regular polygon sides=6,rotate=48](){};
}
\chemmove{%
\node[at=(cyclecenter6),fill=cyan,opacity=0.2,inner sep=9.5pt,regular polygon, regular polygon sides=5,rotate=180](){};
}
}
\end{mybox}
\caption[RNA]{RNA chain}
\end{subfigure}
\hfill
\begin{minipage}[b]{.45\textwidth}
\begin{subfigure}[t]{\textwidth}
\begin{mybox}
\scalebox{0.725}{
\chemfig{!{backB}}
}
\end{mybox}
\caption{sugar backbone}
\end{subfigure}
\par\bigskip
\begin{subfigure}[b]{.55\textwidth}
\begin{mybox}
\scalebox{0.725}{
\chemfig{[:72]!{Abase}}
\chemmove{%
\node[at=(cyclecenter2),fill=red,opacity=0.2,inner sep=12.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\chemmove{%
\node[at=(cyclecenter1),fill=red,opacity=0.2,inner sep=9.5pt,regular polygon, regular polygon sides=5,rotate=90](){};
}
}
\end{mybox}
\caption{adenine}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.4\textwidth}
\begin{mybox}
\scalebox{0.725}{
\chemfig{!{Ubase}}
\chemmove{%
\node[at=(cyclecenter1),fill=yellow,opacity=0.2,inner sep=12.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
}
\end{mybox}
\caption{uracil}
\end{subfigure}
\par\bigskip
\begin{subfigure}[b]{.55\textwidth}
\begin{mybox}
\scalebox{0.725}{
\chemfig{[:72]!{Gbase}}
\chemmove{%
\node[at=(cyclecenter2),fill=cyan,opacity=0.2,inner sep=12.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
\chemmove{%
\node[at=(cyclecenter1),fill=cyan,opacity=0.2,inner sep=9.5pt,regular polygon, regular polygon sides=5,rotate=90](){};
}
}
\end{mybox}
\caption{guanine}
\end{subfigure}
\hfill
\begin{subfigure}[b]{.4\textwidth}
\begin{mybox}
\scalebox{0.725}{
\chemfig{!{Cbase}}
\chemmove{%
\node[at=(cyclecenter1),fill=green,opacity=0.2,inner sep=12.5pt,regular polygon, regular polygon sides=6,rotate=90](){};
}
}
\end{mybox}
\caption{cytosine}
\end{subfigure}
\end{minipage}
\par\bigskip
\decoRule
\caption{RNA structural organisation: \lipsum[1]}\label{reduced}
\end{figure}
\end{document}