CBSE 2026 results are out, Mukul scored a perfect 100/100 in Computer ScienceSee all toppers →

KwickAcademy Course Topics · 8 min · free

Text/paragraph formatting, mathematical typesetting, chapters, sections and table of contents

8 min1 KwickClipsFull text belowFree
Kajal Ma'am (MCA), teaching since 2004Remembered in this browser

Learn LaTeX text formatting, font sizes, paragraphs, alignment, special characters, maths typesetting, chapters, sections and \tableofcontents. Maths goes between $ signs; \tableofcontents builds the contents list from your headings.

Follows the syllabus of: GSEB Std 12 Computer Studies

On screen in this lesson

What is LaTeX?

A typesetting system: you type text plus commands
Commands start with a backslash, like \textbf
The source file is saved with the .tex extension
Compiling the file produces a neat PDF

Formatting text

CommandEffectExample
\textbf{...}bold\textbf{Total}
\textit{...}italic\textit{Note}
\underline{...}underline\underline{Date}
\texttt{...}typewriter font\texttt{print}
\emph{...}emphasis\emph{must}

Font sizes

CommandSizeUse
\tinysmallesttiny labels
\smallsmallfootnotes
\normalsizenormalbody text
\Largelargeheadings
\Hugelargestposters

Paragraphs and line breaks

A blank line starts a new paragraph
Two backslashes break a line inside a paragraph
\noindent stops the first-line indent
Extra spaces and single line breaks are ignored

Special characters

Type thisTo printWhy
\%%% starts a comment
\$$$ starts maths
\&&& is for tables
\### is reserved
\___ means subscript

Mathematical typesetting

Inline maths: between two $ signs, like $a+b$
Display maths: \[ ... \] on its own centred line
equation environment: centred and numbered
Letters in maths are printed in italics

Quick answers

Does $x^10$ show x to the power 10?

No. Only the 1 is raised; write $x^{10}$.

Why compile twice?

So the contents page is up to date.

KwickClips from this lesson

Short clips, one idea each. Good for revision the night before.

The full lesson, in text

Hello students, welcome to Kwickprep. How do textbooks print perfect fractions and a neat contents page? Many of them use LaTeX. Today we will learn text and paragraph formatting, mathematics, chapters, sections and the table of contents in LaTeX.

First, what is LaTeX? LaTeX is a typesetting system, so you type plain text together with commands. Every command starts with a backslash, like backslash textbf. You save this source file with the .tex extension, in an editor such as TeXworks or Texmaker. When you compile the file, LaTeX turns it into a neat PDF document.

Here is the smallest LaTeX document. The first line chooses the document class, here article, for short documents. Everything you want printed goes between begin document and end document. This part is called the body. Compile it, and the PDF shows one line: Welcome to the Annual Day!

Text formatting commands take the text inside curly brackets. Backslash textbf makes text bold. Backslash textit makes it italic. Backslash underline draws a line under it. Backslash texttt uses a typewriter font, which is good for code. Backslash emph emphasises words, and it usually shows them in italics.

LaTeX also has ready commands for font size. Backslash tiny gives the smallest text. Backslash small is slightly smaller than normal. Backslash normalsize is the usual body size. Backslash Large, with a capital L, is bigger, and backslash Huge, with a capital H, is the largest. Remember that LaTeX commands are case sensitive.

Now paragraph formatting. To start a new paragraph, simply leave one blank line in the source file. To break a line without starting a new paragraph, type two backslashes. LaTeX indents the first line of a paragraph, and backslash noindent removes that indent. Also, LaTeX ignores extra spaces and single line breaks, so pressing space many times does nothing.

To align a paragraph, we use environments. An environment starts with begin and ends with end. Here, the center environment puts Annual Day Notice in the middle of the line. The flushright environment pushes Principal to the right margin. There is also flushleft for left alignment.

Some characters have special jobs in LaTeX, so we put a backslash before them to print them. Backslash percent prints the percent sign, because a plain percent starts a comment. Backslash dollar prints a dollar sign, because a dollar starts maths. Backslash ampersand prints an ampersand, which is used in tables. Backslash hash prints a hash sign. Backslash underscore prints an underscore, because a plain underscore means subscript.

LaTeX is famous for mathematical typesetting, which means printing formulas beautifully. For maths inside a sentence, write it between two dollar signs. For a formula on its own centred line, use backslash square bracket to open and close it. The equation environment also centres the formula and gives it a number, like one. In maths mode, letters are printed in italics automatically.

Here are the maths commands you must know. The caret sign makes a superscript, so x caret two is x squared. The underscore makes a subscript, like a sub one. Backslash frac, with two sets of curly brackets, makes a fraction, numerator first. Backslash sqrt gives a square root. And backslash times and backslash pi print the multiply sign and the Greek letter pi.

Let us typeset the quadratic formula. We open the equation environment. Then x equals backslash frac. The numerator is minus b, backslash pm for plus or minus, and the square root of b squared minus four a c. The denominator is two a. The PDF shows the formula centred, with the number one on the right.

Pause and predict, a common exam trap. Suppose you type dollar, x caret one zero, dollar. Will the PDF show x to the power ten? No. The caret raises only one character, so you get x to the power one, followed by a normal zero. Put the ten in curly brackets, and the whole ten is raised.

Long documents are divided into chapters and sections. Backslash chapter starts a new chapter, but it works only in the book and report classes, not in article. Backslash section is level one, and it works in every class. Backslash subsection is level two, inside a section. Backslash subsubsection is level three, the smallest numbered heading.

Here is a small report. We choose the report class, because we want chapters. Backslash tableofcontents prints the contents page. Then chapter Networks, section Types of network, and subsection LAN. LaTeX numbers them by itself: chapter one, section one point one, and subsection one point one point one.

Let us understand the table of contents properly. You never type the contents list yourself, because backslash tableofcontents builds it. It takes the heading names, their numbers and their page numbers from your chapters and sections. LaTeX collects them during the first compile and prints them on the second, so compile twice. If you write section with a star, the heading has no number and does not appear in the contents.

Let us revise what we learned today. Commands like textbf, textit, underline and the size commands format text. A blank line starts a new paragraph, and environments like center and flushright align it. Maths goes between dollar signs, or inside the equation environment. Caret makes a superscript, underscore a subscript, frac a fraction and sqrt a square root. Chapter and section divide the document, tableofcontents lists them, and you compile twice. Try typing a short project report of your own today.

Courses that teach this

CourseUnit
GSEB Std 12 Computer StudiesDocument Publishing and Free Tools

Voice-over in this lesson is AI-generated. The script is written and checked by Kajal Ma'am. Boards can revise a syllabus mid-year, so confirm anything you plan around against the official board circular. Keep your passwords, OTPs and ID numbers to yourself — we never ask for them. To reach Kajal Ma'am, use the WhatsApp button; sharing your number there is how we call you back.

Free to watch, no sign-up. Live classes with Kajal Ma'am are the paid course; these lessons stay free either way.

Want a plan that actually fits your board dates?

Ask Kajal Ma'am directly, 20+ years teaching computer science. Free demo class first, no payment.

Talk to Kajal Ma'am on WhatsApp

Or see the Class 12 Computer Science course →

Studying outside India?

We coach CBSE, IGCSE & international students across the globe, one-to-one, in your local time zone.

Visit International →