LaTeX auto insertion of maths delimiters rather than TeX's
Environment
- TeXstudio: 4.2.2
- Qt: 6.2.2
- OS: MacOS 12.2.1
- TeX distribution: texlive 2021
Expected behaviour
"Auto insert maths delimiters where needed" should add LaTeX maths delimiters \(…\) rather than TeX's $…$, or should let the user choose between LaTeX and TeX.
Moreover, how does one add custom maths to this auto delimiter insertion mechanism?
You are wrong. $ ... $ can be used in LaTeX in the same way as in Plain TeX. But $$ ... $$ is not recommended for use in LaTeX.
\( ... \)is LaTeX syntax.$ ... $is TeX syntax.plainTeX only allows
$. In LaTeX you can use both, but\( ... \)will give less obscure error messages when there is a mistake inside it.Both are shortcuts to start inline math environments.
https://tex.stackexchange.com/a/513/33287
$ ... $ is officially-supported LaTeX2e syntax!
Yes, LaTeX does support TeX commands, whereas TeX does not support LaTeX commands. Nothing I wrote seems incorrect to me.
Your request suggested to me that using $ ... $ in LaTeX is incorrect, it is only correct to use it in plain TeX. I claim that $ ... $ is allowed in LaTeX as well as Plain TeX.
On the other hand, not all Plain TeX methods are supported in LaTeX! For example, $$ ... $$ works in LaTeX but is not supported!
I take the feature request as making the delimiters user changeable. However that does not have a priority for me.
@sunderme, thanks.
Could you also address my question? I.e. how to add custom maths to the auto-insertion of delimiters?
Currently, typing \alpha will trigger the insertion of maths delimiters. But this won't happen, say, for \myAlpha.
So, where is the list that the auto-insertion is checking? Is it user editable?
cwl (completion word list) contain a indicator that a command is a math command, see manual/wiki.