LaTeX/C3/Dynamic-Layout-Adjustments/English

From Script | Spoken-Tutorial
Jump to: navigation, search

Title of the Script: Dynamic Layout Adjustments

Author: Ambika Vanchinathan

Keywords: LateX,  geometry package, page layout, margins, checkoddpage, ifoddpage, else, fi, video tutorial.


Visual Cue Narration
Slide 1

Title Slide

Welcome to the spoken tutorial on Dynamic Layout Adjustments.
Slide 2

Learning Objectives

In this tutorial, we will learn how to:
  • Use the changepage package
  • Adjust page dimensions and margins
  • Adjust the text width in the middle of the document
  • Modify the layout based on whether page number is odd or even
Slide 3

System Requirements

To record this tutorial, I am using:
  • Linux Mint OS version 21.3
  • Texworks version 0.6.6
Slide 4

Pre-requisites

To follow this tutorial, learners should have basic knowledge of LaTeX.
Slide 5

Code files

The following code file is required to practice this tutorial:

1. geomery-eg.tex

This file is provided in the Code Files link of this tutorial page.

The following code file is required to practice this tutorial.

This file is provided in the Code Files link of this tutorial page.

Let us get started.
Comment line 51

Uncomment line 19, 53, 60

Comment the line 51.

Uncomment the lines 19, 53, and 60

Highlight:

line 53\begin{adjustwidth}{1cm}{2cm}

Highlight:

{adjustwidth}

{1cm}

{2cm}

The adjustwidth command is from the changepage package

This command reduces the left margin by 1 cm and the right margin by 2 cm.

Click the green Typeset button and show the output Let’s run the code to see the output.

Observe the changes in page 2.

Comment line 53

Uncomment line 54

Comment the line 53.

Uncomment the line 54.

Highlight:

line 54

\begin{adjustwidth}{1cm}{-2cm}

Highlight:

{-2cm}

This command increases the rightside textwidth by 2cm

Note the minus sign in the command. 

It is used to increase the width.

Run the code and show the output Let’s run the code.

The text shifted 1 cm closer to  the left margin and 2 cm away from the right margin.

Now, let us look into  conditional command and statements.
Comment the lines 54 and 60.

Uncomment lines 61 to 68

Comment the lines 54 and 60.

Uncomment the lines 61 to 68.

Highlight: line 61 \newpage command opens a new page.
Highlight:

line 63

The \checkoddpage command checks whether the page number is odd or even.
Highlight:

line 64, 65

\ifoddpage command checks if the page  is an odd page.

If it is odd page, then it does what is in the next line.

Here, it simply prints the line 65.

Highlight:

line 66, 67

\else statement is performed if it is not an odd page.

Here, it prints the line 67.

Highlight:

line 68

\fi command ends the if command.
Let us run the code and see the output.
Run the code

show the third page

A new page is added as third page.

Since it is an odd page the oddpage part of the command is performed.

We see that the odd-numbered page in bold is printed.

Cursor on the third page. This conditional statement is useful for modifying layout or content.

It allows changes based on whether the page number is odd or even.

Any command can be given after that.

Slide 6

Summary

In this tutorial, we have learnt how to,

  • Use the changepage package
  • Adjust page dimensions and margins
  • Adjust the text width in the middle of the document
  • Modify the layout based on whether page number is odd or even
With this, we come to the end of this tutorial.

Let us summarise.

Slide 7

Assignment

As an Assignment

Apply adjustwidth to indent a paragraph by 2 cm on the left and 1 cm on the right side

As an Assignment, please do the following.
Slide 8

Thank you

Thank you for joining

Contributors and Content Editors

Ketkinaina, Madhurig