\newline 对行对齐有什么作用?

\newline 对行对齐有什么作用?

我不明白如何\newline对齐它断开的行。很明显,\linebreak使用段落的对齐方式,其效果与简单地结束段落(使用\par、空白行、环境结束等)相同,而\newline将行的内容稍微放置在使用的对齐方式的左侧。举个例子:

\documentclass{article}
\usepackage{verbatim}
\usepackage[left=7cm, right=7cm]{geometry}

\begin{document}
\begin{center}
 This is a centered paragraph that features text wrapping
 as well as \linebreak manual \linebreak breaks using \verb+\linebreak+ 

\bigskip
 This is a centered paragraph that features text wrapping
 as well as \newline manual \newline breaks using \verb+\newline+ 
\end{center}

\begin{flushright}
 This is a right-justified paragraph that features text wrapping
 as well as \linebreak manual \linebreak breaks using \verb+\linebreak+ 

\bigskip
 This is a right-justified paragraph that features text wrapping
 as well as \newline manual \newline breaks using \verb+\newline+ 
\end{flushright}

\begin{flushleft}
 This is a left-justified paragraph that features text wrapping
 as well as \linebreak manual \linebreak breaks using \verb+\linebreak+ 

\bigskip
 This is a left-justified paragraph that features text wrapping
 as well as \newline manual \newline breaks using \verb+\newline+ 
\end{flushleft}
\end{document}

生成:

在此处输入图片描述

答案1

的定义\newline归结为\hfil\breakcenter环境本质上包装了中的每一行\hfil <line>\hfil。同样,在每行前面flushlight添加。\hfil

因此,环境\newline内部center相当于

\hfil text \hfil\hfil\break

flushlight进入

\hfil text \hfil\break

获得您所描述的效果。

相关内容