SlideShare a Scribd company logo
17
Most read
22
Most read
23
Most read
Basic structure of a LaTeX 2e
M. Gayathri, M.Sc, M.Phil.
Assistant Professor
Department of Mathematics
Sri Sarada Niketan college of Science for Women , Karur-5
INTRODUCTION
TEX
 TEX is a computer program created by Donald E. Knuth. The original
program was aimed at typesetting text and mathematical formulae. Knuth
started writing the TEX typesetting engine in 1977 to explore the potential of
digital printing equipment. These new devices were beginning to infiltrate
the publishing industry at that time. His goal was to reverse the trend of
deteriorating typographical quality that he saw affecting his own books and
articles. The first stable version of TEX was released in 1982. Version 3.0 was
released in 1989 to better support 8-bit characters and multiple languages.
Knuth considered the TEX-design to be complete with the release of Version
3. TEX is renowned for being extremely stable, for running on many kinds of
computers, and for being virtually bug free. The version number of TEX is
converging to the constant and is now at 3.141592653.
𝜋
LaTeX
 LaTeX is a set of macros for the TEX engine. LaTeX was originally developed by Leslie
Lamport for his own use. After some consideration, he decided to make them more
general so that others could use them for their own projects. Thus, in 1985, the first
version of LaTeX named LaTeX 2.09 was released. The original LaTeX became quite
popular and promoted the creation of many extension packages. Unfortunately,
some of the more popular extensions were not compatible with each other. LaTeX 2e
managed to unify many of the extensions, and also provided an extension
packaging system, dealing with third party extensions in a standardized way.
 The original LaTeX became quite popular and promoted the creation of many
extension packages. Unfortunately, some of the more popular extensions were not
compatible with each other. LaTeX 2e managed to unify many of the extensions,
and also provided an extension packaging system, dealing with third party
extensions in a standardized way.
Basic structure of a LaTeX 2e:
 Preamble: This is the beginning of the document, where you define the
document class, packages, and other settings.
 Document body: This is the main content of the document, where you write
your text, equations, figures, tables, etc.
 Document end: This is the end of the document, where you can add final
commands or text.
Example
 documentclass{article}
 usepackage{amsmath}
 title{My Document}
 author{My Name}
 date{today}
 begin{document}
 maketitle
 section{Introduction}
 This is the introduction.
 section{Method}
 This is the method.
 section{Result}
 This is the result.
 section{Conclusion}
 This is the conclusion.
 end{document}
Layout Design
 The layout of a LaTeX document is determined by the document class and
packages used. Here are some common layout elements:
 Margins: The space between the text and the edge of the page.
 Headers and Footers: The text at the top and bottom of each page.
 Columns: Multiple columns of text on a page.
 Sections: Divisions of the document, such as introduction, method, result, and
conclusion.
 Subsections: Subdivisions of sections.
 Paragraphs: Blocks of text.
 Lists: Ordered or unordered lists of items.
 Figures and Tables: Graphics and tabular data.
 Captions: Text describing figures and tables.
 References: Citations and bibliography.
Layout Design (cont..)
1. Document Class
 The layout often starts with the document class. Common classes include `article`, `report`,
and `book`.
 documentclass[a4paper,12pt]{article} % Options for paper size and font size
2. Margins
 You can adjust the margins using the `geometry` package, which offers great flexibility.
 usepackage[a4paper, margin=1in]{geometry} % Sets 1-inch margins on all sides
3. Page Layout
 You can control the overall layout with parameters like `setlength`. Here are some
common lengths you might adjust:
 setlength{parindent}{0pt} % No paragraph indentation
 setlength{parskip}{1em} % Space between paragraphs
Layout Design (cont..)
4. Sections and Headings
 Use sectioning commands to create a structured layout:
 section{Main Section}
 subsection{Subsection}
 subsubsection{Subsubsection}
 You can customize the appearance of headings using packages like
`titlesec`.
Layout Design (cont..)
5. Lists
 LaTeX provides various list environments to organize content:
 begin{itemize} % Bulleted list
 item First item
 item Second item
 end{itemize}
 begin{enumerate} % Numbered list
 item First item
 item Second item
 end{enumerate}
