%%
%% This is file `colorist/colorist.sty',
%% generated with the docstrip utility.

%% Copyright (C) 2021 by Jinwen XU
%% 
%% This is part of the colorist class series.
%% 
%% This work 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
%% 2005/12/01 or later.
%% 
\NeedsTeXFormat{LaTeX2e}[2020-10-01]
\ProvidesPackage{colorist}
    [2021/08/09 A colorful style for articles and books]
\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
\SetupKeyvalOptions{%
    family = @colorist,
    prefix = @colorist@
}
\DeclareBoolOption[false]{draft}
\DeclareBoolOption[false]{fast}
\DeclareBoolOption[false]{puretext}
\DeclareBoolOption[false]{nothms}
\DeclareBoolOption[false]{nothmnum}
\DeclareStringOption{thmnum}[colorist@thmnum@default]
\DeclareBoolOption[true]{regionalref}
\DeclareBoolOption[false]{originalref}
\DeclareBoolOption[false]{allowbf}
\DeclareBoolOption[false]{runin}
\ProcessKeyvalOptions*\relax

\if@colorist@originalref
    \@colorist@regionalreffalse
\fi
\if@colorist@draft
  \@colorist@fasttrue
\fi
\if@colorist@puretext
  \@colorist@nothmstrue
\fi

\if@colorist@fast
    \PassOptionsToPackage{fast}{PJLdraft}
    \PassOptionsToPackage{fast}{PJLthm}
\fi
\expandafter\ifstrempty\expandafter{\@colorist@thmnum}{}{
    \expandafter\ifstrequal\expandafter{\@colorist@thmnum}{colorist@thmnum@default}{
        \PassOptionsToPackage{thmnum}{PJLthm}
    }{
        \PassOptionsToPackage{thmnum=\@colorist@thmnum}{PJLthm}
    }
}
\if@colorist@regionalref\else
    \PassOptionsToPackage{originalref}{PJLthm}
\fi

\if@colorist@allowbf
    \newcommand{\conditionalbfseries}{\bfseries\colorlet{PJLtempcolor}{.}\color{PJLtempcolor!90!paper}}
\else
    \newcommand{\conditionalbfseries}{}
\fi

\newif\ifIsBook
\ifdefined\c@chapter\IsBooktrue\else\IsBookfalse\fi

\let\colorist@sffamily\sffamily
\let\colorist@scshape\scshape
\let\colorist@textsc\textsc

%%================================
%% Title fonts
%%================================
\RequirePackage{anyfontsize}

\newcommand{\partfont}{\conditionalbfseries\colorist@sffamily}
\newcommand{\chapfont}{\conditionalbfseries\colorist@sffamily\colorist@scshape}
\newcommand{\secfont}{\conditionalbfseries\colorist@sffamily}
\newcommand{\subsecfont}{\conditionalbfseries\colorist@sffamily}
\newcommand{\subsubsecfont}{\conditionalbfseries\colorist@sffamily}

%%================================
%% Paper configuration
%%================================
\RequirePackage{PJLpaper}

%%================================
%% Color
%%================================
\definecolor{maintheme}{RGB}{70,130,180}
\definecolor{forestgreen}{RGB}{21,122,81}
\definecolor{lightorange}{RGB}{255,185,88}

%%================================
%% Footer
%%================================
\RequirePackage{geometry}
\RequirePackage{fancyhdr}
\RequirePackage{extramarks}

\AtEndPreamble{\fancyhfoffset{0pt}}

\fancypagestyle{fancy}{
    \fancyhf{}
    \if@twoside
        \fancyfoot[RO]{\sffamily\textcolor{maintext!30!paper}{\small\lastrightmark}%
            \rlap{~~~~\textcolor{maintext!75!paper}{\textbf{\thepage}}}}
        \fancyfoot[LE]{\leavevmode\sffamily\llap{\textcolor{maintext!75!paper}{\textbf{\thepage}}%
            ~~~~}%
            \textcolor{maintext!30!paper}{\small\lastleftmark}}
    \else
        \fancyfoot[R]{\sffamily\textcolor{maintext!30!paper}{\small\lastrightmark}%
            \rlap{~~~~\textcolor{maintext!75!paper}{\textbf{\thepage}}}}
    \fi
    \renewcommand{\headrulewidth}{0pt}
}
\pagestyle{fancy}

\fancypagestyle{plain}{
    \fancyhf{}
    \if@twoside
        \fancyfoot[RO]{%
            \sffamily~\rlap{~~~~\textcolor{maintext!75!paper}{\textbf{\thepage}}}}
        \fancyfoot[LE]{\leavevmode\sffamily\llap{\textcolor{maintext!75!paper}{\textbf{\thepage}}%
            ~~~}}
    \else
        \fancyfoot[R]{%
            ~\rlap{~~~~\textcolor{maintext!75!paper}{\textbf{\thepage}}}}
    \fi
    \renewcommand{\headrulewidth}{0pt}
}

\ifbool{IsBook}{
    \if@twoside
        \renewcommand{\chaptermark}[1]{\markboth{\textsc{#1}}{}}
    \else
        \renewcommand{\chaptermark}[1]{\markboth{\textsc{#1}}{\textsc{#1}}}
    \fi
    \renewcommand*{\sectionmark}[1]{%
        \markright{\thesection~~#1}}
}{
    \if@twoside
        \renewcommand*{\sectionmark}[1]{\markboth{\textsc{#1}}{}}
    \else
        \renewcommand*{\sectionmark}[1]{\markboth{\textsc{#1}}{\textsc{#1}}}
    \fi
}
%%================================
%% Languages and line spacing
%%================================
\RequirePackage{PJLlang}
\PJLsetlinespacing{\setstretch{1.07}}
\PJLsetCJKlinespacing{\onehalfspacing}
\raggedbottom

%%================================
%% Title format
%%================================
\RequirePackage[explicit,newparttoc]{titlesec}
\PassOptionsToPackage{normalem}{ulem}
\RequirePackage{ulem}

\newcommand{\partstring}{\MakeUppercase{{\partname~\protect\thepart}}}
\gappto{\PJLlang@langconfig@common}{%
\renewcommand{\partstring}{\MakeUppercase{{\partname~\protect\thepart}}}%
}
\gappto{\PJLlang@langconfig@schinese}{%
\renewcommand{\partstring}{第~\thepart~部分}%
}
\gappto{\PJLlang@langconfig@tchinese}{%
\renewcommand{\partstring}{第~\thepart~部分}%
}
\gappto{\PJLlang@langconfig@japanese}{%
\renewcommand{\partstring}{第~\thepart~部}%
}

\ifbool{IsBook}{
    %% Part
    \titleclass{\part}{top} % make part like a chapter
    \titleformat{\part}[display]
        {\partfont\filleft}
        {%
            \thispagestyle{empty}%
            \begin{tikzpicture}[remember picture,overlay]
                \fill[maintheme!10!paper] (current page.north west) rectangle (current page.south east);
                \node at ($(current page.north west)+(15em,-15em)$) {\normalfont\textcolor{maintheme}{\scalebox{12}{\thepart}}};
            \end{tikzpicture}%
        }
        {1em}
        {\fontsize{20}{0}\selectfont\MakeUppercase{#1}}
    \titleformat{name=\part,numberless}[display]
        {% \phantomsection\addcontentsline{toc}{part}{#1}%
        \partfont\filleft}
        {%
            \thispagestyle{empty}%
            \begin{tikzpicture}[remember picture,overlay]
                \fill[maintheme!10!paper] (current page.north west) rectangle (current page.south east);
                \node at ($(current page.north west)+(15em,-15em)$) {\normalfont\textcolor{maintheme}{\scalebox{12}{$*$}}};
            \end{tikzpicture}%
        }
        {1em}
        {\fontsize{20}{0}\selectfont\MakeUppercase{#1}}
    \titlespacing*{\part}{0pt}{5em}{6em}
    %% Text after part
    \newcommand{\parttext}[1]{%
        \vfill%
        \begin{flushright}%
            \begin{minipage}{0.833\textwidth}%
                \color{maintext!80!paper}\raggedleft#1%
            \end{minipage}%
        \end{flushright}%
        \vfill\vfill%
        \cleardoublepage%
    }

    %% Chapter
    \newcommand{\TheChapter}[2]{%
        \tcbsidebyside[enhanced,sidebyside adapt=right,sidebyside align=bottom,
        colback=paper,frame hidden,
        segmentation code={
            \filldraw[maintheme] (segmentation.north)
                -- ($(segmentation.east)-(12pt,0)$)
                -- ($(segmentation.west)+(12pt,0)$)
                -- (segmentation.south);}
        ]{\filleft#2}{\normalfont\textcolor{maintheme}{\scalebox{4}{#1}}}
    }

    \newcommand{\TheChapterSingle}[1]{%
        \begin{tcolorbox}[
            enhanced,
            width = 0.67\textwidth,
            colback=paper,frame hidden,
            halign=center]
            #1
            \vspace{-.6em}
            \begin{center}
                \begin{tikzpicture}
                    \filldraw[maintheme] (-4em,0) -- (4em,0) -- (0,-.1em) -- (0,.1em);
                \end{tikzpicture}
            \end{center}
        \end{tcolorbox}
    }

    \titleformat{name=\chapter}
        {\chapfont\huge} % Format
        {} % Label
        {0mm} % Sep
        {\TheChapter{\thechapter}{#1}} % Before-code
    \titlespacing*{name=\chapter}
        {0em}{*2}{0em} % {left}{before-sep}{after-sep}

    \titleformat{name=\chapter, numberless}
        {\filcenter\chapfont\huge}
        {}
        {0mm}
        {\TheChapterSingle{#1}}
    \titlespacing*{name=\chapter, numberless}
        {0em}{*2}{0em}

    %% Section
    \titleformat{\section}
    {\color{maintheme}\secfont\large}
    {\thesection}{.75em}{#1}
    % [{\titlerule[.75pt]}]

    %% Subsection
    \titleformat{\subsection}
    {\subsecfont}{\thesubsection}{.75em}
    {#1}
}{
    %% Part
    \titleformat{\part}[display]
        {%
        \partfont\filleft}
        {\partstring}
        {.3em}
        {\fontsize{16}{0}\selectfont\MakeUppercase{#1}}
    \titleformat{name=\part,numberless}[display]
        {% \phantomsection\addcontentsline{toc}{part}{#1}%
        \partfont\filleft}
        {\phantom{\MakeUppercase{\partname}}}
        {.3em}
        {\fontsize{16}{0}\selectfont\MakeUppercase{#1}}
    %% Text after part
    \newcommand{\parttext}[1]{%
        \begin{flushright}%
            \begin{minipage}{0.833\textwidth}%
                \color{maintext!80!paper}\raggedleft#1%
            \end{minipage}%
        \end{flushright}%
    }

    %% Section
    \titleformat{\section}
    {\color{maintheme}\secfont\large}
    {\thesection}{.75em}{\scshape #1}
    % [{\titlerule[.75pt]}]

    %% Subsection
    \titleformat{\subsection}
    {\subsecfont}{\thesubsection}{.75em}
    {\scshape #1}
}

%% Subsubsection
\if@colorist@runin
\titleformat{\subsubsection}[runin]
    {\color{maintext!70!paper}\subsubsecfont}{\thesubsubsection}{.5em}
    {#1.}[\hspace*{.3em}]
\else
\titleformat{\subsubsection}
    {\color{maintext!70!paper}\subsubsecfont}{\thesubsubsection}{.5em}
    {#1}
\fi

%% Paragraph
\titleformat{\paragraph}[runin]
    {\conditionalbfseries\scshape}{\theparagraph}{1em}{#1}

\titlespacing{\section}{0pt}{\baselineskip}{.6\baselineskip}
\titlespacing{\subsection}{0pt}{.75\baselineskip}{.4\baselineskip}
\titlespacing{\subsubsection}{0pt}{.6\baselineskip}{.3\baselineskip}

%%================================
%% TOC format
%%================================
\RequirePackage{titletoc}
\titlecontents{part}
    [0em]
    {\addvspace{1.5pc}\large\filcenter\colorist@sffamily\conditionalbfseries}
    {\textcolor{maintheme}{\bfseries\thecontentslabel}\nopagebreak\\\nopagebreak\uppercase}
    {}
    {} % without page number
    [\addvspace{.5pc}]
\ifbool{IsBook}{
    \titlecontents{chapter}
        [2em] % i.e., 0em (part) + 2em
        {\addvspace{1pc}\normalfont\color{maintheme}\colorist@sffamily\conditionalbfseries}
        {\contentslabel{2em}}
        {\colorist@scshape\hspace*{-2em}}
        {\titlerule*[10pt]{\parbox{2pt}{\hspace*{-.25pt}\textcolor{maintext!15!paper}{.}}}\color{maintheme}\contentspage}
    \titlecontents{section}
        [4em] % i.e., 2em (chapter) + 2em
        {\addvspace{.3pc}\normalfont\color{maintheme}\colorist@sffamily}
        {\contentslabel{1.75em}}
        {\hspace*{-1.75em}}
        {\titlerule*[10pt]{\parbox{2pt}{\textcolor{maintext!15!paper}{.}}}\color{maintheme}\contentspage}
    \titlecontents{subsection}
        [7em] % i.e., 4em (section) + 3em
        {\addvspace{.15pc}\normalfont\colorist@sffamily}
        {\contentslabel{2.75em}}
        {\hspace*{-2.75em}}
        {\titlerule*[10pt]{\parbox{2pt}{\textcolor{maintext!15!paper}{.}}}\color{maintext!45!paper}\contentspage}
    \titlecontents{subsubsection}
        [10em] % i.e., 7em (subsection) + 3em
        {\normalfont\colorist@sffamily}
        {\contentslabel{3.25em}}
        {\hspace*{-3.25em}}
        {\titlerule*[10pt]{\parbox{2pt}{\textcolor{maintext!15!paper}{.}}}\color{maintext!45!paper}\contentspage}
}{
    \titlecontents{section}
        [2em] % i.e., 0em (part) + 2em
        {\addvspace{.3pc}\normalfont\color{maintheme}\colorist@sffamily}
        {\contentslabel{1.75em}}
        {\hspace*{-1.75em}}
        {\titlerule*[10pt]{\parbox{2pt}{\textcolor{maintext!15!paper}{.}}}\color{maintheme}\contentspage}
    \titlecontents{subsection}
        [4.5em] % i.e., 2em (section) + 2.5em
        {\addvspace{.15pc}\normalfont\colorist@sffamily}
        {\contentslabel{2.15em}}
        {\hspace*{-2.15em}}
        {\titlerule*[10pt]{\parbox{2pt}{\textcolor{maintext!15!paper}{.}}}\color{maintext!45!paper}\contentspage}
    \titlecontents{subsubsection}
        [7.75em] % i.e., 5em (subsection) + 3.25em
        {\normalfont\colorist@sffamily}
        {\contentslabel{2.75em}}
        {\hspace*{-2.75em}}
        {\titlerule*[10pt]{\parbox{2pt}{\textcolor{maintext!15!paper}{.}}}\color{maintext!45!paper}\contentspage}
}

%%================================
%% Lists
%%================================
\RequirePackage{enumitem}
\setlist{noitemsep}
\setlist[enumerate]{labelsep=*, leftmargin=*}
\setlist[enumerate,1]{label = \arabic*.,
    ref = \arabic*}
\setlist[enumerate,2]{label = \emph{\alph*}),
    ref = \theenumi.\emph{\alph*}}
\setlist[enumerate,3]{label = (\roman*),
    ref = \theenumii.\roman*}
\setlist[description]{font=\normalfont\conditionalbfseries}

\setlist[itemize]{leftmargin=*}
\gappto{\PJLlang@langconfig@common}{\setlist[itemize,1]{label=\textcolor{maintext!25}{$\bullet$}}}
\gappto{\PJLlang@langconfig@french}{\setlist[itemize,1]{label=\textcolor{maintext!50}{---}}}
\setlist[itemize,2]{label=\textcolor{maintext!27}{--}}
\setlist[itemize,3]{label=\textcolor{maintext!27}{\texttt{*}}}

%%================================
%% Blank page
%%================================
\newcommand{\blinkpagetext}{This page is intentionally left blank}
\renewcommand{\cleardoublepage}{\relax
    \clearpage
    \if@twoside\ifodd\c@page\relax\else
    \thispagestyle{empty}
    \AddToHookNext{shipout/background}
      {%
       \put(0.5\paperwidth,-0.5\paperheight){%
       \makebox[0pt]{\large\color{maintext!10!paper}\blinkpagetext}}}
    \null\newpage\fi\fi}

%%================================
%% Draft mark
%%================================
\RequirePackage{PJLdraft}

%%================================
%% Icons
%%================================
\RequirePackage{tikz}
\newcommand{\ideabulb}[2][0.15]{%
    \scalebox{#1}{%
    \begin{tikzpicture}
        \filldraw[draw=#2,fill=#2] (0,0) circle [radius=1cm];
        \filldraw[draw=paper,fill=paper,rounded corners=0.8pt]
            [rotate=20] (-0.26,-0.66) rectangle (-0.06,-0.6)
            [xshift=-0.4mm,yshift=1mm] (-0.26,-0.66) rectangle (0.02,-0.6)
            [xshift=0.4mm,yshift=1mm] (-0.26,-0.66) rectangle (-0.06,-0.6);
        \draw[draw=paper,line width=0.7mm] (-0.18,-0.46)
            .. controls (-0.18,-0.28) and (-0.28,-0.12) ..(-0.4,0.1)
            .. controls (-0.55,0.4) and (-0.3,0.64) ..(0,0.64)
            .. controls (0.3,0.64) and (0.55,0.4) ..(0.4,0.1)
            .. controls (0.28,-0.12) and (0.18,-0.28) ..(0.18,-0.46);
    \end{tikzpicture}}}

\newcommand{\questionmark}[2][0.15]{%
    \scalebox{#1}{%
    \begin{tikzpicture}
        \filldraw[draw=#2,fill=#2] (0,0) circle [radius=1cm];
        \filldraw[paper,yshift=0.5mm,scale=0.9] (-0.4,0.1) circle [radius=0.77mm];
        \draw[draw=paper,line width=1.5mm,yshift=0.5mm,scale=0.9] (-0.4,0.1)
            .. controls (-0.55,0.4) and (-0.3,0.64) ..(0,0.64)
            .. controls (0.3,0.64) and (0.55,0.4) ..(0.4,0.1)
            .. controls (0.28,-0.12) and (0.05,-0.28) ..(0.05,-0.3)
            .. controls (0,-0.36) and (0.0,-0.45) ..(0.0,-0.5);
        \fill[fill=paper,rounded corners=0.6mm]
            (-0.09,-0.75) rectangle (0.09,-0.53);
    \end{tikzpicture}}}

%%================================
%% Theorems
%%================================
\RequirePackage{mathtools}
\RequirePackage{amsthm}
\def\simpleqedsymbol{%
    \makebox[1em]{\rlap{\textcolor{maintext!12!paper}{\rule[-0.1em]{.95em}{.95em}}}{\kern.07em\raisebox{.07em}{\textcolor{paper}{\rule[-0.1em]{.81em}{.81em}}}\kern.07em}}}
\newtheoremstyle{simple}%
    {}{}%
    {\normalfont}{}%
    {\normalfont}{}%
    {0pt}%
    {\global\let\qedsymbol\simpleqedsymbol%
        {\conditionalbfseries\thmname{#1}\thmnumber{ #2}}\hspace{.4em}%
        \textcolor{maintext!27!paper}{$|$}\hspace{.4em}%
        \color{maintext!50!paper}\thmnote{\ensuremath{(\text{#3})}~~}%
        \pushQED{\qed}%
    }
\def\@endtheorem{\global\let\qedsymbol\simpleqedsymbol%
    \popQED\endtrivlist\@endpefalse
    \global\let\qedsymbol\qedsymbolOriginal}

\renewcommand{\qedsymbol}{%
    \makebox[1em]{\color{maintext!27!paper}\rule[-0.1em]{.95em}{.95em}}}
\let\qedsymbolOriginal\qedsymbol

\newtheoremstyle{basic}
    {0pt}{0pt}{\normalfont}{0pt}
    {}{\;}{0.25em}
    {{\thmname{#1}~\thmnumber{\textup{#2}}}
    \thmnote{\normalfont\colorist@sffamily\color{maintext}~(#3)}}

\newtheoremstyle{emphasis}
    {0pt}{0pt}{\itshape}{0pt}{}{}{0pt}
    {\thmnote{\normalfont\colorist@sffamily\color{maintext}#3\hspace*{0.5em}}}

\if@colorist@fast
    \providecommand{\phantomsection}{}
    \RequirePackage{url}
    \newcommand{\href}[2]{#2}
\else
    \PassOptionsToPackage{hidelinks,linktoc=all}{hyperref}
    \RequirePackage{bookmark}
    \RequirePackage{hyperref}
\fi

\PassOptionsToPackage{nothms}{PJLthm}
\RequirePackage{PJLthm}

\pretocmd{\theoremnameEN}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\lemmanameEN}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\propositionnameEN}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\corollarynameEN}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\propertynameEN}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\factnameEN}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\conjecturenameEN}{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\definitionnameEN}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\axiomnameEN}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\assumptionnameEN}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\conventionnameEN}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\hypothesisnameEN}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\notationnameEN}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\examplenameEN}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\problemnameEN}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\questionnameEN}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\exercisenameEN}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\remarknameEN}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\observationnameEN}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\expandafter\def\csname definition-propositionnameEN\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc{Definition}-\propositionnameEN}
\expandafter\def\csname definition-theoremnameEN\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc{Definition}-\theoremnameEN}

\pretocmd{\theoremnameFR}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\lemmanameFR}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\propositionnameFR}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\corollarynameFR}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\propertynameFR}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\factnameFR}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\conjecturenameFR}{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\definitionnameFR}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\axiomnameFR}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\assumptionnameFR}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\conventionnameFR}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\hypothesisnameFR}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\notationnameFR}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\examplenameFR}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\problemnameFR}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\questionnameFR}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\exercisenameFR}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\remarknameFR}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\observationnameFR}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\expandafter\def\csname definition-propositionnameFR\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc{Définition}-\propositionnameFR}
\expandafter\def\csname definition-theoremnameFR\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc{Définition}-\theoremnameFR}

\pretocmd{\theoremnameDE}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\lemmanameDE}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\propositionnameDE}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\corollarynameDE}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\propertynameDE}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\factnameDE}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\conjecturenameDE}{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\definitionnameDE}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\axiomnameDE}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\assumptionnameDE}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\conventionnameDE}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\hypothesisnameDE}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\notationnameDE}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\examplenameDE}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\problemnameDE}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\questionnameDE}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\exercisenameDE}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\remarknameDE}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\observationnameDE}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\expandafter\def\csname definition-propositionnameDE\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc{Definition}-\propositionnameDE}
\expandafter\def\csname definition-theoremnameDE\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc{Definition}-\theoremnameDE}

\pretocmd{\theoremnameIT}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\lemmanameIT}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\propositionnameIT}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\corollarynameIT}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\propertynameIT}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\factnameIT}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\conjecturenameIT}{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\definitionnameIT}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\axiomnameIT}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\assumptionnameIT}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\conventionnameIT}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\hypothesisnameIT}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\notationnameIT}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\examplenameIT}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\problemnameIT}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\questionnameIT}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\exercisenameIT}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\remarknameIT}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\observationnameIT}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\expandafter\def\csname definition-propositionnameIT\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc{Definizione}-\propositionnameIT}
\expandafter\def\csname definition-theoremnameIT\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc{Definizione}-\theoremnameIT}

\pretocmd{\theoremnamePT}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\lemmanamePT}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\propositionnamePT}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\corollarynamePT}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\propertynamePT}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\factnamePT}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\conjecturenamePT}{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\definitionnamePT}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\axiomnamePT}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\assumptionnamePT}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\conventionnamePT}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\hypothesisnamePT}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\notationnamePT}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\examplenamePT}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\problemnamePT}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\questionnamePT}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\exercisenamePT}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\remarknamePT}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\observationnamePT}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\expandafter\def\csname definition-propositionnamePT\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc{Definição}-\propositionnamePT}
\expandafter\def\csname definition-theoremnamePT\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc{Definição}-\theoremnamePT}

\pretocmd{\theoremnameBR}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\lemmanameBR}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\propositionnameBR}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\corollarynameBR}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\propertynameBR}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\factnameBR}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\conjecturenameBR}{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\definitionnameBR}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\axiomnameBR}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\assumptionnameBR}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\conventionnameBR}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\hypothesisnameBR}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\notationnameBR}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\examplenameBR}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\problemnameBR}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\questionnameBR}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\exercisenameBR}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\remarknameBR}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\observationnameBR}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\expandafter\def\csname definition-propositionnameBR\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc{Definição}-\propositionnameBR}
\expandafter\def\csname definition-theoremnameBR\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc{Definição}-\theoremnameBR}

\pretocmd{\theoremnameES}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\lemmanameES}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\propositionnameES}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\corollarynameES}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\propertynameES}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\factnameES}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\conjecturenameES}{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\definitionnameES}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\axiomnameES}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\assumptionnameES}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\conventionnameES}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\hypothesisnameES}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\notationnameES}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\examplenameES}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\problemnameES}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\questionnameES}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\exercisenameES}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\remarknameES}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\pretocmd{\observationnameES}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries\colorist@textsc}{}{\FAIL}
\expandafter\def\csname definition-propositionnameES\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc{Definição}-\propositionnameES}
\expandafter\def\csname definition-theoremnameES\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries\colorist@textsc{Definição}-\theoremnameES}

\pretocmd{\theoremnameCN}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\lemmanameCN}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\propositionnameCN}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\corollarynameCN}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\propertynameCN}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\factnameCN}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\conjecturenameCN}{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries}{}{\FAIL}
\pretocmd{\definitionnameCN}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\axiomnameCN}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\assumptionnameCN}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\conventionnameCN}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\hypothesisnameCN}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\notationnameCN}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\examplenameCN}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\problemnameCN}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\questionnameCN}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\exercisenameCN}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\remarknameCN}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\observationnameCN}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\expandafter\def\csname definition-propositionnameCN\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries{定义}-\propositionnameCN}
\expandafter\def\csname definition-theoremnameCN\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries{定义}-\theoremnameCN}

\pretocmd{\theoremnameTC}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\lemmanameTC}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\propositionnameTC}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\corollarynameTC}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\propertynameTC}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\factnameTC}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\conjecturenameTC}{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries}{}{\FAIL}
\pretocmd{\definitionnameTC}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\axiomnameTC}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\assumptionnameTC}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\conventionnameTC}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\hypothesisnameTC}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\notationnameTC}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\examplenameTC}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\problemnameTC}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\questionnameTC}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\exercisenameTC}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\remarknameTC}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\observationnameTC}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\expandafter\def\csname definition-propositionnameTC\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries{定義}-\propositionnameTC}
\expandafter\def\csname definition-theoremnameTC\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries{定義}-\theoremnameTC}

\pretocmd{\theoremnameJP}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\lemmanameJP}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\propositionnameJP}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\corollarynameJP}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\propertynameJP}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\factnameJP}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\conjecturenameJP}{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries}{}{\FAIL}
\pretocmd{\definitionnameJP}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\axiomnameJP}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\assumptionnameJP}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\conventionnameJP}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\hypothesisnameJP}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\notationnameJP}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\examplenameJP}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\problemnameJP}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\questionnameJP}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\exercisenameJP}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\remarknameJP}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\observationnameJP}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\expandafter\def\csname definition-propositionnameJP\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries{定義}-\propositionnameJP}
\expandafter\def\csname definition-theoremnameJP\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries{定義}-\theoremnameJP}

\pretocmd{\theoremnameRU}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\lemmanameRU}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\propositionnameRU}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\corollarynameRU}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\propertynameRU}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\factnameRU}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\conjecturenameRU}{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries}{}{\FAIL}
\pretocmd{\definitionnameRU}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\axiomnameRU}{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries}{}{\FAIL}
\pretocmd{\assumptionnameRU}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\conventionnameRU}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\hypothesisnameRU}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\notationnameRU}{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries}{}{\FAIL}
\pretocmd{\examplenameRU}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\problemnameRU}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\questionnameRU}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\exercisenameRU}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\remarknameRU}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\pretocmd{\observationnameRU}{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries}{}{\FAIL}
\expandafter\def\csname definition-propositionnameRU\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries{Определение}-\propositionnameRU}
\expandafter\def\csname definition-theoremnameRU\endcsname{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries{Определение}-\theoremnameRU}

\AtEndPreamble{
\if@colorist@nothms\else
\theoremstyle{basic}
\if@colorist@nothmnum
\CreateTheorem*{theorem}
\CreateTheorem*{lemma}
\CreateTheorem*{proposition}
\CreateTheorem*{corollary}
\CreateTheorem*{definition-proposition}
\CreateTheorem*{definition-theorem}
\CreateTheorem*{property}
\CreateTheorem*{fact}
\CreateTheorem*{conjecture}
\else
\CreateTheorem@thmnum{theorem}
\CreateTheorem{lemma}[theorem]
\CreateTheorem{proposition}[theorem]
\CreateTheorem{corollary}[theorem]
\CreateTheorem{definition-proposition}[theorem]
\CreateTheorem{definition-theorem}[theorem]
\CreateTheorem{property}[theorem]
\CreateTheorem{fact}[theorem]
\CreateTheorem{conjecture}[theorem]
\fi
\CreateTheorem*{theorem*}
\CreateTheorem*{lemma*}
\CreateTheorem*{proposition*}
\CreateTheorem*{corollary*}
\CreateTheorem*{definition-proposition*}
\CreateTheorem*{definition-theorem*}
\CreateTheorem*{property*}
\CreateTheorem*{fact*}
\CreateTheorem*{conjecture*}
\if@colorist@nothmnum
\CreateTheorem*{definition}
\CreateTheorem*{axiom}
\CreateTheorem*{assumption}
\CreateTheorem*{convention}
\CreateTheorem*{hypothesis}
\CreateTheorem*{notation}
\CreateTheorem*{example}
\CreateTheorem*{problem}
\CreateTheorem*{question}
\CreateTheorem*{exercise}
\else
\CreateTheorem{definition}[theorem]
\CreateTheorem{axiom}[theorem]
\CreateTheorem{assumption}[theorem]
\CreateTheorem{convention}[theorem]
\CreateTheorem{hypothesis}[theorem]
\CreateTheorem{notation}[theorem]
\CreateTheorem{example}[theorem]
\CreateTheorem{problem}[theorem]
\CreateTheorem{question}[theorem]
\CreateTheorem{exercise}[theorem]
\fi
\CreateTheorem*{definition*}
\CreateTheorem*{axiom*}
\CreateTheorem*{assumption*}
\CreateTheorem*{convention*}
\CreateTheorem*{hypothesis*}
\CreateTheorem*{notation*}
\CreateTheorem*{example*}
\CreateTheorem*{problem*}
\CreateTheorem*{question*}
\CreateTheorem*{exercise*}

\theoremstyle{emphasis}
\if@colorist@nothmnum
\CreateTheorem*{remark}
\CreateTheorem*{observation}
\else
\CreateTheorem@thmnum{remark}
\CreateTheorem@thmnum{observation}
\fi
\CreateTheorem*{remark*}
\CreateTheorem*{observation*}

\theoremstyle{simple}
\fi
}

\theoremstyle{simple}

\creflabelformat{PJLtheorem}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{PJLlemma}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{PJLproposition}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{PJLcorollary}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{PJLproperty}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{PJLfact}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{PJLconjecture}{#2{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries#1}#3}
\creflabelformat{PJLdefinition}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{PJLaxiom}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{PJLassumption}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{PJLconvention}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{PJLhypothesis}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{PJLnotation}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{PJLexample}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{PJLproblem}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{PJLquestion}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{PJLexercise}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{PJLdefinition-theorem}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{PJLdefinition-proposition}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}

\creflabelformat{theoremEN}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{lemmaEN}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propositionEN}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{corollaryEN}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propertyEN}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{factEN}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{conjectureEN}{#2{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries#1}#3}
\creflabelformat{definitionEN}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{axiomEN}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{assumptionEN}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{conventionEN}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{hypothesisEN}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{notationEN}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{exampleEN}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{problemEN}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{questionEN}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{exerciseEN}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{definition-theoremEN}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{definition-propositionEN}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}

\creflabelformat{theoremFR}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{lemmaFR}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propositionFR}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{corollaryFR}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propertyFR}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{factFR}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{conjectureFR}{#2{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries#1}#3}
\creflabelformat{definitionFR}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{axiomFR}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{assumptionFR}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{conventionFR}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{hypothesisFR}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{notationFR}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{exampleFR}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{problemFR}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{questionFR}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{exerciseFR}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{definition-theoremFR}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{definition-propositionFR}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}

\creflabelformat{theoremDE}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{lemmaDE}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propositionDE}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{corollaryDE}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propertyDE}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{factDE}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{conjectureDE}{#2{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries#1}#3}
\creflabelformat{definitionDE}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{axiomDE}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{assumptionDE}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{conventionDE}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{hypothesisDE}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{notationDE}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{exampleDE}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{problemDE}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{questionDE}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{exerciseDE}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{definition-theoremDE}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{definition-propositionDE}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}

\creflabelformat{theoremIT}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{lemmaIT}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propositionIT}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{corollaryIT}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propertyIT}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{factIT}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{conjectureIT}{#2{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries#1}#3}
\creflabelformat{definitionIT}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{axiomIT}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{assumptionIT}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{conventionIT}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{hypothesisIT}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{notationIT}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{exampleIT}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{problemIT}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{questionIT}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{exerciseIT}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{definition-theoremIT}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{definition-propositionIT}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}

\creflabelformat{theoremPT}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{lemmaPT}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propositionPT}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{corollaryPT}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propertyPT}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{factPT}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{conjecturePT}{#2{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries#1}#3}
\creflabelformat{definitionPT}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{axiomPT}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{assumptionPT}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{conventionPT}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{hypothesisPT}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{notationPT}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{examplePT}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{problemPT}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{questionPT}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{exercisePT}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{definition-theoremPT}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{definition-propositionPT}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}

\creflabelformat{theoremBR}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{lemmaBR}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propositionBR}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{corollaryBR}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propertyBR}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{factBR}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{conjectureBR}{#2{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries#1}#3}
\creflabelformat{definitionBR}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{axiomBR}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{assumptionBR}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{conventionBR}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{hypothesisBR}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{notationBR}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{exampleBR}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{problemBR}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{questionBR}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{exerciseBR}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{definition-theoremBR}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{definition-propositionBR}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}

\creflabelformat{theoremES}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{lemmaES}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propositionES}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{corollaryES}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propertyES}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{factES}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{conjectureES}{#2{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries#1}#3}
\creflabelformat{definitionES}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{axiomES}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{assumptionES}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{conventionES}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{hypothesisES}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{notationES}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{exampleES}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{problemES}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{questionES}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{exerciseES}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{definition-theoremES}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{definition-propositionES}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}

\creflabelformat{theoremCN}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{lemmaCN}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propositionCN}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{corollaryCN}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propertyCN}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{factCN}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{conjectureCN}{#2{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries#1}#3}
\creflabelformat{definitionCN}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{axiomCN}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{assumptionCN}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{conventionCN}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{hypothesisCN}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{notationCN}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{exampleCN}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{problemCN}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{questionCN}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{exerciseCN}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{definition-theoremCN}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{definition-propositionCN}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}

\creflabelformat{theoremTC}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{lemmaTC}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propositionTC}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{corollaryTC}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propertyTC}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{factTC}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{conjectureTC}{#2{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries#1}#3}
\creflabelformat{definitionTC}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{axiomTC}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{assumptionTC}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{conventionTC}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{hypothesisTC}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{notationTC}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{exampleTC}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{problemTC}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{questionTC}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{exerciseTC}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{definition-theoremTC}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{definition-propositionTC}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}

\creflabelformat{theoremJP}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{lemmaJP}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propositionJP}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{corollaryJP}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propertyJP}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{factJP}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{conjectureJP}{#2{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries#1}#3}
\creflabelformat{definitionJP}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{axiomJP}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{assumptionJP}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{conventionJP}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{hypothesisJP}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{notationJP}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{exampleJP}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{problemJP}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{questionJP}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{exerciseJP}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{definition-theoremJP}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{definition-propositionJP}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}

\creflabelformat{theoremRU}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{lemmaRU}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propositionRU}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{corollaryRU}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{propertyRU}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{factRU}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{conjectureRU}{#2{\normalfont\colorist@sffamily\color{purple}\conditionalbfseries#1}#3}
\creflabelformat{definitionRU}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{axiomRU}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{assumptionRU}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{conventionRU}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{hypothesisRU}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{notationRU}{#2{\normalfont\colorist@sffamily\color{forestgreen}\conditionalbfseries#1}#3}
\creflabelformat{exampleRU}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{problemRU}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{questionRU}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{exerciseRU}{#2{\normalfont\colorist@sffamily\color{maintext}\conditionalbfseries#1}#3}
\creflabelformat{definition-theoremRU}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}
\creflabelformat{definition-propositionRU}{#2{\normalfont\colorist@sffamily\color{orange}\conditionalbfseries#1}#3}

\RequirePackage{marginnote}
\RequirePackage{ifoddpage}
\newcommand{\mparadjust}[1]{\renewcommand*{\marginnotevadjust}{#1}}
\AtEndPreamble{ % For puretext mode
\pretocmd{\remark}{%
    \if@twoside\checkoddpage%
        \ifoddpage\reversemarginpar\fi%
    \else%
        \reversemarginpar%
    \fi%
    \mparadjust{-.25em}%
    \marginnote{\ideabulb[0.3]{orange}%
        \ifIsBook%
            \hspace*{-.2em}%
        \else%
            \hspace*{-.5em}%
        \fi%
    }\normalmarginpar%
}{}{}
\pretocmd{\conjecture}{%
    \if@twoside\checkoddpage%
        \ifoddpage\reversemarginpar\fi%
    \else%
        \reversemarginpar%
    \fi%
    \mparadjust{-.25em}%
    \marginnote{\questionmark[0.3]{purple}%
        \ifIsBook%
            \hspace*{-.2em}%
        \else%
            \hspace*{-.5em}%
        \fi%
    }\normalmarginpar%
}{}{}
}

\RequirePackage{iftex}
\ifXeTeX
\def\pgfsys@hboxsynced#1{%
{%
    \pgfsys@beginscope%
    \setbox\pgf@hbox=\hbox{%
    \hskip\pgf@pt@x%
    \raise\pgf@pt@y\hbox{%
        \pgf@pt@x=0pt%
        \pgf@pt@y=0pt%
        \special{pdf: content q}%
        \pgflowlevelsynccm%
        \pgfsys@invoke{q -1 0 0 -1 0 0 cm}%
        \special{pdf: content -1 0 0 -1 0 0 cm q}
        % translate to original coordinate system
        \pgfsys@invoke{0 J [] 0 d}% reset line cap and dash
        \wd#1=0pt%
        \ht#1=0pt%
        \dp#1=0pt%
        \box#1%
        \pgfsys@invoke{n Q Q Q}%
    }%
    \hss%
    }%
    \wd\pgf@hbox=0pt%
    \ht\pgf@hbox=0pt%
    \dp\pgf@hbox=0pt%
    \pgfsys@hbox\pgf@hbox%
    \pgfsys@endscope%
}}
\fi

\renewenvironment{proof}[1][\proofname]{\par
  \pushQED{\qed}%
  \normalfont \topsep6\p@\@plus6\p@\relax
  \trivlist
  \item[\hskip\labelsep
        \itshape
    #1\hspace{.4em}%
    \textcolor{maintext!27!paper}{$|$}]\ignorespaces
}{%
  \popQED\endtrivlist\@endpefalse
}

\RequirePackage[many]{tcolorbox}
\if@colorist@fast
    \tcbstartdraftmode
\fi
\tcolorboxenvironment{theorem}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.9,colframe=orange,arc=.7mm}
\tcolorboxenvironment{theorem*}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.9,colframe=orange,arc=.7mm}
\tcolorboxenvironment{lemma}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.9,colframe=orange,arc=.7mm}
\tcolorboxenvironment{lemma*}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.9,colframe=orange,arc=.7mm}
\tcolorboxenvironment{proposition}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.9,colframe=orange,arc=.7mm}
\tcolorboxenvironment{proposition*}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.9,colframe=orange,arc=.7mm}
\tcolorboxenvironment{corollary}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.9,colframe=orange,arc=.7mm}
\tcolorboxenvironment{corollary*}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.9,colframe=orange,arc=.7mm}
\tcolorboxenvironment{property}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.9,colframe=orange,arc=.7mm}
\tcolorboxenvironment{property*}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.9,colframe=orange,arc=.7mm}
\tcolorboxenvironment{axiom}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.9,colframe=orange,arc=.7mm}
\tcolorboxenvironment{axiom*}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.9,colframe=orange,arc=.7mm}
\tcolorboxenvironment{definition-proposition}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.9,colframe=orange,arc=.7mm}
\tcolorboxenvironment{definition-proposition*}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.9,colframe=orange,arc=.7mm}
\tcolorboxenvironment{definition-theorem}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.9,colframe=orange,arc=.7mm}
\tcolorboxenvironment{definition-theorem*}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.9,colframe=orange,arc=.7mm}

\tcolorboxenvironment{fact}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!5!paper,
    boxrule=0pt,frame hidden,arc=.7mm}
\tcolorboxenvironment{fact*}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!5!paper,
    boxrule=0pt,frame hidden,arc=.7mm}

\tcolorboxenvironment{conjecture}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.7,colframe=purple,arc=.7mm}
\tcolorboxenvironment{conjecture*}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!3!paper,
    left=3.5mm,right=3.5mm,
    opacityframe=0.7,colframe=purple,arc=.7mm}

\tcolorboxenvironment{definition}
    {enhanced jigsaw,pad at break*=1mm,breakable,
    left=4mm,right=4mm,top=1mm,bottom=1mm,
    colback=lightorange!10!paper,boxrule=0pt,frame hidden,
    borderline west={1.5mm}{0mm}{forestgreen},arc=.7mm}
\tcolorboxenvironment{definition*}
    {enhanced jigsaw,pad at break*=1mm,breakable,
    left=4mm,right=4mm,top=1mm,bottom=1mm,
    colback=lightorange!10!paper,boxrule=0pt,frame hidden,
    borderline west={1.5mm}{0mm}{forestgreen},arc=.7mm}
\tcolorboxenvironment{assumption}
    {enhanced jigsaw,pad at break*=1mm,breakable,
    left=4mm,right=4mm,top=1mm,bottom=1mm,
    colback=lightorange!10!paper,boxrule=0pt,frame hidden,
    borderline west={1.5mm}{0mm}{forestgreen},arc=.7mm}
\tcolorboxenvironment{assumption*}
    {enhanced jigsaw,pad at break*=1mm,breakable,
    left=4mm,right=4mm,top=1mm,bottom=1mm,
    colback=lightorange!10!paper,boxrule=0pt,frame hidden,
    borderline west={1.5mm}{0mm}{forestgreen},arc=.7mm}
\tcolorboxenvironment{convention}
    {enhanced jigsaw,pad at break*=1mm,breakable,
    left=4mm,right=4mm,top=1mm,bottom=1mm,
    colback=lightorange!10!paper,boxrule=0pt,frame hidden,
    borderline west={1.5mm}{0mm}{forestgreen},arc=.7mm}
\tcolorboxenvironment{convention*}
    {enhanced jigsaw,pad at break*=1mm,breakable,
    left=4mm,right=4mm,top=1mm,bottom=1mm,
    colback=lightorange!10!paper,boxrule=0pt,frame hidden,
    borderline west={1.5mm}{0mm}{forestgreen},arc=.7mm}
\tcolorboxenvironment{hypothesis}
    {enhanced jigsaw,pad at break*=1mm,breakable,
    left=4mm,right=4mm,top=1mm,bottom=1mm,
    colback=lightorange!10!paper,boxrule=0pt,frame hidden,
    borderline west={1.5mm}{0mm}{forestgreen},arc=.7mm}
\tcolorboxenvironment{hypothesis*}
    {enhanced jigsaw,pad at break*=1mm,breakable,
    left=4mm,right=4mm,top=1mm,bottom=1mm,
    colback=lightorange!10!paper,boxrule=0pt,frame hidden,
    borderline west={1.5mm}{0mm}{forestgreen},arc=.7mm}
\tcolorboxenvironment{notation}
    {enhanced jigsaw,pad at break*=1mm,breakable,
    left=4mm,right=4mm,top=1mm,bottom=1mm,
    colback=lightorange!10!paper,boxrule=0pt,frame hidden,
    borderline west={1.5mm}{0mm}{forestgreen},arc=.7mm}
\tcolorboxenvironment{notation*}
    {enhanced jigsaw,pad at break*=1mm,breakable,
    left=4mm,right=4mm,top=1mm,bottom=1mm,
    colback=lightorange!10!paper,boxrule=0pt,frame hidden,
    borderline west={1.5mm}{0mm}{forestgreen},arc=.7mm}

\tcolorboxenvironment{example}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!5!paper,
    boxrule=0pt,frame hidden,arc=.7mm,lines before break=3}
\tcolorboxenvironment{example*}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=maintext!5!paper,
    boxrule=0pt,frame hidden,arc=.7mm,lines before break=3}

\tcolorboxenvironment{problem}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=yellow!25!paper,
    boxrule=0pt,frame hidden,arc=.7mm}
\tcolorboxenvironment{problem*}
    {enhanced jigsaw,pad at break*=1mm,breakable,colback=yellow!25!paper,
    boxrule=0pt,frame hidden,arc=.7mm}

\tcolorboxenvironment{question}
    {enhanced jigsaw,pad at break*=1mm,breakable,oversize,
    top=0mm,bottom=0mm,
    opacityframe=0,opacityback=0,lines before break=3}
\tcolorboxenvironment{question*}
    {enhanced jigsaw,pad at break*=1mm,breakable,oversize,
    top=0mm,bottom=0mm,
    opacityframe=0,opacityback=0,lines before break=3}
\tcolorboxenvironment{exercise}
    {enhanced jigsaw,pad at break*=1mm,breakable,oversize,
    top=0mm,bottom=0mm,
    opacityframe=0,opacityback=0,lines before break=3}
\tcolorboxenvironment{exercise*}
    {enhanced jigsaw,pad at break*=1mm,breakable,oversize,
    top=0mm,bottom=0mm,
    opacityframe=0,opacityback=0,lines before break=3}
\tcolorboxenvironment{remark}
    {enhanced jigsaw,pad at break*=1mm,breakable,oversize,
    top=0mm,bottom=0mm,
    opacityframe=0,opacityback=0,lines before break=3}
\tcolorboxenvironment{remark*}
    {enhanced jigsaw,pad at break*=1mm,breakable,oversize,
    top=0mm,bottom=0mm,
    opacityframe=0,opacityback=0,lines before break=3}
\tcolorboxenvironment{observation}
    {enhanced jigsaw,pad at break*=1mm,breakable,oversize,
    top=0mm,bottom=0mm,
    opacityframe=0,opacityback=0,lines before break=3}
\tcolorboxenvironment{observation*}
    {enhanced jigsaw,pad at break*=1mm,breakable,oversize,
    top=0mm,bottom=0mm,
    opacityframe=0,opacityback=0,lines before break=3}

\ExplSyntaxOn
\NewDocumentCommand \AfterEnvEnd { +m }
  { \colorist_after_env_end:nw {#1} }
\cs_new_protected:Npn \colorist_after_env_end:nw #1 #2
       \if@ignore\@ignorefalse\ignorespaces\fi
  { #2 \if@ignore\@ignorefalse\ignorespaces\fi #1 }
  \NewDocumentCommand \ScanEnv { s m +m+m }
  {
    \IfBooleanTF {#1}
      { \jinwen_scan_env_ignore_par:nTF }
      { \jinwen_scan_env:nTF }
          {#2} {#3} {#4}
  }
\cs_new_protected:Npn \jinwen_scan_env:nTF
  { \__jinwen_scan_env:NnTF \c_false_bool }
\cs_new_protected:Npn \jinwen_scan_env_ignore_par:nTF
  { \__jinwen_scan_env:NnTF \c_true_bool }
\tl_new:N \l__jinwen_collected_tl
\cs_new_protected:Npn \__jinwen_scan_env:NnTF #1 #2 #3 #4
  {
    \tl_clear:N \l__jinwen_collected_tl
    \peek_analysis_map_inline:n
      {
        \tl_put_right:Nn \l__jinwen_collected_tl {##1}
        \int_compare:nNnTF { "##3 } = { 0 }
          {
            \exp_args:No \token_if_eq_meaning:NNTF {##1} \begin
              { \peek_analysis_map_break:n { \__jinwen_chk_env:nTFn {#2} {#3} {#4} } }
              {
                \bool_lazy_and:nnF {#1}
                    { \exp_args:No \token_if_eq_meaning_p:NN {##1} \par }
                  { \__jinwen_scan_env_end:n {#4} }
              }
          }
          { \int_compare:nNnF { "##3 } = { 10 } { \__jinwen_scan_env_end:n {#4} } }
      }
  }
\cs_new_protected:Npn \__jinwen_scan_env_end:n #1
  { \peek_analysis_map_break:n { \__jinwen_reinsert_tokens:nn {#1} { } } }
\cs_new_protected:Npn \__jinwen_reinsert_tokens:nn #1 #2
  {
    \use:x
      {
        \tl_clear:N \exp_not:N \l__jinwen_collected_tl
        \exp_not:n {#1} \l__jinwen_collected_tl #2
      }
  }
\cs_new_protected:Npn \__jinwen_chk_env:nTFn #1 #2 #3 #4
  {
    \exp_args:Nx \__jinwen_reinsert_tokens:nn
      { \str_if_eq:nnTF {#1} {#4} { \exp_not:n {#2} } { \exp_not:n {#3} } } { {#4} }
  }
\ExplSyntaxOff

\def\scandefinitionenv{%
  \AfterEnvEnd{%
    \ScanEnv*{definition}%
      {\vspace{-1.05\baselineskip}}%
      {\ScanEnv*{definition*}%
        {\vspace{-1.05\baselineskip}}%
        {}}}}
\AddToHook{env/definition/end}{\scandefinitionenv}%
\AddToHook{env/definition*/end}{\scandefinitionenv}%

\def\scanassumptionenv{%
  \AfterEnvEnd{%
    \ScanEnv*{assumption}%
      {\vspace{-1.05\baselineskip}}%
      {\ScanEnv*{assumption*}%
        {\vspace{-1.05\baselineskip}}%
        {}}}}
\AddToHook{env/assumption/end}{\scanassumptionenv}%
\AddToHook{env/assumption*/end}{\scanassumptionenv}%

\def\scanconventionenv{%
  \AfterEnvEnd{%
    \ScanEnv*{convention}%
      {\vspace{-1.05\baselineskip}}%
      {\ScanEnv*{convention*}%
        {\vspace{-1.05\baselineskip}}%
        {}}}}
\AddToHook{env/convention/end}{\scanconventionenv}%
\AddToHook{env/convention*/end}{\scanconventionenv}%

\def\scanhypothesisenv{%
  \AfterEnvEnd{%
    \ScanEnv*{hypothesis}%
      {\vspace{-1.05\baselineskip}}%
      {\ScanEnv*{hypothesis*}%
        {\vspace{-1.05\baselineskip}}%
        {}}}}
\AddToHook{env/hypothesis/end}{\scanhypothesisenv}%
\AddToHook{env/hypothesis*/end}{\scanhypothesisenv}%

\def\scannotationenv{%
  \AfterEnvEnd{%
    \ScanEnv*{notation}%
      {\vspace{-1.05\baselineskip}}%
      {\ScanEnv*{notation*}%
        {\vspace{-1.05\baselineskip}}%
        {}}}}
\AddToHook{env/notation/end}{\scannotationenv}%
\AddToHook{env/notation*/end}{\scannotationenv}%

\ifbool{IsBook}{}{%

%%================================
%% Title block style
%%================================
\renewcommand{\@maketitle}{%
\begin{center}%
    \color{maintheme}%
    {\Large\colorist@sffamily\scshape\conditionalbfseries\@title}\\\bigskip%
    \color{maintext!80!paper}%
    {\scshape\@author}\\\smallskip%
    {\@date}%
\end{center}%
\ifx\@date\@empty\bigskip\fi%
\medskip%
}
\apptocmd{\maketitle}{\thispagestyle{fancy}}{}{\FAIL}

%%================================
%% Abstract style
%%================================
\renewenvironment{abstract}
{\small{\centerline{\textsc{\conditionalbfseries\sffamily\abstractname}}\vspace{-0.3\baselineskip}}
    \color{maintext!80!paper}\begin{quotation}}
{\end{quotation}\medskip}

%%================================
%% Keyword
%%================================
\def\keywordnameEN{\textsc{Keywords}}
\def\keywordnameFR{\textsc{Mots clés}}
\def\keywordnameDE{\textsc{Schlüsselwörter}}
\def\keywordnameCN{关键词}
\def\keywordnameTC{關鍵詞}
\def\keywordnameJP{キーワード}
\def\keywordnameRU{Ключевые слова}

\newenvironment{keyword}
{\small{\centerline{{\conditionalbfseries\csname keywordname\csname\languagename ABBR\endcsname\endcsname}}\vspace{-0.3\baselineskip}}
    \color{maintext!80!paper}\begin{center}}
{\end{center}\medskip}

%%================================
%% Simulate features of amsart
%%================================
\PassOptionsToPackage{amsfashion}{PJLauthor}
\RequirePackage{PJLauthor}

}

\endinput
%%
%% End of file `colorist/colorist.sty'.
