
Ich benutzemla13und xelatex, um ein Dokument im MLA-Format zu erstellen. Mein Professor hat darum gebeten, dass unsere Arbeiten linksbündig ausgerichtet sind, also verwende ich \raggedright, um dies zu erreichen. Ich habe herausgefunden, dass dadurch die Absatzeinzüge entfernt werden, aber da die Absätze in einem MLA-formatierten Dokument eingerückt werden müssen, muss ich das auch mit \setlength\parindent{0.5in} neu einstellen. Das Problem, auf das ich stoße, ist, dass dadurch eine neue Zeile zum Dokument hinzugefügt wird.
Hier ist ein Beispiel:
\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}
Hier ist das gerenderte Dokument …
Unten sehen Sie das Dokument ohne die Zeile „line“ \setlength\parindent{0.5in}
. Beachten Sie, dass die neue Zeile nach dem Titel verschwunden ist. Irgendeine Idee, woran das liegt?Um es klar zu sagen: Was ich erreichen möchte, ist der Absatzeinzug ohne die zusätzliche neue Zeile.Danke!
Antwort1
%
Die einfachste Lösung besteht darin , nach dem Befehl ein hinzuzufügen \setlength
. Der Grund dafür ist, dass die Leerzeile nach Ihrem Einrückungsbefehl als neuer Absatz behandelt, nach dem \makeheader
Befehl jedoch ignoriert wird. Durch das Anhängen %
wird die Leerzeile effektiv entfernt. Weitere Informationen finden Sie in dieser Frage.
\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}
Antwort2
Fügen Sie es \setlength\parindent{0.5in}
dort hinzu, wo es hingehört, nämlich davor \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}
Meine Augen bluten, als ich diesen schändlichen Schriftsatz sehe.
Warum wird eine Leerzeile hinzugefügt? Nun, der \makeheader
Befehl endet mit \end{nospacecenter}
, was definiert ist durch
\newenvironment{nospacecenter}
{\parskip=0pt\par\nopagebreak\centering}
{\par\noindent\ignorespacesafterend}
also setzt TeX einen neuen Absatz, wenn \makeheader
seine Arbeit erledigt ist.
Natürlich \noindent\ignorespacesafterend
wäre Entfernen eine korrekte Definition:
\newenvironment{nospacecenter}
{\parskip=0pt\par\nopagebreak\centering}
{\par}
Eine bessere Definition wäre
\newenvironment{nospacecenter}
{\parskip=0pt\topsep=0pt \trivlist\listparindnt=0pt \item\relax\centering}
{\endtrivlist}
Auf diese Weise würde eine Leerzeile danach \end{nospacecenter}
eine Einrückung hinzufügen, keine Leerzeile hingegen nicht.
Außerdem \makeheader
sollte Folgendes behoben werden:
\newcommand*{\makeheader}{%
\begingroup
\parindent\z@
\rmfamily
\@firstname\ \@lastname\\
\@professor\\
\@class\\
\datef\@date
\begin{nospacecenter}
\@title
\end{nospacecenter}
\endgroup
}
Hier ist ein vollständiges Beispiel mit den Änderungen (ich habe auch eine nospacecenter
Umgebung zum Testen hinzugefügt):
\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}