LaTeX forum ⇒ TeXworkshow to avoid first line indented?

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

how to avoid first line indented?

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

  1. \documentclass[a4paper, 12pt]{article}
  2. \usepackage{amsmath}
  3. \usepackage{amssymb}
  4. \usepackage[T1]{fontenc}
  5. \usepackage{graphicx}
  6. \DeclareUnicodeCharacter{202F}{\,}
  7.  
  8.  
  9.  
  10. \begin{document}
  11. \title{Solutions to Math Exercises}
  12. \author{Yao Zhao \\ University of Wisconsin-Madison}
  13. \maketitle
  14.  
  15.  
  16. 1.a. slope = $-\frac{2}{5}$ \\
  17. 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!

mas
Posts: 219
Joined: Thu Dec 04, 2008 4:39 am

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
  1. \setlength{\parindent}{0pt}


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

  1. \noindent


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

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim

yaozhao
Posts: 37
Joined: Sat Oct 27, 2018 10:38 pm

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

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

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.

  1. \documentclass[a4paper, 12pt, parskip=full]{scrartcl}
  2. \usepackage[utf8]{inputenc}
  3. \usepackage{amsmath}
  4. \usepackage{amssymb}
  5. \usepackage[T1]{fontenc}
  6. \usepackage{graphicx}
  7. \DeclareUnicodeCharacter{202F}{\,}
  8. \begin{document}
  9. \title{Solutions to Math Exercises}
  10. \author{Yao Zhao \\ University of Wisconsin-Madison}
  11. \maketitle
  12.  
  13. 1.a. slope = $-\frac{2}{5}$
  14.  
  15. 1.b. slope = undefined (infinity)
  16.  
  17. \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 846 times


Stefan
Site admin


Return to “TeXworks”

Who is online

Users browsing this forum: No registered users and 2 guests