randy3k / LaTeXBox

A lightweight but deprecated LaTeX Plugin for Sublime Text 3
44 stars 8 forks source link

Word wrapping #25

Closed PeterPablo closed 9 years ago

PeterPablo commented 9 years ago

In my document there are cite commands like \cite{author1997}. Currently line wrapping can cut apart the that string at any location inside the curly braces. My own try to modify LaTex Extended.tmLanguage failed. Could you please give me a pointer?

I have comparable issues with formulas like $\beta_v$. Having the whole \beta_v as an undivideable group would be preferable in my opinion.

While at it, I also would prefer that \sin{\varTheta_i} sticks together completely.

randy3k commented 9 years ago

I have pushed some commits to address the issue of \cite and \ref. However, there is only a little I can do with $\beta_v$ or \sin{\varTheta_i}. You can play around with the word_separators setting to see if you can get a format that you like.

PeterPablo commented 9 years ago

Thanks for your recent commits. Unfortunately the behavior of \citeis not improved. The default latex language scheme displays those in a better (non split) way. Manipulating word_separators doesn't seem to affect the wrapping.

Removing

                <dict>
                    <key>include</key>
                    <string>#ref</string>
                </dict>

makes my \citewish come true. Does it have unwanted side effects?

randy3k commented 9 years ago

I only fixed \ref and forgot to fix the \cite. It should look better now @7860154f5777ee8c2d207e413e5258b1bed9f692.

PeterPablo commented 9 years ago

I was wondering why a git pull wouldn't fetch that commit until I noticed that you pushed it to LaTex-Plus and LaTex-Extended. Would you please also update LaTex-Extended with that commit?

randy3k commented 9 years ago

LaTex-Extended is updated. :)

PeterPablo commented 9 years ago

Thanks! This specific issue is fixed. Would you please make comment.latex to wrap only at word_separators. Currently it wraps at any character.

randy3k commented 9 years ago

Fixed. :)

PeterPablo commented 9 years ago

Great! Unfortunately bla (bla) % my (comment) can wrap behind the opening parenthesis (, even if I modify the word_separators. A similar issue exists with $\fex=\SI{1000}{\kilo\hertz}$. I would expect that this is wrapped between the meeting curly braces }{ and nowhere else. Is it possible for you to influence that? Also $p$ in my opinion should only be wrapped as a whole.

Thank you for your fast response!

randy3k commented 9 years ago

There is only a little I can do with "where to break the line". The only setting can be used is word_seperators

PeterPablo commented 9 years ago

You did already a lot, so I am uncertain whether math-handling is any special. It is no dealbreaker for me so I am closing here. Thanks.

randy3k commented 9 years ago

Actually, why are you only interested in the syntax files but not the LaTeX-Plus?

PeterPablo commented 9 years ago

As I wrote in the commit comment (https://github.com/randy3k/LaTeX-Plus/commit/7860154f5777ee8c2d207e413e5258b1bed9f692#commitcomment-9502526) LaTeX-Plus is currently no option for me due to it not having multi-platform support.

randy3k commented 9 years ago

Why do you say so? It does support Mac, windows and Linux(Ubuntu).

PeterPablo commented 9 years ago

Sorry, my fault! I will reevaluate.