SlideShare a Scribd company logo
1 of 16
Download to read offline
Indian TEX Users Group
: http://www.river-valley.com/tug

Why cross refer . . .
A
Let LTEX do it

12

Pointing to a . . .
Pointing outside . . .
Lost the keys? . . .

Title Page

A
On-line Tutorial on LTEX
The Tutorial Team
Indian TEX Users Group,  Buildings, Cotton Hills
Trivandrum 695014, 
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

A
c 2000, Indian TEX Users Group. This document may be distributed under the terms of the LTEX
A
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 16

Go Back

Full Screen

Close

Quit
A
12 Cross References in LTEX
Why cross refer . . .
A
Let LTEX do it

Pointing to a . . .

12.1.

Why cross references?
Cross reference is the technical term for quoting yourself. This is what you do when you say
something like, “As I said earlier, . . . ”. More seriously, in a written article, you may often have
occasion to refer the reader to something mentioned earlier (or sometimes to something yet to
be said) in the same document. Thus you may have explained a new term in the second section
of your article and when you use this term again in the fourth section, it is a matter of courtesy
to the reader to point to the explanation. Again, in a Mathematics article, you may have to cite
an earlier result in the proof of the current result.
Such references can be done by hand, but if you revise your document and insert some new
sections (or theorems) then changing all cross references manually is no easy task. It is always
better to automate such tedious tasks.(After all what’s a computer for, if not to do such mundane
jobs?)

Pointing outside . . .
Lost the keys? . . .

Title Page

Page 2 of 16

Go Back

12.2.

A
Let LTEX do it

The basic method of using cross references (see Section 12.1 for what we mean by cross referee)
A
in LTEX is quite simple. Suppose that somewhere in the in the second section of you article,
you want to refer to the first section. You assign a key to the first section using the command

Full Screen

Close

Quit
section{ section name }label{ key }

and at the point in the second section where the reference is to be made, you type the command
Why cross refer . . .
A
Let LTEX do it

ref{ key }

Pointing to a . . .
Pointing outside . . .

Thus the reference “see Section 12.1 . . . ” in the first sentence of this section was produced by
including the command label{intro} in the command for the first section as

Lost the keys? . . .

Title Page

section{Why cross references}label{intro}

