\documentclass{amsart}
\begin{document}
\title{Title 1}
\maketitle
Here is a sentence. Here is another sentence
that will be
vertical.
Nice.
\end{document}
我不确定格式是否与我看到的格式完全一致(不同的浏览器等),但基本上在这个例句中,它通常会像往常一样水平排列,但在第二个句子中,“句子”、“那将是”、“垂直”和“很好”这几个词将垂直对齐,而不是像往常一样继续水平排列。如何实现这一点?
答案1
两个选项:
可以手动将句子堆叠在
\Longunderstack
;或者可以粘贴一个
\parbox
让“垂直”句子自动格式化。
以下是 MWE:
\documentclass{article}
\usepackage{stackengine}
\setstackEOL{\cr}
\begin{document}
Here is a sentence. Here is another
\Longunderstack[l]{sentence\cr that will be\cr vertical.\cr Nice.}
Next paragraph.
Here is a sentence. Here is another
\parbox[t]{.7in}{\raggedright sentence that will be vertical. Nice.}
\end{document}
答案2
这是一个基于的实现tabular
,其中有一些保持行间距的技巧。
\documentclass[a4paper,twocolumn]{amsart}
\usepackage{lipsum}
% this is just for showing the interline spacing is correct
\addtolength{\textwidth}{4cm}
\calclayout
\newcommand{\checkrule}{%
\makebox[0pt][l]{\vrule height 0pt depth 0.1pt width \textwidth}%
}
%
\newenvironment{vertpar}
{\begin{tabular}[t]{@{}l@{}}}
{\end{tabular}\par\prevdepth=\dp\strutbox}
\begin{document}
\checkrule
Here is a sentence. Here is another
\begin{vertpar}
sentence \\
that will be \\
vertical. \\
\checkrule
Nice.
\end{vertpar}
\checkrule
\lipsum[2]
\newpage
\lipsum[1]
\end{document}
该\checkrule
宏用于显示有或没有特殊环境的行的对齐方式。
答案3
关于什么\hangindent
?
\documentclass{amsart}
\def\sentences{
\noindent Here is a sentence.
Here is another sentence that will be vertical.
Nice.}
\begin{document}
\hyphenpenalty10000
\rightskip16em
\hangindent16.5em
\sentences
\hyphenpenalty0
\rightskip24em
\hangindent6em
\hangafter3
\sentences\sentences\sentences
\end{document}