Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crossref: in includes seem to completely overwrite that of main file #7895

Closed
sda030 opened this issue Dec 12, 2023 · 3 comments
Closed

crossref: in includes seem to completely overwrite that of main file #7895

sda030 opened this issue Dec 12, 2023 · 3 comments
Labels
support a request for support

Comments

@sda030
Copy link

sda030 commented Dec 12, 2023

Bug description

Not very important, but having a crossref: in a sub-document with any setting will completely disregard all crossref-settings in the "mother document". Is this intentional? I could not find this issue in the Crossref Overhaul-list or elsewhere. Persists in today's build.
It is not a very common situation as one typically would want to address all such settings in the mother document anyway. I discovered it after a while because a chapter co-author had inserted list-title: to fix a local "issue". As an "editor" I think I would prefer a warning or even an error instead of silently ignoring it.

P.S. Impressed by your big bite on open issues recently, from 1100+ to 877. 👍

Steps to reproduce

Mother document:

---
format:
  html: default
crossref:
  chapters: true
---

{{< include "test1.qmd" >}}

{{< include "test2.qmd" >}}

test1.qmd:

---
format: html
---

# Introduction


What an interesting issue!

test2.qmd:

---
format: html
crossref:
  lst-title: "Overview "  # Move this to mother  document to get it to work as expected
---

# Method

Text about @fig-1.

```{r}
#| label: 'fig-1'
plot(mtcars)
```


## Data
@Fig-2 is another figure.

```{r}
#| label: 'fig-2'
plot(datasets::anscombe)
```


## Analysis

Expected behavior

Either the typical approach (child document only oversteering mother doc for the given setting, otherwise inheritance),
or a warning/error if there is no forseeable future where one would want to do this with crossref.

Actual behavior

image

Your environment

  • IDE: RStudio 2023.12.0 Build 170
  • Windows 11

Quarto check output

Quarto 1.4.526
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.9: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.4.526
      Path: C:\Program Files\Quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: v2023.09
      Chromium: (not installed)

[>] Checking LaTeX....................OK
      Using: TinyTex
      Path: C:\Users\py128\AppData\Roaming\TinyTeX\bin\windows\
      Version: 2023

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.12.0
      Path: C:/Program Files/Python312/python.exe
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with py -m pip install jupyter

[>] Checking R installation...........OK
      Version: 4.3.1
      Path: C:/PROGRA~1/R/R-43~1.1
      LibPaths:
        - C:/Users/py128/AppData/Local/R/win-library
        - C:/Program Files/R/R-4.3.1/library
      knitr: 1.45
      rmarkdown: 2.25

[>] Checking Knitr engine render......OK
@sda030 sda030 added the bug Something isn't working label Dec 12, 2023
@mcanouil
Copy link
Collaborator

This is not a bug and is described in several issues/discussions and in the documentation.

Include shortcode is simply a copy/paste of the content of the file being included in the main document.

If you set any key in the included document frontmatter it will override the ones from the main document.

@mcanouil mcanouil added support a request for support and removed bug Something isn't working labels Dec 12, 2023
@mcanouil mcanouil closed this as not planned Won't fix, can't repro, duplicate, stale Dec 12, 2023
@cscheid
Copy link
Collaborator

cscheid commented Dec 13, 2023

Just to be specific, this is on the top of the includes documentation:

https://quarto.org/docs/authoring/includes.html

image

@sda030
Copy link
Author

sda030 commented Dec 14, 2023

Apologies, thought it would only be the links, not the YAML. Also, I thought for some unknown reason that knitr::knit_child() would be replaced by include, so I had needlessly moved away from that.. I have now fully read up on the includes-feature vs. knit_child().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support a request for support
Projects
None yet
Development

No branches or pull requests

3 participants