\setlength\parindent{0.5in} adiciona uma nova linha ao meu documento

\setlength\parindent{0.5in} adiciona uma nova linha ao meu documento

estou a usarmla13e xelatex para criar um documento formatado em mla. Meu professor pediu que nossos artigos fossem alinhados à esquerda, então estou usando \raggedright para fazer isso. Descobri que isso faz com que os recuos dos parágrafos sejam removidos, mas como os parágrafos precisam ser recuados em um documento formatado em mla, também preciso redefinir isso com \setlength\parindent{0,5in}. O problema que estou enfrentando é que isso está causando a adição de uma nova linha ao documento.

Aqui está um exemplo:

\documentclass{article}
\usepackage{mla13}
\title{Sample Sources MLA13 Document}
\firstname{John}
\lastname{Smith}
\professor{Dr. Professor}
\class{FunClass}

\raggedright
\begin{document}
\makeheader
\setlength\parindent{0.5in}

In a recent report by the United Nations, they found that more than 884 million people do not have 
access to safe drinking water \cite[e.g.][15-23]{unWater}. This number equates to more than 1 out 
of every 8 people, not having access to something that is so vital to human life. Knowing this 
fact, most must ask themselves, why the same water that we drink is used to clean our toilets and 
wash our lawns. The water that hundreds of millions of people would love to have, is something that 
we just flush down the toilet. This paper intends to examine the benefits of grey water systems, 
and how their use leads to increased water conservation efforts, creating more benefits then costs.

Grey water systems are a technique that aids in water conservation efforts by reusing water that 
doesn't need to be fully cleaned. For example, many grey water systems use the water that comes 
from the shower drain to water the lawn or fill the toilet. Even though this water isn't going to a 
water treatment plant, doesn't mean that it is not clean. Grey water systems are equipped with a 
filter that removes most soaps and solid objects that make their way through the drainage system 
\cite{planetArk}. With a private market for greywater systems developing, there are a variety of 
commercial systems that filter water to ``remove hair, lint, and debris, and remove pollutants, 
bacteria, salts'' and many more materials \cite{pacificInst2010}

\end{document}

Aqui está aquele documento renderizado ...

Documento com recuo

Abaixo está o documento sem a linha \setlength\parindent{0.5in}line. Observe como a nova linha após o título desapareceu. Alguma ideia do que esta causando isso?Para ser claro, o que estou tentando realizar é o recuo do parágrafo sem a nova linha extra.Obrigado!

Documento sem recuo

Responder1

A solução mais simples é adicionar um %após o \setlengthcomando. A razão para isso é que a linha em branco após o comando de recuo é tratada como um novo parágrafo, mas ignorada após o \makeheadercomando. O final %remove efetivamente a linha em branco. Veja esta pergunta para detalhes.

\documentclass{article}
\usepackage{mla13}
\title{Sample Sources MLA13 Document}
\firstname{John}
\lastname{Smith}
\professor{Dr. Professor}
\class{FunClass}
\raggedright


\begin{document}
\makeheader
\setlength\parindent{0.5in}%

In a recent report by the United Nations, they found that more than 884 million people do not have 
access to safe drinking water \cite[e.g.][15-23]{unWater}. This number equates to more than 1 out 
of every 8 people, not having access to something that is so vital to human life. Knowing this 
fact, most must ask themselves, why the same water that we drink is used to clean our toilets and 
wash our lawns. The water that hundreds of millions of people would love to have, is something that 
we just flush down the toilet. This paper intends to examine the benefits of grey water systems, 
and how their use leads to increased water conservation efforts, creating more benefits then costs.

Grey water systems are a technique that aids in water conservation efforts by reusing water that 
doesn't need to be fully cleaned. For example, many grey water systems use the water that comes 
from the shower drain to water the lawn or fill the toilet. Even though this water isn't going to a 
water treatment plant, doesn't mean that it is not clean. Grey water systems are equipped with a 
filter that removes most soaps and solid objects that make their way through the drainage system 
\cite{planetArk}. With a private market for greywater systems developing, there are a variety of 
commercial systems that filter water to ``remove hair, lint, and debris, and remove pollutants, 
bacteria, salts'' and many more materials \cite{pacificInst2010}

\end{document}

saída

Responder2

Adicione \setlength\parindent{0.5in}onde pertence, ou seja, antes \begin{document}:

\documentclass{article}
\usepackage{mla13}
\title{Sample Sources MLA13 Document}
\firstname{John}
\lastname{Smith}
\professor{Dr. Professor}
\class{FunClass}

\raggedright
\setlength\parindent{0.5in}

\begin{document}
\makeheader

