Ok, here's a preliminary result of my analysis.
1st approach
Objective: make your files compile.
While doing so, my MikTeX console asked for a number of missing files to be installed, including the cas-dc.cls .
With the changes marked as % <<< !! I finally could make main.tex compile (with only the first subfile() call active). After changing sub1.tex as mentioned, both files compile separately, as they should.
Though there were warnings, the \sep error did not show up.
main.tex:
%
%
\documentclass[a4paper,fleqn,twoside]{cas-dc}
\usepackage{subfiles}
\usepackage[numbers]{natbib}
\usepackage[T1,T2A]{fontenc}
\usepackage[utf8,]{inputenc}
%\usepackage{tempora}
%\usepackage{XCharter}
\usepackage{textcomp}
\usepackage[russian,ukrainian,romanian,english]{babel}
%\usepackage[dvipsnames,x11names]{xcolor}
\renewcommand{\rmdefault}{ftm}
\usepackage{yfonts}
\usepackage{multicol}
\usepackage{lineno,hyperref}
%\modulolinenumbers[5]
\usepackage{amsmath,amsfonts,amssymb,amsthm,mathtools,enumerate,float}
\sloppy
\makeatletter
\def\ps@first{%
\let@oddhead@empty
\let@evenhead@empty
\def@oddfoot{}
\let@evenfoot@oddfoot
}
\usepackage{wrapfig}
\usepackage{graphicx}
\renewcommand{\rmdefault}{cmr}
\renewcommand{\sfdefault}{cmss}
\renewcommand{\ttdefault}{cmtt}
%\renewcommand{\rmdefault}{cmss}
\renewcommand{\ttdefault}{cmss}
%\DeclareFontSubstitution{T2A}{cmr}{m}{n}
%\DeclareSymbolFont{T2Aletters}{T2A}{cmr}{m}{it}
\usepackage{geometry}
\renewcommand{\theenumi}{\arabic{enumi}}% Меняем везде перечисления на цифра.цифра
\renewcommand{\labelenumi}{\arabic{enumi}}% Меняем везде перечисления на цифра.цифра
\renewcommand{\theenumii}{.\arabic{enumii}}% Меняем везде перечисления на цифра.цифра
\renewcommand{\labelenumii}{\arabic{enumi}.\arabic{enumii}.}% Меняем везде перечисления на цифра.цифра
\renewcommand{\theenumiii}{.\arabic{enumiii}}% Меняем везде перечисления на цифра.цифра
\renewcommand{\labelenumiii}{\arabic{enumi}.\arabic{enumii}.\arabic{enumiii}.}% Меняем везде перечисления на цифра.цифра
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[LE,RO]{\thepage}
\fancyhead[CO]{ }
%\fancyhead[LO] {}
\fancyhead[CE]{ }
%\fancyhead[RE] { }
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}
\fancyfoot[C]{}%}} % <<< !!
{
\fancyfootoffset[R]{-12cm}
\fancyfoot[L]{}
\fancyfoot[C]{}
\fancyfoot[R]{}
\renewcommand{\footrulewidth}{0.3 mm}
\renewcommand{\headrulewidth}{0.3 mm}
}
\setlength{\voffset}{-10mm}
\setlength{\topmargin}{0mm}
\setlength{\headheight}{5mm}
\setlength{\headsep}{5mm}
\setlength{\footskip}{6mm}
%\newcommand{\l@abcd}[2]{\hbox to\textwidth{#1\dotfill #2}}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\BR@backref}{\newblock}{\newblock(page~}{}{}
\patchcmd{\BR@backref}{\par}{)\par}{}{}
\makeatother
\usepackage[]{notes2bib}
\usepackage[nottoc]{tocbibind}
\usepackage[colorlinks]{hyperref}
%\hypersetup{pdffitwindow=true,linkcolor=LightSkyBlue,citecolor=Sienna,urlcolor=Navy,menucolor=black}
\hypersetup{
colorlinks=true,
linkcolor=magenta,
filecolor=blue,
urlcolor=blue,
citecolor=green,
anchorcolor=blue,
menucolor=blue,
backref=false,
backref=page,
pdfpagemode=UseNone,
pdfstartview=}
\RequirePackage[hyperpageref]{backref}
\renewcommand{\backref}[1]{}
\renewcommand{\backrefalt}[4]{
\ifcase #1
No cited.
\or
Cited on page #2.
\else
Cited on pages #2.
\fi}
\begin{document}
\subfile{sub1} % <<< !!
\subfile{sub2} % <<< !! (not used in 1st approach)
\end{document}
sub1.tex, wiht some parts missing (image) or obscure (\maketitle):
%\documentclass[document]{subfiles}
\documentclass[main]{subfiles} % <<< !!
\begin{document}
\title [mode = title]{ }
\tnotemark[1]
\tnotetext[1]{Research Paper}
\tnotetext[1]{This document is the result of blood, sweat, tears and taxpayer money.}
\nonumnote{This note has no numbers. In this work we demonstrate $a_b$
the formation Y_1 of a new type of polariton on the interface
between a cuprous oxide slab and a polystyrene micro-sphere placed
on the slab.}
\credit{Conceptualization of this study, Methodology, Software}
\author[2]{ }
[orcid=https://orcid.org/]
\cormark[2]
\fnmark[2]
\fntext[fn2]{ }
\ead{13335789@ukr.net}
\ead[URL]{www. }%
% Address/affiliation
\affiliation[2]{organization={National Scientific Center «Hon. Prof. M. S. Bokarius Forensic Science Institute»},
addressline={ },
city={ },
country={ }}
\credit{ }
\begin{abstract}
Abstract Text
\end{abstract}
\begin{keywords}
keywords
\vspace*{0.5\baselineskip}
\textbf{Article history:}\ Received: 30.09.2021\ Received in revised form: 19.12.2021 \Accepted: 9.01.2022 \Available online: 11.01.2022
\end{keywords}
%\maketitle % <<< !!
\section{ }
Text
\section{ }
text
\section{ }
Text
\section{Conclusions}
Text
\section{Conclusions}
Text
\subsection{Acknowledgements}
Text
%\bio{{figs/image1}} % <<< !!
Author biography with author photo.
%\end{multicols} % <<< !!
\end{document}
2nd approach
How to provoke \sep errors ? Let's try including a second file:
- including
sub1.tex did it (!)
- modifying sub1.tex into a slightly changed
sub2.tex did it (!)
Note:
with two different subfiles included in main
sub1 went smoothly,
while sub2 cause your error when compiling main.tex
! LaTeX Error: Control sequence \sep: already defined.
For immediate help type H .
...
l.44 \end
{keywords}
So, where is it?
I proved by:
- commenting out the whole keyword environment (no error)
- allowing only the
\begin \end statements (error)
it's here:
% <<< !!!
\begin{keywords}
%keywords
%\vspace*{0.5\baselineskip}
%\textbf{Article history:}\\ Received: 30.09.2021\\ Received in revised form: 19.12.2021 \\Accepted: 9.01.2022 \\Available online: 11.01.2022
\end{keywords}
You probably need to \renewenvironment the keyword environment, or a similar action.
Conclusion
In this case a stepwise enhancement of code was sufficient to cause the error. Reading the error message made it simple to localize the trouble maker: an environment.
Maybe somebody who knows the cas-dc.cls class by heart has a cure for you.
However, some work is left to do, like adjusting the counters, as the main.pdf generated without the trouble maker shows:

If I try subfiles package in subfile I specify:
\documentclass[../main.tex]{subfiles} or
\documentclass[document]{subfiles}
If I try standalone package in subfile I specify:
\documentclass[class=article, crop=false]{standalone} \usepackage[subpreambles=true]{standalone}
and so on according package specification (docmute, combine) and even I try \include or \input command without use any multifile package the problem is the same: \sep is defined and in compiled single pdf I see repetition of Titles, Authors and Affiliations
– Andriy Bublikov Oct 31 '23 at 09:15If I take out any package from my style file it means I will lose some style file functionality.
How to resolve this issue?
Thank you in advance.
– Andriy Bublikov Oct 31 '23 at 09:15“(I'm sure you work on a copy for this analysis, do you?)”
Yes, of cause.
Thank you for your suggestion I will Focus on creating the \sep messages
– Andriy Bublikov Oct 31 '23 at 09:35standalone, you don't want to use the class and package in the same file. I'm not sure if that's what you meant you did, but just in case. You'd want only the package in your main file and only the class (if at all) in your subfiles. – cfr Nov 01 '23 at 01:41