I'm having problems with headers in a file (mwe
attached, although it is only as m as I could make it, since the problem
is over a page break, and includes one short score).
The
TL;dr - you'll see the problem from the MWE attached. Probably
insurmountable problems with multicols. But if there is anything that
can be done, or alternate packages to use, I'd love to know.
Details:
I
expect based on what I've found is the problem is with the package
multicols that does not handle floats, and that a general solution
appears to be insurmountable for that package. So there may be no fix
to my problem with these packages, in which case recommendations of
other packages or other paths to a formatting solution may be the only
hope. I'm going to also post at Stack Exchange since this may not
really be a Gregorio Tex problem. I suspect Gregorio just creates the
float which multicols can't handle. However, expertise here in possibly
typesetting in similar formats may help me avoid the problem.
I'm
trying to reproduce material in the style of the Nocturnale Romanum
(e.g.
https://gregobase.selapa.net/source.php?id=23&images=1&index=4
and ff.). As we all know, such books often have many sections of
partial pages of two column text, chants (probably floats? from gregorio
tex). I also want a header that I can change, preferably supplying my
own text at each change, but if necessary built from section headings
and the like. The latter would require flexibility in order to match
the original.
My problem is that at certain
(but not all) page breaks, the multicols environment seems to screw up
the fancy header, but only if there is a chant involved somewhere. I
understand LaTeX can start preparing material for the next page before
assigning the location of a page break, and this is likely at the heart
of it.
Compiling the attached example (currently linked to the
gtex file for Stack Exchange purposes) will show the problem; changing
the header by commenting out one line and uncommenting the other as
indicated in mwe.tex will show without the problem. It appears not
enough horizontal line space is being allowed for the header, causing
bad line breaks in the header and warnings about needing more space for
the fancy header.
And yes, the formatting is hell because I've
tried to distill it down to an MWE. This obviously bears no relation to
how I've actually formatted this.
Any help, be
it suggestions of other packages or methods, or work arounds with these
packages, or redefinitions of other items would be most appreciated.
Thank you!
Rob Leduc
For whatever reason, I can't seem to attach files - google just gives me an error on posting - so will have to post the text in the message body.
File - ExtraTempusPaschale.Secunda.Antiphon.1.gabc:
name: Dominus ;
office-part: Antiphona;
commentary: {\itshape\mdseries Ps.13,2;\/} Off.m.h.135;
mode: 2;
mode-differential:d;
annotation: 1.Ant;
annotation: II.d;
%%
(f3) DO([alt:Extra Tempus Paschale.]h)mi(g)nus(h) <sp>*</sp>( )
de(f) cœ(g)lo(f) pro(e)spé(g)xit(f) (,)
su(f)per(e) fí(f)li(h)os(g) hó(e)mi(gh)num.(f) (::)
<eu> E(h) U(h) O(h) U(g) A(ef) E.(f) </eu> (::)
MWE.tex:
% !TEX TS-program = lualatex
% !TEX encoding = UTF-8
\documentclass[12pt,latin,twoside]{book}
\usepackage{babel}
\usepackage{geometry}
\geometry{letterpaper}
\usepackage{multicol}
\setlength\columnseprule{0.4pt}
\usepackage[autocompile]{gregoriotex} % for gregorio score inclusion
\newcommand{\flexsymbol}{ }
\newcommand{\psalmstar}{*}
\usepackage{fancyhdr}
\fancyhf{}
\fancyfoot[C]{\rnum{\thepage}}
%Changing between these two headers will show with and without problems.
\fancyhead[C]{Feria II \\* in I Nocturno}
%\fancyhead[C]{Test}
\renewcommand{\headrulewidth}{2pt}
\fancyfoot[C]{\thepage}
\pagestyle{fancy}
\begin{document}
\subsection{Feria Secunda}
\subsubsection{In 1 Nocturno}
\vspace*{0.5cm}
\gregorioscore{ExtraTempusPaschale.Secunda.Antiphon.1}
\vspace*{0.5cm}
\begin{multicols}{2}
{\itshape Sub una tantum Antiphona\/ {\upshape Allelúja,} in hac et aliis Feriis, dicuntur tres Psalmi in unoquoque Nocturno a Feria 2
post Dominicam in Albis usque ad Feriam 6 post Octavam Ascensionis, si Festum de Sanctis novem Lectionum celebretur; et novem
continuatim recitantur Psalmi in unico Nocturno usque ad Vigiliam Ascensions, si Officium trium Lectionum de Tempore vel de Sanctis agatur.
{\upshape \textpilcrow} Antiphonæ, tam intra quam extra Tempus Paschale, in hac et aliis Feriis appositæ, dicuntur semper in Officio feriali et in Festis
sive trium sive novem Lectionum, quando juxta Rubricas sumendi sing Psalmi de Feria, ut in Psalterio; Versus autem, per Annum in singulis Nocturnis assignati, adhibentur etiam in Festis, quæ Tempore Adventus, Quadragesimæ ac Passionis celebrantur.
In Officio autem trium Lectionum, tam de tempore quam de Sanctis, omittuntur Versus et reliqua omnia, quæ in Officio novem Lectionum solent
recitari in fine 1 et 2 Nocturni, et continuantur Psalmi (cum suis Antiphonis extra Tempus Paschale) usque ad versum 3 Nocturni.
}
Dixit insípiens in corde suo:\psalmstar non est Deus.
Corrúpti sunt, et abominábiles facti sunt in stúdiis suis:\psalmstar non est qui fáciat bonum, non est usque ad unum.
Dóminus de cælo prospéxit super fílios hóminum,\psalmstar ut vídeat si est intéllegens, aut requírens Deum.
Omnes declinavérunt, \flexsymbol simul inútiles facti sunt:\psalmstar non est qui fáciat bonum, non est usque ad unum.
Sepúlcrum patens est guttur eórum: \flexsymbol linguis suis dolóse agébant\psalmstar venénum áspidum sub lábiis eórum.
Quorum os maledictióne et amaritúdine plenum est:\psalmstar velóces pedes eórum ad effundéndum sánguinem.
Contrítio et infelícitas in viis eórum, \flexsymbol et viam pacis non cognovérunt:\psalmstar non est timor Dei ante óculos eórum.
Nonne cognóscent omnes qui operántur iniquitátem,\psalmstar qui dévorant plebem meam sicut escam panis?
Dóminum non invocavérunt,\psalmstar illic trepidavérunt timóre, ubi non erat timor.
Quóniam Dóminus in generatióne justa est, consílium ínopis confudístis:\psalmstar quóniam Dóminus spes ejus est.
Quis dabit ex Sion salutáre Israël? \flexsymbol cum avérterit Dóminus captivitátem plebis suæ,\psalmstar exsultábit Jacob, et lætábitur Israël.
\end{multicols}
\end{document}