# How to change font styles in verse environment without setting up a new environment?

This is a related question to:

How to change font size in verse environment?

Although this answer works very well, it does create a new Verse environment without the inherent functions of the verse package. In the case of LyX, it will be cumbersome to implement.

I wondered, if there is a way to define the font styles in the Preamble—font size, leading, style etc—with all the inherent proprieties of verse? It will keep the LyX interface clean and still modifiable through the Preamble.

ps. I tried \renewenvironment with simple \selectfont, it seems to erase the verse functions.

-

Aletrnative to Werner's, this solution doesn't rewriting of the whole environment. This goes into the preamble:

\newcommand{\versefont}{\itshape} % put here whatever font commands you want
\let\myoldverse\verse % now we store the original {verse}
\def\verse{\versefont\myoldverse} % and new {verse} just uses the font and original {verse}

-
this solution is very elegant! thanks! –  Shi Yuan Feb 5 '13 at 11:53

If you're using one of the standard document classes, you can merely add the following to your LaTeX preamble:

\makeatletter
\newcommand{\versefont}{}
\renewenvironment{verse}
{\let\\\@centercr
\list{}{\itemsep      \z@
\itemindent   -1.5em%
\listparindent\itemindent
\rightmargin  \leftmargin
\item\relax\versefont}
{\endlist}
\makeatother


This will allow you to redefine \versefont to make your font selections in the preamble, or through the body text using an ERT.

If you're using the verse package, then your preamble should look like this in order to do the same:

\usepackage{verse}
\makeatletter
\newcommand{\versefont}{}
\renewenvironment{verse}[1][\linewidth]{
\stepcounter{verse@envctr}%
\setcounter{poemline}{0}\refstepcounter{poemline}%
\setcounter{vslineno}{1}%
\let\\=\@vscentercr
\list{}{\itemsep \z@
\itemindent  -\vindent%
\listparindent\itemindent
\ifdim #1 < \linewidth
\rightmargin        \z@
\setlength{\leftmargin}{\linewidth}%
\else
\rightmargin        \leftmargin
\fi

The above code just grabbed the verse environment definition from verse.dtx and inserted \versefont (defined to be empty).
I'd put \versefont before \list in both cases, so that it can contain also font size changing commands. –  egreg Feb 5 '13 at 7:58