Open DhruvaSambrani opened 1 year ago
Just a comment because I saw this new feature in Pandoc 3.0 and quarto 1.3 uses it now
subcaption
package was added in Pandoc 3.0 as part of the complex figure support (https://github.com/jgm/pandoc/commit/909ced5153e2c7cefd5018c39f83231824940fb8)
We have updated the template accordingly inside Quarto https://github.com/quarto-dev/quarto-cli/blob/9c1f27da792adf850bb3f83b0a0ee0dd165725ca/src/resources/formats/pdf/pandoc/latex.template#L310-L312
list=true
can't be added to this line by pandoc's variable. So if this is related to this new addition, maybe this is something to add upstream. cc @tarleb
Just sharing in case it is relevant for the upcoming work
@DhruvaSambrani Can you share a document where you wish this feature was enabled? I'm otherwise inclined to agree with @cderv, and think this has been solved. Thanks!
In this document, I would like the subcaptions (Hanno and Sarus) to also be in the List Of Figures.
❯ quarto check
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.1.1: OK
Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.3.353
Path: /opt/quarto/bin
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.10.9 (Conda)
Path: /home/dhruva/.julia/conda/3/x86_64/bin/python3.10
Jupyter: 5.2.0
Kernels: julia-1.9, python3
[✓] Checking Jupyter engine render....OK
[✓] Checking R installation...........(None)
Unable to locate an installed version of R.
Install R from https://cloud.r-project.org/
Thanks for sharing this !
It seems Quarto itself is handling the insertion of subcaption
https://github.com/quarto-dev/quarto-cli/blob/db9b963758ea3bca30c998054c00589e092b2f63/src/resources/filters/layout/meta.lua#L9-L14
So we could add the list=true
option maybe
diff --git a/src/resources/filters/layout/meta.lua b/src/resources/filters/layout/meta.lua
index 611c8b041..f3348d49b 100644
--- a/src/resources/filters/layout/meta.lua
+++ b/src/resources/filters/layout/meta.lua
@@ -5,12 +5,11 @@
function layout_meta_inject_latex_packages()
return {
Meta = function(meta)
-
-- inject caption, subfig, tikz
metaInjectLatex(meta, function(inject)
inject(
usePackage("caption") .. "\n" ..
- usePackage("subcaption")
+ usePackageWithOption("subcaption", "list=true")
)
if layoutState.usingTikz then
inject(usePackage("tikz"))
The above fix is working.
@cscheid @dragonstyle Do you think we should add subcaption title in list of figure always ? Or should it be by default and with a new lof option to opt-out ?
Current workaround for this : use a header include
include-in-header:
text: |
\PassOptionsToPackage{list=true}{subcaption}
Bug description
Import the subcaption package as
to allow for subcaptions being included in the list of figures.
Checklist
quarto check
so we know which version of quarto and its dependencies you're running.