summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/chemformula-ru/chemformula-ru.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-03-03 03:01:28 +0000
committerNorbert Preining <norbert@preining.info>2024-03-03 03:01:28 +0000
commit56847810aa645903c20fb112fa248caeaef82db6 (patch)
tree4430e794cbb8ab6caf72bbdde5ac5f5c7fe32dfd /macros/latex/contrib/chemformula-ru/chemformula-ru.sty
parentb7323fe884f378851ee661babaa5bd644271f348 (diff)
CTAN sync 202403030301
Diffstat (limited to 'macros/latex/contrib/chemformula-ru/chemformula-ru.sty')
-rw-r--r--macros/latex/contrib/chemformula-ru/chemformula-ru.sty32
1 files changed, 32 insertions, 0 deletions
diff --git a/macros/latex/contrib/chemformula-ru/chemformula-ru.sty b/macros/latex/contrib/chemformula-ru/chemformula-ru.sty
new file mode 100644
index 0000000000..f1df3002c1
--- /dev/null
+++ b/macros/latex/contrib/chemformula-ru/chemformula-ru.sty
@@ -0,0 +1,32 @@
+%% The chemformula-ru package eliminates an incompatibility
+%% between the chemformula package and Russian settings (russian.ldf) of the babel package.
+%%
+%% Copyright (c) 2024 by Alexey Kuznetsov (mailtokuznetsov at gmail.com)
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008/05/04 or later.
+%%
+
+\ProvidesPackage{chemformula-ru}[2024-03-01 Using chemformula package with babel-russian]
+
+\DeclareOption{cosh2ch}{\def\cosh@ch{\DeclareRobustCommand\cosh{\mathop{\operator@font ch}\nolimits}}}
+\DeclareOption{ch2Ch}{\def\ch@Ch{\DeclareRobustCommand\Ch{\mathop{\operator@font ch}\nolimits}}}
+\ProcessOptions\relax
+
+\BeforeBeginEnvironment{document}{
+ \IfPackageLoadedTF{chemformula}{
+ \IfPackageLoadedWithOptionsTF{babel}{russian}{
+ \let\@Chem@Formula\ch \let\ch\undefined
+ \AtBeginDocument{ \let\ch\@Chem@Formula
+ \@ifundefined{cosh@ch}{\relax}{\cosh@ch}
+ \@ifundefined{ch@Ch}{\relax}{\ch@Ch}
+ }
+ } { \relax }
+ } { \relax }
+}
+\endinput