File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
src/resources/filters/quarto-pre Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,14 @@ function bookNumbering()
2929 tappend (appendixPara .content , el .content )
3030 appendixPara .content :insert (pandoc .RawInline (' latex' , ' }' ))
3131 return appendixPara
32+ elseif bookItemType == " chapter" then
33+ preState .usingBookmark = true
34+
35+ local bookmarkReset = pandoc .Para ({
36+ pandoc .RawInline (' latex' , ' \\ bookmarksetup{startatroot}' ),
37+ })
38+ tappend (bookmarkReset .content , el .content )
39+ return bookmarkReset
3240 end
3341 end
3442
Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ function quartoPreMetaInject()
3737 inject (usePackage (" tikz" ))
3838 end
3939 end )
40+
41+
42+ metaInjectLatex (meta , function (inject )
43+ if preState .usingBookmark then
44+ inject (
45+ usePackage (" bookmark" )
46+ )
47+ end
48+ end )
49+
4050 return meta
4151 end
4252 }
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ text = require 'text'
99
1010-- global state
1111preState = {
12+ usingBookmark = false ,
1213 usingTikz = false ,
1314 results = {
1415 resourceFiles = pandoc .List ({}),
You can’t perform that action at this time.
0 commit comments