latex-table-wizard 
- Description
- Magic editing of LaTeX tables
- Latest
- latex-table-wizard-1.6.1.tar (.sig), 2026-Oct-02, 140 KiB
- Maintainer
- Enrico Flor <enrico@eflor.net>
- Other versions:
- development version
- Website
- https://github.com/enricoflor/latex-table-wizard
- ELPA's Repository
- CGit or Gitweb
- All Dependencies
- auctex (.tar)
- transient (.tar)
- 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.6.0.tar.lz | 2026-May-04 | 23.2 KiB |
| latex-table-wizard-1.5.5.tar.lz | 2026-Feb-13 | 23.8 KiB |
| latex-table-wizard-1.5.4.tar.lz | 2024-Mar-31 | 23.7 KiB |
| latex-table-wizard-1.5.3.tar.lz | 2023-Aug-21 | 23.7 KiB |
| latex-table-wizard-1.5.2.tar.lz | 2023-May-16 | 23.5 KiB |
| latex-table-wizard-1.5.1.tar.lz | 2023-May-14 | 23.0 KiB |
News
-*- mode: org -*-
* 1.6.1 <2026-10-01 Thu>
Bug fix release. No user-facing command, keybinding, option, hook or
face was added or removed.
** Parsing
+ A brace group or inline math directly followed by a column
delimiter (e.g. ~{a}& b~ or ~$x$& b~) was merged with the next cell.
+ A last row not terminated by a row delimiter was not counted, so
moving across the end of the table skipped it or landed in the
wrong row. It also wasn't considered when detecting ragged tables.
+ Horizontal-line macros between the last row and ~\end~ (e.g.
~\bottomrule~) were parsed as an extra cell, which commands could
then edit (~insert-column~ produced ~\bottomrule &~).
+ A horizontal-line macro followed by a row starting at the beginning
of a line was parsed as part of that row's first cell: macro names
could extend across line breaks.
+ The first cell of every row included the line break before it. As a
consequence, swapping rows, killing row or column content and
deleting columns could join rows onto a single line, and aligning
left blank lines between rows.
+ Parsing could insert a space after ~\begin{...}~ (and fill an empty
environment) without marking the buffer as modified and without
recording the change for undo.
+ Starting the wizard with point on the ~\begin~ line signaled an error.
+ Cells of a previously visited table could be picked up when looking
for the cell at point.
** Commands
+ ~latex-table-wizard-delete-column~ deleted text outside the current
row (and even outside the table) when a row had a single cell, e.g.
in single-column or ragged tables. The deleted content is now also
added to the kill ring, as ~latex-table-wizard-delete-row~ does.
+ ~latex-table-wizard-comment-out~ always signaled an error (a local
variable shadowed the dynamic variable ~comment-end~), and could
comment out text outside the current row.
+ ~latex-table-wizard-insert-column~, ~latex-table-wizard-delete-column~
and ~latex-table-wizard-kill-column-content~ failed when called after
another command that modified the table.
+ ~latex-table-wizard-kill-column-content~ always signaled an error
after killing the content.
+ ~latex-table-wizard-delete-row~ left a blank line behind.
+ ~latex-table-wizard-edit-cell~ added two spaces to the cell every
time it was used. New content longer than the old one is now still
separated from the delimiters by a space (same for
~latex-table-wizard-yank-cell-content~).
+ ~latex-table-wizard-edit-cell~, ~latex-table-wizard-yank-cell-content~
and ~latex-table-wizard-kill-cell-content~ now run
~latex-table-wizard-after-table-modified-hook~ like the other editing
commands.
** Customization and minor mode
+ Environments added to ~latex-table-wizard-new-environments-alist~
after the package was loaded were not recognized.
+ The customization interface for ~latex-table-wizard-transient-keys~
was broken (its ~:type~ was not evaluated).
+ Disabling ~latex-table-wizard-mode~ did not remove its
~pre-command-hook~ function, and every activation added a new one.
** Internals
*** New internal functions
~+ latex-table-wizard--cell-and-delimiter-bounds COORD~
~+ latex-table-wizard--replace-cell-content BEG END STR LEN~
~+ latex-table-wizard--cleanup-if-not-in-chain~
~+ latex-table-wizard--environments~ (replaces the variable of the same name)
*** Removed internal variables
+ ~latex-table-wizard--environments~ (now a function, see above)
* 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
...
...