STD 12 Computer Chapter 12 Publishing Documents Using LaTeX
STD 12 Computer Chapter 12 Publishing Documents Using LaTeX
LaTeX Language
LaTeX is essentially a markup language.
LaTeX source consists of plain text with some parts of the text marked using markers
known as commands.
LaTeX commands start with a \ (backslash) character.
Command name may be a string of alphabetic letters only or may be a single non-
letter.
LaTeX commands are case-sensitive.
TeX Live, a software package of the TeX and LaTex combination.
LaTeX Package
Modern word processing software operates in WYSIWYG.
TeX was extended in LaTeX.
LaTeX itself also can be extended.
LaTeX hosted on the www.ctan.org website.
Full form of CTAN is The Comprehensive TeX Archive Network
It is extremely good for complex mathematical formula in nice looking and
appropriate way.
Using LaTeX
LaTeX documents are typically created using any plain text editor ( likeSciTE / gedit).
No Use Command
1 To define the document’s title \title
2 To specify the author(s) of \author
document.
3 To indicate the date the \date
document.
4 To explicitly specify logical \chapter,\section,
structure \subsection,\paragraph
It is necessary to provide the title and the author if you want LaTex to create an
automatic title for you.
Providing date is optional;if it is omitted then the date of compilation is used in the title.
Both LaTeX and Tex file extension is .tex
LaTeX has a command called pdflatex that produces the popular PDF (Portable
Document Format) format files.
PDF files are very popular for sharing printable document on the web.
PDF documents can be viewed in Ubuntu’s default document viewer, evince.
Hence the edit-compile-view cycles becomes:-
o Edit the document using any plain text editor like gedit/SciTE
o Compile the document by issuing the command pdflatex filename at the
command prompt.
o View the generated PDF file by either opening it from the GUI or by issuing the
command evince pdffilename at the command prompt.
SciTE has one advantage over gedit- one can compile & view the document from
within the SciTE program itself.
LaTeX Characters
Whitespace characters are the space, tab and new line.
It converts all occurrences of multiple consecutive whitespace into a single space
character.
To insert a break in lines use \\ at the end of each line.
Reserved characters in LaTeX :
#, $, %, &, _, {, }, ^, ~, \
Use follow term to use reserved characters :
\#, \$, \%, \&, \_, \{, \}, \^{}, \~{}, \textbackslash{}
< must be written as \textless and > as \textgreater.
The ` (grave accent or backquote) and ‘ (apostrophe or straight quote) are used around
text to put it in single quotes.
Double quotes are produced by repeating them twice.
LaTeX Group
LaTeX uses groups to mark portions of text.
A group is enclosed between curly braces { and }.
Groups are useful for applying few commands to a small amount of text such as a part
of a line, few lines or a paragraph.
Environment
Where a multitude of commands must be applied or where some commands have to be
applied to large portions, LaTeX provides a facility called environment.
For eg. Applying formatting a table or mathematical equation to several paragraphs
or whole sections.
Environment begins with
\begin {environment-name}
Environment ends with
\end {environment-name}
Environment can be nested.
LaTeX has several advanced features, including programming and automatically
generating parts of the documents or multiple documents (mail merge).
Comment
% character marks the beginning of a comment.
Comment is used to provide explanation for the complicated parts to makes it easy for
others to understand the code.
Everything from the % character up to the end of the line is treated as a comment.
It is completely ignored by the compilation process and hence never makes it into the
output.
Presented by Nuzhat Ibrahim Memon 2
Structure of a LaTeX Document
LaTeX document has 2 parts :
(1) Preamble
It contains metadata.
Metadata is information about the document.
(2) Content
Content is always inside the environment document.
Environment written between\begin {doc} and \end {doc}
Advantage of LaTeX
LaTeX has several benefits. Just as TeX was extended to LaTeX, LaTeX itself also can be
extended. Anyone can create additional packages to enhance the features provided in
LaTeX, to add new features or to provide alternate implementations. Thousands of such
packages have been created by LaTeX users around the world to cater to different needs.
Most of them are free. They are hosted on the CTAN (The Comprehensive TeX Archive
Network) website at www.ctan.org.
LaTeX is extremely good at laying out complex mathematical formulae in nice looking
and appropriate way.Because of this, it is quite popular among authors and publishers in
mathematics, engineering, computer science and other technical areas. Because it is open
source, highly systematic and is developed in the academic spirit of knowledge sharing
and collaboration, it is popular among academicians and scholars. People in these fields
use LaTeX, share their views and experiences, help one another, develop and share new
packages and drive the further development of LaTeX.
LaTeX has built-in facilities to automatically update numbering and references and to
automatically create table of contents, indexes, and other such needs, taking a major
burden off the mind of the author.