Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#303 Hard word wrap should not introduce new spaces

open
nobody
qcodeedit (21)
5
2013-01-07
2012-06-18
Kirill Müller
No

When editing the following line:

\geometry{paperwidth=15cm,paperheight=18cm,margin={0.5cm,0.5cm},ignorehead,ignorefoot}

TeXStudio introduced a hard line wrap between "igno" and "refoot" (margin=80).

Please avoid adding new space with the hard word wrap feature. (Latest SVN build, r2966.)

Discussion

  • Tim Hoffmann
    Tim Hoffmann
    2012-06-20

    This is a fallback, because the editor did not find a space for splitting

    What would be the correct solution in such a case?
    - split as special chars: {},
    - break the 80 char limit

     
  • Kirill Müller
    Kirill Müller
    2012-06-20

    I'd opt for simply breaking the limit in this case. The meaning of special characters might be redefined, and then the break still would be wrong.

    The user will notice that the line is too long and introduce a break manually if required.

     
  • Tim Hoffmann
    Tim Hoffmann
    2012-06-20

    implemented in rev. 2970:

    Violate width rather than wrap inside the word.

    I applied this only to hard wrapping. For soft wrapping the current behaviour is fine, because no actual whitespace is inserted and saved. Furthermore soft wrapping is mainly to limit the visual width. So here it is reasonable actually to wrap inside a word rather than exceed the width limit.

     
  • Kirill Müller
    Kirill Müller
    2012-06-20

    Works like a charm. Thank you.

     
  • No, I don't think that is a good idea.

    The hard wrap should be hard and break all lines

    It could become

    \usepackage[paperwidth=15cm,paperheight=18cm,margin={0.5cm,0.5cm},ign%
    orehead,ignorefoot]
    {geometry}

    On 06/21/12 11:07, SourceForge.net wrote:

    Bugs

     
  • Tim Hoffmann
    Tim Hoffmann
    2012-06-21

    Why? Do some applications need strict wrap widths?

    You could introduce an option for the wrapping behavior. Actually I considered that in the first place, but because I didn't thought this to be important, I didn't bother to write all the code to propagate the option down from the config dialog to the document.

     
  • Mast B.
    Mast B.
    2013-01-07

    My opinion is that, since you're dealing with Tex, you can add a "%" in front of any "\" or "{" or after "," etc found in the line and hard-wrap there. That won't break anything in Tex but will be able to wrap long lines without spaces. Yes, it affects the Tex code, but hard-wrapping would affect it anyway ...

    For the above example, this would be fine:

    \geometry{paperwidth=15cm,paperheight=18cm,%
    margin={0.5cm,0.5cm},ignorehead,ignorefoot}

     
    Last edit: Mast B. 2013-01-07