Comments (8)
Sorry for the delay. I am not a fan of this change because either users will lose some customizability or we will have to deal with all the weird delimiters people use/don't use.
I think for your original problem, it would be much easier to write a script to replace delimiters in your source file to unify all delimiters.
from mdbook-katex.
Why don't you ask ChatGPT to do that?
from mdbook-katex.
Not every GPT
is powerful, and when we have a complex or lengthy prompt, the GPT
may not follow all instructions correctly, but the programming language (like Rust
) generates text very consistently
from mdbook-katex.
My temporary solution is to calculate the dominance between the two situations.
set -e
file="file.md"
left="$(grep -o -e '\\(\(\([^\]*\)[^)]\+\))' -e '\\\[\(\([^\]*\)[^]]\+\)]' "$file" | wc -l)"
dollar="$(grep -o '\$\+\([^$]\+\)\$\+' "$file" | wc -l)"
if [ "$dollar" -gt "$left" ];then
cat book_dollar.toml > book.toml
else
cat book_left.toml > book.toml
fi
from mdbook-katex.
Hello @ayoubelmhamdi, was your problem solved?
I do not plan to support multiple different delimiters because 1. it would complicate the code in a way that I do not find worthy and 2. it would encourage people to commit crimes on using many inconsistent delimiters.
However, if you would like to implement this feature, here is where you need to look at:
Lines 121 to 129 in 5302e96
Hope this helps :D.
from mdbook-katex.
thinks @SichangHe.
I think we don't have many delimiters. Is it acceptable to set a fixed number of delimiters that is already supported, so that it automatically handles these default delimiters without requiring the user to specify which delimiter to use?
This approach would eliminate the need for users to think about which delimiter to use.
from mdbook-katex.
I did not understand what you mean by "set a fixed number of delimiters that is already supported". Do you mean that we hardcode several delimiter pairs? Also, the default delimiters are dollar signs.
from mdbook-katex.
@SichangHe
I mean, we should not accept any delimiters from the user. The user should not worry about delimiters because there is a list of supported delimiters.
[preprocessor.katex]
after = ["links"]
block-delimiter = None # not supported anymore
inline-delimiter = None # not supported anymore
mdbook-katex supports only a list of delimiters, like
for the left [ "\\[", "$", "<math>"]
for the right [ "\\]", "$", "</math>"]
If you think there is another delimiter that is very useful, you could add it to the list.
What do you think?
from mdbook-katex.
Related Issues (20)
- Backslashes process Error(?), like $$ \\\\begin HOT 4
- Devanagri package HOT 1
- cannot use macro `\newcommand` HOT 1
- Scrollable equations HOT 2
- Debugging the plugin HOT 2
- `\\` line separators invalid in matrix environments HOT 7
- Undefined references in new release v0.5.10 HOT 3
- About client-side katex.js features HOT 2
- When a delimiter starts with backtick (`), katex renders inside code blocks HOT 1
- Less than symbol not rendered correctly HOT 7
- Call for PR: use Pulldown-CMark to extract match expressions HOT 1
- Error: The "katex" preprocessor exited unsuccessfully with signal: 6 (SIGABRT) (core dumped) status HOT 7
- `\mathrm` after rendering generate unwanted '>' char HOT 8
- Process chapter names as well HOT 2
- Error: The katex preprocessor does not support the 'pdf' renderer HOT 2
- Help: matrix not display correctly HOT 3
- Unable to render matrix HOT 2
- square brackets cause problems HOT 6
- matrix rendering HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mdbook-katex.