\setlength\parindent{0.5in}이 내 문서에 개행 문자를 추가합니다.

\setlength\parindent{0.5in}이 내 문서에 개행 문자를 추가합니다.

나는 사용하고있다mla13그리고 xelatex를 사용하여 mla 형식의 문서를 만듭니다. 교수님께서 우리 논문을 왼쪽 정렬하라고 하셨기 때문에 나는 \raggedright를 사용하여 이를 수행하고 있습니다. 이로 인해 단락 들여쓰기가 제거된다는 것을 알았지만 mla 형식의 문서에서는 단락을 들여쓰기해야 하기 때문에 \setlength\parindent{0.5in}을 사용하여 이를 다시 설정해야 합니다. 내가 겪고 있는 문제는 이로 인해 문서에 개행 문자가 추가된다는 것입니다.

예는 다음과 같습니다.

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

렌더링된 문서는 다음과 같습니다.

들여쓰기가 있는 문서

아래는 줄 선이 없는 문서입니다 \setlength\parindent{0.5in}. 제목 뒤의 개행 문자가 어떻게 사라졌는지 확인하세요. 이 문제의 원인이 무엇인지 아시나요?내가 달성하려는 것이 무엇인지 명확히 하기 위해 추가 줄 바꿈 없이 단락 들여쓰기를 수행합니다.감사해요!

들여쓰기 없는 문서

답변1

가장 간단한 해결책은 명령 %뒤에 를 추가하는 것입니다 \setlength. 그 이유는 들여쓰기 명령 뒤의 빈 줄은 새 단락으로 처리되지만 명령 뒤에는 무시되기 때문입니다 \makeheader. 후행은 %빈 줄을 효과적으로 제거합니다. 자세한 내용은 이 질문을 참조하세요.

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

산출

답변2

\setlength\parindent{0.5in}그것이 속한 위치, 즉 앞에 추가하십시오 \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}

여기에 이미지 설명을 입력하세요

이 치욕스러운 조판을 보고 눈시울이 붉어졌습니다.

빈 줄이 추가되는 이유는 무엇입니까? 음, 명령은 다음으로 정의된 \makeheader로 끝납니다 .\end{nospacecenter}

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

\makeheader따라서 TeX는 작업이 완료 되면 새 문단을 조판합니다 .

물론 제거하는 것이 \noindent\ignorespacesafterend올바른 정의입니다.

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

더 나은 정의는 다음과 같습니다

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

이런 식으로 뒤에 빈 줄이 있으면 \end{nospacecenter}들여쓰기가 추가되지만 빈 줄은 들여쓰기가 추가되지 않습니다.

또한 다음 사항도 \makeheader수정해야 합니다.

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

다음은 변경 사항이 포함된 전체 예입니다( nospacecenter테스트용 환경도 추가했습니다).

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

여기에 이미지 설명을 입력하세요

관련 정보