Layout Design (cont..)
6.Headers and Footers
 You can customize headers and footers using the `fancyhdr` package:
 usepackage{fancyhdr}
 pagestyle{fancy}
 fancyhf{}
 fancyhead[L]{Left Header}
 fancyhead[C]{Center Header}
 fancyhead[R]{Right Header}
 fancyfoot[C]{thepage} % Page number in the center of the footer
7. Font and Text Styles
 You can change the font family and size, as well as styles like bold and italics:
 textbf{Bold text}
 textit{Italic text}
8. Custom Layouts
 For more complex layouts, you might consider using packages like `layout`, which provides commands
to visualize the current layout parameters:
 usepackage{layout}
 layout
Advantages and Disadvantages
The main advantages of LATEX over normal word processors are the following:
 Professionally crafted layouts are available, which make a document really look as if
“printed”.
 The typesetting of mathematical formulae is supported out of the box.
 Users only need to learn a few easy-to-understand commands that specify the
logical structure of a document. They almost never need to tinker with the actual
layout of the document.
 Even complex structures, such as footnotes, references, table of contents, and
bibliographies, can be generated easily.
 Free add-on packages exist for many typographical tasks not directly supported by
basic LATEX. For example, packages are available to include PostScript graphics or
to typeset bibliographies con forming to exact standards. Many of these add-on
packages are described in The LATEX Companion.
 LATEX encourages authors to write well-structured texts, because this is how LATEX
works—by specifying structure.
 TEX, the formatting engine of LATEX, is highly portable and free. Therefore, the system
runs on almost any hardware platform available.
Advantages and Disadvantages (cont..)
LATEX also has some disadvantages, and I guess it’s a bit difficult for me to find
any sensible ones, though I am sure other people can tell you hundreds .
 LATEX does not work well for people who have sold their souls …
 Although some parameters can be adjusted within a predefined
document layout, the design of a whole new layout is difficult and takes a
lot of time.
 It is very hard to write unstructured and disorganized documents.
 Your hamster might, despite some encouraging first steps, never be able to
fully grasp the concept of Logical Markup.
EDITORS
 It allow users to define formatting of text beforehand through markup-level
instructions and once the content is inserted, the document is ready to be
exported as a PDF or any other file format. Mathematical equations are
exceptionally handled by these editors and they were the primary reasons
leading to its development in the first place.
EDITORS (cont…)
 LaTeX editors are software applications that facilitate editing and compiling LaTeX
documents. Here are some popular LaTeX editors:
 TeXstudio: A free, open-source editor with syntax highlighting, code completion, and a
built-in PDF viewer.
 TeXmaker: A free, open-source editor with syntax highlighting, code completion, and a
built-in PDF viewer.
 Sublime Text: A popular, feature-rich editor with LaTeX plugin support.
 Atom: An open-source editor with LaTeX plugin support.
 Visual Studio Code: A popular, open-source code editor with LaTeX extension support.
 Overleaf: A web-based LaTeX editor with real-time collaboration and cloud compilation.
 ShareLaTeX: A web-based LaTeX editor with real-time collaboration and cloud
compilation.
 LyX: A free, open-source editor with a graphical interface and WYSIWYM (what you see is
what you mean) approach.
 Gummi: A free, open-source editor with a graphical interface and live preview.
 LaTeXila: A free, open-source editor for Linux with syntax highlighting and code
completion.
Forward Search & Inverse Search
 Forward search and inverse search are features in LaTeX editors that
enhance the workflow by allowing you to navigate between the source
code and the compiled PDF document seamlessly. Here’s a breakdown of
both concepts, along with how to set them up in popular LaTeX editors.
Forward Search
 Forward search allows you to click on a specific point in your LaTeX source
code and view the corresponding location in the compiled PDF. This is
especially useful for quickly checking how changes in the code affect the
final output.
Inverse Search
 Inverse search enables you to click on a specific location in the PDF, which
then takes you back to the corresponding line in the LaTeX source code.
This is helpful for quickly locating the code that generated a specific part of
the document.
Forward Search & Inverse Search (cont..)
Setting Up Forward and Inverse Search
1. TeXworks
 - Forward Search: Automatically supported; just click in the PDF after compiling.
 - Inverse Search: Click in the PDF while holding the Shift key, and it will highlight the corresponding line in the
editor.
2. TeXShop (macOS)
 - Forward Search: Click in the TeX source file, then compile to see the changes in the PDF.
 - Inverse Search: Click in the PDF, and it will return you to the corresponding line in the source code.
