summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/hep-float/hep-float.sty
blob: db86ff4e97f51b0a57ae5a2e76238ed368d1d979 (plain)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
%%
%% This is file `hep-float.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% hep-float-implementation.dtx  (with options: `package')
%% This is a generated file.
%% Copyright (C) 2019-2020 by Jan Hajer
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. The latest version of this license is in:
%% http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.

\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{hep-float}[2021/08/01 v1.0 Float adjustments ]

\RequirePackage{kvoptions}
\SetupKeyvalOptions{
  family=hepfloat,
  prefix=hepfloat@
}
\DeclareBoolOption[true]{manualplacement}
\ProcessKeyvalOptions*
\setcounter{bottomnumber}{0} % 1
\setcounter{topnumber}{1} % 2
\setcounter{dbltopnumber}{1} % 2
\renewcommand{\topfraction}{.9} % .7
\renewcommand{\dbltopfraction}{.9} % .7
\renewcommand{\textfraction}{.1} % .2
\renewcommand{\floatpagefraction}{.8} % .5
\let\hep@figure\figure%
\let\end@hep@figure\endfigure%
\let\hep@table\table%
\let\end@hep@table\endtable%
\ifhepfloat@manualplacement%
  \renewenvironment{figure}[1][tbp]{%
    \hep@figure[#1]\centering%
    }{\end@hep@figure}%
  \renewenvironment{table}[1][tbp]{%
    \hep@table[#1]\centering%
  }{\end@hep@table}%
\else%
  \renewenvironment{figure}[1][]{%
    \hep@figure\centering%
  }{\end@hep@figure}%
  \renewenvironment{table}[1][]{%
    \hep@table\centering%
  }{\end@hep@table}
\fi%
\RequirePackage[subrefformat=parens]{subcaption}
\captionsetup{font=small}
\captionsetup[sub]{font=small}
\providecommand*\subcaption@minipage[2]{%
  \minipage#1{#2}\setcaptionsubtype\relax%
}
\newcommand{\hep@panels@space}{20}
\newenvironment{panels}[2][b]{%
  \newcommand{\begin@subcaption@minipage}[2][b]{%
    \caption@withoptargs\subcaption@minipage[##1]{##2}%
    \centering\vskip 0pt%
  }
  \ifdim#2pt>1pt%
    \newcommand{\hep@panel@space}{%
      (1-#2+\hep@panels@space)/\hep@panels@space%
    }%
    \newcommand{\panel}[1][b]{%
      \endminipage\hfill\begin@subcaption@minipage[#1]{%
        \linewidth/#2*\hep@panel@space%
      }%
    }%
    \begin@subcaption@minipage[#1]{\linewidth/#2*\hep@panel@space}%
  \else%
    \newcommand{\panel}[2][b]{%
      \endminipage\hfill\begin@subcaption@minipage[#1]{##2\linewidth}%
    }%
    \begin@subcaption@minipage[#1]{#2\linewidth}%
  \fi%
}{\endminipage}
\RequirePackage{booktabs}
\RequirePackage{multirow}

\RequirePackage{graphicx}
\providecommand{\tikzsetnextfilename}[1]{}
\newcommand{\graphic}[2][1]{\tikzsetnextfilename{#2}{%
  \centering\includegraphics[width=#1\linewidth]{#2}\par%
}}
\newcommand{\graphics}[1]{\graphicspath{{./#1/}}}

\endinput
%%
%% End of file `hep-float.sty'.