Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

LaTeXStrings support #8

Closed
stevengj opened this issue May 21, 2023 · 3 comments · Fixed by #14
Closed

LaTeXStrings support #8

stevengj opened this issue May 21, 2023 · 3 comments · Fixed by #14

Comments

@stevengj
Copy link
Member

The current strip behavior for a LaTeXString doesn't seem quite right:

If format isa LaTeXString, then the keyword clean is present. When clean=true then format is changed for strip(format, '\$'), stripping of the initial and ending '\$'.

A single LaTeXString can, in principle, contain multiple equations delimited by $ or $$, e.g. L"$x+y$ and $e^x$ are formulas", so the right behavior is to apply texprintf to each $...$ substring, probably with a regex search/replace.

However, in the longer term my suggestion would be to remove the LaTeXString support completely. Instead, LaTeXStrings.jl can make this package an optional dependency, and use it automatically for its multiline/3-arg show method for display if LibTeXPrintf is loaded.

@Suavesito-Olimpiada
Copy link
Collaborator

Yup, it was a fast and hacky solution. Although I did think about it.

Each $...$ can be texprintfed to multiple lines. In principle, I would like to check which ones are, and format the rest of the line in a text box to center it wrt the TeX displayed. But for that I need to write a parser to detect which of the $ does form a new section of math, and which ones do not.

Another thing is that I would like to detect $$, to be able to treat them as a new line math section, and print them in a new line.

@Suavesito-Olimpiada
Copy link
Collaborator

About the longer term suggestion, I think that it is really sensible. With the support of extensions, I think this is the correct way to carry on.

@Suavesito-Olimpiada
Copy link
Collaborator

This package side is fixed by #14, the work needed must be done in LaTeXStrings.jl.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants