quarto-dev / quarto-dev/quarto-cli

A few suggestions for cross referencing and text layout

Open
#1,095 11 comments 14 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

crossref enhancement
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

Discussed in https://github.com/quarto-dev/quarto-cli/discussions/1088

Originally posted by arnaudgallou June 7, 2022
Here're a few suggestions/recommendations for possible improvements. I couldn't find easy solutions in the documentation to do what follows so I assume no proper solutions already exist.

Cross referencing
  1. Being able to customize the text of the link when referencing a particular panels in a composite plot (e.g. generated by ggplot::facet_grid() or ggplot::facet_wrap()). The idea would be to have something that looks like Fig. 1A or Fig. 1A-B. I'm currently using [@fig-x]A-B which produces Fig. 1A-B but the unlinked plot tag looks ugly when the ref-hyperlink option is true. I was thinking to have something like @fig-x{A} or @fig-x{A-B} to append some text to the text link.

  2. Somewhat similar to the first point. I'm missing a more flexible way to customize the prefix of supplementary figue/table refs. At the moment, using the fig-prefix option adds a space between the prefix and label. A solution could be to have no space as default prefix separator so that fig-prefix: "Fig. S" would produce Fig. Sx and add a space in the prefix if need be fig-prefix: "fig. ". Alternatively, we could have a yaml option to set the prefix separator. Currently using Fig. S[-@fig-x] which has the same ugly look when enabling hyperlinks.

  3. Adding a x-title-template option for figures and tables to customize the text of figure/table titles easily and with more control. We could imagine something with a placeholder for the labelling. E.g. fig-title-template: "**Fig. S{label}.**" would produce Fig. S1. I can more or less do that with title-delim and fig-title, although I don't find it very convenient. However, I cannot figure out an easy way to have the fig-labels bold. Besides, I have the same spacing problem as mentioned in point 2 for supplementary figures/tables.

  4. I'm missing an easy-to-use system for cross referencing between the supplementary materials and main text. Not sure what would be a simple solution for that because I assume cross references are generated during the rendering process. Ideally, I would imagine adding a yaml option in the main text file to link all references from a specific document (e.g. appendix: supplementary.qmd) and have a new tag for supplementary figures/tables (e.g. @fig-supp-x) for easy cross referencing in the main text.

  5. Adding a way to have a cross reference and citation within the same pair of brackets. E.g.: blah blah Foo (1999; Fig. 1). Probably quite specific and not very common so not sure how relevant it is.

Text layout
  1. Adding a yaml option to align figure/table captions to the left/right/center. This can easily be done with some css but such a trivial thing should be done with a yaml option in my opinion.

  2. Adding a yaml option to justify the text of the document. Same as above, can easily be done with a line of css but having a yaml option to do it would make sense to me.

Other

In RStudio, that would be great to have the possibility to open a file that was included in a document using the {{< include >}} shortcode by clicking on it in the visual markdown editor. E.g.:

{{< include _file.qmd >}} # click the shortcode tag to open _file.qmd in a new tab

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.