0% found this document useful (0 votes)
66 views10 pages

Lesson 12 - 50 Marks MCQ

This document discusses using LaTeX to publish documents. It covers installing LaTeX, the basic structure of LaTeX documents, formatting text and paragraphs, and page layout. Key aspects covered include compiling LaTeX files to PDF, using commands to structure documents and format elements, and adjusting font size and line spacing.

Uploaded by

rathodkushal037
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
66 views10 pages

Lesson 12 - 50 Marks MCQ

This document discusses using LaTeX to publish documents. It covers installing LaTeX, the basic structure of LaTeX documents, formatting text and paragraphs, and page layout. Key aspects covered include compiling LaTeX files to PDF, using commands to structure documents and format elements, and adjusting font size and line spacing.

Uploaded by

rathodkushal037
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Lesson: 12 publishing documents using Latex

=> In this chapter we shall discuss the TeX and LaTeX typesetting software. We shall discuss
the advantages of using LaTeX.
=> Then we will learn how to use LaTeX using TeX Live, a software package of the TeX/LaTeX
software combination along with the SciTE text editor.
Using LaTeX:
=> To use LaTeX, we need any LaTeX distribution (software). Most include TeX and some
additional software in them. TeX Live is a very popular LaTeX distribution available in the
standard Ubuntu repositories.
=> We also need a plain text editor and software to view the output file.
=> LaTeX can produce output in different file formats, and depending on the output file format,
corresponding viewer software is needed.
=> LaTeX documents are typically created using any plain text editor (like gedit or SciTE).
=> The different parts of the text are marked using LaTeX commands that associate a meaning
to them.
=> For example, \title is used to define the document’s title, \author to specify the author(s) of
the document and \date to indicate the date the document was created.
=> Similarly, \chapter, \section, \subsection, \paragraph can be used to explicitly specify the
logical structure of the document.
=> LaTeX comes with built-in ways to format these document elements in a pleasant-looking
professional style.
=> Both TeX and LaTeX use the file extentions .tex; LaTeX now has a command called pdflatex
that produces the popular PDF (Portable Document Format) format files.
=> PDF files are very popular for sharing printable documents on the web.
=> PDF documents can be viewed in Ubuntu’s default document viewer, evince. Hence the
edit-compile-view cycle becomes
1. Edit the document using any plain text editor like gedit
2. Compile the document by issuing the command pdflatex filename at the command prompt
(in the directory where the tex file was saved).
3. View the generated PDF file by either opening it from the GUI or by issuing the command
evinces pdffilename at the command prompt.
The LaTeX Language:
=> LaTeX is essentially a markup language. The LaTeX source consists of plain text, with some
part of the text marked up using markers known as command.
=> Some commands are independent commands - they do not mark any specific part of text.

1
=> LaTeX commands start with a \ (backslash) character followed by the command name.
=> The command name may be a string of alphabetic letters only, or may be a single non-letter.
=> LaTeX commands are case-sensitive (capital and small letters are treated as being
different).
=> There are two types of arguments. Optional arguments, as the name suggests, are not
mandatory. we may or may not provide them.
=> For example, if we issue a command \documentclass [12pt]{article}; then documentclass is
the name of command, 12pt is an optional argument while article is a compulsory argument.
=> LaTeX treats all whitespace characters (the space, tab and newline characters) as the
same.
=> It converts all occurrences of multiple consecutive whitespace into a single space character.
=> To insert a break in lines use \\ (the line break command) at the end of each line except the
last line in the paragraph.
=> The following character are reserved character in LaTeX;
# $ % & _(underscore) { } ^ ~ \
=> They have a special meaning in LaTeX. These characters cannot be used directly in our text
in LaTeX. If we want to use them in our text, we must use the following forms.
\# \$ \% \& \_ \{ \} \^{} \~{} \textbackslash{}
=> Note the special cases of the last three characters. The symbols < and > print very
differently by default (except in math mode). Hence they must be written as \textless and
\textgreater.
=> LaTeX uses groups to mark portions of text. A group is enclosed between curly braces {and}.
=> LaTeX provides a facility called environment; an environment begins with a \begin
{environment-name} command.
=> All the formatting characteristics of the environment are applied to the entire text inside the
environment.
=> Environments can be nested; we can have one environment inside another.
The Structure of a LaTeX Document:
=> A LaTeX document has two parts namely preamble and content.
=> The preamble contains metadata (data about data). In this case, the metadata is information
about the document (for example, what kind of document it is, who is the author, when was it
created.)
=> The actual content is always inside the environment document, written between
\begin{document} \end {document}.

