インデントなしで両端揃え

インデントなしで両端揃え

でインデントせずにテキストを揃えるにはどうしたらいいかと思いました\justifying

\usepackage[parfill]{parskip}

二次質問:

ところで、パースキップ距離を増やす方法はありますか?

ありがとう!

答え1

使用する方が良いでしょうパースキップこれらの変更による副作用を回避するために必要な調整を行う準備ができていない限り、パッケージ (質問に示されているように) を調整するよりも、パッケージ自体を調整するparskip方がparindent効果的です。

これらの長さを調整することに加えて、parskipはリスト環境での過剰なスペースを回避するための基本的な作業も行います。リストを使用していないと思っていても、多くの LaTeX 環境はリストに基づいているため、おそらくリストを使用しているでしょう。たとえば、 はquotation単純なリスト環境であり、他にも多くのリスト環境があります。

これは、長さを手動で調整するだけの文書です。フランの答え:

\documentclass{article}
\usepackage{lipsum} % for example dummy text
\setlength\parskip{.5\baselineskip plus .1\baselineskip minus .1\baselineskip}
\setlength\parindent{0pt}
\begin{document}
  \lipsum[1]

  \begin{quotation}
    \lipsum[2]
  \end{quotation}

  \lipsum[3]

  \begin{itemize}
    \item This is the first item in a list of several items, which is preceded by none but followed by some.
    \item This is the second item in a list of several items, which is preceded by some and followed by some.
    \item This is the third item in a list of several items, which is preceded by some and followed by some.
    \item This is the fourth item in a list of several items, which is preceded by some but followed by none.
  \end{itemize}

  \lipsum[4]
\end{document}

リストの間隔が広すぎる

ご覧のとおり、通常の段落間のスペースと比較して、引用文とリストの周囲には余分なスペースが残されています。

以下は、デフォルトの調整を使用した同じドキュメントですparskip

\documentclass{article}
\usepackage{lipsum} % for example dummy text
\usepackage[parfill]{parskip}
\begin{document}
  \lipsum[1]

  \begin{quotation}
    \lipsum[2]
  \end{quotation}

  \lipsum[3]

  \begin{itemize}
    \item This is the first item in a list of several items, which is preceded by none but followed by some.
    \item This is the second item in a list of several items, which is preceded by some and followed by some.
    \item This is the third item in a list of several items, which is preceded by some and followed by some.
    \item This is the fourth item in a list of several items, which is preceded by some but followed by none.
  \end{itemize}

  \lipsum[4]
\end{document}

<code>parskip</code> によるデフォルトの調整

parskipパッケージのリスト環境のレイアウトの改善の恩恵を受けながら、を調整することは依然として可能です。この例ではparskip、最初のドキュメントと同じものを使用し、Fran の「合理的な」設定で指定されているものを使用します。

\documentclass{article}
\usepackage{lipsum} % for example dummy text
\usepackage[parfill]{parskip}
\setlength\parskip{.5\baselineskip plus .1\baselineskip minus .1\baselineskip}
\begin{document}
  \lipsum[1]

  \begin{quotation}
    \lipsum[2]
  \end{quotation}

  \lipsum[3]

  \begin{itemize}
    \item This is the first item in a list of several items, which is preceded by none but followed by some.
    \item This is the second item in a list of several items, which is preceded by some and followed by some.
    \item This is the third item in a list of several items, which is preceded by some and followed by some.
    \item This is the fourth item in a list of several items, which is preceded by some but followed by none.
  \end{itemize}

  \lipsum[4]
\end{document}

<code>parskip</code> パッケージと、<code>parskip</code> の長さを手動で設定する

ご覧のとおり、parskip長さを手動で調整しても、パッケージをロードすることで実現されるレイアウトの強化が損なわれることはありませんparskip。そのため、このオプションは標準クラスで最良の結果をもたらします。

つまり、一部のクラスは設計上、ゼロ以外parskipとゼロに対応するように設計されておりparindent、これらのクラスにはよりきめ細かい調整が行われる可能性があります。ただし、そのように設計されていないクラスの場合、長さを明示的にparskip設定する代わりに、またはそれに加えてパッケージをロードするparskipと、最良の結果が得られます。

引用文中のインデントされた段落の不自然さを避けるには、quoteではなく を使用するquotationか、後者の環境を前者の環境と同じにします。

\documentclass{article}
\usepackage{lipsum} % for example dummy text
\usepackage[parfill]{parskip}
\setlength\parskip{.5\baselineskip plus .1\baselineskip minus .1\baselineskip}
\let\quotation\quote
\begin{document}
  \lipsum[1]

  \begin{quotation}
    \lipsum[2]
  \end{quotation}

  \lipsum[3]

  \begin{itemize}
    \item This is the first item in a list of several items, which is preceded by none but followed by some.
    \item This is the second item in a list of several items, which is preceded by some and followed by some.
    \item This is the third item in a list of several items, which is preceded by some and followed by some.
    \item This is the fourth item in a list of several items, which is preceded by some but followed by none.
  \end{itemize}

  \lipsum[4]
\end{document}

<code>parskip</code>、<code>parskip</code> を調整し、<code>quotation</code> を修正しました

答え2

デフォルトでは、テキストは両方の余白に合わせて配置されます。最初の行のインデントと段落間のスペースを制御するには、パッケージなしでそれぞれ\parindentと長さを設定するだけです。\parskip

結果を明確に示すために、いくつか誇張した値を使用した例:

\documentclass{article}
\usepackage{lipsum} % for example dummy text
\setlength{\parskip}{2cm}
\setlength{\parindent}{5em}
\begin{document}
\lipsum[1-3] 
\end{document}

ムウェ

LaTexでは、多くの場合、拡張可能な長さや縮小可能な長さを使用できることに注意してください(グルーストレッチとは何ですか?) 次のようなものを使用できます:

\setlength{\parskip}{2cm plus 1.9cm minus 1.9cm}

または

\setlength{\parskip}{2cm plus 1 fill minus 0 cm}

MWE に段落を追加して(たとえば、\lipsum[1-3]に変更して\lipsum[1-4])、この設定または別の設定での効果を確認します。

より合理的な設定は次のようになります。

\setlength\parskip{.5\baselineskip plus .1\baselineskip minus .1\baselineskip}
\setlength\parindent{0pt}

artikel3(これらはドキュメントに記載されているドキュメントクラスの設定とまったく同じですparskip)

関連情報