ute / custom-numbered-blocks Goto Github PK
View Code? Open in Web Editor NEWquarto extension for user defined, automatically numbered div blocks / latex environment
License: MIT License
quarto extension for user defined, automatically numbered div blocks / latex environment
License: MIT License
(thinking loudly)
when (if) making an interface for other custom block styles, it would be logical to put options that affect the rendering/style, like collapse
, as a subkey under the respective boxstyle key. This would however make the boxstyle key compulsory, and give endless cascades…
Default is foldbox
groups:
Theorem:
boxstyle: {foldbox.simple, collapse=true}
???
Quarto has given their cross referencing mechanism a big make over, and there are still changes to come.
For custom numbered block, this means that cross reference labels have do be put in the fenced block specification. It is no longer possible to use the first title in the block.
Summary:
Using a hyphenated cross-reference label like #thm-reference
results in extra text preceding the callout when rendered.
Description:
custom-numbered-blocks
behaves as expected when cross-reference labels are formatted as a single word, such as #thmRef
. But when labels are formatted with hyphens like #thm-ref
, as suggested in the Quarto cross-reference documentation, the resulting rendered output precedes the numbered block with a previous numbered block's label.
Steps to reproduce:
custom-numbered-blocks
extension._quarto.yml
as follows:project:
type: book
book:
title: "Bug Report"
chapters:
- index.qmd
format:
html:
theme: cosmo
pdf:
documentclass: scrreprt
filters:
- custom-numbered-blocks
custom-numbered-blocks:
groups:
thmlike:
colors: [948bde, 584eab]
boxstyle: foldbox.simple
collapse: false
classes:
Theorem:
group: thmlike
index.qmd
as follows:# Index
::: {.Theorem #thmRef}
This theorem has citation key `#thmRef`. It exhibits expected numbering behavior.
:::
Filler text
::: {.Theorem #thm-Ref}
This theorem has citation key `#thm-Ref`. It results in the block being preceded by the text **Theorem 1.1.**
:::
More filler text
::: {.Theorem #thm-Ref2}
This theorem has citation key `#thm-Ref2`. It results in the block being preceded by the text **Theorem 1.2.**
:::
Actual result:
Numbered blocks with hyphenated labels are preceded by unexpected text.
Expected result:
Numbered blocks with hyphenated labels behave identically to blocks with non-hyphenated labels.
[>] 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.450
Path: C:\Users\<User>\AppData\Local\Programs\Quarto\bin
CodePage: 949
Hi great extension, quite neat.
It would be nice to have control over numbering. For instance flat numbering (all items are numbering continuously all along the document, could specifiy a start counter, could specify letter counter or roman numbers).
Groups and listing are really cool.
As of v0.1.0, list-of-blocks are created by appending references to a file. This collides with quarto updating chapters on the go: the same references are appended over and over.
This issue requires a complete change of implementation of lists-of-blocks
Extension crashes in html book projects with parts or appendix, because meta.book.render evaluation assumes that all entries are chapters.
All callouts in HTML have the option to be collapsed. Is it possible to create a callout in HTML more akin to the PDF style, and be non collapsible.
In your exmaple,
I insert this (after number-sections: true, and before filters:
):
bibliography: "link my Pseudo citedrive"
for the bibliography
In your example:
::: TODO
### Custom styles
- [ ] create an API for user defined block styles @geore1997
- [ ] provide an example
- [ ] and documentation
:::
I insert \ref{TeachersHope}
(your code this example) in label:
### Custom styles \ref{TeachersHope}
I see: It work ok :)
But, when I cite @name000 (have in my own citedrive) of the bibliography.
### Custom styles @name000
And I see: It don't work only pdf
but also html
. :( I only see text: "@name000
" (don't see cite the bibliography) on the pdf
and html
.
I see you create for pdf, html.
I use revealjs in quarto for create slide html.
I want to use your _extension with color [948bde, 584eab] for "Theorem" in revealjs with quarto. But color "Theorem" is default!
How you can?
my YAML:
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.