GNU ELPA - latex-table-wizard

latex-table-wizard Atom Feed

Description
Magic editing of LaTeX tables
Latest
latex-table-wizard-1.6.0.tar (.sig), 2026-May-04, 130 KiB
Maintainer
Enrico Flor <enrico@eflor.net>
Website
https://github.com/enricoflor/latex-table-wizard
Browse ELPA's repository
CGit or Gitweb
All Dependencies
auctex (.tar), transient (.tar)
Badge
Manual
latex-table-wizard

To install this package from Emacs, use package-install or list-packages.

Full description

This package provides you with commands to smartly navigate and
edit large and complex LaTeX table-like environments with a
transient.el-based interface.  Table-like environments are portions
of text delimited by a pair of matching "\begin" and "\end" macros
that organize output text into aligned columns.

The entry point of the package is

    M-x latex-table-wizard

while point is inside of a table(-like) environment.  From there, you
can do several things such as:

  + navigate "logically" (that is, move by cells);
  + insert or kill rows or columns;
  + move arbitrary cells or groups of cells around;
  + align the table in different ways (however alignment is not
    needed for the functionalities above).

Standard LaTeX2e table environments are supported out of the box,
but you can define additional ones.  The entry point for
customization is

    M-x latex-table-wizard-customize

The keybinding set by default in the transient prefix are inspired
to some extent by Emacs defaults.  If you want to change these
keybindings you should change the value of the variable
latex-table-wizard-transient-keys.

The package is designed to be perfectly usable without the
transient interface, whose main purpose here is for
discoverability.  All the commands defined here can be called the
usual way without any loss of functionality.

By default, the syntax this package expects is the one of standard
LaTeX tabular environments, whereby "&" separates columns and "\\"
separates rows.  Additional, or different, types of table-like
environments (with their own syntax separators) can be added by the
user.  This is done by adding mappings to
latex-table-wizard-new-environments-alist.  Suppose I want to
define a new table like environment whose name is "mytable", whose
column and row separators are strings like "\COL" and "\ROW", and
the LaTeX macro to add a horizontal line is "\myhline{}":

   \begin{mytable}
       ...
   \end{mytable}

For latex-table-wizard to handle this table, just add the following
cons cell to latex-table-wizard-new-environments-alist:

   '("mytable" . (:col '("\\COL")
                  :row '("\\ROW")
                  :lines '("myhline")))

Each value is a list of strings to allow for more than one macro to
have the same function.

See the Info page for a complete overview of the package.

Data model:

A table is represented by a `latex-table-wizard--table' struct:

  mod-tick   -- value of (buffer-chars-modified-tick) at parse time.
  cells      -- hash: (col . row) -> (beg-marker . end-marker).
  height     -- number of rows.
  width      -- number of columns, or nil for ragged tables.
  row-widths -- alist (row . ncols) for ragged tables; nil when uniform.
  inner-beg  -- marker at the start of the (0,0) cell.
  inner-end  -- marker at the end of the last cell.

During a parse, every cell range in the buffer is stamped with the
text property `ltw-coord' whose value is (col . row).  This makes
"what cell is point in?" a constant-time read and "what are its
buffer bounds?" a constant-time hash lookup.  Text properties are
removed when the cache is invalidated.

A COORD is a (col . row) cons.  All navigation, selection, and
mutation functions take or return COORDs.  Buffer positions appear
only in the `--cell-beg' / `--cell-end' accessors.

