当我使用\lettrine
with时\justify
,缩进是错误的。下面是使用的代码:
\RequirePackage{fix-cm}
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fullpage}
\usepackage{titlesec}
\usepackage{float}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage[document]{ragged2e}
\usepackage[section]{placeins}
\usepackage{amsmath}
\usepackage[headheight=13.3338pt,top=1.5cm,bottom=1cm,margin=2.5cm]{geometry}
\usepackage{lettrine}
\usepackage{oldgerm}
\usepackage{calligra}
\renewcommand{\LettrineFontHook}{\calligra}
\graphicspath{ {img/} }
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\DefaultNindent}{0pt}
\renewcommand{\headrulewidth}{0.1pt}
\renewcommand{\footrulewidth}{0.1pt}
\fancyfoot[C]{\textbf{page \thepage}}
\usepackage{wrapfig}
\usepackage{xcolor}
\titleformat{\paragraph}
{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}
{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\begin{document}
\maketitle
\justify
\section{Introduction}
\subsection{test}
\subsubsection{test}
\lettrine[lines=2, lhang=0.33, loversize=0.25, findent=1.0em]{M}{ea} culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa.
Mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa.
Mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa.
\begin{verbatim}
Mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa.
\end{verbatim}
Mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa.
Mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa, mea culpa.
\end{document}
当您仅删除\justify
缩进时,效果很好,但文本没有正确对齐,但是当您使用\justify
缩进时,效果是错误的,但文本是正确对齐的。
那么有什么问题?
答案1
对齐是默认设置,你几乎不需要\justify
。在这种情况下,问题是
\usepackage[document]{ragged2e}
这使得整个文档变得参差不齐。只需使用
\usepackage{ragged2e}
并删除\justify
我还添加了\title{zzz}
您的测试示例,否则会产生错误。
潜在的问题是,如果您确实想恢复到参差不齐的块内的对齐,那么语法就是或 不是\justifying
,\begin{justify}..\end{justify}
就像\justify
标准的乳胶居中命令\centering
一样。\begin{center}..\end{center}
\center
\justify
只是的内部实现,\begin{justify}
但这是一个列表环境,而 lettrine 在列表中不起作用。
然而,很难想象在 LaTeX 中显式对齐有任何实际用途,因为这是默认设置,并且如果您在特定环境中切换到右边不规则,则很少需要在嵌套环境中切换回对齐文本。