VIII
.2. C
USTOM COMMANDS
81
x\circ y y = = x+y-xy
$$
This operation is associative.
Notethespacessurroundingthe◦symbolintheoutput.Ontheotherhandsupposeyou
want
Forrealnumbersxandy,defineanoperationby
xy=x
2
+y
2
The listofsymbols show thatthesymbolis producedby
\Box
butthatitis avail-
ableonlyinthepackagelatexsymoramssymb. Soifweloadone e oftheseusingthe
\usepackage
commandandthentype
For real numbers s $x$ and $y$, define e an n operation $\Box$ $ by
$$
x\Box y = xˆ2+yˆ2
$$
youwillonlyget
Forrealnumbersxandy,defineanoperationby
xy=x
2
+y
2
Notice thedifference? ? Therearenospacesaround; ; thisis because, this symbolis
notbydefaultdefinedas abinaryoperator. . (Notethatitis s classifiedunder“Miscel-
laneous”.) Butwe canaskT
E
X toconsider this symbolasa a binaryoperator r bythe
command
\mathbin
before
\Box
asin
For real numbers s $x$ and $y$, define e an n operation $\Box$ $ by
$$
x\mathbin\Box y=xˆ2+yˆ2
$$
andthiswillproducetheoutputshownfirst.
Thisholdsfor“Relations”also.T
E
Xleavessomespacearound“Relation”symbols
andwecaninstructT
E
Xtoconsideranysymbolasarelationbythecommand
\mathrel
.
Thuswecanproduce
Definetherelationρonthesetofrealnumbersbyxρyiffxyisarationalnumber.
bytyping
Define the relation $\rho$ on the e set t of real numbers by
$x\mathrel\rho y$ iff $x-y$ is a rational l number.
(Seewhathappensifyouremovethe
\mathrel
command.)
VIII
.2. C
USTOMCOMMANDS
WehaveseenthatLAT
E
Xproducesmathematics(andmanyotherthingsaswell)bymeans
of“commands”. Theinterestingthingisthatwecanbuildour r owncommandsusing
theones available. . For r example, suppose that t ttheexpression (x
1
,x
2
,...,x
n
)occurs
frequentlyinadocument.Ifwenowwrite
Change font size pdf document - Compress reduce PDF size in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
C# Code & .NET API to Compress & Decompress PDF Document
pdf form change font size; pdf paper size
Change font size pdf document - VB.NET PDF File Compress Library: Compress reduce PDF size in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
VB.NET PDF Document Compression and Decompression Control SDK
best way to compress pdf; change font size in fillable pdf
82
VIII
. T
YPESETTING
M
ATHEMATICS
\newcommand{\vect}{(x_1,x_2,\dots,x_n)}
Thenwecantype
$\vect$
anywhereafterwardstoproduce(x
1
,x
2
,...,x
n
)asin
We often n write e $x$ $ to o denote e the e vector $\vect$.
toget
Weoftenwritextodenotethevector(x
1
,x
2
,...,x
n
).
(Bytheway,thebestplacetokeepsuch“newcommands”isthepreamble,sothatyou
canusethemanywhereinthedocument.Also,itwillbeeasiertochangethecommands,
iftheneedarises).
OK,wecannowproduce(x
1
,x
2
,...,x
n
)with
$\vect$
,buthowabout(y
1
,y
2
,...,y
n
)
or(z
1
,z
2
,...,z
n
)?Dowehavetodefinenewcommandsforeachofthese?Notatall.We
canalsodefinecommandswithvariableargumentsalso.Thusifwechangeourdefinition
of
\vect
to
\newcommand{\vect}[1]{(#1_1,#1_2,\dots,#1_n)}
Thenwecanuse
$\vect{x}$
toproduce(x
1
,x
2
,...,x
n
)and
$\vect{a}$
toproduce
(a
1
,a
2
,...,a
n
)andsoon.
Theformofthisdefinitioncallsfor somecomments. . The
[1]
inthe
\newcommand
aboveindicatesthatthecommandistohaveone(variable)argument. Whataboutthe
#1
? Beforeproducingtheoutput,eachoccurrenceof
#1
willbereplacedbythe(single)
argumentwesupplyto
\vect
intheinput. For r example,theinput
$\vect{a}$
willbe
changedto
$(a_1,a_2,\dots,a_n)$
atsomestageofthecompilation.
Wecanalsodefinecommandswithmorethanoneargument(themaximumnumber
is9).Thusforexample,ifthedocumentcontainsnotonly(x
1
,x
2
,...,x
n
),(y
1
,y
2
,...,y
n
)
andsoon,but(x
1
,x
2
,...,x
m
),(y
1
,y
2
,...,y
p
)also,thenwecanchangeourdefinitionof
\vect
to
\newcommand{\vect}[2]{(#1_1,#1_2,\dotsc,#1_#2)}
sothatwecanuse
$\vect{x}{n}$
toproduce(x
1
,x
2
,...,x
n
)and
$\vect{a}{p}$
topro-
duce(a
1
,a
2
,...,a
p
).
VIII
.3. M
OREONMATHEMATICS
TherearesomemanyotherfeaturesoftypesettingmathinLAT
E
X,butthesehavebetter
implementationsinthepackageamsmathwhichhassomeadditionalfeaturesaswell.So,
fortherestofthechapterthediscussionwillbewithreferencetothispackageandsome
alliedones.Thusalldiscussionbelowisundertheassumptionthatthepackageamsmath
hasbeenloadedwiththecommand
\usepackage{amsmath}
.
VIII
.3.1. Singleequations
Inadditiontothe LAT
E
Xcommands fordisplayingmathas discussedearlier,theams-
mathalsoprovidesthe
\begin{equation*} ... \end{equation*}
construct. Thuswith
thispackageloaded,theoutput
TheequationrepresentingastraightlineintheCartesianplaneisoftheform
ax+by+c=0
wherea,b,careconstants.
canalsobeproducedby
C# PDF insert text Library: insert text into PDF content in C#.net
Powerful .NET PDF edit control allows modify existing scanned PDF text. Ability to change text font, color, size and location and output a new PDF document.
can a pdf be compressed; change font size in pdf
C# PDF Annotate Library: Draw, edit PDF annotation, markups in C#.
Able to edit and change PDF annotation properties such as font size or color. Abilities to draw markups on PDF document or stamp on PDF file.
adjust size of pdf in preview; pdf compress
VIII
.3. M
ORE ONMATHEMATICS
83
The equation n representing a straight t line in n the Cartesian plane is
of the form
\begin{equation*}
ax+by+c=0
\end{equation*}
where $a$, $b$, $c$ are e constants.
Whythe*after
equation
?Supposewetryitwithoutthe*as
The equation n representing a straight t line in n the Cartesian plane is
of the form
\begin{equation}
ax+by+c=0
\end{equation}
where $a$, $b$, $c$ are e constants.
weget
TheequationrepresentingastraightlineintheCartesianplaneisoftheform
(
VIII
.1)
ax+by+c=0
wherea,b,careconstants.
Thisprovidestheequationwithanumber.Wewilldiscussequationnumberinginsome
moredetaillateron. Forthetimebeing,wejustnotethatforanyenvironmentname
withastarwediscusshere,theunstarredversionprovidestheoutputwithnumbers.
Ordinarytextcanbeinsertedinsideanequationusingthe
\text
command. Thus
wecanget
Thusforallrealnumbersxwehave
x≤|x| and x≥|x|
andso
x≤|x| forallxinR.
from
Thus for r all l real numbers $x$ we have
\begin{equation*}
x\le|x|\quad\text{and}\quad x\ge|x|
\end{equation*}
and so
\begin{equation*}
x\le|x|\quad\text{for all l $x$ in $R$}.
\end{equation*}
Note theuse ofdollarsigns inthe second
\text
abovetoproducemathematical
symbolswithin
\text
.
Sometimesasingleequationmaybetoolongtofitintooneline(orsometimeseven
twolines).Lookattheonebelow:
(a+b+c+d+e)
2
=a
2
+b
2
+c
2
+d
2
+e
2
+2ab+2ac+2ad+2ae+2bc+2bd+2be+2cd+2ce+2de
C# PDF Sticky Note Library: add, delete, update PDF note in C#.net
Able to change font size in PDF comment box. Note is a necessary feature in PDF annotation, which bring users quick and efficient working with PDF Document.
pdf reduce file size; pdf page size
C# PDF Convert to Word SDK: Convert PDF to Word library in C#.net
target PDF document, keeps the elements (like images, tables and chats) of original PDF file and maintains the original text style (including font, size, color
batch reduce pdf file size; adjust pdf size preview
84
VIII
. T
YPESETTING
M
ATHEMATICS
This is producedbytheenvironment
multline*
(notethe spellingcarefully—itis not
mult
i
line
),asshownbelow.
\begin{multline*}
(a+b+c+d+e)ˆ2=aˆ2+bˆ2+cˆ2+dˆ2+eˆ2\\
+2ab+2ac+2ad+2ae+2bc+2bd+2be+2cd+2ce+2de
\end{multline*}
multline
canbeusedforequationsrequiringmorethantwolines,butwithouttweaking,
theresultsarenotverysatisfactory.Forexample,theinput
\begin{multline*}
(a+b+c+d+e+f)ˆ2=aˆ2+bˆ2+cˆ2+dˆ2+eˆ2+fˆ2\\
+2ab+2ac+2ad+2ae+2af\\
+2bc+2bd+2be+2bf\\
+2cd+2ce+2cf\\
+2de+2df\\
+2ef
\end{multline*}
produces
(a+b+c+d+e+f)
2
=a
2
+b
2
+c
2
+d
2
+e
2
+f
2
+2ab+2ac+2ad+2ae+2af
+2bc+2bd+2be+2bf
+2cd+2ce+2cf
+2de+2df
+2ef
Bydefault,the
multline
environmentplacesthefirstlineflushleft,thelastlineflushright
(exceptforsomeindentation)andthelinesinbetween,centeredwithinthedisplay.
Abetterwaytotypesettheabovemultiline(notmultline)equationisasfollows.
(a+b+c+d+e+f)
2
=a
2
+b
2
+c
2
+d
2
+e
2
+f
2
+2ab+2ac+2ad+2ae+2af
+2bc+2bd+2be+2bf
+2cd+2ce+2cf
+2de+2df
+2ef
Thisisdoneusingthe
split
environmentasshownbelow.
\begin{equation*}
\begin{split}
(a+b+c+d+e+f)ˆ2 & = = aˆ2+bˆ2+cˆ2+dˆ2+eˆ2+fˆ2\\
&\quad +2ab+2ac+2ad+2ae+2af\\
&\quad +2bc+2bd+2be+2bf\\
&\quad +2cd+2ce+2cf\\
&\quad +2de+2df\\
&\quad +2ef
\end{split}
\end{equation*}
C# PDF Field Edit Library: insert, delete, update pdf form field
A best C#.NET PDF document SDK library for PDF form field Able to add text field to specified PDF file position in C# Support to change font size in PDF form.
pdf font size change; adjusting page size in pdf
C# PDF: Use C# Code to Add Watermark to PDF Document
into your C#.NET class application, developers can easily add a transparent watermark with desired font color, size and position onto target PDF document page.
change font size on pdf text box; pdf page size limit
VIII
.3. M
ORE ONMATHEMATICS
85
Somecommentsseemstobeinorder.Firstnotethatthe
split
environmentcannot
beusedindependently, butonlyinsidesomeequationstructuresuchas
equation
(and
otherswewillsoonsee).Unlike
multline
,the
split
environmentprovidesforalignment
amongthe“split”lines(usingthe&character,asin
tabular
).Thusintheaboveexample,
allthe+signsarealignedandtheseinturnarealignedwithapointa
\quad
totheright
ofthe=sign.Itisalsousefulwhentheequationcontainsmultipleequalitiesasin
(a+b)
2
=(a+b)(a+b)
=a
2
+ab+ba+b
2
=a
2
+2ab+b
2
whichisproducedby
\begin{equation*}
\begin{split}
(a+b)ˆ2 & & = = (a+b)(a+b)\\
& = = aˆ2+ab+ba+bˆ2\\
& = = aˆ2+2ab+bˆ2
\end{split}
\end{equation*}
VIII
.3.2. Groupsofequations
Agroupofdisplayedequationscanbetypesetinasinglegousingthe
gather
environ-
ment.Forexample,
(a,b)+(c,d)=(a+c,b+d)
(a,b)(c,d)=(acbd,ad+bc)
canbeproducedby
\begin{gather*}
(a,b)+(c,d)=(a+c,b+d)\\
(a,b)(c,d)=(ac-bd,ad+bc)
\end{gather*}
Nowwhenseveralequationsaretobeconsideredoneunit,thelogicallycorrectway
oftypesettingthemiswithsomealignment(anditisperhapseasierontheeyetoo).For
example,
Thusx,yandzsatisfytheequations
x+yz=1
xy+z=1
Thisisobtainedbyusingthe
align*
environmentasshownbelow
Thus $x$, $y$ $ and d $z$ satisfy the e equations
\begin{align*}
x+y-z & = 1\\
x-y+z & = 1
\end{align*}
Generate Barcodes in Web Image Viewer| Online Tutorials
Select "Generate" to process barcode generation; Change Barcode Properties. Select "Font" to choose human-readable text font style, color, size and effects;
change pdf page size; advanced pdf compressor online
VB.NET Image: Visual Basic .NET Guide to Draw Text on Image in .
Please note that you can change some of the example, you can adjust the text font, font size, font type (regular LoadImage) Dim DrawFont As New Font("Arial", 16
adjust pdf page size; change font size pdf
86
VIII
. T
YPESETTING
M
ATHEMATICS
Wecanaddashortpieceoftextbetweentheequations,withoutdisturbingthealignment,
usingthe
\intertext
command.Forexample,theoutput
Thusx,yandzsatisfytheequations
x+yz=1
xy+z=1
andbyhypothesis
x+y+z=1
isproducedby
Thus $x$, $y$ $ and d $z$ satisfy the e equations
\begin{align*}
x+y-z & = 1\\
x-y+z & = 1\\
\intertext{and by hypothesis}
x+y+z & =1
\end{align*}
Wecanalsosetmultiple‘columns’ofalignedequationssidebysideasin
Comparethefollowingsetsofequations
cos
2
x+sin
2
x=1
cosh
2
x−sinh
2
x=1
cos
2
x−sin
2
x=cos2x
cosh
2
x+sinh
2
x=cosh2x
Allthatitneedsareextra
&
’stoseparatethecolumnsascanbesenfromtheinput
Compare the following sets of equations
\begin{align*}
\cosˆ2x+\sinˆ2x & = 1
& \coshˆ2x-\sinhˆ2x & = 1\\
\cosˆ2x-\sinˆ2x & = \cos 2x & \coshˆ2x+\sinhˆ2x & & = = \cosh 2x
\end{align*}
Wecanalsoadjustthehorizontalspacebetweentheequationcolumns.Forexample,
Compare the sets of equations
\begin{align*}
\cosˆ2x+\sinˆ2x & = 1
&\qquad \coshˆ2x-\sinhˆ2x x & & = 1\\
\cosˆ2x-\sinˆ2x & = \cos 2x &\qquad \coshˆ2x+\sinhˆ2x & = \cosh 2x
\end{align*}
gives
Comparethesetsofequations
cos2x+sin
2
x=1
cosh
2
x−sinh
2
x=1
cos
2
x−sin
2
x=cos2x
cosh
2
x+sinh
2
x=cosh2x
Perhapsanicerwayoftypesettingtheaboveis
VIII
.3. M
ORE ONMATHEMATICS
87
Comparethefollowingsetsofequations
cos
2
x+sin
2
x=1
cos
2
x−sin
2
x=cos2x
and
cosh
2
x−sinh
2
x=1
cosh
2
x+sinh
2
x=cosh2x
Thiscannotbeproducedbytheequationstructuresdiscussedsofar,becauseanyofthese
environmentstakesuptheentirewidthofthetextforitsdisplay,sothatwecannotput
anythingelseonthesameline. Soamsmathprovides s variants
gathered
,
aligned
and
alignedat
whichtakeuponlytheactualwidthofthecontentsfortheirdisplay.Thusthe
aboveexampleisproducedbytheinput
Compare the e following sets of equations
\begin{equation*}
\begin{aligned}
\cosˆ2x+sinˆ2x
& = 1\\
\cosˆ2x-\sinˆ2x & = \cos 2x
\end{aligned}
\qquad\text{and}\qquad
\begin{aligned}
\coshˆ2x-\sinhˆ2x & = 1\\
\coshˆ2x+\sinhˆ2x & = \cosh 2x
\end{aligned}
\end{equation*}
Anotheroftenrecurringstructureinmathematicsisadisplaylikethis
|x|=
x
ifx≥0
ifx≤0
Thereisaspecialenvironment
cases
inamsmathtotakecareofthese.Theaboveexam-
pleisinfactproducedby
\begin{equation*}
|x| =
\begin{cases}
x & \text{if $x\ge 0$}\\
-x & & \text{if f $x\le e 0$}
\end{cases}
\end{equation*}
VIII
.3.3. Numberedequations
We have mentionedthateachofthethe‘starred’equationenvironmentshas acorre-
spondingunstarredversion,whichalsoproducesnumbersfortheirdisplays. Thusour
veryfirstexampleofdisplayedequationswith
equation
insteadof
equation*
asin
The equation n representing a straight t line in n the Cartesian plane is
of the form
\begin{equation}
ax+by+c=0
\end{equation}
where $a$, $b$, $c$ are e constants.
88
VIII
. T
YPESETTING
M
ATHEMATICS
produces
TheequationrepresentingastraightlineintheCartesianplaneisoftheform
(
VIII
.2)
ax+by+c=0
wherea,b,careconstants.
Why
VIII
.2for theequationnumber? ? Well, , this is Equationnumber2ofChap-
ter
VIII
,isn’tit? Ifyouwantthesectionnumberalsointheequationnumber,justgive
thecommand
\numberwithin{equation}{section}
WecanalsooverridethenumberLAT
E
Xproduceswithoneofourowndesignwiththe
\tag
commandasin
The equation n representing a straight t line in n the Cartesian plane is
of the form
\begin{equation}
ax+by+c=0\tag{L}
\end{equation}
where $a$, $b$, $c$ are e constants.
whichgives
TheequationrepresentingastraightlineintheCartesianplaneisoftheform
(L)
ax+by+c=0
wherea,b,careconstants.
Thereisalsoa
\tag*
commandwhichtypesetstheequationlabelwithoutparentheses.
Whataboutnumberingalignmentstructures? Exceptfor
split
and
aligned
, all
otheralignmentstructureshaveunstarredformswhichattachnumberstoeachaligned
equation.Forexample,
\begin{align}
x+y-z & = 1\\
x-y+z & = 1
\end{align}
gives
x+yz=1
(
VIII
.3)
xy+z=1
(
VIII
.4)
Hereisalso,youcangivealabelofyourowntoanyofthe equationswiththe
\tag
command. Becarefultogivethe
\tag
beforetheendoflinecharacter
\\
though. (See
whathappensifyougivea
\tag
commandaftera
\\
.)Youcanalsosuppressthelabelfor
anyequationwiththe
\notag
command.Theseareillustratedinthesampleinputbelow:
Thus $x$, $y$ $ and d $z$ satisfy the e equations
\begin{align*}
VIII
.4. M
ATHEMATICS MISCELLANY
89
x+y-z & = 1\ntag\\
x-y+z & = 1\notag\\
\intertext{and by hypothesis}
x+y+z & =1\tag{H}
\end{align*}
whichgivesthefollowingoutput
Thusx,yandzsatisfytheequations
x+yz=1
xy+z=1
andbyhypothesis
x+y+z=1
(H)
Whatabout
split
and
aligned
? Aswehaveseen,thesecanbeusedonlywithin
someotherequationstructure. Thenumberingorthelackofitis s determinedbythis
parentstructure.Thus
\begin{equation}
\begin{split}
(a+b)ˆ2 & & = = (a+b)(a+b)\\
& = = aˆ2+ab+ba+bˆ2\\
& = = aˆ2+2ab+bˆ2
\end{split}
\end{equation}
gives
(a+b)
2
=(a+b)(a+b)
=a
2
+ab+ba+b
2
=a
2
+2ab+b
2
(
VIII
.5)
VIII
.4. M
ATHEMATICS MISCELLANY
TherearemorethingsMathematicsthanjustequations.LetuslookathowLAT
E
Xandin
particular,theamsmathpackagedealswiththem.
VIII
.4.1. Matrices
Matricesarebydefinitionnumbersormathematicalexpressionsarrangedinrowsand
columns.Theamsmathhasseveralenvironmentsforproducingsucharrays.Forexample
90
VIII
. T
YPESETTING
M
ATHEMATICS
Thesystemofequations
x+yz=1
xy+z=1
x+y+z=1
canbewritteninmatrixtermsas
1
1
−1
1 −1
1
1
1
1
x
y
z
=
1
1
1
.
Here,thematrix
1
1
−1
1 −1
1
1
1
1
isinvertible.
isproducedby
The system m of f equations
\begin{align*}
x+y-z & = 1\\
x-y+z & = 1\\
x+y+z & = 1
\end{align*}
can be e written in matrix terms as
\begin{equation*}
\begin{pmatrix}
1 &
1 & -1\\
1 & -1 &
1\\
1 &
1 &
1
\end{pmatrix}
\begin{pmatrix}
x\\
y\\
z
\end{pmatrix}
=
\begin{pmatrix}
1\\
1\\
1
\end{pmatrix}.
\end{equation*}
Here, the matrix
$\begin{pmatrix}
1 &
1 & & -1\\
1 & & -1 1 &
1\\
1 &
1 &
1
\end{pmatrix}$
is invertible.
Note thattheenvironment
pmatrix
canbeusedwithinin-textmathematics or in
displayedmath. Whythe
p
?Thereisindeedanenvironment
matrix
(withouta
p
)butit
Documents you may be interested
Documents you may be interested