leovan / quarto-pseudocode

Quarto Pseudocode Extension
MIT License
40 stars 2 forks source link

Mention new cross-reference div syntax in readme #3

Closed topepo closed 5 months ago

topepo commented 5 months ago

Thanks for the extension.

The issue with \numberwithin{algorithm}{chapter} being only a LaTeX/pdf thing is solved using Quarto’s cross-reference div syntax.

You might generally recommend that folks use custom cross-referencing for the algorithm and specify the caption in Quarto (and not \caption{}). If you made that a hard constraint, it might significantly reduce the complexity of the extension.

leovan commented 5 months ago

Thanks for your advice.

I've made the extension compatible with Quarto custom cross references. It can fix the problem of cross reference in different files with html document for book type project. Except this situation, I still strongly recommend use build-in cross reference. Because Quarto custom cross reference will add an extra caption like figure, which is not a proper way to show the caption of pseudocode. More details place refer Cross reference example.

topepo commented 5 months ago

Thanks. For a book project, I omitted \caption{} and used the quarto caption syntax. That worked pretty well (and enabled me to use dynamic expressions for the caption).

Here's an example of the results:

image