emacs-leuven icon indicating copy to clipboard operation
emacs-leuven copied to clipboard

`tikzpicture` environment shouldn't be prevented from indentation

Open dbitouze opened this issue 2 years ago • 4 comments

emacs-leuven leaves the tikzpicture code unfilled when doing M-q: (add-to-list 'LaTeX-indent-environment-list '("tikzpicture")).

I agree tikzpicture environment should be prevented from fill-paragraph but, IMO, it shouldn't be prevented from indentation.

dbitouze avatar May 14 '23 13:05 dbitouze

Hello @dbitouze . Do you mean it'd make more sense to remove the above assignment?

Will that make it?

fniessen avatar May 14 '23 13:05 fniessen

Hello @fniessen.

Do you mean it'd make more sense to remove the above assignment?

I'm not sure. In order to keep some commands in the preamble of .tex files in the corresponding lines, I rely on LaTeX-paragraph-commands:

(setq LaTeX-paragraph-commands
      '("documentclass"
        "usepackage"
        "title"
        "author"
        "date"
        "maketitle"
        "newcommand"
        "renewcommand"
        "pause"
        "frametitle"
        "framesubtitle"))

and that allows indentation. For instance, TAB on:

   \usepackage{foo}
   \usepackage{bar}

will result in:

\usepackage{foo}
\usepackage{bar}

but M-q on:

\usepackage{foo}
\usepackage{bar}

won't result in:

\usepackage{foo}\usepackage{bar}

And I guess that's is wanted by most of the users working on tikzpictures. But I don't know if there is an equivalent of LaTeX-paragraph-commands for paragraphs.

dbitouze avatar May 14 '23 14:05 dbitouze

Could you make me a Pull Request (or a simple diff) with the settings you're comfortable with? (The ones which make you happy...)

fniessen avatar May 14 '23 14:05 fniessen

I have to first see whether there is or not an equivalent of LaTeX-paragraph-commands for paragraphs.

dbitouze avatar May 14 '23 19:05 dbitouze