3. TeXmaker
 - Forward Search: Click on the “View” button after compiling to jump to the PDF.
 - Inverse Search: Enable the feature in settings; it generally supports inverse search with external PDF viewers.
4. WinEdt
 - Forward Search: Click in the source and compile to see changes in the PDF.
 - Inverse Search: Requires configuration in the PDF viewer settings. Make sure it’s set up to send back to
WinEdt.
5. LyX
 - Forward Search: Automatically syncs when you compile and view the PDF.
 - Inverse Search: Clicking in the PDF will bring you back to the LyX document.
Forward Search & Inverse Search (cont..)
6. VS Code with LaTeX Workshop
 - Forward Search: Use the command palette or appropriate shortcuts to build and view the PDF.
 - Inverse Search: Clicking in the PDF can be set up to navigate back to the editor with the right configuration.
7. Sublime Text with LaTeXTools
 - Forward Search: Automatically syncs when compiling.
 - Inverse Search: Requires configuration of the PDF viewer to send information back to Sublime Text.
 Configuring PDF Viewers
 To enable inverse search, you often need to configure your PDF viewer:
8. Adobe Reader:
 - Go to Preferences > General, and check the option for "Enable inverse search."
9. Okular:
 - It supports inverse search out of the box. You just need to configure the settings in your LaTeX editor to point to
Okular.
10. SumatraPDF:
 - Set the command for inverse search in the editor settings (e.g., `sumatrapdf.exe -inverse-search "C:PathTo
Editor.exe %f -line %l"`).
 Both forward and inverse search significantly enhance the efficiency of working with LaTeX documents. By configuring
your editor and PDF viewer correctly, you can create a smooth workflow that allows for rapid iteration and editing.
Compiling
A LaTeX document, saved as a .tex file, must be compiled in order to turn it
into a readable document. A compiled .tex file will output either a .dvi, .ps
(PostScript), or .pdf document. Most TeX distributions' default output is .dvi,
but .ps or .pdf documents are relatively easy to produce as well.
There two general ways to compile a LaTeX document:
 Using a LaTeX editor/compiler
 Using the command line/terminal
Compiling (cont..)
1. Compiling in LaTeX Editors
Overleaf
 How to Compile: Overleaf automatically compiles your document as you type. You can also manually
trigger compilation by clicking the "Recompile" button.
 Output: The PDF is displayed on the right side of the editor.
TeXworks
 How to Compile: Open your `.tex` file and click the green "Typeset" button (or press `Ctrl + T`).
 Output: The PDF will open in an integrated viewer.
TeXmaker
 How to Compile: Click the "Quick Build" button (or press `F1`), which compiles the document and opens
the PDF.
 Output: The PDF will display in the built-in viewer.
TeXShop (macOS)
 How to Compile: Click the "Typeset" button (or use `Command + T`).
 Output: The PDF is shown in a separate window.
WinEdt
 How to Compile: Press `Ctrl + T` or click the "TeX" button in the toolbar.
 Output: The PDF will open in your default viewer.
Compiling (cont..)
2. Command Line Compilation
 If you prefer using the command line, you can compile LaTeX documents using various commands:
pdfLaTeX
 To compile a LaTeX document into a PDF:
 pdfLaTeX yourfile.tex
DVI format
 To compile a LaTeX document into DVI format:
 LaTeX yourfile.tex
bibtex
 If your document contains bibliography references, run BibTeX:
 bibtex yourfile
Makeindex
 For documents with an index:
 makeindex yourfile
Compiling (cont..)
3. Compilation Process
Typically, the compilation process involves multiple steps:
1. Initial Compilation: This generates the PDF and any auxiliary files (like `.aux`, `.log`, etc.).
2. Bibliography: If you have citations, you may need to run BibTeX (or Biber) to generate the
bibliography.
3. Recompile: Run the compiler again to ensure all references and citations are updated in the output.
4. Common Issues
 Errors: Check the `.log` file for error messages if the compilation fails. Fix any issues and recompile.
 References Not Found: If citations or references are not updated, ensure you run BibTeX and
recompile the document.
 Missing Packages: Make sure all required packages are installed in your LaTeX distribution.
5. Batch Compilation
 You can also automate the compilation process using a Makefile or a script, especially for larger
projects with multiple files.
 Compiling LaTeX documents can be done easily through various editors or command line tools.
