<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[a4paper]{article}
\usepackage[]{geometry}
\geometry{total={180mm, 267mm}, centering}

\usepackage[russian]{babel}
\usepackage[ch2Ch,cosh2ch]{chemformula-ru}
\usepackage{array,multicol}

\begin{document}

\title{The \textsf{chemformula-ru} package}
\author{Alexey Kuznetsov}
\date{10.07.2024}
\maketitle

\begin{multicols}{2}
The \textsf{chemformula} package defines the command\\[.5ex]
\mbox{}\hfil\verb|\Ñh{|\textit{chemical formula}\verb|}|\\[.5ex]
to type up chemical formulas:\\[.5ex]
\mbox{}\hfil\verb|\ch{H3PO4}| $\to$ \ch{H3PO4}.\\[.5ex]
Russian settings of the \textsf{babel} package \textsf{(russianb.ldf)} define the same command to print the hyperbolic cosine:\\[.5ex] 
\mbox{}\hfil\verb|$\ch x$|\ $\to\ \Ch x$.\\[.5ex]
Loading packages together leads to the error\\[1ex]
\mbox{}\hfil\verb|! LaTeX Error: Command \ch already defined.|\\[1ex]
The \textsf{chemformula-ru} package loads the \textsf{chemformula} and ``neutralizes'' the error by making the babel's command undefined.
Two it's parameters configure printing of the hyperbolic cosine in Russian notation:\\[1ex]
\begin{tabular}{&gt;\sf l @{ ---\quad } p{.75\linewidth}}
cosh2ch &amp; overrides the \verb|\cosh| command for printing:\linebreak
          \verb|$\cosh x$| $\to \cosh x$.  \\[1ex]
ch2Ch &amp; defines a new \verb|\Ch| command for printing:\linebreak
         \verb|$\Ch x$| $\to \Ch x$.
\end{tabular}\\[1ex]

