quarto-journals / elsevier

Quarto template for Elsevier Journals
https://quarto-journals.github.io/elsevier/
MIT License
45 stars 19 forks source link

Suppress references title in PDF #15

Open gregmacfarlane opened 1 year ago

gregmacfarlane commented 1 year ago

I am building a document that intends to knit to a quarto book and to an Elsevier PDF. I've got it basically working, except that in the PDF output, the References tag prints twice, as shown below. Screen Shot 2023-01-26 at 10 35 37 AM

I believe that this is because the quarto document prints a header for the references, as does the latex template. I have tried to modify both.

Modify QMD

In the quarto book, the references.qmd file includes only the following:

# References {.unnumbered}

::: {#refs}
:::

If I modify as suggested in the bookdown documentation by saying r if (knitr::is_html_output()) '# References {}'

then it interferes with Quarto's logic for implementing the header names, giving 'references.html' in the sidebar instead of References, and putting a number on the section even though the .unnumbered flag is turned on.

Screen Shot 2023-01-26 at 10 42 42 AM

In the PDF output, I get a blank numbered section, so this isn't going to work.

Screen Shot 2023-01-26 at 10 49 29 AM

Modify LaTeX

I have attempted to remove the References tag from the PDF output by trying

% this command removes the references title from the PDF, which gets put there
% by both the Elsevier template and the quarto markdown
\usepackage{etoolbox}
\patchcmd{\thebibliography}{\section*{\refname}}{}{}{}
\renewcommand\bibname{}

But this appears to have no effect on either the HTML or PDF outputs

Edit quarto-elsevier?

I think the solution would be to modify the template used by this extension, but the existing partials only apply to the header information, as far as I can tell.

gregmacfarlane commented 1 year ago

A template repository exhibiting this issue is at https://github.com/byu-transpolab/template_quarto