| 1 |
%% |
| 2 |
%% This is file `hep-float-documentation.tex', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% hep-float-implementation.dtx (with options: `documentation') |
| 8 |
%% This is a generated file. |
| 9 |
%% Copyright (C) 2019-2025 by Jan Hajer |
| 10 |
%% This file may be distributed and/or modified under the |
| 11 |
%% conditions of the LaTeX Project Public License, either |
| 12 |
%% version 1.3c of this license or (at your option) any later |
| 13 |
%% version. The latest version of this license is in: |
| 14 |
%% http://www.latex-project.org/lppl.txt |
| 15 |
%% and version 1.3c or later is part of all distributions of |
| 16 |
%% LaTeX version 2005/12/01 or later. |
| 17 |
|
| 18 |
\ProvidesFile{hep-float-documentation.tex}[2025/09/01 v1.4 hep-float documentation] |
| 19 |
\documentclass{ltxdoc} |
| 20 |
|
| 21 |
\renewcommand*\theCodelineNo{\rmfamily\tstyle\footnotesize\arabic{CodelineNo}} |
| 22 |
\AtBeginEnvironment{macrocode}{\renewcommand*{\ttdefault}{clmt}} |
| 23 |
\renewcommand*{\MacroFont}{\codestyle} |
| 24 |
\AtBeginDocument{\DeleteShortVerb{\|}} |
| 25 |
\AtBeginDocument{\MakeShortVerb{\"}} |
| 26 |
\EnableCrossrefs |
| 27 |
\CodelineIndex |
| 28 |
\RecordChanges |
| 29 |
|
| 30 |
\usepackage{hologo} |
| 31 |
|
| 32 |
\usepackage[parskip,oldstyle,font=10pt]{hep-paper} |
| 33 |
\bibliography{bibliography} |
| 34 |
|
| 35 |
\GetFileInfo{hep-float.sty} |
| 36 |
|
| 37 |
\title{The \software{hep-float} package\thanks{This document corresponds to \software{hep-float}~\fileversion.}} |
| 38 |
\subtitle{Convenience package for float placement} |
| 39 |
\author{Jan Hajer \email{[email protected]}} |
| 40 |
\date{\filedate} |
| 41 |
|
| 42 |
\begin{document} |
| 43 |
|
| 44 |
\newgeometry{vscale=.8, vmarginratio=3:4, includeheadfoot, left=11em, marginparwidth=4.6cm, marginparsep=3mm, right=7em} |
| 45 |
|
| 46 |
\maketitle |
| 47 |
|
| 48 |
\begin{abstract} |
| 49 |
The \software{hep-float} package redefines some \hologo{LaTeX} float placement defaults and defines convenience wrappers for floats. |
| 50 |
\end{abstract} |
| 51 |
|
| 52 |
The \software{hep-float} package can be loaded with "\usepackage{hep-float}". |
| 53 |
|
| 54 |
\DescribeEnv{figure} |
| 55 |
\DescribeEnv{table} |
| 56 |
Automatic float placement is adjusted to place a single float at the top of pages and to reduce the number of float pages, using the \hologo{LaTeX} macros. |
| 57 |
|
| 58 |
"\setcounter{bottomnumber}{0}" \hfill no floats at the bottom of a page (default 1) \\ |
| 59 |
"\setcounter{topnumber}{1}" \hfill a single float at the top of a page (default 2) \\ |
| 60 |
"\setcounter{dbltopnumber}{1}" \hfill same for full widths floats in two-column mode \\ |
| 61 |
"\renewcommand{\textfraction}{.1}" \hfill large floats are allowed (default 0.2)\\ |
| 62 |
"\renewcommand{\topfraction}{.9}" \hfill (default 0.7) \\ |
| 63 |
"\renewcommand{\dbltopfraction}{.9}" \hfill (default 0.7) \\ |
| 64 |
"\renewcommand{\floatpagefraction}{.8}" \hfill float pages must be full (default 0.5) |
| 65 |
|
| 66 |
The most useful float placement is usually archived by placing the float \emph{in front} of the paragraph it is referenced in first. |
| 67 |
\DescribeMacro{local} |
| 68 |
Additionally, manual float placement can be deactivated using the "local" package option. |
| 69 |
|
| 70 |
\DescribeMacro{\raggedright} |
| 71 |
The float environments have been adjusted to center their content. |
| 72 |
The usual behaviour can be reactivated using "\raggedright". |
| 73 |
|
| 74 |
\begin{table} |
| 75 |
\begin{panels}{2} |
| 76 |
\begin{verbatim} |
| 77 |
\begin{panels}{2} |
| 78 |
code |
| 79 |
\panel |
| 80 |
\begin{tabular}...\end{tabular} |
| 81 |
\end{panels} |
| 82 |
\end{verbatim} |
| 83 |
\caption{Code for this panel environment.} |
| 84 |
\label{tab:panels} |
| 85 |
\panel |
| 86 |
\begin{tabular}{cccc} |
| 87 |
\toprule |
| 88 |
\multicolumn{2}{c}{one}& \multicolumn{2}{c}{two} \\ \cmidrule(r){1-2} \cmidrule(l){3-4} |
| 89 |
\multirow{2}{*}{a} & b & c & d \\ |
| 90 |
& b & c & d \\ |
| 91 |
\bottomrule |
| 92 |
\end{tabular} |
| 93 |
\caption{The \protecting{"booktabs"} and \protecting{"multirow"} features.} |
| 94 |
\label{tab:booktabs} |
| 95 |
\end{panels} |
| 96 |
\caption{Example use of the \protecting{"panels"} environment in Panel \subref{tab:panels} and the features from the \software{booktabs} and \software{multirow} packages in Panel \subref{tab:booktabs}. |
| 97 |
} \label{tab:table} |
| 98 |
\end{table} |
| 99 |
|
| 100 |
\DescribeEnv{panels} |
| 101 |
\DescribeMacro{\panel} |
| 102 |
The "panels" environment makes use of the \software{subcaption} package \cite{subcaption}. |
| 103 |
It provides sub-floats and takes as mandatory argument either the number of sub-floats (default~2) or the width of the first sub-float as fraction of the "\linewidth". |
| 104 |
Within the "\begin{panels}"\oarg{vertical alignment}\marg{width} environment the "\panel" macro initiates a new sub-float. |
| 105 |
In the case that the width of the first sub-float has been given as an optional argument to the "panels" environment the "\panel"\marg{width} macro takes the width of the next sub-float as mandatory argument. |
| 106 |
The example code is presented in \cref{tab:panels}. |
| 107 |
\DescribeMacro{\panelhspace} |
| 108 |
\DescribeMacro{\panelvspace} |
| 109 |
The spacing between the panels can be adjusted by adjusting the "\panelvspace" in terms of a "\linewidth" fraction "\renewcommand*{\panelhspace}"{fraction} and the "\panelvspace" in terms of a length "\renewcommand*{\panelvspace}"\marg{length}. |
| 110 |
|
| 111 |
\DescribeEnv{tabular} |
| 112 |
The \software{booktabs} \cite{booktabs} and \software{multirow} \cite{multirow} packages are loaded enabling publication quality tabulars such as in \cref{tab:booktabs}. |
| 113 |
|
| 114 |
\DescribeMacro{\graphic} |
| 115 |
\DescribeMacro{\graphics} |
| 116 |
The \software{graphicx} package \cite{graphicx} is loaded and the "\graphic"\oarg{width}\marg{figure} macro is defined, which is a wrapper for the "\includegraphics"\marg{figure} macro and takes the figure width as fraction of the "\linewidth" as optional argument (default~1). |
| 117 |
If the graphics are located in a sub-folder its path can be indicated by "\graphics"\marg{subfolder}. |
| 118 |
|
| 119 |
\printbibliography |
| 120 |
|
| 121 |
\end{document} |
| 122 |
|
| 123 |
\endinput |
| 124 |
%% |
| 125 |
%% End of file `hep-float-documentation.tex'. |