1

I'm using TeXiFy IDEA and it has autoformatting feature. However, in some cases I would like to preserve my own formatting. E.g.

Very
    long
    sentence.

after formatting becomes

Very
long
sentence.

, which I would like to avoid.

One solution (hack) I have in mind is to insert some character in the beginning of indented lines, e.g.:

Very
\   long
\   sentence.

However, it inserts an extra space in the resulting text. Similarly, {} has the same effect. Is there a character/command which is completely ignored by LaTeX, without affecting output in any way?

If there are cleaner solutions for the original problem, they are much appreciated. If there exists an option to achieve this in settings, I didn't find it.

2
  • 4
    \relax would work there although I wouldn't distort my document to work around mis features in the auto-indent, I'd just not let the system re-indent the file. May 30, 2020 at 21:44
  • @DavidCarlisle, thank you, it works! I'd just not let the system re-indent the file. This is what I was doing, auto-formatting only necessary parts, but I really would like this feature to work.
    – Dmitry
    May 30, 2020 at 21:49

2 Answers 2

4

If you really want to do this, you could use \relax, as long as it is normal text not verbatim and other special modes.

1

If you want TeXiFy to stay away from a specific part of your tex file when formatting, you can enclose it with formatter comments (don't forget to enable them in the settings):

% @formatter:off
Very
   long
   sentence
% @formatter:on

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.