2
The Preamble:
=> The very first element in the preamble must be \documentclass {document-class-name}
specifying the type of the document.

Document Class Purpose


Article For writing individual articles
Book For writing entire books.
Slides For creating presentation slides. It automatically sets larger font size.
Letter For writing letters.
Beamer For generating presentations similar to office suites using the beamer
package.

Option Function
10pt, 11pt, 12pt Sets the size of the main font in the document to 10 points (the default),
11 points and 12 points respectively.
A4paper, letterpaper, Defines the paper size. These are several international standard paper
legalpaper sizes. The most common paper sizes in regular office use are A4, letter
and legal.
Fleqn Displayed formulas and equations are flushed left (left-aligned) rather
than centered (the default).
Landscape Changes the layout of the document to print in landscape mode.

=> LaTeX distributions themselves usually come with a large number of such packages
preinstalled.
=> To use one or more packages in our document, we need to declare them in the preamble as
\usepackage{package-name}.
Package Description
Amsmath It contains the advanced math extensions for LaTeX originally developed
for the American Mathematical Society.
Color It adds support for colored text.
Easylist Adds support for multilevel lists.
Geometry For page layout tasks like setting paper size, orientation, margins, etc.
Listings Have special features for including programming code within the document.
setspace Lets you change line spacing.

3
The Document Environment:
=> The document environment for articles and slides will only have a title followed by the main
content of the document.
=> A title is automatically generated by LaTeX when it sees the \maketitle command.
=> The document environment of a book is divided into three main parts – the front matter, the
main matter and the back matter, denoted by the commands \frontmatter, \mainmatter and
\backmatter respectively.
=> A well-formatted table of contents (TOC) is generated automatically from the element titles
by LaTeX when it encounters the command \tableofcontents.
Example:
=> Create a new file in SciTE using the File -> New menu option.
=> Type the content.
=> Save the file using the File -> save menu option. Note that the extension of the file should
be .tex.
=> Now select the Tools -> Build menu option (shortcut key : F7) to compile your LaTeX file.
=> If the compilation was successful, you may select the Tools -> Go menu option (shortcut
key: F5) to view the file in the default document viewer.
Text Formatting
=> In LaTeX documents, we type a paragraph in a continuous flow without pressing the ENTER
key. LaTeX then adjusts the text automatically.
=> It decides how much text should go in the first line, how much text should go in the second
line, and so on according to the page width, font size, alignment option used.
=> LaTeX usually avoids breaking a word in two parts.
=> LaTeX uses the ~(tilde) character to denote a non-breaking space.
=> LaTeX divides font families into three categorie; Roman (also called serif) fonts have a tiny
line or curved called serif at the end of the strokes (lines), sans serif fonts do not have serifs
while monospace fonts use equal width for all characters.
=> Monospace fonts are typically used for computer code listings. The default fonts are Roman.
=> The font size can be changed using the commands \tiny, \scriptsize, \footnotesize, \small,
\normalsize, \large, \LARGE, \huge and \Huge. Notice that the commands are case-
sensitive.
Paragraph Formatting
=> In LaTeX, the setspace package provides the singlespace, onehalfspace, doublespace and
spacing{amount-of-spacing} environments for setting the line spacing.
=> The \indent and \noindent commands can be used immediately before a paragraph to
explicitl make the first line indented and unindented respectively.
4
Page Layout
=> In LaTeX, the geometry package can be used for page layout. The paper size and margins
can be passed as optional arguments with the \usepackage command itself.
=> E.g. \usepackage[a4paper,top=1in.bottom=2in,left=1.5in, right=1in]{geometry}
=> Documents can be either one-sided or two-sided. Articles are by default one-sided while
books are two-sided.
Type setting Mathematical Content in LaTeX
=> Ability of automatically laying out complex mathematical content is a major strength of
LaTeX.
=> The most common way of laying out mathematical content in LaTeX is using the packages
amsmath, amssymb and amsfonts created by the American Mathematical Society.
Using Mathematical Symbols
=> Mathematics uses a large number of symbols
< < > >
= = \leq ≤
\geq ≥ \neq ≠
\times X \div ÷
\pm ± \mp ∓
\in ∈ \notin ∉
\supset ⊃ \subset ⊂
\supseteq ⊇ \subseteq ⊆
\cup ⋃ \cap ⋂

