Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am typesetting a document, and I am trying to convert a command into a environment. Here is the original code and the first environment (which actually works).

\textcolor{red}{\textbf{\small #1}}%

\newenvironment{crub}{   % new environment instead of command

Now, here is the code for the command that I cannot seem to get into a proper environment.

\noindent\textcolor{red}{\textbf{\large #1}}%

To explain further, here is a part of the original doc, BEFORE I tried to change commands into environments:

%Beginning of the Preamble % % % % % % % % % % % % % % % % % % % %

%Document Class and Packages to use % % % % % % % % % % % % % % % %


%Shortcut Commands % % % % % % % % % % % % % % % % % % % % % % % %
\textcolor{red}{S.  }#1%

\textcolor{red}{R.  }#1%

\noindent\textcolor{red}{\textbf{\large #1}}%

\noindent\textcolor{black}{\textbf{\large #1}}%

\noindent\textcolor{black}{\textbf{\large #1}}%


\textcolor{red}{\textbf{\small #1}}%

\textcolor{black}{\textbf{\small #1}}%

\textcolor{red}{\textbf{\small #1}}%

\textcolor{red}{\textbf{\small #1}}%

%Formatting to Center the Chapter, Section, and Subsection Titles % 

{0pt}{3.5ex plus 1.0ex minus 0.2ex}{2.3ex plus 0.2ex}

{0pt}{3.25ex plus 1.0ex minus 0.2ex}{1.5ex plus 0.2ex}
%End of the Preamble % % % % % % % % % % % % % % % % % % % % % % % 

%Title Info % % % % % % % % % % % % % % % % % % % % % % % % % % % %
\author{Father Thomas Moore, Michael Dykes}

\crub{Towards evening, we stand before the holy icons (having lit a candle     and maybe some incense), with reverence and fear of God; we gather our thoughts, make the Sign of the Cross, and say:}

In the Name of the Father, and of the Son, and of the Holy Spirit. Amen.

\crub{From St. Thomas Sunday until Ascension, instead of \textbf{O God,  cleanse me, a sinner \ldots we say:}}
\textrm{Christ is risen from the dead, trampling down death by death, and  upon those in the tombs bestowing life. \crub{(thrice)}}

\crub{During any Vigil-rank Festal Period [(see Appendix A) - including your and your Temple's Patronal Feast Day], we begin our prayers by praying the Festal Troparia (again, see Appendix A).}

\crub{Then, in either case, we immediately pray the Trisagion Prayers as below:}

\crub{Afterwards, we collect our thoughts, and make seven prostrations (or metanoias), saying:}

O God, be merciful to me, a sinner. 

O God, cleanse me, a sinner, and have mercy on me.

Thou hast created me, O Lord, have mercy on me. 

Countless times have I sinned, O Lord, forgive me. 

All-holy Lady Theotokos, save me, a sinner, 

O Angel, my holy Guardian, protect me from all evil. 

O Saint, \crub{N}, my Patron pray to God for me. 

\crub{Then, we begin the Evening Prayers with these words:}

O Lord Jesus Christ our God, through the prayers of our Thine All-pure Mother, of our holy and God-bearing Fathers, and of all the saints, have mercy on us. Amen.

Glory to Thee, O our God, Glory to Thee.

O Heavenly King, the Comforter, the Spirit of Truth, Who art everywhere present and fillest all things, Treasury of blessings and Giver of Life: Come and abide in us; and cleanse us from every impurity, and save our souls, O Good One.

Holy God. Holy Mighty. Holy Immortal. Have mercy on us. \crub{(thrice)}


Upon compiling, I see the section and chapter headings, then to the left of thes, I see a 'shadowed' section and chapter heading. That is what I was trying to get rid of. Thanks again, because at this point, I am a bit lost.

share|improve this question
What's the point? The two commands do exactly the same (apart from \large instead of \small). –  egreg Jan 25 '12 at 21:33
The first obviously cannot work, because the crub environment does not contain \small, whereas the command \crub contains it. And another thing: Never use the same name on both a command and an environment, because it creates a macro name clash. –  tohecz Jan 25 '12 at 21:42
I may not be fully understanding you (or maybe I was not really clear when asking my question), but I do not have both the crub command and the crub environment in the same doc. Due to other issues (which are solved by using the environment), I am using that instead of the the command. I am foregoing the /small there. Additionally, I wish to convert the /psalmheading to environment form, if possible. Thanks. Oh, sorry the second block of code was what I was trying to do to convert the \psalmheading to an environment form. –  Michael Dykes Jan 25 '12 at 21:47
Just to give you an idea of what is going on, here is part of my doc (the original): –  Michael Dykes Jan 25 '12 at 21:53
add comment

2 Answers

There are unnecessary bits in your definition of the crub environment:


is simpler. Actually center is defined with trivlist, but it's better to stick with higher level objects as long as it is possible.

The same strategy works with psalmheading:


You probably had a problem caused by \noindent which starts LR mode so that you got a spurious space in the output; but in center the indent is zero anyway.

share|improve this answer
One more major question (if I may). Currently, the header is set to the chapter (left header) and the section (right header) which I would like to keep, but in some cases they are overlapping. I need a way for both of them to be lowercase and not ALL CAPS, but am not sure how to do this??? –  Michael Dykes Jan 25 '12 at 22:13
Try to put \let\MakeUppercase\relax in your preamble. This will prevent LaTeX from uppercasing the marks (instead of "making uppercase", the LateX will just "relax for a while". –  tohecz Jan 25 '12 at 22:19
@MichaelDykes Look at the packages fancyhdr or titleps for a way to customize your headers. –  egreg Jan 25 '12 at 22:21
@tohecz When I tried adding \let\MakeUppercase\relax to my preamble, I ended up with several blank sheets at the beginning of the doc??? –  Michael Dykes Jan 26 '12 at 0:26
@MichaelDykes It's not a good idea to redefine an important command of LaTeX. The approach with fancyhdr is recommended. The manual is quite clear. –  egreg Jan 26 '12 at 0:28
show 2 more comments

I hope this is a solution (it defines the environment psalmheading, just using the TeX primitives, I prefer it this way):


Using the more standard LaTeX commands should be the same:

\newenvironment{psalmheading}{% percent-sign and the end of line to remove spaces

\endcenter is the ending command of \center. You are used to put \begin{center}...\end{center}, but \center...\endcenter runs a bit faster (and there're few more technical differences).

And you can use any formatting commands in the place of \large\bfseries\color{red}.

Full test code:



\usepackage{lipsum} % package to add some dummy text


\lipsum[1] % inputs some random text

\lipsum[2] % inputs some random text

\lipsum[3] % inputs some random text


Edit: the rub environment, the most tricky is removal of the next empty line, if there is any:



% got from http://phaseportrait.blogspot.com/2011/08/using-gobblepars-to-prevent-latex-from.html

  \quad % put any space command here





share|improve this answer
@tohecx So, what does the command /lipsum do exactly? Also, could this format be applied to all my other /newcommands (see above)? Thanks again. I am really loving LaTeX and TeX, the more I learn about it. –  Michael Dykes Jan 25 '12 at 22:07
Sorry, I should have explained better. I added comments to my response. –  tohecz Jan 25 '12 at 22:18
@MichaelDykes: \lipsum just generates text, so you don't have to type some random text yourself. –  celtschk Jan 25 '12 at 22:23
Why \begingroup and \endgroup? They are added automatically by \begin and \end. Moreover \noindent serves no purpose. Moreover it's preferable to stick with "standard" LaTeX commands, instead of \def, whenever possible: a beginner might be confused with the syntax. –  egreg Jan 25 '12 at 23:19
@egreg: \noindent shall be omitted, you are right, edited. The grouping is a matter of habits, I often use such commands in the short syntax (\env...\endenv) hence the grouping... so again you are right. –  tohecz Jan 25 '12 at 23:23
show 9 more comments

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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