-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using \( ... \) as opposed to $ ... $ when toggling using ts$ #3040
Comments
First, you can change the desired toggle sequence with the option let g:vimtex_env_toggle_math_map = {
\ '$': '\(',
\ '$$': '\[',
\ '\[': 'equation',
\ 'equation': '\(',
\ '\(': '\[',
\}
This would solve one part of your issue. The second part is currently not possible, but I could consider it. In my personal opinion, inline math I prefer not to add more options, but what you are asking would need more options. So I'm curious if you could reconsider if you really want this. |
Thanks for your help, and please do not feel like you must take more work in just because I ask, especially if it involves creating an option and maintaining it further down below. Let us think along if creating an option is necessary at all. I completely see why you have designed When I toggle from Toggling from I am actually curious of how people use the toggle from I thought that adding the
What I have in mind would add one extra layer without options: But please do not think I’m insisting on this, really. I just love your software, and the pleasure I get from writing papers with it. The discomfort I have is very minor, and there is no need to do any changes if you find the behaviour forceful or unnatural. I don’t even know how much work this entails, and if it makes the code harder to maintain. I would say that if we have to go for creating a new option, then I don’t think it’s worth it. |
Thanks for understanding; and sorry for the delay in answering!
Ok, cool - then it is only the other way you find surprising.
I didn't understand the last part here; "commenting one"?
It may be helpful if you show a concrete example of this.
I don't use it too often myself, so I don't know.
Well, yes; you could argue it would be right to change the defaults. But it is a breaking change, so I'm not that comfortable doing it. Also, it is quite easy to change the toggle sequences if you want to.
Do I understand correctly that the following option actually works well for you? let g:vimtex_env_toggle_math_map = {
\ '$': '\[',
\ '$$': '\[',
\ '\[': 'equation',
\ 'equation': '\(',
\ '\(': '$',
\} And that you are also proposing that it should be made the default value?
<3
I don't mind to make changes if I agree with the changes proposed. But I don't like to make changes that increases the complexity and maintenance burden unless it is also a significant improvement. In this case, I think it is useful for me to first properly understand 1) what you personally want for your workflow, and 2) what you are suggesting should be a default behaviour. If I understood correctly above, then it seems that you can get the desired functionality through an existing option, and that you are also suggesting that we change the default.
Thanks, I think we agree here. So let's just make sure we understand things before we decide. |
It could be that the OP has line comments within the display math? \[
a=b
% a = c % this was wrong
\] |
Here is a concrete example for wanting to move from an equation on display to an equation inline (I do this a lot, but I can't think of any other use for such transition). I start from this equation on display The equation is on display, and I am evaluating whether I should put it inline. This typically involves commenting part of the equation and then invoke I will now get an error, as the $ sign has been put after a comment This example is not overly fitting, as the starting equation is really too large for one to put it on display without further edits. But it shows the problem in my opinion: I think the intended use of the transition is for very short inline equations. I often use this type of transition to check whether a mid-sized equation can be put inline (or else, why would one use this transition at all?). As you can see, the text is now garbled, and it also produce code with an error, starting from perfectly legit code. I propose to have an intermediate stage between Hence, without trying to join lines as with I proposed to have (..) by default not to try to join lines, and let those who want to join lines do another keypress and toggle until $..$ |
Is your feature request related to a problem? Please describe it.
When toggling between equation environments using
ts$
, I find the move to$ ... $
ineffective: one comes from a multiple line equation, and when toggling to inline, vimtex puts into a single line. In the vast majority of cases I have to go back to the text, and modify it or re-format it.Describe the solution you'd like
I would like that
$ ... $
be replaced by\(...\)
, or the latter be added to the toggle list. I also would like that what is within the delimiters stay as is (no equation rearranging).The text was updated successfully, but these errors were encountered: