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

Separate figure numbering in the main manuscript from Supplementary figures. #104

Open
wolass opened this issue Oct 7, 2019 · 7 comments

Comments

@wolass
Copy link
Contributor

wolass commented Oct 7, 2019

Please wait for some discussion of your request before making a Pull Request.

Is your feature request related to a problem? Please describe.
When authoring papers in the rrtools pipeline I end up producing a one DOCX file with all the figures included. The problem is that the numbering of the figures is consecutive for supplementary figures and I always have to post-process the file by hand in order to correct numbering of supplementary figures (as these usually start with Suppl. Fig 1).

Describe the solution you'd like
I would like to separate the numbering of main figures from the supplementary figures. Preferably we could use something like \@ref(sfig:supplementaryfigurexyz)

Describe alternatives you've considered
I have posted this problem on the Stackoverflow page
https://stackoverflow.com/questions/57753758/how-to-add-a-cross-reference-supplementary-figures-in-bookdown-knitr-rmarkdown

but with no luck ...

do we have a unified approach for this issue that can be used in the rrttools pipeline?

Additional context

@benmarwick
Copy link
Owner

Interesting question! I can see the need for this functionality, but no obvious solution springs to mind. Perhaps it can be achieved with parent-child Rmd documents, and a method that auto-prefixes figures numbers for figures generated by code in the child documents?

@benmarwick
Copy link
Owner

Perhaps the best solutions to this will come from the bookdown pkg directly, or the user's workflow (for example, two DOCX output files instead of one)

@benmarwick
Copy link
Owner

I think the best solution to this lies outside of rrtools.

@wolass
Copy link
Contributor Author

wolass commented Mar 5, 2024

With the new update of quarto 1.5 there is a new feature allowing custom crossref. This allowed me to have one paper.qmd including main and supplementary figures.

The code is being developed right now, and to crossrefence a suppfig we need to use fenced divs

See this issue here

quarto-dev/quarto-cli#8956


::: {#suppfig-suplementary1}


```{r}
Figure code
```

Figure caption 

:::

But it works!

I think we can have this functionality finally implemented into rrtools.

I will wait a bit to see if the quarto devs are going to make the code easier that will not required the use of fenced divs and update the paper.qmd template soon.

Think we can reopen this issue

@benmarwick
Copy link
Owner

Very interesting! Thanks for sharing the details of this development. Have your seen the quarto "manuscript" format?

@benmarwick benmarwick reopened this Mar 14, 2024
@wolass
Copy link
Contributor Author

wolass commented Mar 14, 2024

Yes, but I still use rrtools qmd templates for the paper, because they are fitting my workflow more closely.

@benmarwick
Copy link
Owner

Yes, right, good to know. I'm not sure what the Posit team had in mind when they designed that manuscript format. Doesn't seem targeted for producing manuscripts for submission to journals, which is what I was expecting. Perhaps they are hoping a journal will adopt their format, and then require authors to use it? If so, I guess you and I are not the target audience!

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

No branches or pull requests

2 participants