-
Notifications
You must be signed in to change notification settings - Fork 382
Description
Discussed in #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
-
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()
orggplot::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 theref-hyperlink
option istrue
. I was thinking to have something like@fig-x{A}
or@fig-x{A-B}
to append some text to the text link. -
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 thatfig-prefix: "Fig. S"
would produce Fig. Sx and add a space in the prefix if need befig-prefix: "fig. "
. Alternatively, we could have a yaml option to set the prefix separator. Currently usingFig. S[-@fig-x]
which has the same ugly look when enabling hyperlinks. -
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 withtitle-delim
andfig-title
, although I don't find it very convenient. However, I cannot figure out an easy way to have thefig-labels
bold. Besides, I have the same spacing problem as mentioned in point 2 for supplementary figures/tables. -
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. -
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
-
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.
-
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