Using Mathematical Operators


=> LaTeX supports a large number of mathematical operators. The power operator (x2) and the
index operator (x1) are not provided separately, but are implemented using the generic
superscript operator ^ (the caret character) and the generic subscript operator _(the
underscore character respectively.
=> Fractions are created using command \frac{numerator}{denominator}, while square root of a
number x is denoted using the command \sqrt{x}. These operators can be nested one inside
another.

5
Using Equations
=> LaTeX provides a special equation environment for typesetting equation is to be enclosed in
the equation environment. Equations are numbered automatically and center-aligned.

Advantages of LaTeX
=> LaTeX has several benefits. Just as TeX was extended to 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.
=> 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.

**************

6
Chapter – 12 - 50 Marks MCQ
1. Which of the following website hosts the LaTex packages?
(A) CTAN (B) CLAN (C) CTEN (D) CLEN
A
2. What is the full form of CTAN?
(A) Comprehensive Tex Active Network (B) Comprehensive Tex Archive Network
(C) Comprehensive Tex Advance Network (D) Comprehensive TeX Access Network
B
3. LaTeX hosted on which website?
(A) www.ctan.org (B) www.ctan.com (C) www.ctan.edu (D) www.ctan.in
A
4. Which of the following is a very popular LaTeX distribution available in the standard Ubuntu
repositories?
(A) Tax Live (B) Test Live (C) Tex Live (D) Text Live
C
5. Which text editor is used to create LaTeX document?
(A) SciTE, gedit (B) LaTeX, kedit (C) SciTE, Notepad (D) LaTeX, gedit
A
6. TeX and LaTeX use which file extension?
(A) .tax (B) .latex (C) .tex (D) .txt
C
7. Which of the following character is used to mark a comment in LaTeX?
(A) $ (B) % (C) # (D) &
B
8. LaTeX command starts with which character followed by the command name?
(A) \ (back slash) (B) / (front slash) (C) $ (Dollar) (D) – (Dash)
A
9. Which command in LaTeX is used to define the document’s title?
(A) \document (B) \title (C) \head (D) \heading
B
10. Which command is used to compile the LaTeX document at command prompt?
(A) pdf filename (B) pdftex filename
(C) pdftext filename (D) pdflatex filename
D
11. Which command is used to view the generated PDF file at the command prompt?
(A) view pdffilename (B) preview pdffilename
(C) evince pdffilename (D) open pdffilename
C
12. In LaTeX, which command is used to insert a break in line?
(A) ## (B) $$ (C) // (D) \\
D
13. In LaTex, how many types of arguments?
(A) 2 (B) 3 (C) 4 (D) 5
A
14. Which of the following option represents the types of arguments?
(A) Primary argument, Secondary argument (B) Main argument, Extra argument
(C) Optional argument, Mandatory argument (D) Master argument, Basic argument
C
7
15. From following LaTeX command which of the part is optional argument?
/documentclass [12pt] {article};
(A) Document [12pt] (B) 12pt (C) document (D) article
B
16. In LaTeX, optional arguments are written into which brackets?
(A) [ ] (B) { } (C) ( ) (D) < >
A
17. In LaTeX, mandatory arguments are written into which brackets?
(A) [ ] (B) { } (C) ( ) (D) < >
B
18. In LaTeX command one or more arguments are separated by which symbol?
(A) , (B) ; (C) . (D) :
A
19. Which of the following characters are reserved in LaTeX?
(A) #, $, % (B) &, _, {, } (C) ^, ~, \ (D) All of these
D
20. Which of the following is not a reserved character in LaTeX?
(A) # (B) @ (C) $ (D) %
B
21. Which of the following is a LaTeX document parts?
(A) Preamble, Content (B) Preamble, Document
(C) Begin, End (D) Start, Quit
A
22. Which of the following part of the LaTeX document contains the metadata?
(A) Preface (B) Comment (C) Preamble (D) Environment
C
23. Which of the following refer to the very first line in the preamble?
(A) \document (B) \class (C) \title (D) \documentclass
D
24. Which command is used to declare packages in the preamble of LaTeX document?
(A) \import {package-name} (B) \insert {package-name}
(C) \open {package-name} (D) \usepackage {package-name)
D
25. Which package contains the advanced math extensions in LaTeX?
(A) math (B) amsmath (C) setmath (D) easymath
B
26. Which package is used to adds support for multilevel lists in LaTeX?
(A) easylist (B) addlist (C) setlist (D) multilist
A
27. Which package is used for page layout tasks like setting paper size, orientation, margins etc.
in LaTex?
(A) easylist (B) setsapce (C) listings (D) geometry
D
28. Which package has special features for including programming code within the document?
(A) easylist (B) geometry (C) listings (D) setspace
C
29. Which package is used to change line spacing in LaTeX?
(A) spacing (B) setsapce (C) setspacing (D) easyspace
8
B
30. Which document class is used for writing individual articles in LaTeX?
(A) beamer (B) slides (C) article (D) book
C
31. Which document class is used for creating presentation slides?
(A) Impress (B) Beamer (C) Slides (D) Article
C
32. Which of the following begins with \begin {name} and ends with \ends {name} in LaTeX?
(A) Group (B) Section (C) Environment (D) Preamble
C
33. How many parts are there in LaTeX document environment of a Book?
(A) 2 (B) 3 (C) 4 (D) 5
B
34. Which command is used for the front matter, main mater and back matter respectively in
LaTeX document?
(A) \front, \main, \back (B) \front, \master, \back
(C) \frontmatter, \mainmatter, \backmatter (D) \frontmatter, \basicmatter, \backmatter
C
35. Which menu – option is used to compile a file in LaTeX?
(A) Tools  Build (B) Tools  Go (C) Format  Build (D) Format  Go
A
36. In SciTE editor, which of the following shortcut key is used to compile a file?
(A) F5 (B) F6 (C) F7 (D) F8
C
37. Which menu – option is used if the file compilation was successful in LaTeX?
(A) Tools  Build (B) Tools  Go (C) Format  Build (D) Format  Go
B
38. Which menu – option is used to view the file in the default document viewer in LaTeX?
(A) Tools  Build (B) Tools  Go (C) Format  Build (D) Format  Go
B
39. In sciTE editor, which shortcut key is used if the compilation was successful and to view the
file in document viewer?
(A) F5 (B) F6 (C) F7 (D) F8
A
40. Which of the following character is denote a non-breaking space in LaTeX?
(A) % (percentage) (B) # (hash) (C) \ (back slash) (D) ~ (tilde)
D
41. LaTeX divides font families into how many categories?
(A) 2 (B) 3 (C) 4 (D) 5
B
42. LaTeX divides font families into which categories?
(A) Roman (Serif), Sant Serif, Monospace (B) Roman (Serif), Sans Serif, Typespace
(C) Roman (Serif), Sans Serif, Tyype Serif (D) Roman (Serif), Sans Serif, Monospace
D
43. Which is used to write Roman, Sans Serif and Monospace fonts respectively in LaTeX?
(A) \textss{text}, \textsf(text}, \texttt{text} (B) \textrm{text}, \textsf{text}, \textms{text}
(C) \textrm{text}, \textsf{text}, \texttt{text} (D) \textrm{text}, \textsf{text}, \textmf{text}
C
9
44. In LaTeX, which command is used to bold, italic and emphasis effect to text respectively?
(A) \b, \i, \e (B) \bf, \it, \eh (C) \textbf, \textit, \emph (D) \fontbf, \fontit, \emph
C
45. In LaTeX packages like amsmath, amssymb and amsfonts is created by which of the
following society?
(A) Russian Mathematical Society (B) Indian Mathematical Society
(C) European Mathematical Society (D) American Mathematical Society
D
46. Which of the following commands generate the set Union ‘’ symbol in LaTeX?
(A) \union (B) \cap (C) \cup (D) \setunion
C
47. Which of the following operator is used to denote a superscript and subscript (index)?
(A) ^ (Caret) and _ (Underscore) (B) ^ (Caret) and – (Dash)
(C) # (Hash) and _ (Underscore) (D) # (Hash) and – (Dash)
A
48. In LaTeX, which command is used to print “Not equal to” symbol (#)?
(A) \net (B) \nodq (C) \neq (D) \nequal
C
49. In LaTeX, square root of a number x is denoted by which command?
(A) \sqrt[x] (B) \sqrt{x} (C) \sqrt<x> (D) \sqrt(x)
B
50. In LaTeX, fractions are created using which command?
(A) \frc (B) \frs (C) \frac (D) \fractions
C

===========

10

You might also like