CONVERSION TO VARIOUS FORMATS
LaTeX documents can be converted to various formats depending on your needs. Here’s an overview of
common formats you might convert to, along with methods for conversion:
1. PDF (Portable Document Format)
 Default Output: Most LaTeX editors (like Overleaf, TeXworks, TeXmaker) compile `.tex` files to PDF by default
using the `pdfLaTeX` command.
 Command Line:
 pdfLaTeX yourfile.tex
2. DVI (DeVice Independent file format)
 Conversion: You can compile to DVI using the `LaTeX` command.
 Command Line: LaTeX yourfile.tex
 DVI to PDF: You can convert DVI to PDF using:
 dvipdf yourfile.dvi
3. PostScript
 Conversion from DVI:
 dvips yourfile.dvi
 Direct PDF to PostScript: You can also convert a PDF file to PostScript using
 pdftops yourfile.pdf
CONVERSION TO VARIOUS FORMATS(Cont..)
4. HTML (HyperText Markup Language)
 Conversion Tools: Use `LaTeX2html` or `TeX4ht`.
 Command Line with LaTeX2html: LaTeX2html yourfile.tex
5. Plain Text
 Extraction: Use the `detex` command to strip LaTeX commands and output plain
text.
 Command Line: detex yourfile.tex > output.txt
6. Word (DOCX)
 Conversion Tools:
 Pandoc: A versatile tool that can convert LaTeX to DOCX.
 Command Line with Pandoc: pandoc yourfile.tex -o output.docx
 Overleaf: You can also export directly to Word format.
7. XML
 Conversion with Pandoc: pandoc yourfile.tex -o output.xml
CONVERSION TO VARIOUS FORMATS(Cont..)
8. EPUB (Electronic Publication)
 Conversion with Pandoc:
 pandoc yourfile.tex -o output.epub
9. Markdown
 Conversion with Pandoc:
 pandoc yourfile.tex -o output.md
10. Beamer Presentations
 If you’re using Beamer for presentations, you can export your presentation to PDF or create HTML
slides using:
 Pandoc for converting `.tex` Beamer presentations to other formats.
 The choice of conversion method depends on the target format and your specific needs. Tools
like Pandoc are extremely versatile for converting LaTeX documents into various formats, while
standard LaTeX commands can handle PDF, DVI, and PostScript conversions directly.

More Related Content

PDF
Final Year Project Report Sample for Engineers - IIT and State University
PPT
Ppt for national conference
PDF
MarketingManagement-Honey.
PDF
BOOK SHOP SYSTEM Project in Python
DOC
Imame bukhari service to hadith
PDF
Acknowledge, list-of-figures-and-tables-sample-writing-report-and-other-docum...
PDF
Tuheed
DOCX
Super marketbillingsystemproject
Final Year Project Report Sample for Engineers - IIT and State University
Ppt for national conference
MarketingManagement-Honey.
BOOK SHOP SYSTEM Project in Python
Imame bukhari service to hadith
Acknowledge, list-of-figures-and-tables-sample-writing-report-and-other-docum...
Tuheed
Super marketbillingsystemproject

Similar to Basic structure of a LaTeX 2e with examples (20)

PDF
Latex Notes
PPTX
Installation guide for Latex and MOODLE
PDF
Introduction to LaTeX
PDF
Latex workshop: Essentials and Practices
PPT
documents writing with LATEX
PPTX
Inroduction to Latex
PPTX
LaTex tutorial with Texstudio
PDF
PDF
Introduction to Latex
PPT
SJCIT-Workshop-Latex-Introduction-7-5-2024-6am.ppt
PDF
STA312 Lec1
PPTX
latex-workshop Dr: Mohamed A. Alrshah
PDF
Write effectlively in late x
PPTX
TECHNICAL WRITING USING LATEX POWER POIN
PPT
Latex - Companion for a Researcher - A Review.ppt
PDF
Ltxprimer 1.0
PDF
Importanat
PPTX
Latex workshop
PPTX
استخدام LATEX في كتابة البحوث والكتب.pptx
PDF
A gentle introduction to Latex
Latex Notes
Installation guide for Latex and MOODLE
Introduction to LaTeX
Latex workshop: Essentials and Practices
documents writing with LATEX
Inroduction to Latex
LaTex tutorial with Texstudio
Introduction to Latex
SJCIT-Workshop-Latex-Introduction-7-5-2024-6am.ppt
STA312 Lec1
latex-workshop Dr: Mohamed A. Alrshah
Write effectlively in late x
TECHNICAL WRITING USING LATEX POWER POIN
Latex - Companion for a Researcher - A Review.ppt
Ltxprimer 1.0
Importanat
Latex workshop
استخدام LATEX في كتابة البحوث والكتب.pptx
A gentle introduction to Latex
Ad

