| by Arround The Web | No comments

Sections in LaTeX with Gummi Editor

After successfully creating a sample LaTeX document in the previous tutorial, now we will try to understand the document structure in LaTeX with our Gummi Editor. We will learn, with pictures and examples, about sections (or similar to "headings" according to LibreOffice Writer) and basically how a document is organized. Now let's start our exercise!  

Subscribe to UbuntuBuzz Telegram Channel to get article updates.

 

<- Basic Writing in LaTeX with Gummi

<- Introduction to Gummi User Interface

<- How To Install Gummi Editor on Ubuntu 

 

Before You Start 

 

You don't know how to start writing a LaTeX document yet? If so, please read previous episode of this tutorial series How To Write in LaTeX with Gummi for Your First Time.

 

Download sample documents

 

We
provide you here a sample text file for your exercise accompanied with
final documents (.txt .tex .pdf) in zip so you can practice and then compare the
results. If you cannot download this, find the copy of sample text at
the end of this post. 

[ DOWNLOAD ZIP 60KB  ]

**** 

 

Expected Results

 

Here's how your final document will look like to explain visually what do we mean with document structure LaTeX can make for you.  We will use the same text from previous tutorial once again with a little changes. The document now spans across 2 pages.

 

 

Did you notice the numbering? It divides section 1 into one sub, section 2 into four subs, and section 3 into three subs. This numbering works automatically e.g. when we add a new one or remove an existing one, all numbering will be adjusted without the need of author intervention. How excellent!

**** 

Basics of Sections

 

In LaTeX, we can divide our document into parts called sections and chapters. The most basic code is like the following. Notice that we are discussing sections right now while chapters should be discussed in separate tutorial.

 

Codes for numbered sections: 

\chapter{ } 

\section{ }

\subsection{ }

\subsubsection{ }

 

Codes for sections without numbering: 

\chapter*{ } 

\section*{ }

\subsection*{ }

\subsubsection*{ }

 

**** 

 

Source Text

 

We use the following plain text as the sample text for your exercise in this episode and you can get it from the download above or text copy at the bottom. This text can be opened using Text Editor.

 

Click to enlarge picture. 

 

Once you have the source text, you can start Gummi Editor and continue to exercise below.

****

  

Writing the Document

 

Now we will start exercising with our LaTeX code on Gummi Editor as the following: 

 

(Front: Text Editor showing the sample text in TXT. | 
Back: Gummi showing the sample text copied onto it.) 

 

1. Upper part of the document

 

Like in the previous episode, copy and paste the sample text from Text Editor into Gummi (see screenshot above) and save it as my-second-document.tex. Now, please focus on Gummi only. Edit it by following example below. 

 

The codes you will use here are:

\documentclass{article} : tells LaTeX to write in article mode.

\title{...} : to save the title of this document. Will show it later.

\author{...} : to save the author's name.

\begin{document} : to start the whole content of document here.

\maketitle : to show the title.

\date : to show today's date.

\section{...} : to make a numbered "heading". You will write paragraphs under this.

\subsection{...} : to make a "subheading". You will write paragraphs under this, too.

\end{document} : to end the whole content of document here. This is mandatory.

 

Before:

After: 

Preview: 

 

****

 

2. Middle part of the document

 

Go to the next part and edit it following example below. You will use the same codes as the above. Compared to the previous episode, actually here we simply remove \begin{enumerate} ... \end{enumerate} and replace them with \subsection{...} instead. 

 Before:

After: 

Preview: 

****

 

3. Lower part of the document

 

Go to the last part and edit it following example below. You will use the same codes as the above, too. Lastly, don't forget to write \end{document} in the last line of your code as it is a pair to \begin{document} in the beginning. Otherwise, your LaTeX code will find error.

 

Before:

After: 

Preview: 

 

 ****

 

4. Full document, compiling and exporting to PDF

 

Once you finished this exercise, you should have a LaTeX document with total 46 lines of code and 2 pages of the resulting document, and finally click File -> Export to PDF (Ctrl+E) to save it as a PDF. Now, you should get a new file called my-second-document.pdf. Here's how Gummi looks like when we finished the document.

 

 ****

 

5. Final Results

 

Open the resulting my-second-document.pdf with your Document Viewer application. It will look beautiful like the following. 

 

[ DOWNLOAD PDF 60KB   ] 

 

 
Click to enlarge picture.
  

In the file manager, now you should find two new files of .tex and .pdf as additions to the what you created previous episode.

 

We hope you enjoy this exercise!

Sample Text 

Ubuntu

Ade Malsasa Akbar

What is Ubuntu?

Ubuntu is a general-purpose computer operating system developed by Canonical corporation from the United Kingdom since 2004 with wide support for multiple computer architectures from the smallest to the largest of them. Ubuntu is one of the most popular operating system as well as GNU/Linux distributions from the Free Software and Open Source community.

How popular is Ubuntu?

Ubuntu is one of the most popular operating system as well as GNU/Linux distributions from the Free Software and Open Source community.

What are the components of Ubuntu?

Ubuntu is consisted of technologies as the following:
GNU operating system and Linux kernel
X window System (also known as XOrg)
GNOME desktop environment and applications
Package management system consisted of APT/DPKG derived from Debian and Snap from Canonical
and many more...

How to get Ubuntu?

You can get Ubuntu in many ways possible as the following:

Purchasing an Ubuntu computer

One can purchase a computer preinstalled with Ubuntu from brands they trust. One can also download Ubuntu at no cost (gratis) and then install it on computer they have. Select your preinstalled computer and laptop from brands like HP, Dell, Lenovo, System76, Entroware, Star Labs and many more. Download Ubuntu from its official website https://www.ubuntu.com.

Downloading Ubuntu at no cost

One can also download Ubuntu at no cost (gratis) and then install it on computer they have. Download Ubuntu from its official website https://www.ubuntu.com.

Ask your friend for a copy of Ubuntu

One can also ask his/her friend for a copy of Ubuntu either with or without distribution fee (mostly people will happily give you a gratis copy). This also makes Ubuntu different to other proprietary (nonfree) operating systems because Ubuntu, being a free software, allows that for all users.

****

References

 

LaTex, Gummi and Ubuntu (in Indonesian) by Author

 

In This Series

<- Basic Writing in LaTeX with Gummi

<- Introduction to Gummi User Interface

<- How To Install Gummi Editor on Ubuntu 

-> Go forward to "Chapters in LaTeX with Gummi Editor"

 

****


This article is licensed under CC BY-SA 3.0.

Share Button

Source: Ubuntu Buzz !