Latex Figure

Latex Figure




πŸ”ž ALL INFORMATION CLICK HERE πŸ‘ˆπŸ»πŸ‘ˆπŸ»πŸ‘ˆπŸ»

































Latex Figure
\documentclass { article }
\usepackage { float }
\begin { document }
\begin { figure } [H]
%figure content goes here
%Can be:
%graphic
%table
%tikz drawing
%etc.
\end { figure }
\end { document }

\documentclass { article }
\usepackage { float }
\usepackage { graphicx }
\begin { document }
\begin { figure } [H]
\centering
\includegraphics [scale=1.5] { atom.png }
\end { figure }
\end { document }

\documentclass { article }
\usepackage { float }
\usepackage { graphicx }
\begin { document }
\begin { figure } [H]
\centering
\includegraphics [scale=1.5] { atom.png }
\caption { This is an atom }
\end { figure }
\end { document }

\documentclass { article }
\usepackage { float }
\usepackage { graphicx }
\usepackage { caption }
\usepackage { subcaption }
\begin { document }
\begin { figure } [H]
\centering
\begin { subfigure }{ .3 \textwidth }
\includegraphics [width=\textwidth] { atom.png }
\caption { Atom 1 }
\end { subfigure }
%%%%%%%%%%%%%%
\begin { subfigure }{ .3 \textwidth }
\includegraphics [width=\textwidth] { atom.png }
\caption { Atom 2 }
\end { subfigure }
%%%%%%%%%%%%%%
\begin { subfigure }{ .3 \textwidth }
\includegraphics [width=\textwidth] { atom.png }
\caption { Atom 3 }
\end { subfigure }
\caption { Atoms are fun! }
\end { figure }
\end { document }

This section will give an overview of floats and figures. It will cover importing external graphics and positioning. It will also cover sub-figures and captions.
We have already seen in the last section that it is often useful to enclose a tabular environment in a table environment. The table environment is an example of a float . Floats are blocks of content that "float" around the page in the sense that LaTeX chooses where to place them based on certain algorithms.
In general, it is a good idea to let LaTeX place the float where it wants, at least at first, when you have the entire document written you can then go back and change it if you wish. If you use the float package, one can override the LaTeX placement with custom options.

The code below on the right right gives an example of a typical float environment with special placement. Here the specifier is H . The table below on the left lists some of the possible specifiers (you can of course define your own).
Note: The float package is not necessary if you wish to let LaTeX place the figure for you.
Often it is useful, if not necessary, to include graphics inside a LaTeX document. For the remainder of this section, we are going to use the image to the right in our code. You can of course use any image you wish, but in order to provide proper consistency, you can right click and download this picture of an atom from wikipedia (I like atoms).

The code on the right imports a figure and places it into a document while scaling it by 1.5x.

It appears you don't have a PDF plugin for this browser. You can click here to download the PDF file.
Warning! Notice that this picture looks pixelated, especially at this scale. One must be careful to use high enough quality images. Preferable are vectorized graphics which will scale without pixelation.
This syntax is fairly self-explanatory, however, one thing to note is the use of the \centering command. There are other ways to center a figure, but this is the correct way to do it inside a float environment. You will almost always be using this command when using floats.
The \includegraphics command is part of the graphicx package and can import all the usual file formats including pdf, jpeg, png, etc. The command also accepts other options instead of scale such as rotation , height , width , bounding box , etc.
Lets take the figure we had before and add a caption to it. Where the caption goes in relation to the \includegraphics command will determine where it is placed on the page. Play with this to see what happens.
It appears you don't have a PDF plugin for this browser. You can click here to download the PDF file.
When one wants to put multiple subfigures inside a subfigure, one must use two packages, caption and subcaption . There are other packages such as subfigure and subfig, however, these are no longer considered standard.
Try the code below to see three subfigures within a figure, each with a separate caption in addition to a global caption.
It appears you don't have a PDF plugin for this browser. You can click here to download the PDF file.
Each subfigure is treated like a normal figure in relation to the containing float. The \textwidth simply tells the compiler to make the width of the subfigure .3 times the width of the allowed width of the text (the page width minus the margins).
However, inside the \includegraphics command, we set width=\textwidth . This is because inside the subfigure enviornment, the \textwidth command has been redefined to the width of the subfigure.
Created by Zachary Glassman. Contact at zach.glassman@gmail.com
Place exactly at spot in source text
Place approximately at spot in source test
Override internal LaTeX parameters for determining float position

