Open dragonstyle opened 1 year ago
This would be very helpful, I need a dedication page before the table of contents.
Likewise, I need "chapters" after the table of contents, but before the main content, whose page numbers should be small roman numerals, such as the preface, forward and acknowledgements.
From a LaTeX point of view, the structure would be very roughly like the following.
So is it just a matter of figuring out how to inject stuff into the Quarto LaTeX template between the \mainmatter
and \frontmatter
slugs? But then how do you accomplish this for html output?
\begin{document}
\frontmatter
Publisher content here such as \copyright, notes, ISBN info.
\clearpage
Dedication text
\clearpage
\tableofcontents
\clearpage
Forward
Information about the book and author
\clearpage
Acknowledgements
A lot of text thanking people...
\mainmatter
\chapter{First Chapter}
Content of first chapter
\chapter{Second Chapter}
Content of second chapter
\appendix
\chapter{An Appendix}
Appendix content here
\backmatter
\cleardoublepage
\addcontentsline{toc}{chapter}{\listfigurename}
\listoffigures
\cleardoublepage
\addcontentsline{toc}{chapter}{\listtablename}
\listoftables
\cleardoublepage
\printindex
\end{document}
Unfortunately this isn't going to make it into the 1.3 release as we're beginning the stabilization process for it soon. I will take a look once again in 1.4.
Is this possible for docx output as well? I also feel like this will have some side-effects or is at least related to #4024
This option would be really useful, instead of relying on hacks
@danieltomasz what hacks are you using? At this point I'll resort to them.
@jaredlander
The simplest is to include something like this
format:
pdf:
template-partials:
- before-body.tex
with the `before-body.tex' having example content ( those parts appear before toc)
$if(has-frontmatter)$
\frontmatter
$endif$
$if(title)$
\maketitle
$endif$
\newpage
%----------------------------------------------
% Abstract
%----------------------------------------------
\begin{center}
\Large{Abstract}
\end{center}
\vspace*{\baselineskip}
This is the Abstract part
%\newpage
%----------------------------------------------
% Preface
%----------------------------------------------
\begin{center}
\Large{Preface}
\end{center}
\vspace*{\baselineskip}
This is the Preface part
%\newpage
%----------------------------------------------
% Acknowledgement
%----------------------------------------------
\begin{center}
\Large{Acknowledgement}
\end{center}
\vspace*{\baselineskip}
This is the acknowledgement part
%\newpage
Check also this repository https://github.com/nmfs-opensci/quarto-thesis, here those content can be more modular (separate tex files)
@jaredlander I see you know this already, sorry for false hope
Still very helpful @danieltomasz, thanks!
@jaredlander here another looking good example https://github.com/numbats/monash-quarto-thesis/tree/main
Thanks!
I'm writing doctoral thesis now, when will this function (frontmatter) would be added? I appreciate your answer.
Probably not in time for you to use. There is already a huge amount of work ongoing.
@dragonstyle still targeting this for 1.4 or this will need to be postponed ?
There is a chance it would make 1.4 (prob less than 50% but a chance), but if so it is still probably weeks away.
hi @Guangyao1991 I made a hack I just use a hack I treat everything like mainmater, but I put
format:
pdf:
include-before-body:
text: |
\pagestyle{plain}
\pagenumbering{roman}
and use
\pagenumbering{arabic}
where my main content starts
Discussed in https://github.com/quarto-dev/quarto-cli/discussions/2872