Skip to content

Commit e325790

Browse files
committed
Add tex for sidebars
1 parent cd93d22 commit e325790

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

preamble.tex

+24
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,27 @@
2323
\newunicodechar{├}{\textfallback{├}}
2424
\newunicodechar{│}{\textfallback{│}}
2525

26+
27+
% sidebar environment
28+
\usepackage{framed,color}
29+
\definecolor{shadecolor}{RGB}{242,242,242}
30+
\makeatletter
31+
\newenvironment{sidebar}{%
32+
\medskip{}
33+
\setlength{\fboxsep}{.8em}
34+
\def\at@end@of@kframe{}%
35+
\ifinner\ifhmode%
36+
\def\at@end@of@kframe{\end{minipage}}%
37+
\begin{minipage}{\columnwidth}%
38+
\fi\fi%
39+
\def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep
40+
\colorbox{shadecolor}{##1}\hskip-\fboxsep
41+
% There is no \\@totalrightmargin, so:
42+
\hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
43+
\MakeFramed {\advance\hsize-\width
44+
\@totalleftmargin\z@ \linewidth\hsize
45+
\@setminipage}}%
46+
{\par\unskip\endMakeFramed%
47+
\at@end@of@kframe}
48+
\makeatother
49+

0 commit comments

Comments
 (0)