1

I'm looking for some script (program) which would help in editing LaTeX code. Usually I have a mess in my .tex code, so it would be good if the script could align tabulars and so on. It would also be nice, if it allows editing code (for example replace every $$ with \begin{equation}...\end{equation} and vice versa).

Is there any program which is doing such a thing? It can be program, or a plugin of texstudio or a bash (python) script as well. However I don` want to change my editor (if it is of course possible).

  • note exactly, I`m not looking for editor but for program which just do things I wrote above. – Adam Glos May 04 '15 at 18:46
  • You should tell us what platform you're working on. Solutions that work with *nix-based platforms may not work on Windows, for example. – Sean Allred May 04 '15 at 18:47
  • @AdamGlos: Some of the listed editors have regular expression search-and-replace. – Werner May 04 '15 at 18:48
  • @Werner I would be hard-pressed to come up with a regex to align tabulars... It's not a well-formed question right now -- too broad -- but regex alone wouldn't help. – Sean Allred May 04 '15 at 18:48
  • 4
    @SeanAllred: For that there's latexindent. – Werner May 04 '15 at 18:49
  • I`m working on Ubuntu/Kubuntu (14.04 for know). – Adam Glos May 04 '15 at 18:50
  • Search/replace for $$ might be harder than you think (in the general case), but a naive solution is an easy sed: s/\$\$([^(\$\$)])\$\$/\\begin{equation*}\1\\end{equation*}/ should do it, I think (untested) – Sean Allred May 04 '15 at 18:53
  • @SeanAllred You're missing an asterisk, I think. Else you'll only allow maths expressions which are very short. Maybe... – cfr May 04 '15 at 18:55
  • $$'s should be rather replaced by \[ and \], because the equation environment adds (roughly speaking) the numer of equation. – Przemysław Scherwentke May 04 '15 at 19:00
  • latexindent looks very good. For every other my problem it will probably be enough to define my own script (tabulars where the harders objects to handle). However I will wait if there is something better than that:) – Adam Glos May 04 '15 at 19:02
  • @PrzemysławScherwentke that's why I want to replace it. I`m used to use $$, but in my work I have to use equation instead. – Adam Glos May 04 '15 at 19:03
  • Emacs (with AUCTeX): C-c C-q C-e. (Won't do everything, but comes close.) – jon May 04 '15 at 19:08
  • True, it`s duplcation. Thank you for help:) – Adam Glos May 04 '15 at 19:34

0 Answers0