diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/chemformula-ru/chemformula-ru.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/chemformula-ru/chemformula-ru.sty | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/chemformula-ru/chemformula-ru.sty b/Master/texmf-dist/tex/latex/chemformula-ru/chemformula-ru.sty new file mode 100644 index 00000000000..f1df3002c11 --- /dev/null +++ b/Master/texmf-dist/tex/latex/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 |