nmfs-opensci / quarto_titlepages

A Quarto extension for making title and cover pages for PDF output.
https://nmfs-opensci.github.io/quarto_titlepages/
Creative Commons Zero v1.0 Universal
115 stars 20 forks source link

`title-fontsize` is having no effect on the title font size when rendering to pdf format #35

Closed shafayetShafee closed 1 year ago

shafayetShafee commented 1 year ago

Bug Description and steps to reproduce

If we try the following reprex,

---
title: "Test page tilte font size"
date: last-modified  
format:  
  titlepage-pdf:  
    documentclass: scrbook
    titlepage: plain  
    titlepage-theme:
      title-fontsize: 50
      title-align: center
keep-tex: true
---

we get the following output,


image

And clearly, the title font size is not as expected. After checking the intermediate tex file I see that,

\newcommand{\titleandsubtitle}{
% Title and subtitle
{\fontsize{50}{60.0}\selectfont
{\Large{\nohyphens{Test page tilte font size}}}\par
}%
}

And it seems font size 50 is getting overridden by \Large. So no matter what value is assigned to title-fontsize, none of them will work.

Note that, this issue mainly originates from this Stackoverflow question where a working solution is provided

Version and Sytem info

eeholmes commented 1 year ago

Yes, it is a rather confusing problem that I wasn't sure how to solve. The title-fontsize is being overridden by title-style. You need to set title-fontstyle: [] This will work:

---
title: "Test page tilte font size"
date: last-modified  
format:  
  titlepage-pdf:  
    documentclass: scrbook
    titlepage: plain  
    titlepage-theme:
      title-fontsize: 50
      title-align: center
      title-fontstyle: []
keep-tex: true
---

I considered doing a check if title-fontsize is spec-ed and then check if any fontsize is being set in title-fontstyle and disallow that. But I haven't coded that. I am thinking perhaps to just 'outlaw' any fontsize in title-fontstyle and require title-fontsize for that. The only problem is that you also need to set title-fontspacing; there is a default, but it doesn't always look good. Maybe I should just issue a warning if title-fontsize is set and title-fontstyle has a font size spec.

shafayetShafee commented 1 year ago

Ok Got it. Then I think it would be better to update the extension documentation with the above information.