Support more symbols and accents, tests, bug fixes.#1
Open
Danila-Bain wants to merge 7 commits into
Open
Conversation
// Changelog:
// - Bug fix: rename "mode=figs" -> "mode=figures" to adhere README
// - Support more acent functions, like dot, grave, etc, with error text
when accent is not recognized instead of ignoring it
// - Support `math.limits`
// - Support more math characters
// - Support itemize lists
// - Support `block` and stand-alone `caption`: just render the body.
// - Use eqref when label starts with "eq:"
// - Support figures with custom "kind"s for theorems
// - Support soft-failing for context expressions
// - Fix broken figure numeration with nested calls
// - Minor cosmetic changes: extra new-lines, not trimming text,
increased margin in exported figures
// - Bug fix: escape curly brackets in math mode ("{ }" -> "\{ \}")
// - Remove usage of \\boldsymbol, it was used when not needed in test
documents
Fix identation after it was temporarely turned off. The identation is no longer increased for "styled" blocks, since it caused extra identation for no justified reason. Add src/test/identation.typ
Remove removal of \boldsymbol, so "test/main.typ" is rendered correctly. Add color-styled equations to "test/main.typ", showing that current implementation treats all styled math as boldsymbol. There is an issue that `styled` objects apparently only have `child` and `styles` fields, where `styles` seems to be unreadable (has no access methods?).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Great project! It worked very well for converting a 15-page document with large amount of formulas and lilaq-powered plots, except for some rough edges, which I tried to solve with this pull request. Figure export is awesome!
Main issues I had are the following.
Fixed:
figure.kind, and if it is present, we just render the environment with corresponding name.Not fixed:
show math.equation: math.display, cause affected equations to be wrapped with \boldsymbol, which is just incorrect. I could not fix this, however, becausestylesfield instyledseems to be a black box with no access methods, so checks likeif math.bold in elem.stylesare not possible.The details of all changes are readily read from commit comments and diffs.
I did not test many of the implemented functionality, like
alignorpmatrixenvironments, and it is possible that I broketableorcolumns(not tested).Also I think the project would benefit from splitting the
lib.typinto several files (at least separate symbol tables), and following some Typst code styling recommendations, like using more descriptive variable names, likelatex-streamforltxandchild-latexfortemp, etc.Other thoughts:
texporter-buildshould not display, or even render latex by default. It should display it only when it is called like#show: texporter-build.with(display: true)and otherwise only render latex when there is "latex" passed in sys arguments. This would allow to render latex at any time without unnecessary increase of compilation time.op, declares the corresponding math operators in latex preambule using\DeclareMathOperator, and uses them instead of inline\mathrmor\operatorname. Again, those additional calculations should be off by default, because it is not guaranteed that there would be no name collisions. The common usage for this feature would be redefined\Reand\Imoperators.