TeXworkshow to avoid first line indented?

Information and discussion about TeXworks, an integrated LaTeX environment for several platforms
Post Reply
yaozhao
Posts: 57
Joined: Sat Oct 27, 2018 10:38 pm

how to avoid first line indented?

Post by yaozhao »

Code: Select all

\documentclass[a4paper, 12pt]{article}  
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[T1]{fontenc}	
\usepackage{graphicx}
\DeclareUnicodeCharacter{202F}{\,}



\begin{document}
\title{Solutions to Math Exercises}
\author{Yao Zhao \\ University of Wisconsin-Madison}
\maketitle


1.a. slope = $-\frac{2}{5}$ \\
1.b. slope = undefined (infinity) \\
The first line (1.a. slope) is indented, which is not desired. How to avoid such problem?
Many thanks in advance!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

how to avoid first line indented?

Post by mas »

If you want to avoid the first line indent throughout the document, set it in the preamble as

Code: Select all

\setlength{\parindent}{0pt}
If you want it for a specific line/para, use

Code: Select all

\noindent
A suggestion: Avoid using \\ to end the paragraphs in your text.

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
yaozhao
Posts: 57
Joined: Sat Oct 27, 2018 10:38 pm

how to avoid first line indented?

Post by yaozhao »

Thank you so much! It works!

As you mentioned, A suggestion: Avoid using \\ to end the paragraphs in your text.

I also often heard of such comments before. I want to have space between 1.a. and 1.b. I don't know what I can do if not using \\
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

how to avoid first line indented?

Post by Johannes_B »

Package parskip
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10308
Joined: Mon Mar 10, 2008 9:44 pm

how to avoid first line indented?

Post by Stefan Kottwitz »

As Johannes said, \usepackage{parskip} (to put it in code) or, what I would prefer, use the modern class scrartcl.

Code: Select all

\documentclass[a4paper, 12pt, parskip=full]{scrartcl}  
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage[T1]{fontenc}	
\usepackage{graphicx}
\DeclareUnicodeCharacter{202F}{\,}
\begin{document}
\title{Solutions to Math Exercises}
\author{Yao Zhao \\ University of Wisconsin-Madison}
\maketitle

1.a. slope = $-\frac{2}{5}$

1.b. slope = undefined (infinity)

\end{document}
Here you see: end a line (a paragraph) by having an empty line in the code.
paragraph.png
paragraph.png (17.99 KiB) Viewed 32848 times
Stefan
LaTeX.org admin
Post Reply