7

I really want to have my environment to look like this:

enter image description here

Also, I saw these environments from the book linear algebra done right, which @Jinwen informed me about. I was wondering how would I create environments like these ones here:

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

Anway, any help will be greatly appreciated! :)

1
  • borderline west is provided in tcolorbox library skins, so perhaps you didn't load it. Feb 26, 2022 at 20:07

2 Answers 2

11

Here is something for you to get start with:

\documentclass{article}

\usepackage{amsthm}
\usepackage[many]{tcolorbox}

\usepackage{blindtext}

\begin{document}

\newtheoremstyle{basic}
    {0pt}{0pt}{\normalfont}{0pt}
    {}{\;}{0.25em}
    {{\sffamily\bfseries\color{blue!50!cyan}\thmname{#1}~\thmnumber{\textup{#2}}.}
        \thmnote{\normalfont\color{black}~(#3)}}

\theoremstyle{basic}

\newtheorem{conclusion}{Conclusion}

\tcolorboxenvironment{conclusion}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=blue!50!cyan!10, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{blue!50!cyan}, arc=.5mm
}

\begin{conclusion}
    \blindtext
\end{conclusion}


\end{document}

enter image description here


ADDED:

Here is a brief example to demonstrated the idea that the color of the proof environments changes with the previous theorem-like environment. Note that the current approach won't work for proofs like Proof of Theorem 3.1, as it reads only the color of the previous environment. For this to work in the general case, some effort shall be needed.

\documentclass{article}

\usepackage{amsthm}
\usepackage[many]{tcolorbox}

\usepackage{blindtext}

\begin{document}

\newtheoremstyle{theorem}
    {0pt}{0pt}{\normalfont}{0pt}
    {}{\;}{0.25em}
    {{\sffamily\bfseries\color{theoremcolor}\thmname{#1}~\thmnumber{\textup{#2}}.}
        \thmnote{\normalfont\color{black}~(#3)}}

\newtheoremstyle{definition}
    {0pt}{0pt}{\normalfont}{0pt}
    {}{\;}{0.25em}
    {{\sffamily\bfseries\color{definitioncolor}\thmname{#1}~\thmnumber{\textup{#2}}.}
        \thmnote{\normalfont\color{black}~(#3)}}

\theoremstyle{theorem}

\newtheorem{theorem}{Theorem}

\theoremstyle{definition}

\newtheorem{definition}{Definition}

\colorlet{theoremcolor}{blue!50!cyan}
\colorlet{definitioncolor}{red!50!orange}

\definecolor{proofcolor}{RGB}{0,0,0}

\tcolorboxenvironment{theorem}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=theoremcolor!10, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{theoremcolor}, arc=.5mm
}

\tcolorboxenvironment{definition}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=definitioncolor!10, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{definitioncolor}, arc=.5mm
}

% These patches must be placed after \tcolorboxenvironment !
\AddToHook{env/theorem/after}{\colorlet{proofcolor}{theoremcolor}}
\AddToHook{env/definition/after}{\colorlet{proofcolor}{definitioncolor}}

\renewcommand{\proofname}{%
    \normalfont\sffamily\bfseries%
    \color{proofcolor}Proof%
}
\let\qedsymbolMyOriginal\qedsymbol
\renewcommand{\qedsymbol}{%
    \color{proofcolor}\qedsymbolMyOriginal%
}


\begin{theorem}
    \blindtext
\end{theorem}

\begin{proof}
    Some text.
\end{proof}

\begin{definition}
    \blindtext
\end{definition}

\begin{proof}
    Some text.
\end{proof}


\end{document}

enter image description here


And if one wants to put the proofs in color boxes too:

\documentclass{article}

\usepackage{amsthm}
\usepackage[many]{tcolorbox}

\usepackage{blindtext}

\begin{document}

\newtheoremstyle{theorem}
    {0pt}{0pt}{\normalfont}{0pt}
    {}{\;}{0.25em}
    {{\sffamily\bfseries\color{theoremcolor}\thmname{#1}~\thmnumber{\textup{#2}}.}
        \thmnote{\normalfont\color{black}~(#3)}}

\newtheoremstyle{definition}
    {0pt}{0pt}{\normalfont}{0pt}
    {}{\;}{0.25em}
    {{\sffamily\bfseries\color{definitioncolor}\thmname{#1}~\thmnumber{\textup{#2}}.}
        \thmnote{\normalfont\color{black}~(#3)}}

\theoremstyle{theorem}

\newtheorem{theorem}{Theorem}

\theoremstyle{definition}

\newtheorem{definition}{Definition}

\colorlet{theoremcolor}{blue!50!cyan}
\colorlet{definitioncolor}{red!50!orange}

\definecolor{proofcolor}{RGB}{0,0,0}

\tcolorboxenvironment{theorem}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=theoremcolor!10, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{theoremcolor}, arc=.5mm
}

\tcolorboxenvironment{definition}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=definitioncolor!10, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{definitioncolor}, arc=.5mm
}

\tcolorboxenvironment{proof}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    opacityback=0, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{proofcolor}, arc=.5mm
}

% These patches must be placed after \tcolorboxenvironment !
\AddToHook{env/theorem/after}{\colorlet{proofcolor}{theoremcolor}}
\AddToHook{env/definition/after}{\colorlet{proofcolor}{definitioncolor}}

\renewcommand{\proofname}{%
    \normalfont\sffamily\bfseries%
    \color{proofcolor}Proof%
}
\let\qedsymbolMyOriginal\qedsymbol
\renewcommand{\qedsymbol}{%
    \color{proofcolor}\qedsymbolMyOriginal%
}


\begin{theorem}
    \blindtext
\end{theorem}

\begin{proof}
    Some text.
\end{proof}

\begin{definition}
    \blindtext
\end{definition}

\begin{proof}
    Some text.
\end{proof}


\end{document}

enter image description here

17
  • Thank you! This finally workd!!!!! Feb 26, 2022 at 20:07
  • @SingularisArt As @muzimuzhi pointed out in his comment, the key borderline west requires the library skins. Here I simply use the option many to make tcolorbox load frequently used modules. Did you check if the corresponding tcolorbox library has been loaded? (You can also load it explicitly via \tcbuselibrary{skins}.)
    – Jinwen
    Feb 26, 2022 at 20:13
  • Yeah. After I added \tcbuselibrary{skins}, it finally worked. Also, quick question, how can I make the proof environment change color based on what environment it's near? For example, if it's near the conclusion environment, then the proof environment will be blue. But if it's near the definition environment, then it will be green. Do you think this is possible? Feb 26, 2022 at 20:30
  • @SingularisArt This is definitely possible and not very hard. The thing is that I believe putting proof environments inside color boxes does not make you document clearer, so I propose that you just change the color of the title Proof. If you are interested in that, I can expand my answer to include such an approach ;)
    – Jinwen
    Feb 26, 2022 at 20:34
  • Yes. If you can, that will be amazing. Feb 26, 2022 at 20:37
0

Here's my final result. Thanks a ton to @Jinwen.

Here's the final code:

\documentclass{tuftebook}
\usepackage{amsthm}
\usepackage[many]{tcolorbox}

\makeatletter

\makeatletter

\def\renewtheorem#1{%
    \expandafter\let\csname#1\endcsname\relax
    \expandafter\let\csname c@#1\endcsname\relax
    \gdef\renewtheorem@envname{#1}
    \renewtheorem@secpar
}
\def\renewtheorem@secpar{\@ifnextchar[{\renewtheorem@numberedlike}{\renewtheorem@nonumberedlike}}
\def\renewtheorem@numberedlike[#1]#2{\newtheorem{\renewtheorem@envname}[#1]{#2}}
\def\renewtheorem@nonumberedlike#1{
    \def\renewtheorem@caption{#1}
    \edef\renewtheorem@nowithin{\noexpand\newtheorem{\renewtheorem@envname}{\renewtheorem@caption}}
    \renewtheorem@thirdpar
}
\def\renewtheorem@thirdpar{\@ifnextchar[{\renewtheorem@within}{\renewtheorem@nowithin}}
\def\renewtheorem@within[#1]{\renewtheorem@nowithin[#1]}

\makeatother

%%%%%%%%%%%%%%%%%%%%
% New environments %
%%%%%%%%%%%%%%%%%%%%

\makeatother
\mdfsetup{skipabove=1em,skipbelow=0em}

\tcbuselibrary{skins}

% Color definitions

\definecolor{proofcolor}{RGB}{0,0,0}

% Dark orange and Dark Red rgb
\definecolor{theorembordercolor}{RGB}{151, 63, 5}
\definecolor{theorembackgroundcolor}{RGB}{248, 241, 234}

\definecolor{examplebordercolor}{RGB}{0, 110, 184}
\definecolor{examplebackgroundcolor}{RGB}{240, 244, 250}

\definecolor{definitionbordercolor}{RGB}{0, 150, 85}
\definecolor{definitionbackgroundcolor}{RGB}{239, 247, 243}

\definecolor{propertybordercolor}{RGB}{128, 0, 128}
\definecolor{propertybackgroundcolor}{RGB}{255, 240, 255}

\definecolor{formulabordercolor}{RGB}{0, 0, 0}
\definecolor{formulabackgroundcolor}{RGB}{230, 229, 245}

\newtheoremstyle{theorem}
{0pt}{0pt}{\normalfont}{0pt}
{}{\;}{0.25em}
{{\sffamily\bfseries\color{theorembordercolor}\thmname{#1}~\thmnumber{\textup{#2}}.}
\thmnote{\normalfont\color{black}~(#3)}}

\newtheoremstyle{definition}
{0pt}{0pt}{\normalfont}{0pt}
{}{\;}{0.25em}
{{\sffamily\bfseries\color{definitionbordercolor}\thmname{#1}~\thmnumber{\textup{#2}}.}
\thmnote{\normalfont\color{black}~(#3)}}

\newtheoremstyle{example}
{0pt}{0pt}{\normalfont}{0pt}
{}{\;}{0.25em}
{{\sffamily\bfseries\color{examplebordercolor}\thmname{#1}.}
\thmnote{\normalfont\color{black}~(#3)}}

\newtheoremstyle{property}
{0pt}{0pt}{\normalfont}{0pt}
{}{\;}{0.25em}
{{\sffamily\bfseries\color{propertybordercolor}\thmname{#1}~\thmnumber{\textup{#2}}.}
\thmnote{\normalfont\color{black}~(#3)}}

\newtheoremstyle{formula}
{0pt}{0pt}{\normalfont}{0pt}
{}{\;}{0.25em}
{{\sffamily\bfseries\color{formulabordercolor}\thmname{#1}~\thmnumber{\textup{#2}}.}
\thmnote{\normalfont\color{black}~(#3)}}

%%%%%%%%%%%%%%%%%%%%%%%%
% Theorem Environments %
%%%%%%%%%%%%%%%%%%%%%%%%

\theoremstyle{theorem}

\newtheorem{theorem}{Theorem}
\newtheorem{postulate}{Postulate}
\newtheorem{conjecture}{Conjecture}
\newtheorem{corollary}{Corollary}
\newtheorem{lemma}{Lemma}
\newtheorem{conclusion}{Conclusion}

\tcolorboxenvironment{theorem}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=theorembackgroundcolor, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{theorembordercolor}, arc=.5mm
}
\tcolorboxenvironment{postulate}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=theorembackgroundcolor, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{theorembordercolor}, arc=.5mm
}
\tcolorboxenvironment{conjecture}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=theorembackgroundcolor, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{theorembordercolor}, arc=.5mm
}
\tcolorboxenvironment{corollary}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=theorembackgroundcolor, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{theorembordercolor}, arc=.5mm
}
\tcolorboxenvironment{lemma}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=theorembackgroundcolor, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{theorembordercolor}, arc=.5mm
}
\tcolorboxenvironment{conclusion}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=theorembackgroundcolor, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{theorembordercolor}, arc=.5mm
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Definition Environments %
%%%%%%%%%%%%%%%%%%%%%%%%%%%

\theoremstyle{definition}
\newtheorem{definition}{Definition}
\newtheorem{review}{Review}

\tcolorboxenvironment{definition}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=definitionbackgroundcolor, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{definitionbordercolor}, arc=.5mm
}
\tcolorboxenvironment{review}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=definitionbackgroundcolor, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{definitionbordercolor}, arc=.5mm
}


%%%%%%%%%%%%%%%%%%%%%%%%
% Example Environments %
%%%%%%%%%%%%%%%%%%%%%%%%

\theoremstyle{example}
\newtheorem*{example}{Example}
\newtheorem*{remark}{Remark}
\newtheorem*{note}{Note}

\tcolorboxenvironment{example}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=examplebackgroundcolor, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{examplebordercolor}, arc=.5mm
}
\tcolorboxenvironment{remark}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=white, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{examplebordercolor}, arc=.5mm
}
\tcolorboxenvironment{note}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=white, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{examplebordercolor}, arc=.5mm
}


%%%%%%%%%%%%%%%%%%%%%%%%%
% Property Environments %
%%%%%%%%%%%%%%%%%%%%%%%%%

\theoremstyle{property}
\newtheorem{property}{Property}
\newtheorem{proposition}{Proposition}

\tcolorboxenvironment{property}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=propertybackgroundcolor, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{propertybordercolor}, arc=.5mm
}
\tcolorboxenvironment{proposition}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=propertybackgroundcolor, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{propertybordercolor}, arc=.5mm
}

%%%%%%%%%%%%
% Formula %
%%%%%%%%%%%%

\theoremstyle{formula}
\newtheorem{formula}{Formula}

\tcolorboxenvironment{formula}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=formulabackgroundcolor, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{formulabordercolor}, arc=.5mm
}

%%%%%%%%%
% Proof %
%%%%%%%%%

% These patches must be placed after \tcolorboxenvironment !
\AddToHook{env/theorem/after}{\colorlet{proofcolor}{theorembordercolor}}
\AddToHook{env/postulate/after}{\colorlet{proofcolor}{theorembordercolor}}
\AddToHook{env/conjecture/after}{\colorlet{proofcolor}{theorembordercolor}}
\AddToHook{env/corollary/after}{\colorlet{proofcolor}{theorembordercolor}}
\AddToHook{env/lemma/after}{\colorlet{proofcolor}{theorembordercolor}}
\AddToHook{env/conclusion/after}{\colorlet{proofcolor}{theorembordercolor}}

\AddToHook{env/definition/after}{\colorlet{proofcolor}{definitionbordercolor}}
\AddToHook{env/review/after}{\colorlet{proofcolor}{definitionbordercolor}}

\AddToHook{env/example/after}{\colorlet{proofcolor}{examplebordercolor}}
\AddToHook{env/remark/after}{\colorlet{proofcolor}{examplebordercolor}}
\AddToHook{env/note/after}{\colorlet{proofcolor}{examplebordercolor}}

\AddToHook{env/property/after}{\colorlet{proofcolor}{propertybordercolor}}
\AddToHook{env/proposition/after}{\colorlet{proofcolor}{propertybordercolor}}

\AddToHook{env/formula/after}{\colorlet{proofcolor}{formulabordercolor}}

\renewcommand{\qedsymbol}{Q.E.D.}
\let\qedsymbolMyOriginal\qedsymbol
\renewcommand{\qedsymbol}{
    \color{proofcolor}\qedsymbolMyOriginal
}

\newtheoremstyle{proof}
{0pt}{0pt}{\normalfont}{0pt}
{}{\;}{0.25em}
{{\sffamily\bfseries\color{proofcolor}\thmname{#1}.}
    \thmnote{\normalfont\color{black}~(\textit{#3})}}

\theoremstyle{proof}
\renewtheorem{proof}{Proof}

\tcolorboxenvironment{proof}{
    enhanced jigsaw, pad at break*=1mm, breakable,
    left=4mm, right=4mm, top=1mm, bottom=1mm,
    colback=white, boxrule=0pt, frame hidden,
    borderline west={0.5mm}{0mm}{proofcolor}, arc=.5mm
}

\newenvironment{info}{\begin{tcolorbox}[
            arc=0mm,
            colback=white,
            colframe=gray,
            title=Info,
            fonttitle=\sffamily,
            breakable
        ]}{\end{tcolorbox}}
\newenvironment{terminology}{\begin{tcolorbox}[
            arc=0mm,
            colback=white,
            colframe=green!60!black,
            title=Terminology,
            fonttitle=\sffamily,
            breakable
        ]}{\end{tcolorbox}}
\newenvironment{warning}{\begin{tcolorbox}[
            arc=0mm,
            colback=white,
            colframe=red,
            title=Warning,
            fonttitle=\sffamily,
            breakable
        ]}{\end{tcolorbox}}
\newenvironment{caution}{\begin{tcolorbox}[
            arc=0mm,
            colback=white,
            colframe=yellow,
            title=Caution,
            fonttitle=\sffamily,
            breakable
        ]}{\end{tcolorbox}}

\begin{document}
  \mbox{}\newpage

  \begin{theorem}[Theorem 1]
    \label{thrm:theorem_1}

    \lipsum[1]
  \end{theorem}

  \begin{postulate}[Postulate 1]
    \label{post:postulate_1}
  
    \lipsum[1]
  \end{postulate}

  \begin{conjecture}[Conjecture 1]
    \lipsum[1]
  \end{conjecture}

  \begin{corollary}
    \label{corl:corollary_1}
  
    \lipsum[1]
  \end{corollary}

  \begin{lemma}
    \label{lemma:lemma_1}
  
    \lipsum[1]
  \end{lemma}

  \begin{conclusion}
    \label{conc:conclusion_1}
  
    \lipsum[1]
  \end{conclusion}

  \begin{proof}
    \label{prf:proof_1}
  
    \lipsum[1]
  \end{proof}

  \newpage

  \begin{definition}[Definition 1]
    \label{def:definition_1}
  
    \lipsum[1]
  \end{definition}

  \begin{review}[Review 1]
    \label{rev:review_1}
  
    \lipsum[1]
  \end{review}

  \begin{proof}
    \label{prf:proof_2}
  
    \lipsum[1]
  \end{proof}

  \newpage

  \begin{proof}
    \label{prf:proof_4}
  
    \lipsum[1]
  \end{proof}

  \newpage

  \begin{example}
    \label{exm:example_1}
  
    \lipsum[1]
  \end{example}

  \begin{remark}[Remark 1]
    \label{rmk:remark_1}
  
    \lipsum[1]
  \end{remark}

  \begin{note}
    \label{nte:note_1}
  
    \lipsum[1]
  \end{note}

  \begin{proof}
    \label{prf:proof_3}
  
    \lipsum[1]
  \end{proof}

  \newpage

  \begin{property}[Property 1]
    \label{prop:property_1}
  
    \lipsum[1]
  \end{property}

  \begin{proposition}[Proposition 1]
    \label{prop:proposition_1}
  
    \lipsum[1]
  \end{proposition}

  \begin{proof}
    \label{prf:proof_4}
  
    \lipsum[1]
  \end{proof}

  \newpage

  \begin{formula}[Formula 1]
    \label{form:formula_1}

    \lipsum[1]
  \end{formula}

  \begin{proof}
    \label{prf:proof_5}
  
    \lipsum[1]
  \end{proof}

  \newpage

  \begin{info}
    \lipsum[1]
  \end{info}

  \begin{terminology}
    \lipsum[1]
  \end{terminology}

  \begin{warning}
    \lipsum[1]
  \end{warning}

  \begin{caution}
    \lipsum[1]
  \end{caution}
\end{document}

Here's the output:

enter image description here enter image description here enter image description here enter image description here enter image description here

Here's the tuftebook.cls file:

\LoadClass[20pt,a4paper,11pt,openany,tikz]{report}

\NeedsTeXFormat{LaTeX2e}
\ProvidesFile{tuftebook.cls}[2020/03/24 v1.00a Caesar book]

\RequirePackage{amsmath}
\RequirePackage{sidenotes}
\captionsetup{font=footnotesize, skip=2pt}
\RequirePackage[maxfloats=45]{morefloats}

\RequirePackage{marginfix}
\newcommand{\caesar@letterspace}[1]{#1}
\RequirePackage[letterspace=150]{microtype}
\@ifpackagelater{microtype}{2011/08/18}
{\renewcommand{\caesar@letterspace}[1]{\textls{#1}}}
{\AtEndDocument{\ClassWarningNoLine{caesar_book}{Need newest microtype for letterspacing.}}}

% Setting up the dimensions of the page using the package geometry.
\RequirePackage{geometry}
\geometry{
    paperwidth=210mm,
    paperheight=297mm,
    left=42pt,
    top=72pt,
    textwidth=320pt,
    marginparsep=20pt,
    marginparwidth=180pt,
    textheight=650pt,
    footskip=40pt,
}

\renewcommand{\normalsize}{\fontsize{10pt}{13pt}\selectfont}%
\renewcommand{\footnotesize}{\fontsize{8pt}{10pt}\selectfont}%

\newlength{\overhang}
\setlength{\overhang}{\marginparwidth}
\addtolength{\overhang}{\marginparsep}

\newenvironment{fullwidth}
    {\ifthenelse{\boolean{@twoside}}
        {\begin{adjustwidth*}{}{-\overhang}}
        {\begin{adjustwidth}{}{-\overhang}}
    }
    {\ifthenelse{\boolean{@twoside}}
        {\end{adjustwidth*}}
        {\end{adjustwidth}}
    }

\RequirePackage{titlesec,titletoc}
\RequirePackage{fmtcount}
\titleformat{\chapter}[display]
{\bfseries\Large\sf}
{\filleft
\textls{\MakeUppercase{\chaptertitlename}} \expandafter\textls\expandafter{\NUMBERstring{chapter}}}
{1.5ex}
{\titlerule
\vspace*{1.1ex}
\filright}
[\vspace*{1.5ex}
\titlerule]


% This is used for chapters
\RequirePackage{fancyhdr}                       % Helper package
\fancypagestyle{plain}{
    \renewcommand{\headrulewidth}{0pt}          % Line at the header invisible
    \renewcommand{\footrulewidth}{0pt}          % Line at the footer visible
}

% Basic formatting.
% \renewcommand{\frontmatter}{\pagestyle{empty}}
% \renewcommand{\mainmatter}{\cleardoublepage\pagestyle{fancy}}
\RequirePackage{ragged2e}
\newcommand{\marginparstyle}{\footnotesize}
\long\def\@ympar#1{
    \@savemarbox\@marbox{\marginparstyle#1}
    \global\setbox\@currbox\copy\@marbox
    \@xympar}
\renewcommand*{\marginfont}{\marginparstyle}

% Setting up itemize and enumerate.
\RequirePackage[shortlabels]{enumitem}
\setlist[itemize]{leftmargin=*}

\newcommand\newthought[1]{
   \addvspace{1.0\baselineskip plus 0.5ex minus 0.2ex}%
   \noindent\textsc{#1}
}
\ExplSyntaxOn
\NewDocumentCommand \sidecite { o o m }
{ 
    \IfNoValueOrEmptyTF{#1}
    {
        \IfNoValueOrEmptyTF{#2}
        {
          \sidenote{\fullcite{#3}}
        }
        {
          \sidenote{\fullcite[#2]{#3}}
        }
    }
    {
        \IfNoValueOrEmptyTF{#2}
        {
          \sidenote{\fullcite[#1]{#3}}
        }
        {
          \sidenote{\fullcite[#1][#2]{#3}}
        }
    }
}
\ExplSyntaxOff

\RequirePackage{caption}
\RequirePackage[margincaption,outercaption,,wide]{sidecap}
\sidecaptionvpos{figure}{t} 
\captionsetup{labelfont={sf,bf,footnotesize}}
\DeclareCaptionStyle{marginfigure}[]{labelfont={sf,bf,footnotesize}, font=footnotesize, justification=justified}
\DeclareCaptionStyle{sidecaption}[]{labelfont={sf,bf,footnotesize}, font=footnotesize, justification=justified, singlelinecheck=off}
\DeclareCaptionStyle{widefigure}[]{labelfont={sf,bf,footnotesize}, font=footnotesize}

\renewcommand{\normalsize}{\fontsize{10pt}{13pt}\selectfont}%
\renewcommand{\footnotesize}{\fontsize{8pt}{10pt}\selectfont}%

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .