Skip to content

Breaking line after \newline or double slash, with after modifylinebreak #598

@Tokariew

Description

@Tokariew

Please provide the following when posting an issue:

original .tex code

A\\ B C D\\ E F G H I J The text wrapping routine operates, by default, before the code blocks have been found, but this can be changed to after

yaml settings

modifyLineBreaks:
    textWrapOptions:
        when: after
        columns: 80
        blocksFollow:
           other: \\\]|\\item(?:\h|\[)|\\\\|\\newline
replacements:
  -
    amalgamate: 0
  -
    when: before
    substitution: |-
        s/(\\\\|\\newline)\s*/$1\n/sg

actual/given output

A\\
B C D\\
E F G H I J The text wrapping routine operates, by default, before the code
  blocks have been found, but this can be changed to after

desired or expected output

A\\
B C D\\
E F G H I J The text wrapping routine operates, by default, before the code
blocks have been found, but this can be changed to after

anything else

This is maybe continuation of #424
But when using latexindent modifyLineBreaks with when: after it insert additional spaces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    text-wraptext wrapping; documented at https://latexindentpl.readthedocs.io/en/latest/sec-the-m-switch.html

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions