LaTeX forum ⇒ TeXworkshow to avoid first line indented?

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

how to avoid first line indented?

Postby yaozhao » Sun Jan 27, 2019 3:01 am

\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 2021:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
mas
Posts: 223
Joined: Thu Dec 04, 2008 4:39 am

how to avoid first line indented?

Postby mas » Sun Jan 27, 2019 3:57 am

If you want to avoid the first line indent throughout the document, set it in the preamble as
\setlength{\parindent}{0pt}


If you want it for a specific line/para, use

\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?

Postby yaozhao » Sun Jan 27, 2019 4:35 am

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: 4183
Joined: Thu Nov 01, 2012 4:08 pm

how to avoid first line indented?

Postby Johannes_B » Sun Jan 27, 2019 7:58 am

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: 10067
Joined: Mon Mar 10, 2008 9:44 pm

how to avoid first line indented?

Postby Stefan Kottwitz » Sun Jan 27, 2019 11:21 am

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

\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 17271 times


Stefan
LaTeX.org admin


Return to “TeXworks”

Who is online

Users browsing this forum: No registered users and 4 guests