Update box styling
This commit is contained in:
@@ -21,7 +21,7 @@ This is a formula: \( \sum\limits_{f=1}^{\infty}\frac{o}{r}\cdot m_{u} + l^{a} \
|
|||||||
This is \textbf{bold text that is slightly bold}, so underwhelming.
|
This is \textbf{bold text that is slightly bold}, so underwhelming.
|
||||||
In contrast, \sansbf{this text is very strong}, very cool\footnote{very cool}.
|
In contrast, \sansbf{this text is very strong}, very cool\footnote{very cool}.
|
||||||
|
|
||||||
\begin{codeblock}[label=lst:examplelisting]{This is a listing}{C++}
|
\begin{codeblock}[label=lst:examplelisting]{This is a listing.}{C++}
|
||||||
\inputminted{cpp}{\subfix{listings/example.cpp}}
|
\inputminted{cpp}{\subfix{listings/example.cpp}}
|
||||||
\end{codeblock}
|
\end{codeblock}
|
||||||
|
|
||||||
@@ -33,24 +33,15 @@ In contrast, \sansbf{this text is very strong}, very cool\footnote{very cool}.
|
|||||||
\caption{This is a figure.}\label{fig:examplefigure}
|
\caption{This is a figure.}\label{fig:examplefigure}
|
||||||
\end{figure}
|
\end{figure}
|
||||||
|
|
||||||
\begin{figure}[H]
|
|
||||||
\centering
|
|
||||||
\begin{subfigure}[b]{\textwidth}
|
|
||||||
\includesvg[width=1.0\linewidth]{\subfix{figures/heatmap2.svg}}
|
|
||||||
\end{subfigure}
|
|
||||||
\caption{This is another figure.}\label{fig:exampleheatmap}
|
|
||||||
\end{figure}
|
|
||||||
|
|
||||||
\begin{table}[H]
|
\begin{table}[H]
|
||||||
\centering
|
\centering
|
||||||
\begin{tabularx}{\textwidth}{lX}
|
\begin{tabularx}{\textwidth}{lX}
|
||||||
Column A & Column B \\
|
Column A & Column B \\
|
||||||
\toprule
|
\midrule
|
||||||
This is & a table where the right column does automatic line breaking, so long cell contents don't exceed the page boundary. Cool. \\
|
This is & a table where the right column does automatic line breaking, so long cell contents don't exceed the page boundary. Cool. \\
|
||||||
This is & an second row. \\
|
This is & an second row. \\
|
||||||
\bottomrule
|
|
||||||
\end{tabularx}
|
\end{tabularx}
|
||||||
\caption{This is a table}\label{tab:exampletable}
|
\caption{This is a table.}\label{tab:exampletable}
|
||||||
\end{table}
|
\end{table}
|
||||||
|
|
||||||
\lipsum%
|
\lipsum%
|
||||||
|
|||||||
+73
-27
@@ -275,7 +275,7 @@
|
|||||||
nobeforeafter,
|
nobeforeafter,
|
||||||
boxrule=0pt,
|
boxrule=0pt,
|
||||||
colback=languagebg,
|
colback=languagebg,
|
||||||
arc=2pt,
|
arc=3pt,
|
||||||
boxsep=0pt,
|
boxsep=0pt,
|
||||||
left=3pt,
|
left=3pt,
|
||||||
right=3pt,
|
right=3pt,
|
||||||
@@ -300,11 +300,11 @@
|
|||||||
top color=codebg,
|
top color=codebg,
|
||||||
bottom color=codebg
|
bottom color=codebg
|
||||||
},
|
},
|
||||||
boxrule=0.5pt, % Border width
|
boxrule=1pt, % Border width
|
||||||
arc=2pt, % Rounded corners
|
arc=4pt, % Rounded corners
|
||||||
width=\linewidth,
|
width=\linewidth,
|
||||||
fonttitle=\normalsize,
|
fonttitle=\normalsize,
|
||||||
adjusted title=\textbf{\texttt{\thetcbcounter}\hspace{0.75em}\texttt{#2}},
|
adjusted title=\textbf{\texttt{Listing \thetcbcounter.}\hspace{0.75em}\texttt{#2}},
|
||||||
list entry=\thetcbcounter\quad\texttt{#2}, % List of listings
|
list entry=\thetcbcounter\quad\texttt{#2}, % List of listings
|
||||||
list text={\hspace*{1ex}#2}, % Chapter - Caption spacing in list of listings
|
list text={\hspace*{1ex}#2}, % Chapter - Caption spacing in list of listings
|
||||||
after title={% Display used language
|
after title={% Display used language
|
||||||
@@ -319,7 +319,8 @@
|
|||||||
top=1mm,
|
top=1mm,
|
||||||
bottom=1mm,
|
bottom=1mm,
|
||||||
right=0mm,
|
right=0mm,
|
||||||
left=5mm,
|
left=4.3mm,
|
||||||
|
drop shadow=titlebg!50!white,
|
||||||
#1 % Extra args, e.g. a label
|
#1 % Extra args, e.g. a label
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -341,32 +342,77 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
% A box surrounding inline code-type text
|
% A box surrounding inline code-type text
|
||||||
\newtcbox{\codehighlight}{nobeforeafter,boxrule=.5pt,colback=black!5,colframe=black!35,
|
\newtcbox{\codehighlight}{
|
||||||
arc=2pt,boxsep=0pt,left=2pt,right=2pt,top=2pt,bottom=2pt, tcbox raise base}
|
nobeforeafter,
|
||||||
|
boxrule=.5pt,
|
||||||
|
colback=black!5,
|
||||||
|
colframe=black!35,
|
||||||
|
arc=2pt,
|
||||||
|
boxsep=0pt,
|
||||||
|
left=2pt,
|
||||||
|
right=2pt,
|
||||||
|
top=2pt,
|
||||||
|
bottom=2pt,
|
||||||
|
tcbox raise base
|
||||||
|
}
|
||||||
|
|
||||||
% Quickly place inline codehighlight boxes
|
% Quickly place inline codehighlight boxes
|
||||||
\newcommand{\code}[1]{\codehighlight{\texttt{\small{#1}}}}
|
\newcommand{\code}[1]{\codehighlight{\texttt{\small{#1}}}}
|
||||||
|
|
||||||
% A box surrounding figures
|
% Boxes for figures and tables use the same title bar as code listings.
|
||||||
\tcolorboxenvironment{figure}{
|
% Existing \caption and \label commands still work.
|
||||||
enhanced,
|
\tcbset{captionbox/.style={
|
||||||
float=htb,
|
enhanced,
|
||||||
arc=2pt,
|
arc=4pt,
|
||||||
boxrule=0.5pt,
|
boxrule=1pt,
|
||||||
colframe=black,
|
boxsep=1mm,
|
||||||
colback=white,
|
left=4mm, right=4mm,
|
||||||
before skip=\intextsep,
|
lefttitle=4mm, righttitle=4mm,
|
||||||
after skip=\intextsep,
|
colbacktitle=titlebg,
|
||||||
|
coltitle=titlecolor,
|
||||||
|
colframe=titlebg,
|
||||||
|
colback=white,
|
||||||
|
fonttitle=\normalsize\bfseries\ttfamily,
|
||||||
|
drop shadow=titlebg!50!white,
|
||||||
|
}}
|
||||||
|
|
||||||
|
% Captions
|
||||||
|
\captionsetup[captionbox]{
|
||||||
|
font={normalsize,bf,tt,color=titlecolor},
|
||||||
|
labelfont={bf,tt},
|
||||||
|
labelsep=quad,
|
||||||
|
margin=0pt,
|
||||||
|
justification=raggedright,
|
||||||
|
singlelinecheck=false,
|
||||||
|
skip=0pt,
|
||||||
}
|
}
|
||||||
|
|
||||||
% A box surrounding tables
|
% Subcaptions
|
||||||
\tcolorboxenvironment{table}{
|
\captionsetup[sub]{
|
||||||
enhanced,
|
font={normalfont,small,color=black},
|
||||||
float=htb,
|
labelfont={normalfont,bf},
|
||||||
arc=2pt,
|
|
||||||
boxrule=0.5pt,
|
|
||||||
colframe=black,
|
|
||||||
colback=white,
|
|
||||||
before skip=\intextsep,
|
|
||||||
after skip=\intextsep,
|
|
||||||
}
|
}
|
||||||
|
\makeatletter
|
||||||
|
\newcommand{\fs@captionbox}{%
|
||||||
|
\fs@plain%
|
||||||
|
\def\@fs@pre{%
|
||||||
|
\begin{tcolorbox}[captionbox,title={\unvbox\@floatcapt}]
|
||||||
|
}
|
||||||
|
\def\@fs@post{\end{tcolorbox}}
|
||||||
|
\def\@fs@mid{}
|
||||||
|
\let\@fs@iftopcapt\iffalse%
|
||||||
|
}
|
||||||
|
\makeatother
|
||||||
|
|
||||||
|
% Reserve padding
|
||||||
|
\newcommand{\captionboxwidth}{%
|
||||||
|
\hsize=\dimexpr\linewidth-10mm-1pt\relax
|
||||||
|
\linewidth=\hsize
|
||||||
|
\textwidth=\hsize
|
||||||
|
}
|
||||||
|
\floatstyle{captionbox}
|
||||||
|
\restylefloat{figure}
|
||||||
|
\restylefloat{table}
|
||||||
|
\floatevery{figure}{\captionboxwidth}
|
||||||
|
\floatevery{table}{\captionboxwidth}
|
||||||
|
\floatstyle{plain}
|
||||||
|
|||||||
Reference in New Issue
Block a user