1

I would like to create a new environment to do this:

\begin{alltt}\normalfont
    \textit{#1}
\end{alltt}

where I would like to put some text instead of #1. Text consists of lines, as a poem:

aaa

bbb

ccc

I create the new environment like this:

\documentclass[20pt]{extarticle}

\usepackage{alltt}

\newenvironment{poem}[1]

{\begin{alltt}\normalfont \textit{#1}} { \end{alltt} }

\begin{document}

\begin{poem}
    {aaa
     bbb
     ccc}
\end{poem}  

\end{document}

As result, the poem environment prints all the text in one line aaabbbccc. How to make the new environment, so the lines are separated?

CarLaTeX
  • 62,716
Marina
  • 133
  • 6

1 Answers1

1

I would suggest the following definition without argument. The \itshape will switch the font to italic

\documentclass[20pt]{extarticle}

\usepackage{alltt}

\newenvironment{poem}{% \begin{alltt}% \normalfont \itshape }{% \end{alltt}% }

\begin{document}

\begin{poem} aaa bbb ccc \end{poem}

\end{document}