\begin { figure } [placement specifier]
... figure contents ...
\end { figure }

\usepackage { float }
\floatstyle { boxed }
\restylefloat { figure }

\begin { table }
\begin { tabular }{ ... }
... table data ...
\end { tabular }
\end { table }

\documentclass [a4paper,12pt] { article }

\usepackage [english] { babel }
\usepackage { graphicx }

\begin { document }

\begin { figure }
\caption { A picture of a gull. }
\centering
\includegraphics [width=0.5\textwidth] { gull }
\end { figure }

\begin { figure }
\centering
\reflectbox { %
\includegraphics [width=0.5\textwidth] { gull }}
\caption { A picture of the same gull
looking the other way! }
\end { figure }

\begin { table }
\centering
\begin { tabular }{ | l c r | }
\hline
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \\
\hline
\end { tabular }
\caption { A simple table }
\end { table }

Notice how the tables and figures
have independent counters.

\end { document }

\documentclass { article }

\usepackage { graphicx }
\usepackage { sidecap }

\begin { document }

\begin { SCfigure }
\centering
\caption { ... caption text ... }
\includegraphics [width=0.3\textwidth] %
{ Giraffe _ picture } % picture filename
\end { SCfigure }

\end { document }

\usepackage { caption }
\captionsetup [table] { name=New Table Name }

