2

I'm getting "nag Warning: Unmatched ``\flushright'' command" from nag:

\RequirePackage[orthodox]{nag} \documentclass{article} \begin{document} \flushright some text \end{document} 

It does not help to group the flushright:

{\flushright some text} 

I don't understand what "Unmatched" means in this warning, and I don't understand how nag would like to see \flushright used. What is orthodox?

2
  • 3
    flushright is an environment, use \raggedleft. Commented Oct 24, 2020 at 16:48
  • Thanks, that works. And all this time I thought \raggedright and \flushright were a pair. Commented Oct 24, 2020 at 16:54

1 Answer 1

2

For once nag is right.

You should never use \flushright, \center or \flushleft in the document. Their usage should be reserved to defining other environments and in that case there must be the corresponding \end... instruction in the end part of the environment.

The advice is not specific to the flushright, center or flushleft environments. Anything that's presented as an environment in the LaTeX manual follows the same rule.

The corresponding declarations are

\raggedleft \centering \raggedright 

On the other hand, I'm not sure what an application of \raggedleft would be in a document without proper grouping. And then it's easier to use

\begin{flushright} ... \end{flushright} 

that also provides proper spacing before and after.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.