diff --git a/helpfulMaterials/Floats (LaTeX2e unofficial reference manual (January 2023)).html b/helpfulMaterials/Floats (LaTeX2e unofficial reference manual (January 2023)).html new file mode 100644 index 00000000..e16a94c5 --- /dev/null +++ b/helpfulMaterials/Floats (LaTeX2e unofficial reference manual (January 2023)).html @@ -0,0 +1,309 @@ + +
+ + +Some typographic elements, such as figures and tables, cannot be broken +across pages. They must be typeset outside of the normal flow of text, +for instance floating to the top of a later page. +
+LaTeX can have a number of different classes of floating material.
+The default is the two classes, figure (see figure) and
+table (see table), but you can create a new class with the
+package float.
+
Within any one float class LaTeX always respects the order, so that +the first figure in a document source must be typeset before the second +figure. However, LaTeX may mix the classes, so it can happen that +while the first table appears in the source before the first figure, it +appears in the output after it. +
+The placement of floats is subject to parameters, given below, that +limit the number of floats that can appear at the top of a page, and +the bottom, etc. If so many floats are queued that the limits prevent +them all from fitting on a page then LaTeX places what it can and +defers the rest to the next page. In this way, floats may end up +being typeset far from their place in the source. In particular, a +float that is big may migrate to the end of the document. In which +event, because all floats in a class must appear in sequential order, +every following float in that class also appears at the end. +
+ + +In addition to changing the parameters, for each float you can tweak
+where the float placement algorithm tries to place it by using its
+placement argument. The possible values are a sequence of the
+letters below. The default for both figure and table, in
+both article and book classes, is tbp.
+
t(Top)—at the top of a text page. +
+b(Bottom)—at the bottom of a text page. (However, b is not
+allowed for full-width floats (figure*) with double-column
+output. To ameliorate this, use the stfloats or
+dblfloatfix package, but see the discussion at caveats in the
+FAQ: https://www.texfaq.org/FAQ-2colfloat.
+
h(Here)—at the position in the text where the figure environment
+appears. However, h is not allowed by itself; t is
+automatically added.
+
To absolutely force a float to appear “here”, you can
+\usepackage{float} and use the H specifier which it
+defines. For further discussion, see the FAQ entry at
+https://www.texfaq.org/FAQ-figurehere.
+
p ¶(Page of floats)—on a separate float page, which is a page +containing no text, only floats. +
+!Used in addition to one of the above; for this float only, LaTeX
+ignores the restrictions on both the number of floats that can appear
+and the relative amounts of float and non-float text on the page.
+The ! specifier does not mean “put the float here”;
+see above.
+
Note: the order in which letters appear in the placement argument
+does not change the order in which LaTeX tries to place the float;
+for instance, btp has the same effect as tbp. All that
+placement does is that if a letter is not present then the
+algorithm does not try that location. Thus, LaTeX’s default of
+tbp is to try every location except placing the float where it
+occurs in the source.
+
To prevent LaTeX from moving floats to the end of the document or a
+chapter you can use a \clearpage command to start a new page and
+insert all pending floats. If a pagebreak is undesirable then you can
+use the afterpage package and issue
+\afterpage{\clearpage}. This will wait until the current page
+is finished and then flush all outstanding floats.
+
LaTeX can typeset a float before where it appears in the source
+(although on the same output page) if there is a t specifier in
+the placement parameter. If this is not desired, and deleting
+the t is not acceptable as it keeps the float from being placed
+at the top of the next page, then you can prevent it by either using
+the flafter package or using the command
+
+\suppressfloats[t], which causes floats for the top position on
+this page to moved to the next page.
+
Parameters relating to fractions of pages occupied by float and
+non-float text (change them with
+\renewcommand{parameter}{decimal between 0 and 1}):
+
\bottomfraction ¶The maximum fraction of the page allowed to be occupied by floats at +the bottom; default ‘.3’. +
+\floatpagefraction ¶The minimum fraction of a float page that must be occupied by floats; +default ‘.5’. +
+\textfraction ¶Minimum fraction of a page that must be text; if floats take up too +much space to preserve this much text, floats will be moved to a +different page. The default is ‘.2’. +
+\topfraction ¶Maximum fraction at the top of a page that may be occupied before +floats; default ‘.7’. +
Parameters relating to vertical space around floats (change them with a
+command of the form \setlength{parameter}{length
+expression}):
+
\floatsep ¶Space between floats at the top or bottom of a page; default +‘12pt plus2pt minus2pt’. +
+\intextsep ¶Space above and below a float in the middle of the main text; default +‘12pt plus2pt minus2pt’ for 10 point and 11 point documents, +and ‘14pt plus4pt minus4pt’ for 12 point documents. +
+\textfloatsep ¶Space between the last (first) float at the top (bottom) of a page; +default ‘20pt plus2pt minus4pt’. +
Counters relating to the number of floats on a page (change them with a
+command of the form \setcounter{ctrname}{natural
+number}):
+
bottomnumber ¶Maximum number of floats that can appear at the bottom of a text page; +default 1. +
+dbltopnumber ¶Maximum number of full-sized floats that can appear at the top of a +two-column page; default 2. +
+topnumber ¶Maximum number of floats that can appear at the top of a text page; +default 2. +
+totalnumber ¶Maximum number of floats that can appear on a text page; default 3. +
The principal TeX FAQ entry relating to floats +https://www.texfaq.org/FAQ-floats contains +suggestions for relaxing LaTeX’s default parameters to reduce the +problem of floats being pushed to the end. A full explanation of the +float placement algorithm is in Frank Mittelbach’s article “How to +influence the position of float environments like figure and table in +LaTeX?” +(https://www.latex-project.org/publications/2014-FMi-TUB-tb111mitt-float-placement.pdf). +
+ + +\captiontableSynopsis: +
+\begin{table}[placement]
+ table body
+ \caption[loftitle]{title} % optional
+ \label{label} % also optional
+\end{table}
+A class of floats (see Floats). They cannot be split across pages +and so they are not typeset in sequence with the normal text but instead +are floated to a convenient place, such as the top of a following page. +
+This example table environment contains a tabular
+
\begin{table}
+ \centering\small
+ \begin{tabular}{ll}
+ \multicolumn{1}{c}{\textit{Author}}
+ &\multicolumn{1}{c}{\textit{Piece}} \\ \hline
+ Bach &Cello Suite Number 1 \\
+ Beethoven &Cello Sonata Number 3 \\
+ Brahms &Cello Sonata Number 1
+ \end{tabular}
+ \caption{Top cello pieces}
+ \label{tab:cello}
+\end{table}
+but you can put many different kinds of content in a table:
+the table body may contain text, LaTeX commands, graphics, etc. It is
+typeset in a parbox of width \textwidth.
+
For the possible values of placement and their effect on the +float placement algorithm, see Floats. +
+The label is optional; it is used for cross references (see Cross references).
+
+The \caption command is also optional. It specifies caption
+text title for the table (see \caption). By default it is
+numbered. If its optional lottitle is present then that text is
+used in the list of tables instead of title (see Table of contents, list of figures, list of tables).
+
In this example the table and caption will float to the bottom of a page, +unless it is pushed to a float page at the end. +
+\begin{table}[b]
+ \centering
+ \begin{tabular}{r|p{2in}} \hline
+ One &The loneliest number \\
+ Two &Can be as sad as one.
+ It's the loneliest number since the number one.
+ \end{tabular}
+ \caption{Cardinal virtues}
+ \label{tab:CardinalVirtues}
+\end{table}
+tabularSynopsis: +
+\begin{tabular}[pos]{cols}
+ column 1 entry &column 2 entry ... &column n entry \\
+ ...
+\end{tabular}
+or +
+\begin{tabular*}{width}[pos]{cols}
+ column 1 entry &column 2 entry ... &column n entry \\
+ ...
+\end{tabular*}
+Produce a table, a box consisting of a sequence of horizontal rows. +Each row consists of items that are aligned vertically in columns. This +illustrates many of the features. +
+\begin{tabular}{l|l}
+ \textit{Player name} &\textit{Career home runs} \\
+ \hline
+ Hank Aaron &755 \\
+ Babe Ruth &714
+\end{tabular}
+The output will have two left-aligned columns with a vertical bar
+between them. This is specified in tabular’s argument
+{l|l}.
+
+Put the entries into different columns by separating them with an
+ampersand, &. The end of each row is marked with a double
+backslash, \\. Put a horizontal rule below a row, after a double
+backslash, with \hline.
+
+After the last row the \\ is optional, unless an \hline
+command follows to put a rule below the table.
+
The required and optional arguments to tabular consist of:
+
Optional. Specifies the table’s vertical position. The default is to
+align the table so its vertical center matches the baseline of the
+surrounding text. There are two other possible alignments: t
+aligns the table so its top row matches the baseline of the surrounding
+text, and b aligns on the bottom row.
+
This only has an effect if there is other text. In the common case of a
+tabular alone in a center environment this option makes
+no difference.
+
Required. Specifies the formatting of columns. It consists of a +sequence of the following specifiers, corresponding to the types of +column and intercolumn material. +
+lA column of left-aligned items. +
+rA column of right-aligned items. +
+cA column of centered items. +
+|A vertical line the full height and depth of the environment. +
+@{text or space}Insert text or space at this location in every row. The text
+or space material is typeset in LR mode. This text is fragile
+(see \protect).
+
If between two column specifiers there is no @-expression then
+LaTeX’s book, article, and report classes will
+put on either side of each column a space of width \tabcolsep,
+which by default is 6pt. That is, by default adjacent columns are
+separated by 12pt (so \tabcolsep is misleadingly named
+since it is only half of the separation between tabular columns). In
+addition, a space of \tabcolsep also comes before the first
+column and after the final column, unless you put a @{...}
+there.
+
If you override the default and use an @-expression then LaTeX does
+not insert \tabcolsep so you must insert any desired space
+yourself, as in @{\hspace{1em}}.
+
An empty expression @{} will eliminate the space. In
+particular, sometimes you want to eliminate the space before the first
+column or after the last one, as in the example below where the
+tabular lines need to lie on the left margin.
+
\begin{flushleft}
+ \begin{tabular}{@{}l}
+ ...
+ \end{tabular}
+\end{flushleft}
+The next example shows text, a decimal point between the columns, +arranged so the numbers in the table are aligned on it. +
+\begin{tabular}{r@{$.$}l}
+ $3$ &$14$ \\
+ $9$ &$80665$
+\end{tabular}
+An \extracolsep{wd} command in an @-expression causes an
+extra space of width wd to appear to the left of all subsequent
+columns, until countermanded by another \extracolsep. Unlike
+ordinary intercolumn space, this extra space is not suppressed by an
+@-expression. An \extracolsep command can be used only in an
+@-expression in the cols argument. Below, LaTeX inserts the
+right amount of intercolumn space to make the entire table 4 inches
+wide.
+
\begin{tabular*}{4in}{l@{\extracolsep{\fill}}l}
+ Seven times down, eight times up \ldots
+ &such is life!
+\end{tabular*}
+To insert commands that are automatically executed before a given
+column, load the array package and use the >{...}
+specifier.
+
p{wd}Each item in the column is typeset in a parbox of width wd, as if
+it were the argument of a \parbox[t]{wd}{...} command.
+
A line break double backslash \\ may not appear in the item,
+except inside an environment like minipage, array, or
+tabular, or inside an explicit \parbox, or in the scope of
+a \centering, \raggedright, or \raggedleft
+declaration (when used in a p-column element these declarations
+must appear inside braces, as with {\centering .. \\
+..}). Otherwise LaTeX will misinterpret the double backslash as
+ending the tabular row. Instead, to get a line break in there use
+\newline (see \newline).
+
*{num}{cols}Equivalent to num copies of cols, where num is a
+positive integer and cols is a list of specifiers. Thus the
+specifier \begin{tabular}{|*{3}{l|r}|} is equivalent to
+the specifier \begin{tabular}{|l|rl|rl|r|}. Note that
+cols may contain another *-expression.
+
Required for tabular*, not allowed for tabular. Specifies
+the width of the tabular* environment. The space between columns
+should be rubber, as with @{\extracolsep{\fill}}, to allow
+the table to stretch or shrink to make the specified width, or else you
+are likely to get the Underfull \hbox (badness 10000) in alignment
+... warning.
+
Parameters that control formatting: +
+\arrayrulewidth ¶A length that is the thickness of the rule created by |,
+\hline, and \vline in the tabular and array
+environments. The default is ‘.4pt’. Change it as in
+\setlength{\arrayrulewidth}{0.8pt}.
+
\arraystretch ¶A factor by which the spacing between rows in the tabular and
+array environments is multiplied. The default is ‘1’, for
+no scaling. Change it as \renewcommand{\arraystretch}{1.2}.
+
\doublerulesep ¶A length that is the distance between the vertical rules produced by the
+|| specifier. The default is ‘2pt’.
+
\tabcolsep ¶A length that is half of the space between columns. The default is
+‘6pt’. Change it with \setlength.
+
The following commands can be used inside the body of a tabular
+environment, the first two inside an entry and the second two between
+lines:
+
\multicolumn\vline\cline\hline