More from Gayathri M (9)

PPTX
Group Theory - Discrete Mathematics.pptx
PPTX
BASIC CONCEPT OF SET THEORY - DISCRETE MATHEMATICS.pptx
PPTX
Mathematical Logic - Discrete mathematics.pptx
PPTX
Using package amsmath typing equation labeling and referring.pptx
PPTX
Type setting Simple documents - LaTeX.pptx
PPT
Statistics - Measure of central tendency
PPTX
BIOSTATISTICS - Data, Types of Data, and collection of data
PPTX
BIOSTATISTICS- Basic definition and Statistical Method
PPTX
GRAPH THEORY - Basic definition with examples
Group Theory - Discrete Mathematics.pptx
BASIC CONCEPT OF SET THEORY - DISCRETE MATHEMATICS.pptx
Mathematical Logic - Discrete mathematics.pptx
Using package amsmath typing equation labeling and referring.pptx
Type setting Simple documents - LaTeX.pptx
Statistics - Measure of central tendency
BIOSTATISTICS - Data, Types of Data, and collection of data
BIOSTATISTICS- Basic definition and Statistical Method
GRAPH THEORY - Basic definition with examples
Ad

Recently uploaded (20)

PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
Institutional Correction lecture only . . .
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Pre independence Education in Inndia.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Basic Mud Logging Guide for educational purpose
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Abdominal Access Techniques with Prof. Dr. R K Mishra
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Institutional Correction lecture only . . .
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Final Presentation General Medicine 03-08-2024.pptx
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Microbial disease of the cardiovascular and lymphatic systems
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Pre independence Education in Inndia.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Microbial diseases, their pathogenesis and prophylaxis
Basic Mud Logging Guide for educational purpose
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
TR - Agricultural Crops Production NC III.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
O7-L3 Supply Chain Operations - ICLT Program
102 student loan defaulters named and shamed – Is someone you know on the list?

