You could make the following paragraph believe that it follows a heading where there's also no indent by appending \@afterindentfalse\@afterheading
after the end of the environment. Package etoolbox
provides the handy \AfterEndEnvironment
which makes this an easy task. \@afterheading
also temporarily sets \clubpenalty
to \@M
(10000), though. If you don't want this after the patched environment one could insert an adapted version of \@afterheading
instead.
\documentclass{article}
% environment hooks and patching:
\usepackage{etoolbox}
\makeatletter
% uncomment the following if you don't want \clubpenalty\@M ...
% \let\nearly@afterheading\@afterheading
% \patchcmd\nearly@afterheading
% {\@M}% original temporary setting for \clubpenalty replaced by ...
% {\@clubpenalty}% ... or whichever value you deem right
% {}{}
% ... and use \nearly@afterheading instead of \@afterheading here:
\newcommand*\NoIndentAfterEnv[1]{%
\AfterEndEnvironment{#1}{\par\@afterindentfalse\@afterheading}}
\makeatother
\NoIndentAfterEnv{itemize}
% treat other environments you want to patch accordingly
% dummy text:
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{itemize}
\item foo
\item bar
\end{itemize}
\lipsum[1-2]
\end{document}
You have loaded the package ragged2e
with the document
option, that kills indents and typesets the document in raggedright fashion, which I don't think is what you want.
I've also made some changes to your input, so that it's more easily manageable. Note that commands such as \Large
don't take an argument, but set their action to continue until countermanded by another command or the end of the group where they have been issued.
Note also that a paragraph is ended by simply leaving an empty line in the source code.
\documentclass[12pt,a4paper]{article}
%% Packages
\usepackage{amsmath} % must go before fontspec
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage[
top=2.5cm,
left=3cm,
bottom=2.5cm,
right=2.5cm
]{geometry}
\usepackage{graphicx}
\usepackage{units}
\usepackage{pstricks}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{setspace}
\usepackage{ragged2e}
\usepackage[nottoc]{tocbibind}
\usepackage{titlesec}
\usepackage{indentfirst}
\usepackage{pgfplots}
\usepgfplotslibrary{polar}
\usepgflibrary{shapes.geometric}
\usetikzlibrary{calc}
\pgfplotsset{compat=1.8}
\pgfplotsset{
pa/.append style={
axis x line=bottom,
axis y line=left,
xlabel={$r; \cdot 10^7 m$},
ylabel={$F_{pa}; \cdot 10^8 N$}
}
}
%% Fonts and languages
\setmainfont[Ligatures=TeX,
SmallCapsFont=TeX Gyre Termes,
SmallCapsFeatures={Letters=SmallCaps}
]{Times New Roman}
\setdefaultlanguage{latvian}
\setotherlanguages{english, russian}
%% Misc settings
\titleformat{\section}[block]
{\color{black}\Large\bfseries\filcenter}
{}
{1em}
{}
\makeatletter
\renewcommand\@biblabel[1]{#1.}
\makeatother
\numberwithin{equation}{subsection}
\numberwithin{figure}{subsection}
\numberwithin{table}{subsection}
\onehalfspacing
\setlength\parindent{24pt}
\begin{document}
\begin{titlepage}
\centering
{\large\scshape
University \\
Department \\
Faculty
\par}
\vspace*{\fill}
{\Large
name
\par}
{\Large\bfseries
Topic
\par}
{\Large
Study
\par}
\vspace*{\fill}
\raggedleft
{\large
Work advisor: \\
Professor
\par}
\vspace{\fill}
\centering
{\large\scshape
City, Year
\par}
\end{titlepage}
\tableofcontents
\clearpage
\section*{Abstrakts}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
\end{document}
Best Answer
Before setting
\parindent
to zero, we can store its value in another length variable and redefine the\indent
command to use this other length variable instead of\parindent
(which has been set to zero).