`latex-table-wizard--selection' is a list of COORDs.

Old versions

latex-table-wizard-1.5.5.tar.lz2026-Feb-1323.8 KiB
latex-table-wizard-1.5.4.tar.lz2024-Mar-3123.7 KiB
latex-table-wizard-1.5.3.tar.lz2023-Aug-2123.7 KiB
latex-table-wizard-1.5.2.tar.lz2023-May-1623.5 KiB
latex-table-wizard-1.5.1.tar.lz2023-May-1423.0 KiB

News

-*- mode: org -*-

* 1.6.0 <2026-05-03 Sun>

** Complete overhaul of the interals
Every user visible command, keybinding, customization variable, hook,
and face is preserved without change, with backward compatibility.
The rewrite replaces the internal data structures and algorithms with
ones that scale better with table size, resulting in measurable
performance improvements on medium and large tables.  For reference,
we list the functions and variables removed and their replacement
(again, all of them never being part of the public API).

*** Removed internal functions and variables

The following symbols existed in 1.5.5 and are absent in 1.6.0.  They
were never part of the public API.

**** Functions removed:
+  ~latex-table-wizard--parse-table~       (replaced by --parse)
+  ~latex-table-wizard--get-env-ends~      (replaced by struct slots)
+  ~latex-table-wizard--get-cell-pos~      (replaced by gethash)
+  ~latex-table-wizard--locate-point~      (replaced by get-text-property)
+  ~latex-table-wizard--get-thing~         (replaced by coord accessors)
+  ~latex-table-wizard--sort~              (replaced by --row-coords / --col-coords)
+  ~latex-table-wizard--get-other-cell~    (replaced by --jump internals)
+  ~latex-table-wizard--get-landing-index~ (no longer needed)
+  ~latex-table-wizard--shift~             (replaced by --shift-coord)
+  ~latex-table-wizard--hl-cells~          (replaced by --hl-coords)
+  ~latex-table-wizard--swap-line~         (replaced by --swap-lines)

**** Variables removed:
+ ~latex-table-wizard--parse~             (replaced by --current-table)
+ ~latex-table-wizard--table-begin~       (replaced by struct :inner-beg)
+ ~latex-table-wizard--table-end~         (replaced by struct :inner-end)

*** New internal functions

  ~+ latex-table-wizard--parse~
  ~+ latex-table-wizard--do-parse~
  ~+ latex-table-wizard--invalidate~
  ~+ latex-table-wizard--table-valid-p~
  ~+ latex-table-wizard--coord-at-point~
  ~+ latex-table-wizard--snap-to-cell~
  ~+ latex-table-wizard--current-coord~
  ~+ latex-table-wizard--all-coords~
  ~+ latex-table-wizard--row-coords ROW &optional REVERSE~
  ~+ latex-table-wizard--col-coords COL &optional REVERSE~
  ~+ latex-table-wizard--current-row-coords &optional REVERSE~
  ~+ latex-table-wizard--current-col-coords &optional REVERSE~
  ~+ latex-table-wizard--shift-coord COORD DIR~
  ~+ latex-table-wizard--cell-bounds COORD~
  ~+ latex-table-wizard--cell-beg COORD~
  ~+ latex-table-wizard--cell-end COORD~
  ~+ latex-table-wizard--hl-coords COORDS~
  ~+ latex-table-wizard--swap-lines TYPE LINE1 LINE2~
  ~+ latex-table-wizard--selection-in-current-table-p~



** Added new hook: latex-table-wizard-after-movement-hook
Hook run after execution of a latex-table-wizard movement command.
* 1.5.3 <2023-08-21 Mon>
** Commands changed:
*** latex-table-wizard-align
Makes it so calling latex-table-wizard-align always start the cycle
with left alignment.  This behavior was suggested by fountainer
* 1.5.2 <2023-05-16 Tue>
** User option changed: latex-table-wizard-row-delimiters
Default value changed from "\\\\\\\\" to "\\\\".
* 1.4.0 <2023-05-02 Tue>
** New commands:
*** latex-table-wizard-edit-cell
*** latex-table-wizard-copy-cell-content
*** latex-table-wizard-yank-cell-content
*** latex-table-wizard-kill-cell-content
* 1.3.1 <2023-04-13 Thu>
** Added new hook: latex-table-wizard-after-table-modified-hook
This hook is ran whenever a latex-table-wizard command that
potentially changes the table is called.  This fixes a bug that previously
occurred when the user would swap around things in a table
"vacuously", such that after the command the content of the table was
exactly the same as before.
* 1.3.0 <2023-04-10 Mon>
** New commands:
*** latex-table-wizard-kill-row-content
*** latex-table-wizard-kill-column-content
*** latex-table-wizard-delete-row
*** latex-table-wizard-delete-column
*** latex-table-wizard-comment-out
*** latex-table-wizard-comment-out-content
** Commands changed:
*** latex-table-wizard-kill-column
...
...