Basic structure of a LaTeX 2e with examples

  • 1. Basic structure of a LaTeX 2e M. Gayathri, M.Sc, M.Phil. Assistant Professor Department of Mathematics Sri Sarada Niketan college of Science for Women , Karur-5
  • 2. INTRODUCTION TEX  TEX is a computer program created by Donald E. Knuth. The original program was aimed at typesetting text and mathematical formulae. Knuth started writing the TEX typesetting engine in 1977 to explore the potential of digital printing equipment. These new devices were beginning to infiltrate the publishing industry at that time. His goal was to reverse the trend of deteriorating typographical quality that he saw affecting his own books and articles. The first stable version of TEX was released in 1982. Version 3.0 was released in 1989 to better support 8-bit characters and multiple languages. Knuth considered the TEX-design to be complete with the release of Version 3. TEX is renowned for being extremely stable, for running on many kinds of computers, and for being virtually bug free. The version number of TEX is converging to the constant and is now at 3.141592653. 𝜋
  • 3. LaTeX  LaTeX is a set of macros for the TEX engine. LaTeX was originally developed by Leslie Lamport for his own use. After some consideration, he decided to make them more general so that others could use them for their own projects. Thus, in 1985, the first version of LaTeX named LaTeX 2.09 was released. The original LaTeX became quite popular and promoted the creation of many extension packages. Unfortunately, some of the more popular extensions were not compatible with each other. LaTeX 2e managed to unify many of the extensions, and also provided an extension packaging system, dealing with third party extensions in a standardized way.  The original LaTeX became quite popular and promoted the creation of many extension packages. Unfortunately, some of the more popular extensions were not compatible with each other. LaTeX 2e managed to unify many of the extensions, and also provided an extension packaging system, dealing with third party extensions in a standardized way.
  • 4. Basic structure of a LaTeX 2e:  Preamble: This is the beginning of the document, where you define the document class, packages, and other settings.  Document body: This is the main content of the document, where you write your text, equations, figures, tables, etc.  Document end: This is the end of the document, where you can add final commands or text.
  • 5. Example  documentclass{article}  usepackage{amsmath}  title{My Document}  author{My Name}  date{today}  begin{document}  maketitle  section{Introduction}  This is the introduction.  section{Method}  This is the method.  section{Result}  This is the result.  section{Conclusion}  This is the conclusion.  end{document}
  • 6. Layout Design  The layout of a LaTeX document is determined by the document class and packages used. Here are some common layout elements:  Margins: The space between the text and the edge of the page.  Headers and Footers: The text at the top and bottom of each page.  Columns: Multiple columns of text on a page.  Sections: Divisions of the document, such as introduction, method, result, and conclusion.  Subsections: Subdivisions of sections.  Paragraphs: Blocks of text.  Lists: Ordered or unordered lists of items.  Figures and Tables: Graphics and tabular data.  Captions: Text describing figures and tables.  References: Citations and bibliography.
  • 7. Layout Design (cont..) 1. Document Class  The layout often starts with the document class. Common classes include `article`, `report`, and `book`.  documentclass[a4paper,12pt]{article} % Options for paper size and font size 2. Margins  You can adjust the margins using the `geometry` package, which offers great flexibility.  usepackage[a4paper, margin=1in]{geometry} % Sets 1-inch margins on all sides 3. Page Layout  You can control the overall layout with parameters like `setlength`. Here are some common lengths you might adjust:  setlength{parindent}{0pt} % No paragraph indentation  setlength{parskip}{1em} % Space between paragraphs
  • 8. Layout Design (cont..) 4. Sections and Headings  Use sectioning commands to create a structured layout:  section{Main Section}  subsection{Subsection}  subsubsection{Subsubsection}  You can customize the appearance of headings using packages like `titlesec`.
  • 9. Layout Design (cont..) 5. Lists  LaTeX provides various list environments to organize content:  begin{itemize} % Bulleted list  item First item  item Second item  end{itemize}  begin{enumerate} % Numbered list  item First item  item Second item  end{enumerate}
  • 10. Layout Design (cont..) 6.Headers and Footers  You can customize headers and footers using the `fancyhdr` package:  usepackage{fancyhdr}  pagestyle{fancy}  fancyhf{}  fancyhead[L]{Left Header}  fancyhead[C]{Center Header}  fancyhead[R]{Right Header}  fancyfoot[C]{thepage} % Page number in the center of the footer 7. Font and Text Styles  You can change the font family and size, as well as styles like bold and italics:  textbf{Bold text}  textit{Italic text} 8. Custom Layouts  For more complex layouts, you might consider using packages like `layout`, which provides commands to visualize the current layout parameters:  usepackage{layout}  layout
  • 11. Advantages and Disadvantages The main advantages of LATEX over normal word processors are the following:  Professionally crafted layouts are available, which make a document really look as if “printed”.  The typesetting of mathematical formulae is supported out of the box.  Users only need to learn a few easy-to-understand commands that specify the logical structure of a document. They almost never need to tinker with the actual layout of the document.  Even complex structures, such as footnotes, references, table of contents, and bibliographies, can be generated easily.  Free add-on packages exist for many typographical tasks not directly supported by basic LATEX. For example, packages are available to include PostScript graphics or to typeset bibliographies con forming to exact standards. Many of these add-on packages are described in The LATEX Companion.  LATEX encourages authors to write well-structured texts, because this is how LATEX works—by specifying structure.  TEX, the formatting engine of LATEX, is highly portable and free. Therefore, the system runs on almost any hardware platform available.
  • 12. Advantages and Disadvantages (cont..) LATEX also has some disadvantages, and I guess it’s a bit difficult for me to find any sensible ones, though I am sure other people can tell you hundreds .  LATEX does not work well for people who have sold their souls …  Although some parameters can be adjusted within a predefined document layout, the design of a whole new layout is difficult and takes a lot of time.  It is very hard to write unstructured and disorganized documents.  Your hamster might, despite some encouraging first steps, never be able to fully grasp the concept of Logical Markup.
  • 13. EDITORS  It allow users to define formatting of text beforehand through markup-level instructions and once the content is inserted, the document is ready to be exported as a PDF or any other file format. Mathematical equations are exceptionally handled by these editors and they were the primary reasons leading to its development in the first place.
  • 14. EDITORS (cont…)  LaTeX editors are software applications that facilitate editing and compiling LaTeX documents. Here are some popular LaTeX editors:  TeXstudio: A free, open-source editor with syntax highlighting, code completion, and a built-in PDF viewer.  TeXmaker: A free, open-source editor with syntax highlighting, code completion, and a built-in PDF viewer.  Sublime Text: A popular, feature-rich editor with LaTeX plugin support.  Atom: An open-source editor with LaTeX plugin support.  Visual Studio Code: A popular, open-source code editor with LaTeX extension support.  Overleaf: A web-based LaTeX editor with real-time collaboration and cloud compilation.  ShareLaTeX: A web-based LaTeX editor with real-time collaboration and cloud compilation.  LyX: A free, open-source editor with a graphical interface and WYSIWYM (what you see is what you mean) approach.  Gummi: A free, open-source editor with a graphical interface and live preview.  LaTeXila: A free, open-source editor for Linux with syntax highlighting and code completion.
  • 15. Forward Search & Inverse Search  Forward search and inverse search are features in LaTeX editors that enhance the workflow by allowing you to navigate between the source code and the compiled PDF document seamlessly. Here’s a breakdown of both concepts, along with how to set them up in popular LaTeX editors. Forward Search  Forward search allows you to click on a specific point in your LaTeX source code and view the corresponding location in the compiled PDF. This is especially useful for quickly checking how changes in the code affect the final output. Inverse Search  Inverse search enables you to click on a specific location in the PDF, which then takes you back to the corresponding line in the LaTeX source code. This is helpful for quickly locating the code that generated a specific part of the document.
  • 16. Forward Search & Inverse Search (cont..) Setting Up Forward and Inverse Search 1. TeXworks  - Forward Search: Automatically supported; just click in the PDF after compiling.  - Inverse Search: Click in the PDF while holding the Shift key, and it will highlight the corresponding line in the editor. 2. TeXShop (macOS)  - Forward Search: Click in the TeX source file, then compile to see the changes in the PDF.  - Inverse Search: Click in the PDF, and it will return you to the corresponding line in the source code. 3. TeXmaker  - Forward Search: Click on the “View” button after compiling to jump to the PDF.  - Inverse Search: Enable the feature in settings; it generally supports inverse search with external PDF viewers. 4. WinEdt  - Forward Search: Click in the source and compile to see changes in the PDF.  - Inverse Search: Requires configuration in the PDF viewer settings. Make sure it’s set up to send back to WinEdt. 5. LyX  - Forward Search: Automatically syncs when you compile and view the PDF.  - Inverse Search: Clicking in the PDF will bring you back to the LyX document.
  • 17. Forward Search & Inverse Search (cont..) 6. VS Code with LaTeX Workshop  - Forward Search: Use the command palette or appropriate shortcuts to build and view the PDF.  - Inverse Search: Clicking in the PDF can be set up to navigate back to the editor with the right configuration. 7. Sublime Text with LaTeXTools  - Forward Search: Automatically syncs when compiling.  - Inverse Search: Requires configuration of the PDF viewer to send information back to Sublime Text.  Configuring PDF Viewers  To enable inverse search, you often need to configure your PDF viewer: 8. Adobe Reader:  - Go to Preferences > General, and check the option for "Enable inverse search." 9. Okular:  - It supports inverse search out of the box. You just need to configure the settings in your LaTeX editor to point to Okular. 10. SumatraPDF:  - Set the command for inverse search in the editor settings (e.g., `sumatrapdf.exe -inverse-search "C:PathTo Editor.exe %f -line %l"`).  Both forward and inverse search significantly enhance the efficiency of working with LaTeX documents. By configuring your editor and PDF viewer correctly, you can create a smooth workflow that allows for rapid iteration and editing.
  • 18. Compiling A LaTeX document, saved as a .tex file, must be compiled in order to turn it into a readable document. A compiled .tex file will output either a .dvi, .ps (PostScript), or .pdf document. Most TeX distributions' default output is .dvi, but .ps or .pdf documents are relatively easy to produce as well. There two general ways to compile a LaTeX document:  Using a LaTeX editor/compiler  Using the command line/terminal
  • 19. Compiling (cont..) 1. Compiling in LaTeX Editors Overleaf  How to Compile: Overleaf automatically compiles your document as you type. You can also manually trigger compilation by clicking the "Recompile" button.  Output: The PDF is displayed on the right side of the editor. TeXworks  How to Compile: Open your `.tex` file and click the green "Typeset" button (or press `Ctrl + T`).  Output: The PDF will open in an integrated viewer. TeXmaker  How to Compile: Click the "Quick Build" button (or press `F1`), which compiles the document and opens the PDF.  Output: The PDF will display in the built-in viewer. TeXShop (macOS)  How to Compile: Click the "Typeset" button (or use `Command + T`).  Output: The PDF is shown in a separate window. WinEdt  How to Compile: Press `Ctrl + T` or click the "TeX" button in the toolbar.  Output: The PDF will open in your default viewer.
  • 20. Compiling (cont..) 2. Command Line Compilation  If you prefer using the command line, you can compile LaTeX documents using various commands: pdfLaTeX  To compile a LaTeX document into a PDF:  pdfLaTeX yourfile.tex DVI format  To compile a LaTeX document into DVI format:  LaTeX yourfile.tex bibtex  If your document contains bibliography references, run BibTeX:  bibtex yourfile Makeindex  For documents with an index:  makeindex yourfile
  • 21. Compiling (cont..) 3. Compilation Process Typically, the compilation process involves multiple steps: 1. Initial Compilation: This generates the PDF and any auxiliary files (like `.aux`, `.log`, etc.). 2. Bibliography: If you have citations, you may need to run BibTeX (or Biber) to generate the bibliography. 3. Recompile: Run the compiler again to ensure all references and citations are updated in the output. 4. Common Issues  Errors: Check the `.log` file for error messages if the compilation fails. Fix any issues and recompile.  References Not Found: If citations or references are not updated, ensure you run BibTeX and recompile the document.  Missing Packages: Make sure all required packages are installed in your LaTeX distribution. 5. Batch Compilation  You can also automate the compilation process using a Makefile or a script, especially for larger projects with multiple files.  Compiling LaTeX documents can be done easily through various editors or command line tools.
  • 22. CONVERSION TO VARIOUS FORMATS LaTeX documents can be converted to various formats depending on your needs. Here’s an overview of common formats you might convert to, along with methods for conversion: 1. PDF (Portable Document Format)  Default Output: Most LaTeX editors (like Overleaf, TeXworks, TeXmaker) compile `.tex` files to PDF by default using the `pdfLaTeX` command.  Command Line:  pdfLaTeX yourfile.tex 2. DVI (DeVice Independent file format)  Conversion: You can compile to DVI using the `LaTeX` command.  Command Line: LaTeX yourfile.tex  DVI to PDF: You can convert DVI to PDF using:  dvipdf yourfile.dvi 3. PostScript  Conversion from DVI:  dvips yourfile.dvi  Direct PDF to PostScript: You can also convert a PDF file to PostScript using  pdftops yourfile.pdf
  • 23. CONVERSION TO VARIOUS FORMATS(Cont..) 4. HTML (HyperText Markup Language)  Conversion Tools: Use `LaTeX2html` or `TeX4ht`.  Command Line with LaTeX2html: LaTeX2html yourfile.tex 5. Plain Text  Extraction: Use the `detex` command to strip LaTeX commands and output plain text.  Command Line: detex yourfile.tex > output.txt 6. Word (DOCX)  Conversion Tools:  Pandoc: A versatile tool that can convert LaTeX to DOCX.  Command Line with Pandoc: pandoc yourfile.tex -o output.docx  Overleaf: You can also export directly to Word format. 7. XML  Conversion with Pandoc: pandoc yourfile.tex -o output.xml
  • 24. CONVERSION TO VARIOUS FORMATS(Cont..) 8. EPUB (Electronic Publication)  Conversion with Pandoc:  pandoc yourfile.tex -o output.epub 9. Markdown  Conversion with Pandoc:  pandoc yourfile.tex -o output.md 10. Beamer Presentations  If you’re using Beamer for presentations, you can export your presentation to PDF or create HTML slides using:  Pandoc for converting `.tex` Beamer presentations to other formats.  The choice of conversion method depends on the target format and your specific needs. Tools like Pandoc are extremely versatile for converting LaTeX documents into various formats, while standard LaTeX commands can handle PDF, DVI, and PostScript conversions directly.