You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't set document properties based on context #4065
There currently is no way to set any document properties using context-dependent functions.
If one tries to define a show-rule as follows, the PDF export will not have a title set. Using context document.title does still output the set title, though.
// NOTE: You probably don't want to actually do such a `show: body => context …` construction.#show: body=>context {
setdocument(title: [Title]) ifquery(<my-label>).len() ==0body
}
#contextdocument.title// uncomment if desired: <my-label>
Proposal
There should probably be a way to define document properties based on context.
If that is not feasible, then context set document() should throw a compiler error.
#lettemplate(doc) = {
// context if state("bundle").get() != true {contextifquery(<sub-document-begin>).len() ==0 {
setdocument(title: [Title])
}
// set ...// set ...// set ...// show ...// show ...// show ...doc
}
#show: template
Text
Activity
Andrew15-5 commentedon May 3, 2024
Here is the minified version:
Andrew15-5 commentedon May 16, 2024
Similar issue: #2326.
(
set page()insidecontextvs.set document()(insideifstatement that is) insidecontext)Fix document set rules