4 ms·
> Our hero, a mathematician, is writing notes in LaTeX and needs to convert it to a format that her blog platform accepts. She’s used to using dollar sign delim
by OskarS 8y ago
> Our hero, a mathematician, is writing notes in LaTeX and needs to convert it to a format that her blog platform accepts. She’s used to using dollar sign delimiters for math mode, but her blog requires \( \) and \[ \].
Unless our hero mathematician is writing, like, several blog posts a day, using tools like parser generators and writing your grammar in BNF and the like is WAY overkill. Just use search/replace and manually fix it up. Or, like, maybe some kind of editor macro/multiple cursor nonsense in your fully-featured text editor. If she really wants to go nuts, she should write a four-line python script to do the search/replace a tiny bit smarter. Fixing it up with some manual oversight takes like three minutes per blog post at most, it's not worth trying to automate fully.
This is one of them "killing an ant with a nuclear bomb" situations.