SlideShare a Scribd company logo
Indian TEX Users Group

URL: http://www.river-valley.com/tug

Creating Float . . .
Figure Placement
Customizing . . .

9

Using Graphics . . .
Rotating and . . .

Title Page

A
On-line Tutorial on LTEX
The Tutorial Team
Indian TEX Users Group, SJP Buildings, Cotton Hills
Trivandrum 695014, INDIA
2000
Prof. (Dr.) K. S. S. Nambooripad, Director, Center for Mathematical Sciences, Trivandrum, (Editor); Dr. E. Krishnan,
Reader in Mathematics, University College, Trivandrum; Mohit Agarwal, Department of Aerospace Engineering,
Indian Institute of Science, Bangalore; T. Rishi, Focal Image (India) Pvt. Ltd., Trivandrum; L. A. Ajith, Focal Image
(India) Pvt. Ltd., Trivandrum; A. M. Shan, Focal Image (India) Pvt. Ltd., Trivandrum; C. V. Radhakrishnan, River
Valley Technologies, Software Technology Park, Trivandrum constitute the Tutorial team
A
A
This document is generated from LTEX sources compiled with pdfLTEX v. 14e in an
INTEL Pentium III 700 MHz system running Linux kernel version 2.2.14-12. The
packages used are hyperref.sty and pdfscreen.sty

c 2000, Indian TEX Users Group. This document may be distributed under the terms of the
A
A
LTEX Project Public License, as described in lppl.txt in the base LTEX distribution, either
version 1.0 or, at your option, any later version

Page 1 of 13

Go Back

Full Screen

Close

Quit
9 The Figure Environment
Creating Float . . .
Figure Placement
Customizing . . .

Figures are really problematical to present in a document because they never split between
pages. These leads to bad page breaks which leave blank space at the bottom of pages. For the
fine-tuning of that document, typesetter has to adjust the page breaks manually.
A
But LTEX provides floating figures which automatically move to suitable locations. So the
A
positioning of figures is the duty of LTEX.

9.1.

Using Graphics . . .

Title Page

Rotating and . . .

Creating Floating Figures
Floating figures are created by putting commands in a figure environment. The contents of the
figure environment always remains in one chunk, floating to produce good page breaks. The
following commands put the graphic from figure.eps inside a floating figure

Page 2 of 13

Go Back

begin{figure}
centering
includegraphics{figure.eps}
caption{This is an inserted EPS graphic}
label{fig1}
end{figure}

Full Screen

Close

Quit
Features
The optional label command, can be used with the ref,
and pageref commands to reference the caption. The
label command must be placed immediately after the

¤¥ ¤¢ 
¦ £ ¡

caption

Customizing . . .
¤¨ ¤!¨ "
% $ #

¡ $ £ ¤¤¨ 
) (

Using Graphics . . .
Rotating and . . .

 $ # (
¤ ¤!¤¨ ¦' $ 

If the figure environment contains multiple caption commands, it produces multiple figures which float together.
This is useful in constructing side-by-side graphics or
complex arrangements.

Creating Float . . .
Figure Placement

  
!¨ ¤

If the figure environment contains no caption commands, it produces an unnumbered floating figure.

  ¨
¨  ¤ £ ©§

9.1.1.

Figure 1. This is an inserted EPS
graphic

Title Page

A list of figures is generated by the listoffigures command.
By default, the caption text is used as the caption and also in the list of figures. The caption
has an optional argument which specifies the list-of-figure entry. For example,
caption[List Text]{Caption Text}

causes “Caption Text” to appear in the caption, but “List Text” to appear in the list of
figures. This is useful when using long, descriptive captions.
The figure environment can only be used in outer paragraph mode, preventing it from
being used inside any box (such as parbox or minipage).
Figure environments inside the paragraphs are not processed until the end of the paragraph.
For example:

Page 3 of 13

Go Back

Full Screen

Close

Quit
............. text text text text text text
begin{figure}
.........
end{figure}
............. text text text text text text

Creating Float . . .
Figure Placement
Customizing . . .
Using Graphics . . .
Rotating and . . .

9.2.

Figure Placement
Title Page

The figure environment has an optional argument which allows users to specify possible figure
locations. The optional argument can contain any combination of the letters: h, t, b, p.
h Place the figure in the text where the figure command is located. This option
cannot be executed if there is not enough room remaining on the page.
t Place the figure at the top of the page.
b Place the figure at the bottom of a page.

Page 4 of 13

p Place the figure on a page containing only floats.
Go Back

If no optional arguments are given, the placement options default to [tbp].
Full Screen
A
When we input a float, LTEX will read that float and hold it until it can place that at a better
A
location. Unprocessed floats are those which are read by LTEX but not yet placed on the page.
A
Though the float-placing is done by LTEX, sometimes user has to do something to process
unprocessed floats. Following commands will do that job:

Close

Quit
clearpage

This command places unprocessed floats and starts a new page.

FloatBarrier

This command causes all unprocessed floats to be processed. This
is provided by the placeins package. It does not start a new page,
unlike clearpage.

Creating Float . . .
Figure Placement
Customizing . . .

Since it is often desirable to keep floats in the section in which they were issued, the section
option
usepackage[section]{placeins}

Using Graphics . . .
Rotating and . . .

Title Page

redefines the section command, inserting a FloatBarrier command before each section.
Note that this option is very strict. This option does not allow a float from the old section to
appear at the bottom of the page, since that is after the start of a new section.
The below option
Page 5 of 13

usepackage[below]{placeins}
Go Back

is a less-restrictive version of the section option. It allows floats to be placed after the beginning
of a new section, provided that some of the old section appears on the page.

afterpage/clearpage

The afterpage package provides the afterpage command which
executes a command at the next naturally-ocurring page break.

Full Screen

Close

Quit
Therefore, using afterpage{clearpage} causes all unprocessed floats to be cleared at the
next page break. afterpage{clearpage} is especially useful when producing small floatpage
figures.

9.3.

Customizing Float Placement

Creating Float . . .
Figure Placement
A
LT

The following style parameters are used by EX to prevent awkward-looking pages which
contain too many floats or badly-placed floats.

Customizing . . .
Using Graphics . . .
Rotating and . . .

9.3.1.

Float Placement Counters
Title Page

topnumber

The maximum number of floats allowed at the top of a text page
(the default is 2)

bottomnumber

The maximum number of floats allowed at the bottom of a text
page (the default is 1)

totalnumber

The maximum number of floats allowed on any one text page (the
default is 3)

Page 6 of 13

Go Back

Full Screen
A
These counters prevent LTEX from placing too many floats on a text page. These counters do
A
not affect float pages. Specifying a ! in the float placement options causes LTEX to ignore these
parameters. The values of these counters are set with the setcounter command. For example,

Close

Quit
setcounter{totalnumber}{2}

prevents more than two floats from being placed on any text page.

Creating Float . . .
Figure Placement
Customizing . . .

9.3.2.

Figure Fractions

Using Graphics . . .
Rotating and . . .

The commands in the below table control what fraction of a page can be covered by floats
(where “fraction” refers to the height of the floats divided by textheight). The first three
commands pertain only to text pages, while the last command pertains only to float pages.
A
Specifying a ! in the float placement options causes LTEX to ignore the first three parameters,
but floatpagefraction is always used. The value of these fractions are set by renewcommand.
For example,

Title Page

renewcommand{textfraction}{0.3}

Page 7 of 13

textfraction

The minimum fraction of a text page which must be occupied by
text. The default is 0.2, which prevents floats from covering more
than 80% of a text page.

Go Back

Full Screen

Close

Quit
topfraction

The maximum fraction of a text page which can be occupied by
floats at the top of the page. The default is 0.7, which prevents any
float whose height is greater than 70% of textheight from being
placed at the top of a page.

Creating Float . . .
Figure Placement
Customizing . . .

bottomfraction

floatpagefraction

The maximum fraction of a text page which can be occupied by
floats at the bottom of the page. The default is 0.3, which prevents
any float whose height is greater than 40% of textheight from
being placed at the bottom of a text page.

Using Graphics . . .
Rotating and . . .

Title Page

The minimum fraction of a float page that must be occupied by
floats. Thus the fraction of blank space on a float page cannot be
more than 1-floatpagefraction. The default is 0.5.

Page 8 of 13

9.4.

A
Using Graphics in LTEX

A
A
This section shows the methods to use graphics in LTEX documents. While LTEX can import
virtually any graphics format, Encapsulated PostScript (EPS) is the easiest graphics format to
A
import into LTEX. The ‘eps’ files are inserted into the file using command includegraphics{file.eps}

Go Back

Full Screen

Close

Quit
9.4.1.

The includegraphics Command

includegraphics[options]{filename}
Creating Float . . .

Following are the options available in includegraphics command:

Figure Placement
Customizing . . .

width

The width of the graphics (in any of the accepted TEX units).

height

The height of the graphics (in any of the accepted TEX units).

totalheight

The totalheight of the graphics (in any of the accepted TEX units).

scale

Scale factor for the graphic. Specifying scale=2 makes the graphic twice
as large as its natural size.

angle

Using Graphics . . .

Specifies the angle of rotation, in degrees, with a counter-clockwise
(anti-clockwise) rotation being positive.

Rotating and . . .

Title Page

Page 9 of 13

Go Back

Full Screen

Close

Quit
includegraphics[width=.5textwidth]{filename}
includegraphics[height=2in]{filename}
includegraphics[totalheight=2in]{filename}
includegraphics[scale=2]{filename}
Creating Float . . .
Figure Placement
Customizing . . .
Using Graphics . . .
Rotating and . . .

Title Page

includegraphics[width=1in]{duck}

includegraphics[height=1.5in]{duck}

Page 10 of 13

Go Back

Full Screen

includegraphics[scale=.25,angle=45]{duck}

includegraphics[scale=.25,angle=90]{duck}
Close

Quit
9.4.2.

Graphics Search Path
A
By default, LTEX looks for graphics files in any directory on the TEX search path. In addition to
A
these directories, LTEX also looks in any directories specified in the graphicspath command.
For example,
Creating Float . . .

graphicspath{{dir1/}{dir2/}}

Figure Placement
Customizing . . .
Using Graphics . . .

A
tells LTEX to also look for graphics files in dir1/ and dir2/. For Macintosh, this becomes

graphicspath{{dir1:}{dir2:}}

9.4.3.

Rotating and . . .

Title Page

Graphics Extensions
A
The DeclareGraphicsExtensions command tells LTEX which extensions to try if a file with
no extension is specified in the includegraphics command. For convenience, a default set of
extensions is pre-defined depending on which graphics driver is selected. For example if dvips
is used, the following graphic extensions (defined in dvips.def) are used by default

Page 11 of 13

Go Back

DeclareGraphicsExtensions{.eps,.ps,.eps.gz,.ps.gz,.eps.Z}
Full Screen

With the above graphics extensions specified, includegraphics{file} first looks for file.eps,
then file.ps, then file file.eps.gz, etc. until a file is found. This allows the graphics to be
specified with

Close

Quit
includegraphics{file}

instead of
Creating Float . . .

includegraphics{file.eps}

Figure Placement
Customizing . . .
Using Graphics . . .

9.5.

Rotating and Scaling Objects
In addition to the includegraphics command, the graphicx package includes 4 other comA
mands which rotates and scale any LTEX object: text, EPS graphic, etc.

Rotating and . . .

Title Page

scalebox{2}{includegraphics{file.eps}}
resizebox{4in}{!}{includegraphics{file.eps}}
rotatebox{45}{includegraphics{file.eps}}
Page 12 of 13

produces the same three graphics as
Go Back

includegraphics[scale=2]{file.eps}
includegraphics[width=4in]{file.eps}
includegraphics[angle=45]{file.eps}

For example, the following is produced with

Full Screen

Close

Quit
LA
T
EX

LA
T
EX

rotatebox{45}{fbox{Large
textcolor{blue}{LaTeX}}}

rotatebox{180}{fbox{Large
textcolor{blue}{LaTeX}}}

Creating Float . . .
Figure Placement

However, the includegraphics is preferred because it is faster and produces more efficient
PostScript.

Customizing . . .
Using Graphics . . .
Rotating and . . .

Title Page

Page 13 of 13

Go Back

Full Screen

Close

Quit

More Related Content

PDF
Latex tutorial
PDF
Course 1 media, culture and society 1
PDF
Cultuurforum 2016 Samenwerking binnen eigen sector
PPTX
Los blogs
PDF
Tomar Decisiones... Entre la Incertidumbre y la Asertividad
DOC
retail report
PDF
The truth seeker
PDF
Optimal content downloading in vehicular network with density measurement
Latex tutorial
Course 1 media, culture and society 1
Cultuurforum 2016 Samenwerking binnen eigen sector
Los blogs
Tomar Decisiones... Entre la Incertidumbre y la Asertividad
retail report
The truth seeker
Optimal content downloading in vehicular network with density measurement

Viewers also liked (15)

PDF
Iwona light condensed
PDF
Columns in ConTeXt
DOCX
05. Colspan dan rowspan
PPTX
7월 첫주 캠페인
PDF
OPTIMIZED TASK ALLOCATION IN SENSOR NETWORKS
PPTX
I will be showing you the way in
PDF
Szakony
PDF
Chap14 scr
PDF
Cover book with post scripts
PPTX
Understanding Claims Made Legal Malpractice Insurance
PDF
Olympicchemistry51
PDF
Towards a better life by sabry shaheen - summary
PPTX
10 tips sample
PDF
Weingarten Beamer
Iwona light condensed
Columns in ConTeXt
05. Colspan dan rowspan
7월 첫주 캠페인
OPTIMIZED TASK ALLOCATION IN SENSOR NETWORKS
I will be showing you the way in
Szakony
Chap14 scr
Cover book with post scripts
Understanding Claims Made Legal Malpractice Insurance
Olympicchemistry51
Towards a better life by sabry shaheen - summary
10 tips sample
Weingarten Beamer
Ad

Similar to Chap09 scr (20)

PDF
Chap13 scr
PDF
Chap03 scr
PDF
Chap07 scr
PDF
Chap16 scr
PDF
Chap12 scr
PPTX
How to use Latex in Paper , Book writing in an easy way
PDF
La tex basics
PDF
Oracle adf performance tips
PPTX
Latex workshop
PPTX
Applet and graphics programming
PDF
[ITP - Lecture 16] Structures in C/C++
DOCX
Html frames
PPT
Extending Struts(1)
PPTX
02 create first-map
PPTX
My 70-480 HTML5 certification learning
PDF
Flutter State Management Using GetX.pdf
PPTX
Latex Tuitorial
PPTX
HTML Frameset & Inline Frame
PDF
Lecture 22
PPTX
Java applet
Chap13 scr
Chap03 scr
Chap07 scr
Chap16 scr
Chap12 scr
How to use Latex in Paper , Book writing in an easy way
La tex basics
Oracle adf performance tips
Latex workshop
Applet and graphics programming
[ITP - Lecture 16] Structures in C/C++
Html frames
Extending Struts(1)
02 create first-map
My 70-480 HTML5 certification learning
Flutter State Management Using GetX.pdf
Latex Tuitorial
HTML Frameset & Inline Frame
Lecture 22
Java applet
Ad

More from Hirwanto Iwan (20)

PDF
Analisis Butir Soal PAS Matematika Wajib Kelas 12 IPA/IPS 2024-2025
PDF
01. integral fungsi aljabar
PDF
Analisis Butir Soal PG Matematika Wajib Kelas XII IPA-IPS NFBS Serang
PDF
Analisis Butir Soal Pilihan Ganda Matematika Wajib Kelas XII IPA
PDF
Materi Limit Aljabar dan Turunan Aljabar
PDF
Pembahasan Soal Matematika Wajib PTS Kelas XI IPS
PDF
Pembahasan Soal Matematika Wajib PTS Kelas XI IPA
PDF
Fitur Baru WinEdt 9.1
PDF
Pemasangan WinEdt 9.1
PDF
Kumpulan Soal UM UGM
PDF
Membuat Dokumen LaTeX Edisi ke - 33
PDF
LATEX OR INDESIGN
PDF
AGH Beamer
PDF
AFIT Beamer
PDF
Hackd Beamer
PDF
LUH Beamer
PDF
Cambridge Beamer
PDF
ESOP Beamer
PDF
AP Beamer
PDF
Naked Beamer
Analisis Butir Soal PAS Matematika Wajib Kelas 12 IPA/IPS 2024-2025
01. integral fungsi aljabar
Analisis Butir Soal PG Matematika Wajib Kelas XII IPA-IPS NFBS Serang
Analisis Butir Soal Pilihan Ganda Matematika Wajib Kelas XII IPA
Materi Limit Aljabar dan Turunan Aljabar
Pembahasan Soal Matematika Wajib PTS Kelas XI IPS
Pembahasan Soal Matematika Wajib PTS Kelas XI IPA
Fitur Baru WinEdt 9.1
Pemasangan WinEdt 9.1
Kumpulan Soal UM UGM
Membuat Dokumen LaTeX Edisi ke - 33
LATEX OR INDESIGN
AGH Beamer
AFIT Beamer
Hackd Beamer
LUH Beamer
Cambridge Beamer
ESOP Beamer
AP Beamer
Naked Beamer

Recently uploaded (20)

PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
Cloud computing and distributed systems.
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
A Presentation on Artificial Intelligence
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPT
Teaching material agriculture food technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
MYSQL Presentation for SQL database connectivity
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Cloud computing and distributed systems.
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Reach Out and Touch Someone: Haptics and Empathic Computing
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
A Presentation on Artificial Intelligence
Network Security Unit 5.pdf for BCA BBA.
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Teaching material agriculture food technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
NewMind AI Weekly Chronicles - August'25 Week I
Per capita expenditure prediction using model stacking based on satellite ima...
NewMind AI Monthly Chronicles - July 2025
20250228 LYD VKU AI Blended-Learning.pptx

Chap09 scr

  • 1. Indian TEX Users Group URL: http://www.river-valley.com/tug Creating Float . . . Figure Placement Customizing . . . 9 Using Graphics . . . Rotating and . . . Title Page A On-line Tutorial on LTEX The Tutorial Team Indian TEX Users Group, SJP Buildings, Cotton Hills Trivandrum 695014, INDIA 2000 Prof. (Dr.) K. S. S. Nambooripad, Director, Center for Mathematical Sciences, Trivandrum, (Editor); Dr. E. Krishnan, Reader in Mathematics, University College, Trivandrum; Mohit Agarwal, Department of Aerospace Engineering, Indian Institute of Science, Bangalore; T. Rishi, Focal Image (India) Pvt. Ltd., Trivandrum; L. A. Ajith, Focal Image (India) Pvt. Ltd., Trivandrum; A. M. Shan, Focal Image (India) Pvt. Ltd., Trivandrum; C. V. Radhakrishnan, River Valley Technologies, Software Technology Park, Trivandrum constitute the Tutorial team A A This document is generated from LTEX sources compiled with pdfLTEX v. 14e in an INTEL Pentium III 700 MHz system running Linux kernel version 2.2.14-12. The packages used are hyperref.sty and pdfscreen.sty c 2000, Indian TEX Users Group. This document may be distributed under the terms of the A A LTEX Project Public License, as described in lppl.txt in the base LTEX distribution, either version 1.0 or, at your option, any later version Page 1 of 13 Go Back Full Screen Close Quit
  • 2. 9 The Figure Environment Creating Float . . . Figure Placement Customizing . . . Figures are really problematical to present in a document because they never split between pages. These leads to bad page breaks which leave blank space at the bottom of pages. For the fine-tuning of that document, typesetter has to adjust the page breaks manually. A But LTEX provides floating figures which automatically move to suitable locations. So the A positioning of figures is the duty of LTEX. 9.1. Using Graphics . . . Title Page Rotating and . . . Creating Floating Figures Floating figures are created by putting commands in a figure environment. The contents of the figure environment always remains in one chunk, floating to produce good page breaks. The following commands put the graphic from figure.eps inside a floating figure Page 2 of 13 Go Back begin{figure} centering includegraphics{figure.eps} caption{This is an inserted EPS graphic} label{fig1} end{figure} Full Screen Close Quit
  • 3. Features The optional label command, can be used with the ref, and pageref commands to reference the caption. The label command must be placed immediately after the ¤¥ ¤¢  ¦ £ ¡ caption Customizing . . . ¤¨ ¤!¨ " % $ # ¡ $ £ ¤¤¨ ) ( Using Graphics . . . Rotating and . . . $ # ( ¤ ¤!¤¨ ¦' $ If the figure environment contains multiple caption commands, it produces multiple figures which float together. This is useful in constructing side-by-side graphics or complex arrangements. Creating Float . . . Figure Placement !¨ ¤ If the figure environment contains no caption commands, it produces an unnumbered floating figure. ¨ ¨ ¤ £ ©§ 9.1.1. Figure 1. This is an inserted EPS graphic Title Page A list of figures is generated by the listoffigures command. By default, the caption text is used as the caption and also in the list of figures. The caption has an optional argument which specifies the list-of-figure entry. For example, caption[List Text]{Caption Text} causes “Caption Text” to appear in the caption, but “List Text” to appear in the list of figures. This is useful when using long, descriptive captions. The figure environment can only be used in outer paragraph mode, preventing it from being used inside any box (such as parbox or minipage). Figure environments inside the paragraphs are not processed until the end of the paragraph. For example: Page 3 of 13 Go Back Full Screen Close Quit
  • 4. ............. text text text text text text begin{figure} ......... end{figure} ............. text text text text text text Creating Float . . . Figure Placement Customizing . . . Using Graphics . . . Rotating and . . . 9.2. Figure Placement Title Page The figure environment has an optional argument which allows users to specify possible figure locations. The optional argument can contain any combination of the letters: h, t, b, p. h Place the figure in the text where the figure command is located. This option cannot be executed if there is not enough room remaining on the page. t Place the figure at the top of the page. b Place the figure at the bottom of a page. Page 4 of 13 p Place the figure on a page containing only floats. Go Back If no optional arguments are given, the placement options default to [tbp]. Full Screen A When we input a float, LTEX will read that float and hold it until it can place that at a better A location. Unprocessed floats are those which are read by LTEX but not yet placed on the page. A Though the float-placing is done by LTEX, sometimes user has to do something to process unprocessed floats. Following commands will do that job: Close Quit
  • 5. clearpage This command places unprocessed floats and starts a new page. FloatBarrier This command causes all unprocessed floats to be processed. This is provided by the placeins package. It does not start a new page, unlike clearpage. Creating Float . . . Figure Placement Customizing . . . Since it is often desirable to keep floats in the section in which they were issued, the section option usepackage[section]{placeins} Using Graphics . . . Rotating and . . . Title Page redefines the section command, inserting a FloatBarrier command before each section. Note that this option is very strict. This option does not allow a float from the old section to appear at the bottom of the page, since that is after the start of a new section. The below option Page 5 of 13 usepackage[below]{placeins} Go Back is a less-restrictive version of the section option. It allows floats to be placed after the beginning of a new section, provided that some of the old section appears on the page. afterpage/clearpage The afterpage package provides the afterpage command which executes a command at the next naturally-ocurring page break. Full Screen Close Quit
  • 6. Therefore, using afterpage{clearpage} causes all unprocessed floats to be cleared at the next page break. afterpage{clearpage} is especially useful when producing small floatpage figures. 9.3. Customizing Float Placement Creating Float . . . Figure Placement A LT The following style parameters are used by EX to prevent awkward-looking pages which contain too many floats or badly-placed floats. Customizing . . . Using Graphics . . . Rotating and . . . 9.3.1. Float Placement Counters Title Page topnumber The maximum number of floats allowed at the top of a text page (the default is 2) bottomnumber The maximum number of floats allowed at the bottom of a text page (the default is 1) totalnumber The maximum number of floats allowed on any one text page (the default is 3) Page 6 of 13 Go Back Full Screen A These counters prevent LTEX from placing too many floats on a text page. These counters do A not affect float pages. Specifying a ! in the float placement options causes LTEX to ignore these parameters. The values of these counters are set with the setcounter command. For example, Close Quit
  • 7. setcounter{totalnumber}{2} prevents more than two floats from being placed on any text page. Creating Float . . . Figure Placement Customizing . . . 9.3.2. Figure Fractions Using Graphics . . . Rotating and . . . The commands in the below table control what fraction of a page can be covered by floats (where “fraction” refers to the height of the floats divided by textheight). The first three commands pertain only to text pages, while the last command pertains only to float pages. A Specifying a ! in the float placement options causes LTEX to ignore the first three parameters, but floatpagefraction is always used. The value of these fractions are set by renewcommand. For example, Title Page renewcommand{textfraction}{0.3} Page 7 of 13 textfraction The minimum fraction of a text page which must be occupied by text. The default is 0.2, which prevents floats from covering more than 80% of a text page. Go Back Full Screen Close Quit
  • 8. topfraction The maximum fraction of a text page which can be occupied by floats at the top of the page. The default is 0.7, which prevents any float whose height is greater than 70% of textheight from being placed at the top of a page. Creating Float . . . Figure Placement Customizing . . . bottomfraction floatpagefraction The maximum fraction of a text page which can be occupied by floats at the bottom of the page. The default is 0.3, which prevents any float whose height is greater than 40% of textheight from being placed at the bottom of a text page. Using Graphics . . . Rotating and . . . Title Page The minimum fraction of a float page that must be occupied by floats. Thus the fraction of blank space on a float page cannot be more than 1-floatpagefraction. The default is 0.5. Page 8 of 13 9.4. A Using Graphics in LTEX A A This section shows the methods to use graphics in LTEX documents. While LTEX can import virtually any graphics format, Encapsulated PostScript (EPS) is the easiest graphics format to A import into LTEX. The ‘eps’ files are inserted into the file using command includegraphics{file.eps} Go Back Full Screen Close Quit
  • 9. 9.4.1. The includegraphics Command includegraphics[options]{filename} Creating Float . . . Following are the options available in includegraphics command: Figure Placement Customizing . . . width The width of the graphics (in any of the accepted TEX units). height The height of the graphics (in any of the accepted TEX units). totalheight The totalheight of the graphics (in any of the accepted TEX units). scale Scale factor for the graphic. Specifying scale=2 makes the graphic twice as large as its natural size. angle Using Graphics . . . Specifies the angle of rotation, in degrees, with a counter-clockwise (anti-clockwise) rotation being positive. Rotating and . . . Title Page Page 9 of 13 Go Back Full Screen Close Quit
  • 10. includegraphics[width=.5textwidth]{filename} includegraphics[height=2in]{filename} includegraphics[totalheight=2in]{filename} includegraphics[scale=2]{filename} Creating Float . . . Figure Placement Customizing . . . Using Graphics . . . Rotating and . . . Title Page includegraphics[width=1in]{duck} includegraphics[height=1.5in]{duck} Page 10 of 13 Go Back Full Screen includegraphics[scale=.25,angle=45]{duck} includegraphics[scale=.25,angle=90]{duck} Close Quit
  • 11. 9.4.2. Graphics Search Path A By default, LTEX looks for graphics files in any directory on the TEX search path. In addition to A these directories, LTEX also looks in any directories specified in the graphicspath command. For example, Creating Float . . . graphicspath{{dir1/}{dir2/}} Figure Placement Customizing . . . Using Graphics . . . A tells LTEX to also look for graphics files in dir1/ and dir2/. For Macintosh, this becomes graphicspath{{dir1:}{dir2:}} 9.4.3. Rotating and . . . Title Page Graphics Extensions A The DeclareGraphicsExtensions command tells LTEX which extensions to try if a file with no extension is specified in the includegraphics command. For convenience, a default set of extensions is pre-defined depending on which graphics driver is selected. For example if dvips is used, the following graphic extensions (defined in dvips.def) are used by default Page 11 of 13 Go Back DeclareGraphicsExtensions{.eps,.ps,.eps.gz,.ps.gz,.eps.Z} Full Screen With the above graphics extensions specified, includegraphics{file} first looks for file.eps, then file.ps, then file file.eps.gz, etc. until a file is found. This allows the graphics to be specified with Close Quit
  • 12. includegraphics{file} instead of Creating Float . . . includegraphics{file.eps} Figure Placement Customizing . . . Using Graphics . . . 9.5. Rotating and Scaling Objects In addition to the includegraphics command, the graphicx package includes 4 other comA mands which rotates and scale any LTEX object: text, EPS graphic, etc. Rotating and . . . Title Page scalebox{2}{includegraphics{file.eps}} resizebox{4in}{!}{includegraphics{file.eps}} rotatebox{45}{includegraphics{file.eps}} Page 12 of 13 produces the same three graphics as Go Back includegraphics[scale=2]{file.eps} includegraphics[width=4in]{file.eps} includegraphics[angle=45]{file.eps} For example, the following is produced with Full Screen Close Quit
  • 13. LA T EX LA T EX rotatebox{45}{fbox{Large textcolor{blue}{LaTeX}}} rotatebox{180}{fbox{Large textcolor{blue}{LaTeX}}} Creating Float . . . Figure Placement However, the includegraphics is preferred because it is faster and produces more efficient PostScript. Customizing . . . Using Graphics . . . Rotating and . . . Title Page Page 13 of 13 Go Back Full Screen Close Quit