0

The MWE below demonstrates that I have a distinct lack of symmetry in the space between the horizontal lines and chapter title text despite employing the solution in Consistent Line Spacing in Customized Titles .

The meaningful difference between this MWE and those provided in the linked question/answer is the inclusion of setspace and parskip. I originally worked around this by using two different point sizes, but this limited my minimum separation distance and it's not the most elegant solution, so I would like to fix this properly, even if that means I shouldn't be using these packages (but if this is the case I would like some help figuring out why that is the case so I can try and figure out if I can fix the incompatibility with a renew command or if I have to remove all commands provided by these two packages in all my documents sharing this cls file).

\documentclass{report}

\usepackage{setspace}
\usepackage{parskip}

% CONFIGURE PAGE AND PERIOD SPACING 
\onehalfspacing 
%\doublespacing 
%\singlespacing
\frenchspacing 

% CONFIGURE HYPHEN RESTRICTION CRITERION
\righthyphenmin=6
\lefthyphenmin=6

\usepackage[small,md,explicit]{titlesec}

\makeatletter
%http://zoonek.free.fr/LaTeX/LaTeX_samples_chapter/0.html

    \def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}%

    \def\@makechapterhead#1{%
        {   \begin{singlespacing}%
                \parindent \z@ \centering \reset@font%
                \thickhrulefill\quad%
                \large \bfseries \@chapapp{} \thechapter%
                \quad \thickhrulefill%
                \par\nobreak%
                \vspace*{6\p@}%
                \interlinepenalty\@M%
                \hrule%
                \vspace*{2\p@}%
                \Large \bfseries \strut#1\strut\par\nobreak%
                \par\nobreak%
                \vspace*{2\p@}%
                \hrule%
                \vskip 20\p@%
            \end{singlespacing}%
        }}%
        \def\@makeschapterhead#1{%
            {   \begin{singlespacing}%
                    \parindent \z@ \centering \reset@font%
                    \thickhrulefill%
                    \par\nobreak%
                    \vspace*{6\p@}%
                    \interlinepenalty\@M%
                    \hrule%
                    \vspace*{2\p@}%
                    \Large \bfseries \strut#1\strut \par\nobreak%
                    \par\nobreak%
                    \vspace*{2\p@}%
                    \hrule%
                    \vskip 20\p@%
                \end{singlespacing}%
            }}% 
\makeatother
    \begin{document}

            \chapter{Text Here for Chapter Title}

        \end{document}

Update: Re. Asymmetry

Swapping out the following for chapter titles should reproduce inconsistent spacing. I will use short titles so the symmetry isn't complicated by the interline spacing of the lines of the title. Strut seems pretty necessary here to ensure these lines are consistent, but it looks funny to me when this same logic is applied to hanging characters on the last line before the drawn horizontal line. I will demonstrate. enter image description here

  • try \newlength\oldparskip \setlength{\oldparskip}{\parskip} before loadingparskip package and then use \parskip\oldparskip just before \parindent \z@ – touhami Oct 12 '15 at 6:16
3

Here is the version using titlesec. Inside the title, we make \parskip as 0.0pt plus 1.0pt (which would have been the case without parskip package). parskip changes it to 6.0pt plus 2.0pt.

\documentclass{report}

\usepackage{setspace}
\usepackage{parskip}


% CONFIGURE PAGE AND PERIOD SPACING
\onehalfspacing
%\doublespacing
%\singlespacing
\frenchspacing

% CONFIGURE HYPHEN RESTRICTION CRITERION
\righthyphenmin=6
\lefthyphenmin=6

\usepackage{titlesec}

\makeatletter
%http://zoonek.free.fr/LaTeX/LaTeX_samples_chapter/0.html

    \def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}%
\makeatother

\titleformat{\chapter}[display]
{\filcenter\bfseries\Large\singlespacing\setlength{\parskip}{0.0pt plus 1.0pt}}
{\thickhrulefill{\quad\large\bfseries\chaptertitlename{} \thechapter\quad} \thickhrulefill}
{6pt}
{\titlerule%
\vspace{2pt}%
}
[\vspace{2pt}%
\titlerule]

\titleformat{name=\chapter,numberless}[display]
{\filcenter\bfseries\Large\singlespacing\setlength{\parskip}{0pt}}
{\thickhrulefill}
{6pt}
{\titlerule%
\vspace{2pt}%
}
[\vspace{2pt}%
\titlerule]

