[Tex/LaTex] Why gap + indent after \\ and [return]

indentationline-breakingparagraphs

I'm using TeXLive (pdftex) with TexShop on my Mac and usually, I don't format my .tex files. Now that I have to write some bigger ones, the code soon gets too messy to read and I tried to insert some newlines/returns to divide my code blocks. So why does my TeX package (or my TexShop) turn this into additional newlines and on top of that, indents?

For example, consider this minimum example:

\documentclass[10pt,a4paper,fleqn]{article}
\begin{document}
\section{Test}
\subsection{Sub1}
A line\\\\

newline
\end{document}

Why does this turn into (something like) this:

A Line



___newline

Is this some feature of TeX? I really want to format my code, can I turn this off somewhere?

edit (solved):

ok, as egreg said, I'm now using an empty line to end a paragraph. With this, my code gets a bit cleaner. But now, something like this:

\documentclass[10pt,a4paper,fleqn]{article}
\usepackage{amsthm}
\theoremstyle{definition}
\newtheorem{defi}{Definition}[section]
\begin{document}
\begin{defi}
....
\end{defi}

\begin{defi}
....
\end{defi}
\end{document}

(just as an example) compiled, these two theorems get (visually) really close to each other (less line spacing than between two \items of an itemize, even though I inserted a blank line there), which I think, does not look good. Why is this? Basically I am asking when to use \\, \\\\ and a blank line, now that you all shattered my beliefs ;D

edit 2: solved it myself, just removed \usepackage{parskip} and now it looks really nice. thank you all!

Best Answer

if you want a paragraph skip instead of the indentation then set:

\setlength\parindent{0pt}
\setlength\parskip{\medskipamount}