我的代码是:
\documentclass[12pt,letterpaper]{report}
\usepackage{blindtext}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in]{geometry}
\usepackage{titlesec}
\setcounter{secnumdepth}{5}
\titleformat{\chapter}[display]
{\filcenter\normalfont\bfseries}
{\MakeUppercase{\chaptertitlename}\ \thechapter}
{0pt}
{}
\titlespacing{\chapter}{0pt}{-24pt}{20pt}
\titleformat{\section}
{\normalfont\normalsize\bfseries}{\thesection}{12pt}{}
\titlespacing{\section}{0pt}{0pt}{0pt}
\titleformat{\subsection}
{\normalfont\normalsize\bfseries}{\thesubsection}{12pt}{}
\titlespacing{\subsection}{0pt}{0pt}{0pt}
\titleformat{\subsubsection}
{\normalfont\normalsize\bfseries}{\thesubsubsection}{12pt}{}
\titlespacing{\subsubsection}{0pt}{0pt}{0pt}
\usepackage{indentfirst}
\usepackage{parskip}
\setlength{\parindent}{.5in}
\usepackage{setspace}
\renewcommand{\baselinestretch}{1.75}
\usepackage{natbib}
\usepackage{chemfig,chemmacros}
\begin{document}
\begin{center}
\schemestart
\chemfig{CH_4}\+\chemfig{Cl_2}
\arrow{->[\footnotesize\chemfig{440\celsius}]}
\chemfig{CH_4}\+\chemfig{CH_3Cl}\+\chemfig{CH_2Cl_2}
\+\chemfig{CHCl_3}\+\chemfig{CCl_4}\
\schemestop
\end{center}
\end{document}
我想制作这个:
答案1
由于您已经加载chemmacros
加载并使用chemformula
包您可以使用后者进行反应。
关键是!(<below>)(<text>)
里面的语法\ch
。
\documentclass[12pt,letterpaper]{report}
\usepackage{chemmacros}
% \usepackage{siunitx} % already loaded by `chemmacros'
\begin{document}
\begin{center}
\ch{
CH4 + Cl2
->[\SI{440}{\celsius}]
!(\SI{47}{\percent})( CH4 ) +
!(\SI{20}{\percent})( CH3Cl ) +
!(\SI{22}{\percent})( CH2Cl2 ) +
!(\SI{10}{\percent})( CHCl3 ) +
!(\SI{1}{\percent})( CCl4 )
}
\end{center}
\end{document}
如果您希望百分比值的大小与上面的化合物相同,您可以通过更改选项来设置格式name-format
。默认设置为\scriptsize\centering
\documentclass[12pt,letterpaper]{report}
\usepackage{chemmacros}
% \usepackage{siunitx} % already loaded by `chemmacros'
\setchemformula{
name-format= \centering
}
\begin{document}
\begin{center}
\ch{
CH4 + Cl2
->[\SI{440}{\celsius}]
!(\SI{47}{\percent})( CH4 ) +
!(\SI{20}{\percent})( CH3Cl ) +
!(\SI{22}{\percent})( CH2Cl2 ) +
!(\SI{10}{\percent})( CHCl3 ) +
!(\SI{1}{\percent})( CCl4 )
}
\end{center}
\end{document}
答案2
您可以使用。此外,\chembelow[<dim>]{<code>}{<stuff>}
我还使用了来写这些百分比。siunitx
\documentclass[12pt,letterpaper]{report}
\usepackage{chemfig,chemmacros}
\usepackage{siunitx}
\begin{document}
\begin{center}
\schemestart
\chembelow[1.5ex]{\chemfig{CH_4}}{}
\chemsign{+}
\chemfig{Cl_2}
\arrow{->[\footnotesize\chemfig{\SI{440}{\celsius}}]}
\chembelow[1.5ex]{\chemfig{CH_4}}{\SI{47}{\percent}}
\chemsign{+}
\chembelow[1.5ex]{\chemfig{CH_3Cl}}{\SI{20}{\percent}}
\chemsign{+}
\chembelow[1.5ex]{\chemfig{CH_2Cl_2}}{\SI{22}{\percent}}
\chemsign{+}
\chembelow[1.5ex]{\chemfig{CHCl_3}}{\SI{10}{\percent}}
\chemsign{+}
\chembelow[1.5ex]{\chemfig{CCl_4}}{\SI{1}{\percent}}
\chemsign{+}
\chemfig{HCl}
\schemestop
\end{center}
\end{document}