In a recent report by the United Nations, they found that more than 884 million people do not have 
access to safe drinking water \cite[e.g.][15-23]{unWater}. This number equates to more than 1 out 
of every 8 people, not having access to something that is so vital to human life. Knowing this 
fact, most must ask themselves, why the same water that we drink is used to clean our toilets and 
wash our lawns. The water that hundreds of millions of people would love to have, is something that 
we just flush down the toilet. This paper intends to examine the benefits of grey water systems, 
and how their use leads to increased water conservation efforts, creating more benefits then costs.

Grey water systems are a technique that aids in water conservation efforts by reusing water that 
doesn't need to be fully cleaned. For example, many grey water systems use the water that comes 
from the shower drain to water the lawn or fill the toilet. Even though this water isn't going to a 
water treatment plant, doesn't mean that it is not clean. Grey water systems are equipped with a 
filter that removes most soaps and solid objects that make their way through the drainage system 
\cite{planetArk}. With a private market for greywater systems developing, there are a variety of 
commercial systems that filter water to ``remove hair, lint, and debris, and remove pollutants, 
bacteria, salts'' and many more materials \cite{pacificInst2010}

\end{document}

insira a descrição da imagem aqui

Meus olhos sangram depois de ver essa composição tipográfica vergonhosa.

Por que uma linha em branco foi adicionada? Bem, o \makeheadercomando termina com \end{nospacecenter}, que é definido por

\newenvironment{nospacecenter}
  {\parskip=0pt\par\nopagebreak\centering}
  {\par\noindent\ignorespacesafterend}

então o TeX está escrevendo um novo parágrafo quando \makeheaderterminar seu trabalho.

É claro que remover \noindent\ignorespacesafterendseria uma definição correta:

\newenvironment{nospacecenter}
  {\parskip=0pt\par\nopagebreak\centering}
  {\par}

Uma definição melhor seria

\newenvironment{nospacecenter}
  {\parskip=0pt\topsep=0pt \trivlist\listparindnt=0pt \item\relax\centering}
  {\endtrivlist}

Dessa forma, uma linha em branco depois \end{nospacecenter}adicionaria recuo, nenhuma linha em branco não adicionaria.

Também \makeheaderdeve ser corrigido:

\newcommand*{\makeheader}{%
  \begingroup
  \parindent\z@
  \rmfamily
  \@firstname\ \@lastname\\
  \@professor\\
  \@class\\
  \datef\@date
  \begin{nospacecenter}
  \@title
  \end{nospacecenter}
  \endgroup
}

Aqui está um exemplo completo, com as alterações (adicionei também um nospacecenterambiente para testá-lo):

\documentclass{article}
\usepackage{mla13}
\title{Sample Sources MLA13 Document}
\firstname{John}
\lastname{Smith}
\professor{Dr. Professor}
\class{FunClass}

% Fix some wrong bits in mla13.sty
\makeatletter
\renewcommand*{\makeheader}{%
  \begingroup
  \parindent\z@
  \rmfamily
  \@firstname\ \@lastname\\
  \@professor\\
  \@class\\
  \datef\@date
  \begin{nospacecenter}
  \@title
  \end{nospacecenter}
  \endgroup
}
\renewenvironment{nospacecenter}
  {\parskip=\z@\topsep=\z@\trivlist\listparindent\z@
  \item\relax\centering}
  {\endtrivlist}
\makeatletter

\raggedright
\setlength\parindent{0.5in}

\begin{document}
\makeheader

In a recent report by the United Nations, they found that more than 884 million people do not have 
access to safe drinking water \cite[e.g.][15-23]{unWater}. This number equates to more than 1 out 
of every 8 people, not having access to something that is so vital to human life. Knowing this 
fact, most must ask themselves, why the same water that we drink is used to clean our toilets and 
wash our lawns. The water that hundreds of millions of people would love to have, is something that 
we just flush down the toilet. This paper intends to examine the benefits of grey water systems, 
and how their use leads to increased water conservation efforts, creating more benefits then costs.
\begin{nospacecenter}
abc
\end{nospacecenter}
Grey water systems are a technique that aids in water conservation efforts by reusing water that 
doesn't need to be fully cleaned. For example, many grey water systems use the water that comes 
from the shower drain to water the lawn or fill the toilet. Even though this water isn't going to a 
water treatment plant, doesn't mean that it is not clean. Grey water systems are equipped with a 
filter that removes most soaps and solid objects that make their way through the drainage system 
\cite{planetArk}. With a private market for greywater systems developing, there are a variety of 
commercial systems that filter water to ``remove hair, lint, and debris, and remove pollutants, 
bacteria, salts'' and many more materials \cite{pacificInst2010}

\end{document}

insira a descrição da imagem aqui

informação relacionada