\documentclass [12pt,] { article }
\usepackage { graphicx }
\newcommand { \species } [1] { \textit { #1 } sp. }
\begin { document }

\listoffigures
\section { Introduction }

\begin { figure }
\centering
\includegraphics [width=4in] { gecko }
\caption [Close up of \species{Hemidactylus}]
{ Close up of \species { Hemidactylus } , which is part the genus of the gecko family. It is the second most speciose genus in the family. }
\end { figure }

\end { document }

\begin { wrapfigure } [lineheight] { position } [overhang] { width }

\begin { wrapfigure }{ r }{ 0.5 \textwidth }
\begin { center }
\includegraphics [width=0.48\textwidth] { gull }
\end { center }
\caption { A gull }
\end { wrapfigure }

\begin { wrapfigure }{ r }{ 0.5 \textwidth }
\vspace { -20pt }
\begin { center }
\includegraphics [width=0.48\textwidth] { gull }
\end { center }
\vspace { -20pt }
\caption { A gull }
\vspace { -10pt }
\end { wrapfigure }

\usepackage { graphicx }
\usepackage { subcaption }

\begin { figure }
\centering
\begin { subfigure } [b] { 0.3 \textwidth }
\includegraphics [width=\textwidth] { gull }
\caption { A gull }
\label { fig:gull }
\end { subfigure }
~ %add desired spacing between images, e. g. ~, \quad, \qquad, \hfill etc.
%(or a blank line to force the subfigure onto a new line)
\begin { subfigure } [b] { 0.3 \textwidth }
\includegraphics [width=\textwidth] { tiger }
\caption { A tiger }
\label { fig:tiger }
\end { subfigure }
~ %add desired spacing between images, e. g. ~, \quad, \qquad, \hfill etc.
%(or a blank line to force the subfigure onto a new line)
\begin { subfigure } [b] { 0.3 \textwidth }
\includegraphics [width=\textwidth] { mouse }
\caption { A mouse }
\label { fig:mouse }
\end { subfigure }
\caption { Pictures of animals } \label { fig:animals }
\end { figure }

\begin { table } []
\begin { subtable } [] { }
\centering
... table 1 ...
\caption { }
\end { subtable }
~
\begin { subtable } [] { }
\centering
... table 2 ...
\caption { }
\end { subtable }
\end { table }

\usepackage { caption }
\DeclareCaptionLabelFormat { cont }{ #1~#2 \alph { ContinuedFloat }}
\captionsetup [ContinuedFloat] { labelformat=cont }

\begin { figure }
\ContinuedFloat*
\[ e^{i \pi } + 1 = 0 \]
\caption { Euler's identity, first form. }
\end { figure }
\begin { figure }
\ContinuedFloat
\[ e^{i \pi } = - 1 \]
\caption { Euler's identity, second form. }
\end { figure }

\documentclass { article }

\usepackage { float }

\floatstyle { ruled }
\newfloat { program }{ thp }{ lop }
\floatname { program }{ Program }

\begin { document }

\begin { program }
\begin { verbatim }

class HelloWorldApp {
public static void main(String[] args) {
//Display the string
System.out.println("Hello World!");
}
}
\end { verbatim }
\caption { The Hello World! program in Java. }
\end { program }

\end { document }

\documentclass { article }

% have hyperref package before float in order to get strange errors with .\theHfloatbox
\usepackage { hyperref }

\usepackage { float }

% allows use of "@" in control sequence names
\makeatletter

% this creates a custom and simpler ruled box style
\newcommand\floatc @simplerule[2] {{ \@ fs@cfont #1 #2 } \par }
\newcommand\fs @simplerule { \def\@ fs@cfont { \bfseries } \let\@ fs@capt \floatc @simplerule
\def\@ fs@pre { \hrule height.8pt depth0pt \kern 4pt } %
\def\@ fs@post { \kern 4pt \hrule height.8pt depth0pt \kern 4pt \relax } %
\def\@ fs@mid { \kern 8pt } %
\let\@ fs@iftopcapt \iftrue }

% this code block defines the new and custom floatbox float environment
\floatstyle { simplerule }
\newfloat { floatbox }{ thp }{ lob } [section]
\floatname { floatbox }{ Text Box }

\begin { document }

\begin { floatbox }{ r }{}
\textit { Bootstrapping } is a resampling technique used
for robustly estimating statistical quantities, such as
the model fit $ R^ 2 $ . It offers some protection against
the sampling bias.
\caption { Bootstrapping }
\end { floatbox }

\end { document }

\usepackage [font=small,labelfont=bf] { caption }

\renewcommand { \thefigure }{ \arabic { section } . \arabic { figure }}



Last edited 2 years ago by 185.89.35.4



The previous chapter introduced importing graphics. However, just having a picture stuck in between paragraphs does not look professional. To start with, we want a way of adding captions, and to be able to cross-reference. What we need is a way of defining figures . It would also be good if LaTeX could apply principles similar to when it arranges text to look its best to arrange pictures as well. This is where floats come into play.

Floats are containers for things in a document that cannot be broken over a page. LaTeX by default recognizes "table" and "figure" floats, but you can define new ones of your own (see Custom floats below). Floats are there to deal with the problem of the object that won't fit on the present page and to help when you really don't want the object here just now.

Floats are not part of the normal stream of text, but separate entities, positioned in a part of the page to themselves (top, middle, bottom, left, right, or wherever the designer specifies). They always have a caption describing them and they are always numbered so they can be referred to from elsewhere in the text. LaTeX automatically floats Tables and Figures, depending on how much space is left on the page at the point that they are processed. If there is not enough room on the current page, the float is moved to the top of the next page. This can be changed by moving the Table or Figure definition to an earlier or later point in the text, or by adjusting some of the parameters which control automatic floating.

Authors sometimes have many floats occurring in rapid succession, which raises the problem of how they are supposed to fit on the page and still leave room for text. In this case, LaTeX stacks them all up and prints them together if possible, or leaves them to the end of the chapter in protest. The skill is to space them out within your text so that they intrude neither on the thread of your argument or discussion nor on the visual balance of the typeset pages.

As with various other entities, there exist limitations on the number of unprocessed (placed) floats in line. LaTeX by default can cope with maximum 18 floats and a symptomatic error is:

The morefloats package lifts this limit.

To create a figure that floats, use the figure environment.

The previous section mentioned how floats are used to allow LaTeX to handle figures while maintaining the best possible presentation. However, there may be times when you disagree, and a typical example is with its positioning of figures. The placement specifier parameter exists as a compromise, and its purpose is to give the author a greater degree of control over where certain floats are placed.

What you do with these placement permissions is to list which of the options you wish to make available to LaTeX. These are simply possibilities, and LaTeX will decide when typesetting your document which of your supplied specifiers it thinks is best. Frank Mittelbach describes the algorithm [2] :

In some special cases, LaTeX won't follow these positioning parameters and additional commands will be necessary, for example, if one needs to specify an alignment other than centered for a float that sits alone in one page [3] .

Use \listoffigures to add a list of the figures in the beginning of the document.
To change the name used in the caption from Figure to Example ,
use \renewcommand { \figurename }{ Example } in the figure contents.

It's possible to get a thin border around all figures. You have to write the following once at the beginning of
the document:

The border will not include the caption.

Floating tables are covered in a separate chapter .
Let's give a quick reminder here. The tabular environment that was used to construct the tables is not a float by default. Therefore, for tables you wish to float, wrap the tabular environment within a table environment, like this:

You may feel that it is a bit long-winded, but such distinctions are necessary, because you may not want all tables to be treated as a float.

Use \listoftables to add a list of the tables in the beginning of the document.

The placeins [1] package provides the command \FloatBarrier , which can be used to prevent floats from being moved over it. This can, e.g., be useful at the beginning of each section. The package even provides an option to change the definition of \section to automatically include a \FloatBarrier . This can be set by loading the package with the option [section] ( \usepackage [section] { placeins } ). \FloatBarrier may also be useful to prevent floats intruding on lists created using itemize or enumerate .

The flafter package can be used to force floats to appear after they are defined, and the endfloat [2] package can be used to place all floats at the end of a document.

The float [3] package provides the H option to floating environments, which completely stops them from floating.

Package caption [4] provides the command \captionof { }{ } that lets you typeset a caption without a floating environment. You have the full and absolute control about the placement of your figures and captions.

It is always good practice to add a caption to any figure or table. Fortunately, this is very simple in LaTeX. All you need to do is use the \caption { ''text'' } command within the float environment. LaTeX will automatically keep track of the numbering of figures, so you do not need to include this within the caption text.

The location of the caption is traditionally underneath the float. However, it is up to you to, therefore, insert the caption command after the actual contents of the float (but still within the environment). If you place it before, then the caption will appear above the float. Try out the following example to demonstrate this effect:

Note that the command \reflectbox { ... } flips its content horizontally.

It is sometimes desirable to have a caption appear on the side of a float, rather than above or below. The sidecap package can be used to place a caption beside a figure or table. The following example demonstrates this for a figure by using a SCfigure environment in place of the figure environment. The floatrow package is newer and has more capabilities.

In some types of documents (such as presentations), it may not be desirable for figure captions to start with Figure: . This is easy to suppress by just placing the caption text in the figure environment, without enclosing it in a caption . This however means that there is no caption available for inclusion in a list of figures.

In case you want to rename your table caption from "Table" to something else, you can use the \captionsetup command. For example,

Captions can be listed at the beginning of a paper or report in a "List of Tables" or a "List of Figures" section by using the \listoftables or \listoffigures commands, respectively. The caption used for each figure will appear in these lists, along with the figure numbers, and page numbers that they appear on.

The \caption command also has an optional parameter, \caption [''short''] { ''long'' } which is used for the List of Tables or List of Figures . Typically the short description is for the caption listing, and the long description will be placed beside the figure or table. This is particularly useful if the caption is long, and only a "one-liner" is desired in the figure/table listing. Here is an example of this usage:

Labels and cross-references work fairly similarly to the general case - see the Labels and Cross-referencing section for more information.

If the label picks up the section or list number instead of the figure number, put the label inside the caption to ensure correct numbering. If you get an error when the label is inside the caption, use \protect in front of the \label command.

An author may prefer that some floats do not break the flow of text, but instead allow text to wrap around it. (Obviously, this effect only looks decent when the figure in question is significantly narrower than the text width.)

A word of
Porno Foto Asian Girl
Hot Very Young Porno
Husband Cuckold Video

Report Page