Sublime Forum

Latex Wrap Paragraph at Ruler (Alt+Q)

#1

Hi.

Wrap Paragraph at ruler contains a bug in Latex files. When a word with a hyphen is present (e.g. fake-word) at the end of the paragraph, it splits the work into “fake-” and “word” on the next paragraph. This results in a additional space in the latex document, appearing as “fake- word”, instead of “fake-word” as intended…

Wrap paragraph should not break the hyphenated words. In the example “fake-word” should be wrapped as a whole to the next line.

0 Likes

#2

Any chance of a fix for this ASAP??? This seriously breaks LaTeX files, and in unpredictable ways that change every time one rewraps an edited paragraph.

A correction to the original bug report. This bug appears everytime a hyphen is present at the end of a wrapped line in your source file.

So this source:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do fake- word tempor incididunt

Gets incorrectly rendered by LaTeX as:

Trying to fix this by adding LaTeX % line continuation hint (fake-%\nword) is a disaster, since a subsequent rewrap can easily turn a line into a comment). I can’t see an easy solution, and it should not be the way line wrap should operate, at least on LaTeX files.

0 Likes

#3

NB. This problem also arises for en- and em-dashes (–) and (—), which are very common punctation marks in LaTeX documents, and create havoc when wrapped.

So the hard-wrapped:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed--- do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Gets rendered as:

0 Likes

#4

I am also having this problem. It breaks my figure references sporadically.

0 Likes