% -----------------------
% CUSTOM PREAMBLE STUFF
% -----------------------
\usepackage{enumitem}
\usepackage{fontspec}
\usepackage{float}
\usepackage[normalem]{ulem}
\usepackage{hyperref}
\usepackage{nameref} %needed by zref-xr
\usepackage{zref-xr,zref-hyperref,zref-user}
\usepackage{xr-hyper}
\usepackage[normalem]{ulem}
\usepackage{setspace}
\usepackage{lineno}
\usepackage[UTF8, scheme=plain]{ctex}
\usepackage{orcidlink}

% \setkomafont{author}{\normalsize}

% for revision
\usepackage{adjustbox}
% \usepackage{xcolor}
\usepackage{mdframed}
\newmdenv[topline=false,
          leftline=true,
          bottomline=false,
          rightline=false,
          linewidth=3pt,
          %backgroundcolor=lightgray,
          linecolor=gray!30,
          backgroundcolor=gray!5,
          skipabove=\topsep,
          skipbelow=\topsep,
          leftmargin=0pt,
          rightmargin=0pt,
          innertopmargin=0pt,
          innerbottommargin=0pt
          ]{refquote}
\newmdenv[topline=false,
          leftline=true,
          bottomline=false,
          rightline=false,
          linewidth=3pt,
          %backgroundcolor=lightgray,
          backgroundcolor=red!3!white,
          linecolor=red!30!white,
          skipabove=\topsep,
          skipbelow=\topsep,
          leftmargin=0pt,
          rightmargin=0pt,
          innertopmargin=10pt,
          innerbottommargin=10pt
          ]{question}
% setup hyperlink for page and line number
\def\msname{MS}
\def\smname{SM}
\setenumerate{labelsep=*, leftmargin=1.0pc}
%\zexternaldocument*{ManuscriptNew\veraa}
\zexternaldocument*{\msname}
\zexternaldocument*{\smname}
\newcommand{\hlabel}[1]{\label{#1}\hypertarget{#1}{
    \linelabel{line:#1}}}
%\externaldocument[si-]{\smname\veraa}[\smname\veraa.pdf]
\makeatletter
\newcommand{\clab}[2][]{
		\protected@write\@auxout{\let\clab\@secondoftwo}{
				\string\newlabel{r:#1}{{#2}{}}}%
		\hlabel{#1}#2\hlabel{#1end}}
\makeatother 
\newcommand{\zhypera}[1]{\href[pdfnewwindow]{\msname.pdf\##1}{\\[1ex]\textbf{Page \zpageref{#1}, Line
\zref{line:#1}--\zref{line:#1end}:}\\}}
\newcommand{\cref}[1]{\begin{refquote}\zhypera{#1}{\zref{r:#1}}\\[-0.5ex]\end{refquote}}
% \newenvironment{ra}[1][\unskip]{\par \noindent \\[-1ex] \textbf{Response/Action:}\par\bf}{\ \\}
% \renewenvironment{verbatim}{\begin{ra}}{\end{ra}}
\renewenvironment{quote}{%
  \vspace{12pt plus 4pt minus 2pt}% 12pt基础间距，可伸缩
  \begin{question}%
}{%
  \end{question}%
  % \vspace{12pt plus 4pt minus 2pt}%
}




% -----------------
% Title block stuff
% -----------------

% Title
\makeatletter
\renewcommand{\title}[1]{\gdef\@title{\large\textbf{#1}}} % Adjust \Huge or other font commands
\makeatother


% ------------------
% Section headings
% ------------------
\usepackage{titlesec}
\titleformat*{\section}{\Large\sffamily\bfseries\raggedright}
\titleformat*{\subsection}{\large\sffamily\bfseries\raggedright}
\titleformat*{\subsubsection}{\normalsize\sffamily\bfseries\raggedright}
\titleformat*{\paragraph}{\small\sffamily\bfseries\raggedright}

%\titlespacing{<command>}{<left>}{<before-sep>}{<after-sep>}
% Starred version removes indentation in following paragraph
% \titlespacing*{\section}{0em}{2em}{0.1em}
% \titlespacing*{\subsection}{0em}{1.25em}{0.1em}
% \titlespacing*{\subsubsection}{0em}{0.75em}{0em}

% ------------------
% Headers/Footers
% ------------------
% \usepackage{fancyhdr}
% \pagestyle{fancy}
% \fancyhf{}
% \fancyhead[L,C,R]{}
% \fancyfoot[L,C]{}
% \fancyfoot[R]{\thepage}
% \renewcommand{\headrulewidth}{1pt}
% \fancypagestyle{plain}{%
%     \renewcommand{\headrulewidth}{0pt}%
%     \fancyhf{}%
%     \fancyfoot[R]{\thepage}%
% }
% \renewcommand\footnoterule{\rule{\linewidth}{0.1pt}\vspace{5pt}}

% ------------------
% Captions
% ------------------
\usepackage[labelfont=bf,labelsep=period]{caption}
\captionsetup[figure]{font=footnotesize,justification=centering,singlelinecheck=false,format=hang}


% ---------------------------
% END CUSTOM PREAMBLE STUFF
% ---------------------------
