-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtuftex-floats.sty
50 lines (40 loc) · 1.57 KB
/
tuftex-floats.sty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{tuftex-floats}[2023-06-20 package tuftex-floats]
\RequirePackage{tuftex-fullwidth} % for autoadjustwidth
\RequirePackage{tuftex-sidenotes} % for marginnote
\RequirePackage{caption} % for DeclareCaptionFormat, captionsetup
% Tighten up space between displays (e.g., a figure or table) and make symmetric
\setlength\abovedisplayskip{6pt plus 2pt minus 4pt}
\setlength\belowdisplayskip{6pt plus 2pt minus 4pt}
\DeclareCaptionFormat{figure}{\marginnote{#1#2#3}} % HERE NEED TO SET THIS
\RenewDocumentEnvironment{figure}{O{\fps@figure}}
{\@float{figure}[#1]
\captionsetup{format=figure,font=footnotesize,skip=0pt}
}
{\end@float}
\DeclareCaptionFormat{figure*}{\marginnote{#1#2#3}}
\RenewDocumentEnvironment{figure*}{O{\fps@figure}}
{\@dblfloat{figure}[#1]
\begin{autoadjustwidth}{}{-\@tuftex@overhang}
\captionsetup{format=figure*,font=footnotesize,skip=0pt}
}
{\end{autoadjustwidth}\end@dblfloat}
% marginfigure
% keep definition from sidenotes / tuftex-sidenotes for now
% table
\DeclareCaptionFormat{table}{\marginnote{#1#2#3}} % HERE NEED TO SET THIS
\RenewDocumentEnvironment{table}{O{\fps@table}}
{\@float{table}[#1]
\captionsetup{format=table,font=footnotesize,skip=0pt}
}
{\end@float}
% table*
\DeclareCaptionFormat{table*}{\marginnote{#1#2#3}}
\RenewDocumentEnvironment{table*}{O{\fps@table}}
{\@dblfloat{table}[#1]
\begin{autoadjustwidth}{}{\@tuftex@overhang}
\captionsetup{format=table*,font=footnotesize,skip=0pt}
}
{\end{autoadjustwidth}\end@dblfloat}
% margintable
% keep definition from sidenotes / tuftex-sidenotes for now