\titlespacing*{\chapter} {0pt}{50pt}{20pt}

\begin{document}

    \chapter{Text Here for Chapter Title Text Here for Chapter Title Text Here for Chapter Title}
    Some text for this chapter. Some text for this chapter. Some text for this chapter. Some text for this chapter.
   \chapter*{Some un numbered chapter Some un numbered chapter Some un numbered chapter}
   Some text for this chapter. Some text for this chapter. Some text for this chapter. Some text for this chapter.

\end{document}

enter image description here

Same with your version.

\documentclass{report}

\usepackage{setspace}
\usepackage{parskip}

% CONFIGURE PAGE AND PERIOD SPACING
\onehalfspacing
%\doublespacing
%\singlespacing
\frenchspacing

% CONFIGURE HYPHEN RESTRICTION CRITERION
\righthyphenmin=6
\lefthyphenmin=6

\usepackage[small,md,explicit]{titlesec}

\makeatletter
%http://zoonek.free.fr/LaTeX/LaTeX_samples_chapter/0.html

    \def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}%

    \def\@makechapterhead#1{%
        {   \begin{singlespacing}%
                \setlength{\parskip}{0.0pt plus 1.0pt}%
                \parindent \z@ \centering \reset@font%
                \thickhrulefill\strut\quad%
                {\large \bfseries \@chapapp{} \thechapter}%
                \quad \thickhrulefill%
                \par\nobreak%
                \vspace*{6\p@}%
                \interlinepenalty\@M%
                \hrule%
                \vspace*{2\p@}%
                \Large \bfseries \strut#1\strut\par\nobreak%
                \par\nobreak%
                \vspace*{2\p@}%
                \hrule%
                \vskip 20\p@%
            \end{singlespacing}%
        }}%
        \def\@makeschapterhead#1{%
            {   \begin{singlespacing}%
                    \setlength{\parskip}{0.0pt plus 1.0pt}%
                    \parindent \z@ \centering \reset@font%
                    \strut\thickhrulefill%
                    \par\nobreak%
                    \vspace*{6\p@}%
                    \interlinepenalty\@M%
                    \hrule%
                    \vspace*{2\p@}%
                    \Large \bfseries \strut#1\strut \par\nobreak%
                    \par\nobreak%
                    \vspace*{2\p@}%
                    \hrule%
                    \vskip 20\p@%
                \end{singlespacing}%
            }}%
\makeatother
\begin{document}

    \chapter{Text Here for Chapter Title Text Here for Chapter Title Text Here for Chapter Title}
    Some text for this chapter. Some text for this chapter. Some text for this chapter. Some text for this chapter.
   \chapter*{Some un numbered chapter Some un numbered chapter Some un numbered chapter}
   Some text for this chapter. Some text for this chapter. Some text for this chapter. Some text for this chapter.

\end{document}

Note: Since you are defining the \thickhrulefill using 1ex, the font size commands like \large will have effect on the thickness of the line. So don't forget to use braces to limit the scope of these commands like `{\large...} in the definition.

  • Thanks for including both a titlesec approach and a manual approach akin to my original post. Now I am trying to decide between the two. Is there any benefit to use one over the other? I did some checking and they are no different end results when it comes to the table of contents. It seems to me that the more manual one might be easier to modify, but I could be wrong. – EngBIRD Oct 12 '15 at 16:33
  • This isn't a problem with your solution, more a possibility that my use of strut is misapplied. But is it possible for your solution to be modified to make the lines symmetrical adaptively based on whether there is a hanging character or not? Because titles can be different length with or without hanging characters, I am getting inconsistent space before my bottom line. I think my use of strut keeps the space between multiple lines of text consistent, but not the bottom line of text relative to the bottom rule line when there isn't a hanging character. – EngBIRD Oct 13 '15 at 2:59
  • @EngBIRD: I could not reproduce that asymmetry with my tests. I tried with different title lengths (as you can see in my MWE). Hence it is difficult to comment. – user11232 Oct 13 '15 at 4:50
  • I have updated my question with a diagram of where I see hanging character induced asymmetry. – EngBIRD Oct 13 '15 at 18:49
  • @EngBIRD Remove \struts and adjust the space (2\p@) like: \vspace*{5\p@}% \Large \bfseries #1\par\nobreak% \par\nobreak% \vspace*{5\p@}%. – user11232 Oct 13 '15 at 23:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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