Ihor Radchenko writes: >> And finally, I think that applying a general solution to this problem is >> something that should be done(IMHO) in LaTeX and not in Org, for >> example, with some new package that would protect certain signs or >> through ad hoc LaTeX/Lua code. > > Either way, we will need to use the new package in ox-latex.el. And our > current approach is somewhat better because users can still use direct > LaTeX @@latex:\\@@ if they want to get "\\" exactly.
I'm afraid we differ completely on what Org's priorities are at this point. The way I see it, Org shouldn't try to solve LaTeX problems, because Org isn't proficient in LaTeX. This is a known issue in LaTeX, where a leading bracket can be confused with the optional argument of a preceding macro (such as \\ or \linebreak). And it doesn't just happen in this context. It can also happen with environments that have optional arguments, although the case of \\ is the most common and the case of environments depends on how the environment is defined. For this problem, LaTeX has been recommending various *specific* solutions (because the probability of it appearing is very low, luckily), such as enclosing the brackets in two {} or putting a \relax before . In this case Org intends to solve the LaTeX problem, and it does it, in my opinion, poorly, by generalizing a particular solution for what is even an extremely rare problem. This is the typical case that can be easily solved by the user with a macro or an export filter, as I have been doing for a long time, and at no time have I needed anything else. Org must worry about exporting well and offering the necessary tools for that to happen, as it has been doing until now. And the duty of the users is to know reasonably the language to which they export, to the extent of what they want to obtain when they export. Org should not be a substitute for LaTeX: whoever wants to get special things in LaTeX, must know LaTeX. It's that easy. If Org is going to start trying to solve at its own risk all the *specific* problems that can appear in the typical compilation of a LaTeX document, then I prefer to stop using Org and use pure LaTeX from the beginning. And as for the ox-latex.el file, in its current state it is completely unusable for me. At least the user could be offered the possibility of choosing.