\documentclass{article} \makeatletter \newenvironment{myquote}[1]{% % to change text size, say to small % add \small before \par in the next line \par\addvspace{2ex} \if@nobreak % we're at the start of a section % add the indent \if@afterindent\else\hspace*{\parindent}\fi % and instruct LaTeX to reset \@afterheading at the end \def\reset@nobreakatend{\@afterheading}% \else \def\reset@nobreakatend{}% \fi \begin{minipage}{\dimexpr\linewidth -2\parindent\relax}% \def\myquoteauthorname{#1}% }{% \par\vspace{0.2ex} \noindent \hspace*{0.25\linewidth}% \rule{0.5\linewidth }{.4pt} \par\addvspace{1ex} \centering \textbf{\myquoteauthorname}\par\vspace{1ex} \end{minipage} \par\nobreak\reset@nobreakatend} \makeatother \begin{document} \begin{myquote}{Diane Ravitch} The person who knows ``how'' will always have a job. The person who knows ``why'' will always be his boss. \end{myquote} \begin{myquote}{Diane Ravitch} \centering The person who knows ``how'' will always have a job. The person who knows ``why'' will always be his boss. \end{myquote} \begin{myquote}{Diane Ravitch} \begin{center} The person who knows ``how'' will always have a job. The person who knows ``why'' will always be his boss. \end{center} \end{myquote} \end{document} In the code above (original answer by @egreg), I want to center the text inside the minipage. If I use \centering the rule moves; if I use \begin{center} \end{center}, I get vertical space.
- How can I center the text without moving the rule and not have extra vertical space?
- How can have an alternate version of
myquotewhere text is centered? (I tried to place\centeringinside at various points, but in all of them the rule has also moved.)

