0

When I compile MWE #1, I get Chapter Heading format #1, which is what I want it to look like.

MWE #1 (XeLaTeX):

\documentclass{book}
\usepackage{lipsum}
\usepackage[
    paperwidth=7.5in,
    paperheight=9.25in,
    inner=0.5in,
    outer=0.5in,
    bindingoffset=0.25in,
    top=0.75in,
    bottom=1.25in,
    twoside,
    %showframe
    ]
    {geometry} 

%%%%%%%%%%
\usepackage[compact,pagestyles]{titlesec}

        %changes page numbering to bottom outer
        \newpagestyle{mystyle}{\setfoot[\thepage][][]{}{}                   {\thepage}}
        \pagestyle{mystyle}
        %

    %creates the chapter heading style  
    \titleformat{\chapter}[display]
    {\normalfont\huge\filcenter\bfseries\rmfamily}
    {\titlerule[1pt]%
    \vspace{1pt}%
    \titlerule
    \vspace{1pc}%
    \LARGE\MakeUppercase{\chaptertitlename} \thechapter}
    {1pc}
    {\titlerule
    \vspace{0pc}%
    \footnotesize}
    %
        %changes chapter heading distance from top
        \makeatletter
        \beforetitleunit=1ex\@plus.ex\@minus.2ex
        \makeatother
        \titlespacing*{\chapter}{0pt}{*-2.25}{*2}
        %

    %changes "Chapter" to "Story"   
    \makeatletter
    \renewcommand\@chapapp{Story}
    \makeatother
    %
%%%%%%%%%%

\begin{document}

\chapter{}
\lipsum[1-24]

\end{document}

Chapter Heading format #1: enter image description here

But when I compile MWE #2, which adds expex and polyglossia commands to the preamble, then I get Chapter Heading format #2.

MWE #2 (XeLaTeX):

\documentclass{book}
\usepackage{lipsum}
\usepackage[
    paperwidth=7.5in,
    paperheight=9.25in,
    inner=0.5in,
    outer=0.5in,
    bindingoffset=0.25in,
    top=0.75in,
    bottom=1.25in,
    twoside,
    %showframe
    ]
    {geometry} 

%%%%%%%%%%
\usepackage[compact,pagestyles]{titlesec}

        %changes page numbering to bottom outer
        \newpagestyle{mystyle}{\setfoot[\thepage][][]{}{}                   {\thepage}}
        \pagestyle{mystyle}
        %

    %creates the chapter heading style  
    \titleformat{\chapter}[display]
    {\normalfont\huge\filcenter\bfseries\rmfamily}
    {\titlerule[1pt]%
    \vspace{1pt}%
    \titlerule
    \vspace{1pc}%
    \LARGE\MakeUppercase{\chaptertitlename} \thechapter}
    {1pc}
    {\titlerule
    \vspace{0pc}%
    \footnotesize}
    %
        %changes chapter heading distance from top
        \makeatletter
        \beforetitleunit=1ex\@plus.ex\@minus.2ex
        \makeatother
        \titlespacing*{\chapter}{0pt}{*-2.25}{*2}
        %

    %changes "Chapter" to "Story"   
    \makeatletter
    \renewcommand\@chapapp{Story}
    \makeatother
    %
%%%%%%%%%%

\usepackage{expex}
\usepackage{polyglossia}
    \setdefaultlanguage{english}
    \setotherlanguage{hebrew}
    \newfontfamily\hebrewfont[Script=Hebrew]{Arial}
    \newfontfamily\englishfont{Linux Libertine O}

\begin{document}

\chapter{}
\lipsum[1-24]

\end{document}

Chapter Heading format #2: enter image description here

The only difference between the two MWEs is the six lines before \begin{document}.

\usepackage{expex}
\usepackage{polyglossia}
    \setdefaultlanguage{english}
    \setotherlanguage{hebrew}
    \newfontfamily\hebrewfont[Script=Hebrew]{Arial}
    \newfontfamily\englishfont{Linux Libertine O}

As far as I can tell, the \setotherlanguage{hebrew} command is causing a problem. What is happening; why would polyglossia or \setotherlanguage affect chapter heading formats? And how can I fix it so that I get Chapter Heading format #1 while still using the expex and polyglossia packages?

2

hebrew loads bidi, and bidi patches tons of packages and commands -- beside other titlesec and headers.

Load hebrew after titlesec but before defining the chapter format:

\documentclass{book}
\usepackage{lipsum}
\usepackage[
    paperwidth=7.5in,
    paperheight=9.25in,
    inner=0.5in,
    outer=0.5in,
    bindingoffset=0.25in,
    top=0.75in,
    bottom=1.25in,
    twoside,
    %showframe
    ]
    {geometry}

%%%%%%%%%%
\usepackage[compact,pagestyles]{titlesec}

\usepackage{polyglossia}
    \setdefaultlanguage{english}
    \setotherlanguage{hebrew}
    \newfontfamily\hebrewfont[Script=Hebrew]{Arial}
    \newfontfamily\englishfont{Linux Libertine O}



        %changes page numbering to bottom outer
        \newpagestyle{mystyle}{\setfoot[\thepage][][]{}{}                   {\thepage}}
        \pagestyle{mystyle}
        %

    %creates the chapter heading style
    \titleformat{\chapter}[display]
    {\normalfont\huge\filcenter\bfseries\rmfamily}
    {\titlerule[1pt]%
    \vspace{1pt}%
    \titlerule
    \vspace{1pc}%
    \LARGE\MakeUppercase{\chaptertitlename} \thechapter}
    {1pc}
    {\titlerule
    \vspace{0pc}%
    \footnotesize}
    %
        %changes chapter heading distance from top
        \makeatletter
        \beforetitleunit=1ex\@plus.ex\@minus.2ex
        \makeatother
        \titlespacing*{\chapter}{0pt}{*-2.25}{*2}
        %

    %changes "Chapter" to "Story"
    \makeatletter
    \renewcommand\@chapapp{Story}
    \makeatother
    %
%%%%%%%%%%

\usepackage{expex}




\begin{document}

\chapter{}
\lipsum[1-24]

\end{document}

enter image description here

  • I love simple solutions! – AML Mar 27 '18 at 14:49
  • Is this sort of order-of-loading issue a feature or a bug of LaTeX? – AML Mar 28 '18 at 11:46

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.