11
\documentclass{amsart}

\begin{document}

\title{Title 1}
\maketitle

Here is a sentence. Here is another sentence
                                    that will be
                                    vertical.
                                    Nice.
\end{document}

I'm not sure if the formatting will show on the post exactly as how I see it (different browsers and such), but basically in this example sentence, it will be normally horizontal as usual, but in the second sentence, the words "sentence," "that will be," "vertical," and "Nice" will be aligned vertically instead of continuing horizontally as usual. How can this be achieved?

12

Two options:

  1. One can manually stack the sentence in a \Longunderstack; or

  2. One can stick a \parbox to let the "vertical" sentence auto-format.

Here is the 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}

enter image description here

| improve this answer | |
10

Here's an implementation based on tabular, with some trick for keeping the interline spacing.

\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}

The \checkrule macro is used for showing the alignment of lines with or without the special environment.

enter image description here

| improve this answer | |
5

What about \hangindent?

mwe

\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}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.