ÐŸÐ°ÐºÐµÑ‚ \textsf{chemformula} Ð²Ð²Ð¾Ð´Ð¸Ñ‚ ÐºÐ¾Ð¼Ð°Ð½Ð´Ñƒ\\[.5ex]
\mbox{}\hfil\verb|\Ñh{|\textit{Ñ…Ð¸Ð¼Ð¸Ñ‡ÐµÑÐºÐ°Ñ Ñ„Ð¾Ð¾Ñ€Ð¼ÑƒÐ»Ð°}\verb|}|\\[.5ex]
Ð´Ð»Ñ Ð²ÐµÑ€ÑÑ‚ÐºÐ¸ Ñ…Ð¸Ð¼Ð¸Ñ‡ÐµÑÐºÐ¸Ñ… Ñ„Ð¾Ñ€Ð¼ÑƒÐ»:\\[.5ex]
\mbox{}\hfil\verb|\ch{H3PO4}| $\to$ \ch{H3PO4}.\\[.5ex]
Ð&nbsp;ÑƒÑÑÐºÐ¸Ðµ Ð½Ð°ÑÑ‚Ñ€Ð¾Ð¹ÐºÐ¸ Ð¿Ð°ÐºÐµÑ‚Ð° \textsf{babel (russianb.ldf)} Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÑÑŽÑ‚ Ð¾Ð´Ð½Ð¾Ð¸Ð¼ÐµÐ½Ð½ÑƒÑŽ ÐºÐ¾Ð¼Ð°Ð½Ð´Ñƒ Ð´Ð»Ñ Ð¿ÐµÑ‡Ð°Ñ‚Ð¸ Ð³Ð¸Ð¿ÐµÑ€Ð±Ð¾Ð»Ð¸Ñ‡ÐµÑÐºÐ¾Ð³Ð¾ ÐºÐ¾ÑÐ¸Ð½ÑƒÑÐ°:\\[-.85\baselineskip]
\mbox{}\hfil\verb|$\ch x$|\ $\to\ \Ch x$.\\[.5ex]
CÐ¾Ð²Ð¼ÐµÑÑ‚Ð½Ð°Ñ Ð·Ð°Ð³Ñ€ÑƒÐ·ÐºÐ° Ð¿Ð°ÐºÐµÑ‚Ð¾Ð² Ð²ÐµÐ´ÐµÑ‚ Ðº Ð¾ÑˆÐ¸Ð±ÐºÐµ\\[1ex]
\mbox{}\hfil\verb|! LaTeX Error: Command \ch already defined.|\\[1ex]
ÐŸÐ°ÐºÐµÑ‚ \textsf{chemformula-ru} Ð·Ð°Ð³Ñ€ÑƒÐ¶Ð°ÐµÑ‚ \textsf{chemformula} Ð¸ &lt;&lt;Ð½ÐµÐ¹Ñ‚Ñ€Ð°Ð»Ð¸Ð·ÑƒÐµÑ‚&gt;&gt; Ð¾ÑˆÐ¸Ð±ÐºÑƒ, Ð´ÐµÐ»Ð°Ñ ÐºÐ¾Ð¼Ð°Ð½Ð´Ñƒ Ð¿Ð°ÐºÐµÑ‚Ð° \textsf{babel} Ð½ÐµÐ¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÐµÐ½Ð½Ð¾Ð¹.
Ð”Ð²Ð° ÐµÐ³Ð¾ Ð¿Ð°Ñ€Ð°Ð¼ÐµÑ‚Ñ€Ð° Ð½Ð°ÑÑ‚Ñ€Ð°Ð¸Ð²Ð°ÑŽÑ‚ Ð¿ÐµÑ‡Ð°Ñ‚ÑŒ Ð³Ð¸Ð¿ÐµÑ€Ð±Ð¾Ð»Ð¸Ñ‡ÐµÑÐºÐ¾Ð³Ð¾ ÐºÐ¾ÑÐ¸Ð½ÑƒÑÐ° Ð² Ñ€ÑƒÑÑÐºÐ¸Ñ… Ð½Ð¾Ñ‚Ð°Ñ†Ð¸ÑÑ…:\\[1ex]
\begin{tabular}{&gt;\sf l @{ --- } p{.8\linewidth}}
cosh2ch &amp; Ð¿ÐµÑ€ÐµÐ¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÑÐµÑ‚ Ð´Ð»Ñ Ð¿ÐµÑ‡Ð°Ñ‚Ð¸ ÐºÐ¾Ð¼Ð°Ð½Ð´Ñƒ \verb|\cosh|:\linebreak
          \verb|$\cosh x$| $\to \cosh x$.  \\[1ex]
ch2Ch &amp; Ð¾Ð¿Ñ€ÐµÐ´ÐµÐ»ÑÐµÑ‚ Ð´Ð»Ñ Ð¿ÐµÑ‡Ð°Ñ‚Ð¸ Ð½Ð¾Ð²ÑƒÑŽ ÐºÐ¾Ð¼Ð°Ð½Ð´Ñƒ \verb|\Ch|:\linebreak
         \verb|$\Ch x$| $\to \Ch x$.
\end{tabular}
\end{multicols}

\thispagestyle{empty}

\noindent\hrulefill

\begin{verbatim}
%% Redefine \cosh to print ch.
\DeclareOption{cosh2ch}{\def\cosh@ch{%
                        \DeclareRobustCommand\cosh{\mathop{\operator@font ch}\nolimits}}}

%% Define new command \Ch to print ch.
\DeclareOption{ch2Ch}{\def\ch@Ch{%
                      \DeclareRobustCommand\Ch{\mathop{\operator@font ch}\nolimits}}}

%% Pass all other options to the chemformula package.
\DeclareOption*{\PassOptionsToPackage\CurrentOption{chemformula}}

\ProcessOptions\relax

\RequirePackage{chemformula}

\BeforeBeginEnvironment{document}{
   \let\@Chem@Formula\ch \let\ch\undefined
   \AtBeginDocument{ 
      \let\ch\@Chem@Formula 
      \@ifundefined{cosh@ch}{\relax}{\cosh@ch}
      @ifundefined{ch@Ch}{\relax}{\ch@Ch}
   } }

\endinput
\end{verbatim}

\end{document}
</pre></body></html>