and the command ref{intro} at the place of reference in the second section as
. . . (see Sectionref{intro} for . . .
Page 3 of 16

Okay, the example is a bit silly, since the actual reference here is not really necessary, but you
get the general idea, don’t you? Incidentally, the label{key} for a section need not be given
immediately after the section{section name}. It can be given anywhere within the section.
A
The first time you run LTEX on a file named, say, myfile.tex containing cross references, the
A
reference information in an auxiliary file named myfile.aux and at the end of the run LTEX
prints a warning

Go Back

Full Screen

Close

LaTeX Warning: There were undefined references.
Quit
LaTeX Warning: Label(s) may have changed.
Rerun to get cross-references right.

A second run gets the references right. The same thing happens when you’ve changed the
reference information in any way, say, by adding a new section.
Though the key in label{key} can be any sequence letters, digits or punctuation characters,
it is convenient to use some mnemonic (such as label{limcon} for a section entitled “Limits
and Continuity” rather than label{sec@#*?!}. Also, when you make a reference, it’s better
to type ˜ref{limcon} (notice the tie?) than ref{limcon} to prevent the possibility of the
reference number falling off the edge as in “ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . see Section
12.1 for further details. . . . ”
In addition to sectioning commands such as chapter or section, reference can also be made
to an item entry in an enumerate environment, by attaching a label. For example the input
In the classical emph{syllogism}
begin{enumerate}
item All men are mortal.label{pre1}
item Socrates is a man.label{pre2}
item So Socrates is a mortal.label{con}
end{enumerate}
Statements (ref{pre1}) and (ref{pre2}) are
the emph{premises} and statement (ref{con}) is
the conclusion.

Why cross refer . . .
A
Let LTEX do it

Pointing to a . . .
Pointing outside . . .
Lost the keys? . . .

Title Page

Page 4 of 16

Go Back

Full Screen

gives the following output
Close

Quit
In the classical syllogism
(1) All men are mortal.
(2) Socrates is a man.
(3) So Socrates is a mortal.
Statements (1) and (2) are the premises and statement (3) is the conclusion

Why cross refer . . .
A
Let LTEX do it

You must be a bit careful about references to tables or figures (technically, “floats”). For them,
the label command should be given after the caption command or in its argument, as in the
example below
begin{table}[h]
begin{center}
setlength{extrarowheight}{5pt}
begin{tabular}{|c|c|c|c|}
hline
Value of $x$ & 1 & 2 & 3
hline
Value of $y$ & 1 & 8 & 27
hline
end{tabular}
caption{Observed values of $x$ and $y$}label{tabxy}
end{center}
end{table}
Two possible relations betweeen $x$ and $y$ satisfying
the data in Tableref{tabxy} are $y=xˆ3$ and
$y=6xˆ2-11x+6$

Pointing to a . . .
Pointing outside . . .
Lost the keys? . . .

Title Page

Page 5 of 16

Go Back

Full Screen

Close

produces the following output
Quit
Value of x

1

2

3

Value of y

1

8

27

Table 12.6 Observed values of x and y

Two possible relations between x and y satisfying the data in Table 12.6 are
y = x3 and y = 6x2 − 11x + 6
You can think of a caption command within a figure or table environment as a sort of
sectioning command within the environment. Thus you can have several caption and label
pairs within a single figure or table environment.
You can also make forward references in exactly the same way by refing to the key of some
succeeding label such as “see Subsection 12.2.1 for a discussion of cross references in Mathematics.”

12.2.1.

Why cross refer . . .
A
Let LTEX do it

Pointing to a . . .
Pointing outside . . .
Lost the keys? . . .

Title Page

Cross references in Math
Mathematical documents abounds in cross references. There are references to theorems and
equations and figures and whatnot. The method of reference is exactly as before. Thus if
you’ve defined newtheorem{thm}[subsection], then after typing

Page 6 of 16

Go Back

begin{thm}label{diffcon}
Every differentiable function is continuous
end{thm}

to get

Full Screen

Close

Theorem 12.2.1.1 Every differentiable function is continuous
Quit
and you can type elsewhere in the document
The converse of Theorem˜ref{diffcon} is false.

Why cross refer . . .

to get

A
Let LTEX do it

Pointing to a . . .

The converse of Theorem 12.2.1.1 is false.

Pointing outside . . .
Lost the keys? . . .

References can be made to equations as in the following examples.

Title Page

Input
begin{equation}label{sumsq}
(x+y)ˆ2=xˆ2+2xy+yˆ2
end{equation}
Changing $y$ to $-y$ in
Equation˜(ref{sumsq})
gives the following

Output
(x + y)2 = x2 + 2xy + y2

(12.1)

Changing y to −y in Equation (12.1) gives
the following

Page 7 of 16

If you load the package amsmath, you can use the command eqref instead of ref to make a
reference to an equation. This automatically supplies the parantheses around the equation number and provides an italic correction before the closing parenthesis, if necessary. For example,

Go Back

Full Screen

Equation˜eqref{sumsq} gives the following
Close

produces

Quit
Equation (12.1) gives the following
References can be made to individual equations in multiline displays of equations produced
by such environments as align or gather (defined in the amsmath package). The label
command can be used within such a structure for subnumbering as in the example below
Why cross refer . . .
A
Let LTEX do it

Input
begin{align}
(x+y)ˆ2&=xˆ2+2xy+yˆ2
label{sum}
(x-y)ˆ2&=xˆ2-2xy+yˆ2
tag{ref{sum}a}
end{align}

12.3.

Output
(x + y)2 = x2 + 2xy + y2
(x − y)2 = x2 − 2xy + y2

Pointing to a . . .

(12.2)
(12.2a)

Pointing outside . . .
Lost the keys? . . .

Title Page

Pointing to a page – the package varioref
In making a reference to a table or an equation, it is more to convenient (for the reader, that is)
to give the page number of the reference also. The command

Page 8 of 16

Go Back

pageref{key}
Full Screen

typesets the number of the page where the command label{key} was given. Thus for example
Close

see Table˜ref{tabxy} in page˜pageref{tabxy}
Quit
in this document produces
see Table 12.6 in page 6
To avoid the tedium of typing
Why cross refer . . .

ref{key} on page˜pageref{key}

A
Let LTEX do it

Pointing to a . . .
Pointing outside . . .

every time, you can define the macro
newcommand{fullref}[1]{ref{#1} on page˜pageref{#1}}

and use fullref for such references. But the trouble is that at times the referred abject and
the reference to it fall on the same page (with TEX you never know this till the end) so that
you get a reference to the page number of the very page you are reading, which looks funny.
This can be avoided by using the package varioref. If you load this package by including
usepackage{varioref} in your preamble, then you can use the command

Lost the keys? . . .

Title Page

Page 9 of 16

vref{key}
Go Back

to refer to an object you’ve marked with label{key} elsewhere in the document. The action
of vref varies according to the page(s) where the referred object and the reference are typeset
by TEX in the final output

Full Screen

Close

(1) If the object and the reference are on the same page, vref produces only a ref suppressing pageref so that only the number pointing to the object is typeset, without any

Quit
reference to the page number.
(2) If the object and the reference are on different pages whose numbers differ by more than
1, vref produces both ref and pageref.
(3) If the object and the reference fall on pages whose numbers differ by one (that is, on
successive pages), vref produces ref followed by the phrase “on the preceding page”
or “on the following page” depending on whether the object or the reference occurs first.
Moreover, in the next occurance of vref in a situation of the same type, the phrases are
changed to “on the next page” and the “page before” respectively.

Why cross refer . . .
A
Let LTEX do it

Pointing to a . . .
Pointing outside . . .

This is the default behavior of vref in the article documentclass. If the article class is used with
the twoside option or if the documentclass book is used, then the behavior in Case (3)above is
a bit different.

Lost the keys? . . .

Title Page

(1) If the object and the reference fall on the two sides of the same leaf, the behavior of vref
is as in 3 above.
(2) If the object and the reference fall on pages forming a double spread (that is, a page of even
number followed by the next page), then vref produces ref followed by the phrase “on
the facing page”. Moreover, in the next occurence of vref in a situation of the same type,
the phrases are changed to “on the preceding page” and “on the next page” respectively.
Page 10 of 16

The phrases used in the various case considered above can be customized by redefining the commands generating them. For the article class without the twoside option, reference to the previous page use the command reftextbefore and reference to the next page uses reftextafter.
In the case of the article class with the twoside option or the book class, the commands
reftextfaceafter and reftextfacebefore are used in the case of reference to a page in
a double spread. The default definitions of these commands are given below. In all these, the
two arguments of the command reftextvario are the phrases alternatively used in the repeated
use of the reference as mentioned above.

Go Back

Full Screen

Close

Quit
newcommand{reftextbefore}
{on the reftextvario{preceding page}{page before}}
newcommand{reftextafter}
{on the reftextvario{following}{next} page}
newcommand{reftextfacebefore}
{on the reftextvario{facing}{preceding} page}
newcommand{reftextfaceafter}
{on the reftextvario{facing}{next}{page}}

Why cross refer . . .
A
Let LTEX do it

Pointing to a . . .

You can customize the phrases generated in various situations by redefining these with phrases
of your choice in the arguments of reftextvario.
If you want to refer only to a page number using varioref, you can use the command

Pointing outside . . .
Lost the keys? . . .

Title Page

vpageref{key}

to produce the page number of the object marked with label{key}. The phrases used in the
various special cases are the same as described above, except that when the referred object and
the reference fall on the same page, either the phrase “on this page” or “on the current page” is
produced. The command used to generate these is reftextcurrenr whose default definition is
newcommand{reftextcurrent}
{on reftextvario{this}{the current} page}

You can change the phrases “this” and “the current” globally by redefining this command. You
can also make some local changes by using the two optional arguments that vpageref allows.
Thus you can use the command
vpageref[same page phrase][other page phrase]{key}

Page 11 of 16

Go Back

Full Screen

Close

Quit
to refer to the page number of the object marked with label{key}. The same page phrase will
be used if the object and the reference fall on the same page and the phrase other page phrase
will be used, if they fall on different pages. Thus for example, the command
see the vpageref[above table][table]{tabxy}
Why cross refer . . .
A
Let LTEX do it

Pointing to a . . .

given in this document will produce

Pointing outside . . .

see the above table
if the reference occurs on the same page as Table 12.6 and

Lost the keys? . . .

Title Page

see the tableon page 6
if they fall on different pages.

12.4.

Pointing outside – the package xr

Page 12 of 16

Go Back

Sometimes you may want to refer to something in a document other than the one you are
working on. (This happens, for instance if you keep an article as separate files.) The package xr
allows such external references.

Full Screen

If you want to refer to objects in a file named other.tex in your current document, load the
package xr and set the external document as other.tex using the commands

Close

usepakage{xr}
externaldocument{other}

Quit
in the preamble of the current document. Then you can use the ref and pageref to refer
to anything that has been marked with the label command in either the current document or
other.tex. Any number of such external documents can be specified.
If same key is used to mark different objects in two such documents, there’ll be a conflict. To
get over this, you can use the optional argument available in externaldocument command. If
you say

Why cross refer . . .
A
Let LTEX do it

externaldocument[a-]{other}

Pointing to a . . .
Pointing outside . . .
Lost the keys? . . .

then a reference to label{key} in other.tex could be made by ref{a-key}. The prefix need
not be a-; it can be any convenient string.

12.5.

Title Page

Lost the keys? Use lablst.tex
One of the conveniences of using keys for cross references is that you need not keep track of
the actual numbers, but then you’ll have to remember the keys. You can produce the list of keys
A
used in a document by running LTEX on the file lablst.tex. In my system, I do this by first
typing

Page 13 of 16

Go Back

latex lablst
Full Screen

Close

Quit
A
LTEXresponds as follows

*********************************
* Enter input file name
*
without the .tex extension:
*********************************

Why cross refer . . .
A
Let LTEX do it

lablstfile=

Pointing to a . . .
Pointing outside . . .
Lost the keys? . . .

I type in the file name as cref which is the source of this document. I’m presented with another
query.
Title Page

**********************************************
* Enter document class used in file cref.tex
*
with no options or extension:
**********************************************
lablstclass=
Page 14 of 16

So I type article. I am asked
Go Back

********************************************
* Enter packages used in file cref.tex
*
with no options or extensions:
********************************************

Full Screen

Close

lablstpackages=
Quit
Here I need give only those packages used in the article which define commands used in section
titles etc. need be given. So I type
amsmath,array,enumerate
Why cross refer . . .

This produces a file lablst.dvi which I can view to see a list of keys used in the document.

A
Let LTEX do it

Pointing to a . . .

Finally if your text editor is GNU Emacs, then you can use its RefTeX package to automate generation, insertion and location of keys at the editing stage.

Pointing outside . . .
Lost the keys? . . .

Click here to see lablst output
Title Page

Page 15 of 16

Go Back

Full Screen

Close

Quit
Why cross refer . . .

File tutor.tex — lablst output ()

A
Let LT X do it

E
Using document class: ../tugindia
Pointing to a . . .
and packages: txfonts,varioref,pdfscreen,colortbl,xspace,woodfont,tutorial,longtable,hhline,ifthen,lay
1

Pointing outside . . .
Lost the keys? . . .

Logical labels within sections
A
Cross References in LTEX

2

12.1

Why cross references?

2

12.2

A
Let LTEX do it

12

intro

Page:

2

1
2
3
12.6
12.2.1
12.2.1.1
12.1
12.2

Page:
Page:
Page:
Page:
Page:
Page:
Page:
Page:

5
5
5
6
6
6
7
8

3

Page:
Page:
Page:

10
12
12

2
pre1
pre2
con
tabxy
mathref
diffcon
sumsq
sum

12.3

12.1

Title Page

Pointing to a page – the package varioref

Page 16 of 16

8
diff1
1@xvr
1@vr

Go Back

12.4

Pointing outside – the package xr

12

12.5

Lost the keys? Use lablst.tex

13

Bibliography logical labels

Full Screen

Close

Quit

More Related Content

What's hot

What's hot (20)

Introduction to LaTeX - Workshop Day 1
Introduction to LaTeX - Workshop Day 1Introduction to LaTeX - Workshop Day 1
Introduction to LaTeX - Workshop Day 1
 
Ch13
Ch13Ch13
Ch13
 
single linked list
single linked listsingle linked list
single linked list
 
Linked list
Linked listLinked list
Linked list
 
IJERD(www.ijerd.com)International Journal of Engineering Research and Develop...
IJERD(www.ijerd.com)International Journal of Engineering Research and Develop...IJERD(www.ijerd.com)International Journal of Engineering Research and Develop...
IJERD(www.ijerd.com)International Journal of Engineering Research and Develop...
 
Insertion sort
Insertion sortInsertion sort
Insertion sort
 
linked list (c#)
 linked list (c#) linked list (c#)
linked list (c#)
 
Link list presentation slide(Daffodil international university)
Link list presentation slide(Daffodil international university)Link list presentation slide(Daffodil international university)
Link list presentation slide(Daffodil international university)
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
 
Circular link list.ppt
Circular link list.pptCircular link list.ppt
Circular link list.ppt
 
Dsu qb
Dsu qbDsu qb
Dsu qb
 
Lecture3a sorting
Lecture3a sortingLecture3a sorting
Lecture3a sorting
 
Deletion from single way linked list and search
Deletion from single way linked list and searchDeletion from single way linked list and search
Deletion from single way linked list and search
 
EE6711 Power System Simulation Lab manual
EE6711 Power System Simulation Lab manualEE6711 Power System Simulation Lab manual
EE6711 Power System Simulation Lab manual
 
Data structures using c
Data structures using cData structures using c
Data structures using c
 
Linked list
Linked listLinked list
Linked list
 
Join operation
Join operationJoin operation
Join operation
 
DATA STRUCTURES
DATA STRUCTURESDATA STRUCTURES
DATA STRUCTURES
 
Singly link list
Singly link listSingly link list
Singly link list
 
Latex Tutorial
Latex TutorialLatex Tutorial
Latex Tutorial
 

Viewers also liked

Family literacy events made easy 2013
Family literacy events made easy 2013Family literacy events made easy 2013
Family literacy events made easy 2013RealRosemary
 
1010735電子商務
1010735電子商務1010735電子商務
1010735電子商務Hank Yang
 
A STOCHASTIC STATISTICAL APPROACH FOR TRACKING HUMAN ACTIVITY
A STOCHASTIC STATISTICAL APPROACH FOR TRACKING HUMAN ACTIVITYA STOCHASTIC STATISTICAL APPROACH FOR TRACKING HUMAN ACTIVITY
A STOCHASTIC STATISTICAL APPROACH FOR TRACKING HUMAN ACTIVITYZac Darcy
 
CPH snapshot of activities 2015-16 final
CPH snapshot of activities 2015-16 finalCPH snapshot of activities 2015-16 final
CPH snapshot of activities 2015-16 finalAayam Gupta
 
Преподавание перевода. Пример презентации: buzzwords, канцелярит, глаголобояз...
Преподавание перевода. Пример презентации: buzzwords, канцелярит, глаголобояз...Преподавание перевода. Пример презентации: buzzwords, канцелярит, глаголобояз...
Преподавание перевода. Пример презентации: buzzwords, канцелярит, глаголобояз...Yuri Pavlov
 
Strategic Business Planning Development
Strategic Business Planning DevelopmentStrategic Business Planning Development
Strategic Business Planning DevelopmentDave Warnes
 
Financieringswijzer energiezuinig bouwen
Financieringswijzer energiezuinig bouwenFinancieringswijzer energiezuinig bouwen
Financieringswijzer energiezuinig bouwenMastermate
 
SUPERVISED LEARNING MODEL FOR KICKSTARTER CAMPAIGNS WITH R MINING
SUPERVISED LEARNING MODEL FOR KICKSTARTER CAMPAIGNS WITH R MININGSUPERVISED LEARNING MODEL FOR KICKSTARTER CAMPAIGNS WITH R MINING
SUPERVISED LEARNING MODEL FOR KICKSTARTER CAMPAIGNS WITH R MININGZac Darcy
 
SUNU - 3 : PROJE ANALİZ
SUNU - 3 : PROJE ANALİZSUNU - 3 : PROJE ANALİZ
SUNU - 3 : PROJE ANALİZAhmet Bozkurt
 
Az első hó Bene hegyen 2014
Az első hó Bene hegyen 2014Az első hó Bene hegyen 2014
Az első hó Bene hegyen 2014krizma
 

Viewers also liked (15)

Family literacy events made easy 2013
Family literacy events made easy 2013Family literacy events made easy 2013
Family literacy events made easy 2013
 
1010735電子商務
1010735電子商務1010735電子商務
1010735電子商務
 
Norman Peires
Norman PeiresNorman Peires
Norman Peires
 
A STOCHASTIC STATISTICAL APPROACH FOR TRACKING HUMAN ACTIVITY
A STOCHASTIC STATISTICAL APPROACH FOR TRACKING HUMAN ACTIVITYA STOCHASTIC STATISTICAL APPROACH FOR TRACKING HUMAN ACTIVITY
A STOCHASTIC STATISTICAL APPROACH FOR TRACKING HUMAN ACTIVITY
 
CPH snapshot of activities 2015-16 final
CPH snapshot of activities 2015-16 finalCPH snapshot of activities 2015-16 final
CPH snapshot of activities 2015-16 final
 
Volume2
Volume2Volume2
Volume2
 
Преподавание перевода. Пример презентации: buzzwords, канцелярит, глаголобояз...
Преподавание перевода. Пример презентации: buzzwords, канцелярит, глаголобояз...Преподавание перевода. Пример презентации: buzzwords, канцелярит, глаголобояз...
Преподавание перевода. Пример презентации: buzzwords, канцелярит, глаголобояз...
 
Teaching: support and advice
Teaching: support  and adviceTeaching: support  and advice
Teaching: support and advice
 
Strategic Business Planning Development
Strategic Business Planning DevelopmentStrategic Business Planning Development
Strategic Business Planning Development
 
Financieringswijzer energiezuinig bouwen
Financieringswijzer energiezuinig bouwenFinancieringswijzer energiezuinig bouwen
Financieringswijzer energiezuinig bouwen
 
SUPERVISED LEARNING MODEL FOR KICKSTARTER CAMPAIGNS WITH R MINING
SUPERVISED LEARNING MODEL FOR KICKSTARTER CAMPAIGNS WITH R MININGSUPERVISED LEARNING MODEL FOR KICKSTARTER CAMPAIGNS WITH R MINING
SUPERVISED LEARNING MODEL FOR KICKSTARTER CAMPAIGNS WITH R MINING
 
SUNU - 3 : PROJE ANALİZ
SUNU - 3 : PROJE ANALİZSUNU - 3 : PROJE ANALİZ
SUNU - 3 : PROJE ANALİZ
 
Negus
NegusNegus
Negus
 
Az első hó Bene hegyen 2014
Az első hó Bene hegyen 2014Az első hó Bene hegyen 2014
Az első hó Bene hegyen 2014
 
DISCOVER MIKE
DISCOVER MIKEDISCOVER MIKE
DISCOVER MIKE
 

Similar to Chap12 scr

Similar to Chap12 scr (20)

La tex basics
La tex basicsLa tex basics
La tex basics
 
Chap03 scr
Chap03 scrChap03 scr
Chap03 scr
 
Chap11 scr
Chap11 scrChap11 scr
Chap11 scr
 
Latex Tuitorial
Latex TuitorialLatex Tuitorial
Latex Tuitorial
 
Introduction to latex by Rouhollah Nabati
Introduction to latex by Rouhollah NabatiIntroduction to latex by Rouhollah Nabati
Introduction to latex by Rouhollah Nabati
 
LaTex tutorial with Texstudio
LaTex tutorial with TexstudioLaTex tutorial with Texstudio
LaTex tutorial with Texstudio
 
Introduction to matlab
Introduction to matlabIntroduction to matlab
Introduction to matlab
 
Chap16 scr
Chap16 scrChap16 scr
Chap16 scr
 
Chap17 scr
Chap17 scrChap17 scr
Chap17 scr
 
Latex_Tutorial.pdf
Latex_Tutorial.pdfLatex_Tutorial.pdf
Latex_Tutorial.pdf
 
LaTeX_tutorial_Syed_Jan09.ppt
LaTeX_tutorial_Syed_Jan09.pptLaTeX_tutorial_Syed_Jan09.ppt
LaTeX_tutorial_Syed_Jan09.ppt
 
Introduction to Latex
Introduction to LatexIntroduction to Latex
Introduction to Latex
 
A Hitchhiker S Guide To LaTex (Or How I Learned To Stop Worrying And Love Wri...
A Hitchhiker S Guide To LaTex (Or How I Learned To Stop Worrying And Love Wri...A Hitchhiker S Guide To LaTex (Or How I Learned To Stop Worrying And Love Wri...
A Hitchhiker S Guide To LaTex (Or How I Learned To Stop Worrying And Love Wri...
 
Technical writing using LaTeX
Technical writing using LaTeXTechnical writing using LaTeX
Technical writing using LaTeX
 
Chap02 scr
Chap02 scrChap02 scr
Chap02 scr
 
latex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. Alrshahlatex-workshop Dr: Mohamed A. Alrshah
latex-workshop Dr: Mohamed A. Alrshah
 
Learn Latex
Learn LatexLearn Latex
Learn Latex
 
Ch1
Ch1Ch1
Ch1
 
An Introduction to MATLAB with Worked Examples
An Introduction to MATLAB with Worked ExamplesAn Introduction to MATLAB with Worked Examples
An Introduction to MATLAB with Worked Examples
 
Matlab Manual
Matlab ManualMatlab Manual
Matlab Manual
 

More from Hirwanto Iwan

01. integral fungsi aljabar
01. integral fungsi aljabar01. integral fungsi aljabar
01. integral fungsi aljabarHirwanto Iwan
 
Analisis Butir Soal PG Matematika Wajib Kelas XII IPA-IPS NFBS Serang
Analisis Butir Soal PG Matematika Wajib Kelas XII IPA-IPS NFBS SerangAnalisis Butir Soal PG Matematika Wajib Kelas XII IPA-IPS NFBS Serang
Analisis Butir Soal PG Matematika Wajib Kelas XII IPA-IPS NFBS SerangHirwanto Iwan
 
Analisis Butir Soal Pilihan Ganda Matematika Wajib Kelas XII IPA
Analisis Butir Soal Pilihan Ganda Matematika Wajib Kelas XII IPAAnalisis Butir Soal Pilihan Ganda Matematika Wajib Kelas XII IPA
Analisis Butir Soal Pilihan Ganda Matematika Wajib Kelas XII IPAHirwanto Iwan
 
Materi Limit Aljabar dan Turunan Aljabar
Materi Limit Aljabar dan Turunan Aljabar Materi Limit Aljabar dan Turunan Aljabar
Materi Limit Aljabar dan Turunan Aljabar Hirwanto Iwan
 
Pembahasan Soal Matematika Wajib PTS Kelas XI IPS
Pembahasan Soal Matematika Wajib PTS Kelas XI IPSPembahasan Soal Matematika Wajib PTS Kelas XI IPS
Pembahasan Soal Matematika Wajib PTS Kelas XI IPSHirwanto Iwan
 
Pembahasan Soal Matematika Wajib PTS Kelas XI IPA
Pembahasan Soal Matematika Wajib PTS Kelas XI IPAPembahasan Soal Matematika Wajib PTS Kelas XI IPA
Pembahasan Soal Matematika Wajib PTS Kelas XI IPAHirwanto Iwan
 
Membuat Dokumen LaTeX Edisi ke - 33
Membuat Dokumen LaTeX Edisi ke - 33Membuat Dokumen LaTeX Edisi ke - 33
Membuat Dokumen LaTeX Edisi ke - 33Hirwanto Iwan
 

More from Hirwanto Iwan (20)

01. integral fungsi aljabar
01. integral fungsi aljabar01. integral fungsi aljabar
01. integral fungsi aljabar
 
Analisis Butir Soal PG Matematika Wajib Kelas XII IPA-IPS NFBS Serang
Analisis Butir Soal PG Matematika Wajib Kelas XII IPA-IPS NFBS SerangAnalisis Butir Soal PG Matematika Wajib Kelas XII IPA-IPS NFBS Serang
Analisis Butir Soal PG Matematika Wajib Kelas XII IPA-IPS NFBS Serang
 
Analisis Butir Soal Pilihan Ganda Matematika Wajib Kelas XII IPA
Analisis Butir Soal Pilihan Ganda Matematika Wajib Kelas XII IPAAnalisis Butir Soal Pilihan Ganda Matematika Wajib Kelas XII IPA
Analisis Butir Soal Pilihan Ganda Matematika Wajib Kelas XII IPA
 
Materi Limit Aljabar dan Turunan Aljabar
Materi Limit Aljabar dan Turunan Aljabar Materi Limit Aljabar dan Turunan Aljabar
Materi Limit Aljabar dan Turunan Aljabar
 
Pembahasan Soal Matematika Wajib PTS Kelas XI IPS
Pembahasan Soal Matematika Wajib PTS Kelas XI IPSPembahasan Soal Matematika Wajib PTS Kelas XI IPS
Pembahasan Soal Matematika Wajib PTS Kelas XI IPS
 
Pembahasan Soal Matematika Wajib PTS Kelas XI IPA
Pembahasan Soal Matematika Wajib PTS Kelas XI IPAPembahasan Soal Matematika Wajib PTS Kelas XI IPA
Pembahasan Soal Matematika Wajib PTS Kelas XI IPA
 
Fitur Baru WinEdt 9.1
Fitur Baru WinEdt 9.1Fitur Baru WinEdt 9.1
Fitur Baru WinEdt 9.1
 
Pemasangan WinEdt 9.1
Pemasangan WinEdt 9.1Pemasangan WinEdt 9.1
Pemasangan WinEdt 9.1
 
Kumpulan Soal UM UGM
Kumpulan Soal UM UGMKumpulan Soal UM UGM
Kumpulan Soal UM UGM
 
Membuat Dokumen LaTeX Edisi ke - 33
Membuat Dokumen LaTeX Edisi ke - 33Membuat Dokumen LaTeX Edisi ke - 33
Membuat Dokumen LaTeX Edisi ke - 33
 
LATEX OR INDESIGN
LATEX OR INDESIGN LATEX OR INDESIGN
LATEX OR INDESIGN
 
AGH Beamer
AGH BeamerAGH Beamer
AGH Beamer
 
AFIT Beamer
AFIT BeamerAFIT Beamer
AFIT Beamer
 
Hackd Beamer
Hackd BeamerHackd Beamer
Hackd Beamer
 
LUH Beamer
LUH BeamerLUH Beamer
LUH Beamer
 
Cambridge Beamer
Cambridge BeamerCambridge Beamer
Cambridge Beamer
 
ESOP Beamer
ESOP BeamerESOP Beamer
ESOP Beamer
 
AP Beamer
AP BeamerAP Beamer
AP Beamer
 
Naked Beamer
Naked BeamerNaked Beamer
Naked Beamer
 
TUDelft Beamer
TUDelft BeamerTUDelft Beamer
TUDelft Beamer
 

Recently uploaded

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Chap12 scr

  • 1. Indian TEX Users Group : http://www.river-valley.com/tug Why cross refer . . . A Let LTEX do it 12 Pointing to a . . . Pointing outside . . . Lost the keys? . . . Title Page A On-line Tutorial on LTEX The Tutorial Team Indian TEX Users Group,  Buildings, Cotton Hills Trivandrum 695014,  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 A c 2000, Indian TEX Users Group. This document may be distributed under the terms of the LTEX A 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 16 Go Back Full Screen Close Quit
  • 2. A 12 Cross References in LTEX Why cross refer . . . A Let LTEX do it Pointing to a . . . 12.1. Why cross references? Cross reference is the technical term for quoting yourself. This is what you do when you say something like, “As I said earlier, . . . ”. More seriously, in a written article, you may often have occasion to refer the reader to something mentioned earlier (or sometimes to something yet to be said) in the same document. Thus you may have explained a new term in the second section of your article and when you use this term again in the fourth section, it is a matter of courtesy to the reader to point to the explanation. Again, in a Mathematics article, you may have to cite an earlier result in the proof of the current result. Such references can be done by hand, but if you revise your document and insert some new sections (or theorems) then changing all cross references manually is no easy task. It is always better to automate such tedious tasks.(After all what’s a computer for, if not to do such mundane jobs?) Pointing outside . . . Lost the keys? . . . Title Page Page 2 of 16 Go Back 12.2. A Let LTEX do it The basic method of using cross references (see Section 12.1 for what we mean by cross referee) A in LTEX is quite simple. Suppose that somewhere in the in the second section of you article, you want to refer to the first section. You assign a key to the first section using the command Full Screen Close Quit
  • 3. section{ section name }label{ key } and at the point in the second section where the reference is to be made, you type the command Why cross refer . . . A Let LTEX do it ref{ key } Pointing to a . . . Pointing outside . . . Thus the reference “see Section 12.1 . . . ” in the first sentence of this section was produced by including the command label{intro} in the command for the first section as Lost the keys? . . . Title Page section{Why cross references}label{intro} and the command ref{intro} at the place of reference in the second section as . . . (see Sectionref{intro} for . . . Page 3 of 16 Okay, the example is a bit silly, since the actual reference here is not really necessary, but you get the general idea, don’t you? Incidentally, the label{key} for a section need not be given immediately after the section{section name}. It can be given anywhere within the section. A The first time you run LTEX on a file named, say, myfile.tex containing cross references, the A reference information in an auxiliary file named myfile.aux and at the end of the run LTEX prints a warning Go Back Full Screen Close LaTeX Warning: There were undefined references. Quit
  • 4. LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right. A second run gets the references right. The same thing happens when you’ve changed the reference information in any way, say, by adding a new section. Though the key in label{key} can be any sequence letters, digits or punctuation characters, it is convenient to use some mnemonic (such as label{limcon} for a section entitled “Limits and Continuity” rather than label{sec@#*?!}. Also, when you make a reference, it’s better to type ˜ref{limcon} (notice the tie?) than ref{limcon} to prevent the possibility of the reference number falling off the edge as in “ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . see Section 12.1 for further details. . . . ” In addition to sectioning commands such as chapter or section, reference can also be made to an item entry in an enumerate environment, by attaching a label. For example the input In the classical emph{syllogism} begin{enumerate} item All men are mortal.label{pre1} item Socrates is a man.label{pre2} item So Socrates is a mortal.label{con} end{enumerate} Statements (ref{pre1}) and (ref{pre2}) are the emph{premises} and statement (ref{con}) is the conclusion. Why cross refer . . . A Let LTEX do it Pointing to a . . . Pointing outside . . . Lost the keys? . . . Title Page Page 4 of 16 Go Back Full Screen gives the following output Close Quit
  • 5. In the classical syllogism (1) All men are mortal. (2) Socrates is a man. (3) So Socrates is a mortal. Statements (1) and (2) are the premises and statement (3) is the conclusion Why cross refer . . . A Let LTEX do it You must be a bit careful about references to tables or figures (technically, “floats”). For them, the label command should be given after the caption command or in its argument, as in the example below begin{table}[h] begin{center} setlength{extrarowheight}{5pt} begin{tabular}{|c|c|c|c|} hline Value of $x$ & 1 & 2 & 3 hline Value of $y$ & 1 & 8 & 27 hline end{tabular} caption{Observed values of $x$ and $y$}label{tabxy} end{center} end{table} Two possible relations betweeen $x$ and $y$ satisfying the data in Tableref{tabxy} are $y=xˆ3$ and $y=6xˆ2-11x+6$ Pointing to a . . . Pointing outside . . . Lost the keys? . . . Title Page Page 5 of 16 Go Back Full Screen Close produces the following output Quit
  • 6. Value of x 1 2 3 Value of y 1 8 27 Table 12.6 Observed values of x and y Two possible relations between x and y satisfying the data in Table 12.6 are y = x3 and y = 6x2 − 11x + 6 You can think of a caption command within a figure or table environment as a sort of sectioning command within the environment. Thus you can have several caption and label pairs within a single figure or table environment. You can also make forward references in exactly the same way by refing to the key of some succeeding label such as “see Subsection 12.2.1 for a discussion of cross references in Mathematics.” 12.2.1. Why cross refer . . . A Let LTEX do it Pointing to a . . . Pointing outside . . . Lost the keys? . . . Title Page Cross references in Math Mathematical documents abounds in cross references. There are references to theorems and equations and figures and whatnot. The method of reference is exactly as before. Thus if you’ve defined newtheorem{thm}[subsection], then after typing Page 6 of 16 Go Back begin{thm}label{diffcon} Every differentiable function is continuous end{thm} to get Full Screen Close Theorem 12.2.1.1 Every differentiable function is continuous Quit
  • 7. and you can type elsewhere in the document The converse of Theorem˜ref{diffcon} is false. Why cross refer . . . to get A Let LTEX do it Pointing to a . . . The converse of Theorem 12.2.1.1 is false. Pointing outside . . . Lost the keys? . . . References can be made to equations as in the following examples. Title Page Input begin{equation}label{sumsq} (x+y)ˆ2=xˆ2+2xy+yˆ2 end{equation} Changing $y$ to $-y$ in Equation˜(ref{sumsq}) gives the following Output (x + y)2 = x2 + 2xy + y2 (12.1) Changing y to −y in Equation (12.1) gives the following Page 7 of 16 If you load the package amsmath, you can use the command eqref instead of ref to make a reference to an equation. This automatically supplies the parantheses around the equation number and provides an italic correction before the closing parenthesis, if necessary. For example, Go Back Full Screen Equation˜eqref{sumsq} gives the following Close produces Quit
  • 8. Equation (12.1) gives the following References can be made to individual equations in multiline displays of equations produced by such environments as align or gather (defined in the amsmath package). The label command can be used within such a structure for subnumbering as in the example below Why cross refer . . . A Let LTEX do it Input begin{align} (x+y)ˆ2&=xˆ2+2xy+yˆ2 label{sum} (x-y)ˆ2&=xˆ2-2xy+yˆ2 tag{ref{sum}a} end{align} 12.3. Output (x + y)2 = x2 + 2xy + y2 (x − y)2 = x2 − 2xy + y2 Pointing to a . . . (12.2) (12.2a) Pointing outside . . . Lost the keys? . . . Title Page Pointing to a page – the package varioref In making a reference to a table or an equation, it is more to convenient (for the reader, that is) to give the page number of the reference also. The command Page 8 of 16 Go Back pageref{key} Full Screen typesets the number of the page where the command label{key} was given. Thus for example Close see Table˜ref{tabxy} in page˜pageref{tabxy} Quit
  • 9. in this document produces see Table 12.6 in page 6 To avoid the tedium of typing Why cross refer . . . ref{key} on page˜pageref{key} A Let LTEX do it Pointing to a . . . Pointing outside . . . every time, you can define the macro newcommand{fullref}[1]{ref{#1} on page˜pageref{#1}} and use fullref for such references. But the trouble is that at times the referred abject and the reference to it fall on the same page (with TEX you never know this till the end) so that you get a reference to the page number of the very page you are reading, which looks funny. This can be avoided by using the package varioref. If you load this package by including usepackage{varioref} in your preamble, then you can use the command Lost the keys? . . . Title Page Page 9 of 16 vref{key} Go Back to refer to an object you’ve marked with label{key} elsewhere in the document. The action of vref varies according to the page(s) where the referred object and the reference are typeset by TEX in the final output Full Screen Close (1) If the object and the reference are on the same page, vref produces only a ref suppressing pageref so that only the number pointing to the object is typeset, without any Quit
  • 10. reference to the page number. (2) If the object and the reference are on different pages whose numbers differ by more than 1, vref produces both ref and pageref. (3) If the object and the reference fall on pages whose numbers differ by one (that is, on successive pages), vref produces ref followed by the phrase “on the preceding page” or “on the following page” depending on whether the object or the reference occurs first. Moreover, in the next occurance of vref in a situation of the same type, the phrases are changed to “on the next page” and the “page before” respectively. Why cross refer . . . A Let LTEX do it Pointing to a . . . Pointing outside . . . This is the default behavior of vref in the article documentclass. If the article class is used with the twoside option or if the documentclass book is used, then the behavior in Case (3)above is a bit different. Lost the keys? . . . Title Page (1) If the object and the reference fall on the two sides of the same leaf, the behavior of vref is as in 3 above. (2) If the object and the reference fall on pages forming a double spread (that is, a page of even number followed by the next page), then vref produces ref followed by the phrase “on the facing page”. Moreover, in the next occurence of vref in a situation of the same type, the phrases are changed to “on the preceding page” and “on the next page” respectively. Page 10 of 16 The phrases used in the various case considered above can be customized by redefining the commands generating them. For the article class without the twoside option, reference to the previous page use the command reftextbefore and reference to the next page uses reftextafter. In the case of the article class with the twoside option or the book class, the commands reftextfaceafter and reftextfacebefore are used in the case of reference to a page in a double spread. The default definitions of these commands are given below. In all these, the two arguments of the command reftextvario are the phrases alternatively used in the repeated use of the reference as mentioned above. Go Back Full Screen Close Quit
  • 11. newcommand{reftextbefore} {on the reftextvario{preceding page}{page before}} newcommand{reftextafter} {on the reftextvario{following}{next} page} newcommand{reftextfacebefore} {on the reftextvario{facing}{preceding} page} newcommand{reftextfaceafter} {on the reftextvario{facing}{next}{page}} Why cross refer . . . A Let LTEX do it Pointing to a . . . You can customize the phrases generated in various situations by redefining these with phrases of your choice in the arguments of reftextvario. If you want to refer only to a page number using varioref, you can use the command Pointing outside . . . Lost the keys? . . . Title Page vpageref{key} to produce the page number of the object marked with label{key}. The phrases used in the various special cases are the same as described above, except that when the referred object and the reference fall on the same page, either the phrase “on this page” or “on the current page” is produced. The command used to generate these is reftextcurrenr whose default definition is newcommand{reftextcurrent} {on reftextvario{this}{the current} page} You can change the phrases “this” and “the current” globally by redefining this command. You can also make some local changes by using the two optional arguments that vpageref allows. Thus you can use the command vpageref[same page phrase][other page phrase]{key} Page 11 of 16 Go Back Full Screen Close Quit
  • 12. to refer to the page number of the object marked with label{key}. The same page phrase will be used if the object and the reference fall on the same page and the phrase other page phrase will be used, if they fall on different pages. Thus for example, the command see the vpageref[above table][table]{tabxy} Why cross refer . . . A Let LTEX do it Pointing to a . . . given in this document will produce Pointing outside . . . see the above table if the reference occurs on the same page as Table 12.6 and Lost the keys? . . . Title Page see the tableon page 6 if they fall on different pages. 12.4. Pointing outside – the package xr Page 12 of 16 Go Back Sometimes you may want to refer to something in a document other than the one you are working on. (This happens, for instance if you keep an article as separate files.) The package xr allows such external references. Full Screen If you want to refer to objects in a file named other.tex in your current document, load the package xr and set the external document as other.tex using the commands Close usepakage{xr} externaldocument{other} Quit
  • 13. in the preamble of the current document. Then you can use the ref and pageref to refer to anything that has been marked with the label command in either the current document or other.tex. Any number of such external documents can be specified. If same key is used to mark different objects in two such documents, there’ll be a conflict. To get over this, you can use the optional argument available in externaldocument command. If you say Why cross refer . . . A Let LTEX do it externaldocument[a-]{other} Pointing to a . . . Pointing outside . . . Lost the keys? . . . then a reference to label{key} in other.tex could be made by ref{a-key}. The prefix need not be a-; it can be any convenient string. 12.5. Title Page Lost the keys? Use lablst.tex One of the conveniences of using keys for cross references is that you need not keep track of the actual numbers, but then you’ll have to remember the keys. You can produce the list of keys A used in a document by running LTEX on the file lablst.tex. In my system, I do this by first typing Page 13 of 16 Go Back latex lablst Full Screen Close Quit
  • 14. A LTEXresponds as follows ********************************* * Enter input file name * without the .tex extension: ********************************* Why cross refer . . . A Let LTEX do it lablstfile= Pointing to a . . . Pointing outside . . . Lost the keys? . . . I type in the file name as cref which is the source of this document. I’m presented with another query. Title Page ********************************************** * Enter document class used in file cref.tex * with no options or extension: ********************************************** lablstclass= Page 14 of 16 So I type article. I am asked Go Back ******************************************** * Enter packages used in file cref.tex * with no options or extensions: ******************************************** Full Screen Close lablstpackages= Quit
  • 15. Here I need give only those packages used in the article which define commands used in section titles etc. need be given. So I type amsmath,array,enumerate Why cross refer . . . This produces a file lablst.dvi which I can view to see a list of keys used in the document. A Let LTEX do it Pointing to a . . . Finally if your text editor is GNU Emacs, then you can use its RefTeX package to automate generation, insertion and location of keys at the editing stage. Pointing outside . . . Lost the keys? . . . Click here to see lablst output Title Page Page 15 of 16 Go Back Full Screen Close Quit
  • 16. Why cross refer . . . File tutor.tex — lablst output () A Let LT X do it E Using document class: ../tugindia Pointing to a . . . and packages: txfonts,varioref,pdfscreen,colortbl,xspace,woodfont,tutorial,longtable,hhline,ifthen,lay 1 Pointing outside . . . Lost the keys? . . . Logical labels within sections A Cross References in LTEX 2 12.1 Why cross references? 2 12.2 A Let LTEX do it 12 intro Page: 2 1 2 3 12.6 12.2.1 12.2.1.1 12.1 12.2 Page: Page: Page: Page: Page: Page: Page: Page: 5 5 5 6 6 6 7 8 3 Page: Page: Page: 10 12 12 2 pre1 pre2 con tabxy mathref diffcon sumsq sum 12.3 12.1 Title Page Pointing to a page – the package varioref Page 16 of 16 8 diff1 1@xvr 1@vr Go Back 12.4 Pointing outside – the package xr 12 12.5 Lost the keys? Use lablst.tex 13 Bibliography logical labels Full Screen Close Quit