# Unexpected spacing in \newenvironment

The issue is correctly described by barbara in her comment but the solution needs more than just a \par: when the rule is drawn in your code it's at the baseline of the \LARGE paragraph. So you need to end that paragraph (which is what the \par does) and then go back to the normal baseline (which is what \normalsize does.)

When TeX sets a fontsize, it sets two sizes: the fontsize itself, and the leading (baseline height). So your \LARGE command sets the fontsize to 18pt and the leading to 22pt. So the total height of a line is 22pt. This height will remain in place until you change it or the group ends. So in your code, the rule is drawn on a line that is 22pt, which is where the extra vertical space comes from.

The command \normalsize in a 10pt document sets the fontsize to 10pt on a 12pt baseline. This can only be done after the \par is issued to end the previous paragraph.

You don't really need the inner \begin{center} ... \end{center} environment; this could be done by adding \centering instead of the \begin{center} and removing the inner \end{center}.

\documentclass[12pt]{article}

\newenvironment{mytitle}{
\begin{center}
\begin{minipage}[t]{0.5\linewidth}
\begin{center}
\rule{\linewidth}{0.4pt}
\LARGE\bfseries
}{  \par\normalsize
\rule{\linewidth}{0.4pt}
\end{center}
\end{minipage}
\end{center}
}

\begin{document}
\begin{mytitle}
Lorem Ipsum Dipsum Gypsum
\end{mytitle}
\end{document}


The correct answer is Alan Munn's one, however, as a workaround, you could raise a bit your rule adding [.4\baselineskip], the \rule macro syntax is:

\rule[raise]{width}{thickness}


As for \centering instead of center environment, Barbara Beeton has already answered in her comment, however, see here: When should we use \begin{center} instead of \centering?.

\documentclass[12pt]{article}
\newenvironment{mytitle}
{%
\begin{center}
\begin{minipage}{0.5\linewidth}
\rule{\linewidth}{0.4pt}
\LARGE\bfseries\centering
}{%
\rule[.4\baselineskip]{\linewidth}{0.4pt}
\end{minipage}
\end{center}
}
\begin{document}
\begin{mytitle}
Lorem Ipsum Dipsum Gypsum
\end{mytitle}
\end{document}