The latex-table Reference Manual

This is the latex-table Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 16:52:14 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 latex-table

Pretty latex tables from Lisp matrices and vectors.

Author

Tamas K Papp

License

Boost Software License, Version 1.0.

Dependencies
  • alexandria (system).
  • anaphora (system).
  • array-operations (system).
  • let-plus (system).
Source

latex-table.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 latex-table/latex-table.asd

Source

latex-table.asd.

Parent Component

latex-table (system).

ASDF Systems

latex-table.


3.1.2 latex-table/package.lisp

Source

latex-table.asd.

Parent Component

latex-table (system).

Packages

latex-table.


3.1.3 latex-table/latex-table.lisp

Dependency

package.lisp (file).

Source

latex-table.asd.

Parent Component

latex-table (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 latex-table

Source

package.lisp.

Nickname

lxt

Use List
  • alexandria.
  • anaphora.
  • common-lisp.
  • let-plus.
Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Special variables

Special Variable: *ascii-column-separator*

The default separator for columns in ASCII output.

Package

latex-table.

Source

latex-table.lisp.

Special Variable: *digits-after-decimal*

Default number of digits after the decimal point.

Package

latex-table.

Source

latex-table.lisp.

Special Variable: *digits-before-decimal*

Default number of digits before the decimal point.

Package

latex-table.

Source

latex-table.lisp.


5.1.2 Ordinary functions

Function: align (alignment content)
Package

latex-table.

Source

latex-table.lisp.

Function: expand-to-vector (length position-value-pairs &optional initial-element)

Construct a vector of given LENTH from (position . value) pairs. Negative positions are counted from the end of the vector (eg -1 is for the last element), while a position T sets all elements.

Package

latex-table.

Source

latex-table.lisp.

Function: labeled-vertical (labels values &key labels-column values-column header?)

Create a table labeling a vector as a vertical column. When HEADER? is set, the top cells are treated as headers and centered, except when HEADER? is ’MULTICOLUMN, which centers it across the two columns.

Package

latex-table.

Source

latex-table.lisp.

Function: multicolumn (alignment content number)
Package

latex-table.

Source

latex-table.lisp.

Function: numprint (digits-after-decimal &optional digits-before-decimal)
Package

latex-table.

Source

latex-table.lisp.

Function: table (cells &key column-types rules)

Construct a table with the given CELLS, COLUMN-TYPES and RULES.

CELLS may be a 2D array or a sequence of sequences, converted to a 2D array.

RULES and COLUMN-TYPES may be lists of pairs, in which case they are passed on to EXPAND-TO-VECTOR. Values which are neither vectors nor lists are recycled to give a vector of the desired length.

Package

latex-table.

Source

latex-table.lisp.


5.1.3 Generic functions

Generic Function: format-content (content)

Return a string.

Package

latex-table.

Source

latex-table.lisp.

Methods
Method: format-content ((content null))
Method: format-content ((integer integer))
Method: format-content ((real real))
Method: format-content ((string string))
Method: format-content ((symbol symbol))
Generic Function: write-ascii (filespec-or-stream table &key column-separator)
Package

latex-table.

Source

latex-table.lisp.

Methods
Method: write-ascii (filespec-or-stream (raw-table raw-table) &key column-separator)
Method: write-ascii (filespec-or-stream (table table) &key column-separator)
Generic Function: write-latex (filespec-or-stream table)

Write TABLE to FILESPEC-OR-STREAM for LaTeX.

Package

latex-table.

Source

latex-table.lisp.

Methods
Method: write-latex (filespec-or-stream (raw-table raw-table))
Method: write-latex (filespec-or-stream (table table))

5.1.4 Standalone methods

Method: initialize-instance :after ((table table-mixin) &key cells column-types rules &allow-other-keys)
Source

latex-table.lisp.

Method: print-object ((table table-mixin) stream)
Source

latex-table.lisp.


5.1.5 Structures

Structure: aligned

Wrapper structure for aligned content.

Package

latex-table.

Source

latex-table.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: alignment
Type

latex-table:alignment

Readers

aligned-alignment.

Writers

(setf aligned-alignment).

Slot: content
Readers

aligned-content.

Writers

(setf aligned-content).

Structure: multicolumn

Wrapper structure for multicolumn content, spanning NUMBER of columns, aligned according to ALIGNMENT.

Package

latex-table.

Source

latex-table.lisp.

Direct superclasses

structure-object.

Direct methods
Direct slots
Slot: alignment
Type

latex-table:alignment

Readers

multicolumn-alignment.

Writers

(setf multicolumn-alignment).

Slot: content
Readers

multicolumn-content.

Writers

(setf multicolumn-content).

Slot: number
Package

common-lisp.

Type

(integer 1)

Readers

multicolumn-number.

Writers

(setf multicolumn-number).

Structure: numprint

Numprint n{before}{after} column type.

Package

latex-table.

Source

latex-table.lisp.

Direct superclasses

structure-object.

Direct methods

format-cell.

Direct slots
Slot: digits-before-decimal
Type

(integer 1)

Initform

latex-table:*digits-before-decimal*

Readers

numprint-digits-before-decimal.

Writers

(setf numprint-digits-before-decimal).

Slot: digits-after-decimal
Type

(integer 0)

Initform

latex-table:*digits-after-decimal*

Readers

numprint-digits-after-decimal.

Writers

(setf numprint-digits-after-decimal).


5.1.6 Classes

Class: table

User-constructed representation of a table. Cells are
formatted and their alignment is resolved according to the column types. Contents of cells that coincide with multicolumn tables are ignored.

Package

latex-table.

Source

latex-table.lisp.

Direct superclasses

table-mixin.

Direct methods

5.1.7 Types

Type: alignment ()

Allowed types of alignment.

Package

latex-table.

Source

latex-table.lisp.

Type: column-type ()

Column types recognized by tables.

Package

latex-table.

Source

latex-table.lisp.

Type: rule ()

Horizontal rule types recognized by tables.

Package

latex-table.

Source

latex-table.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *output*

Variable holding the stream output commands write to.

Package

latex-table.

Source

latex-table.lisp.


5.2.2 Macros

Macro: &aligned (alignment content)

LET+ form for slots of the structure ALIGNED.

Package

latex-table.

Source

latex-table.lisp.

Macro: &aligned-r/o (alignment content)

LET+ form for slots of the structure ALIGNED. Read-only.

Package

latex-table.

Source

latex-table.lisp.

Macro: &multicolumn (alignment content number)

LET+ form for slots of the structure MULTICOLUMN.

Package

latex-table.

Source

latex-table.lisp.

Macro: &multicolumn-r/o (alignment content number)

LET+ form for slots of the structure MULTICOLUMN. Read-only.

Package

latex-table.

Source

latex-table.lisp.

Macro: &numprint (digits-before-decimal digits-after-decimal)

LET+ form for slots of the structure NUMPRINT.

Package

latex-table.

Source

latex-table.lisp.

Macro: &numprint-r/o (digits-before-decimal digits-after-decimal)

LET+ form for slots of the structure NUMPRINT. Read-only.

Package

latex-table.

Source

latex-table.lisp.

Macro: with-output ((filespec-or-stream) &body body)

Make output commands write to the given target for the scope of BODY. Filespecs are opened, streams are used as is.

Package

latex-table.

Source

latex-table.lisp.


5.2.3 Ordinary functions

Reader: aligned-alignment (instance)
Writer: (setf aligned-alignment) (instance)
Package

latex-table.

Source

latex-table.lisp.

Target Slot

alignment.

Reader: aligned-content (instance)
Writer: (setf aligned-content) (instance)
Package

latex-table.

Source

latex-table.lisp.

Target Slot

content.

Function: aligned-p (object)
Package

latex-table.

Source

latex-table.lisp.

Function: alignf (cells row-index col-index &optional alignment)

Wrap cell at indexes as aligned.

Package

latex-table.

Source

latex-table.lisp.

Function: ascii-absolute-positions (column-widths separator-width)

Return two values: the first a vector containing the absolute positions in the format (LIST START END &OPTIONAL OFFSET) where offset is the width of the part before the decimal dot; the second value the total width of the table.

Package

latex-table.

Source

latex-table.lisp.

Function: ascii-buffer-write (buffer start end string offset)

Write STRING in BUFFER as if STRING started at (+ START OFFSET) but not modifying any other elements except the ones between START and END.

Package

latex-table.

Source

latex-table.lisp.

Function: ascii-buffer-write-aligned (buffer start end string alignment)

Like ASCII-BUFFER-WRITE, but also accepting alignment keywords and automatically aligning string.

Package

latex-table.

Source

latex-table.lisp.

Function: ascii-column-widths (raw-table)

Traverse columns and calculate the column widths, returned as a vector. Each column with is either an integer or a cons of two integers, the first the column width, the second the width of the first part (before the decimal dot).

Package

latex-table.

Source

latex-table.lisp.

Function: ascii-row (absolute-positions total-width column-types row)

Render ROW in ASCII.

Package

latex-table.

Source

latex-table.lisp.

Function: ascii-rule (absolute-positions total-width rule)

Expand rule into a string.

Package

latex-table.

Source

latex-table.lisp.

Function: check-table-consistency (cells column-types rules)

Check that the dimensions of the table definition are consistent.

Package

latex-table.

Source

latex-table.lisp.

Function: copy-aligned (instance)
Package

latex-table.

Source

latex-table.lisp.

Function: copy-multicolumn (instance)
Package

latex-table.

Source

latex-table.lisp.

Function: copy-numprint (instance)
Package

latex-table.

Source

latex-table.lisp.

Function: decimal-position (string)

Return the position of the decimal dot in STRING. If no decimal dot is present, return the length of the string, which implies that the string will be aligned left of the decimal dot in numprint columns.

Package

latex-table.

Source

latex-table.lisp.

Function: dump (string)

Write STRING to output.

Package

latex-table.

Source

latex-table.lisp.

Function: ensure-matrix (object)

Return OBJECT as a 2D array if possible, otherwise signal an error.

Package

latex-table.

Source

latex-table.lisp.

Function: ensure-vector (length object &optional initial-element)

Return OBJECT as a VECTOR of length, constructing it using EXPAND-TO-VECTOR if necessary, using the given INITIAL-ELEMENT. For internal use only, not exported.

Package

latex-table.

Source

latex-table.lisp.

Function: format-float (number &key digits-before-decimal digits-after-decimal)
Package

latex-table.

Source

latex-table.lisp.

Function: fresh ()

Fresh line in output.

Package

latex-table.

Source

latex-table.lisp.

Function: latex-column-type-string (column-type)

Return the LaTeX fragment designating a given column type, as a string.

Package

latex-table.

Source

latex-table.lisp.

Function: latex-multicolumn (number column-type string)

Write a LaTeX \multicolumn fragment.

Package

latex-table.

Source

latex-table.lisp.

Function: latex-rule (rule)

Return LaTeX code representing rule as a string.

Package

latex-table.

Source

latex-table.lisp.

Reader: multicolumn-alignment (instance)
Writer: (setf multicolumn-alignment) (instance)
Package

latex-table.

Source

latex-table.lisp.

Target Slot

alignment.

Reader: multicolumn-content (instance)
Writer: (setf multicolumn-content) (instance)
Package

latex-table.

Source

latex-table.lisp.

Target Slot

content.

Reader: multicolumn-number (instance)
Writer: (setf multicolumn-number) (instance)
Package

latex-table.

Source

latex-table.lisp.

Target Slot

number.

Function: multicolumn-p (object)
Package

latex-table.

Source

latex-table.lisp.

Function: multicolumnf (cells row-index col-index number &optional alignment)

Wrap cell at indexes as multicolumn.

Package

latex-table.

Source

latex-table.lisp.

Reader: numprint-digits-after-decimal (instance)
Writer: (setf numprint-digits-after-decimal) (instance)
Package

latex-table.

Source

latex-table.lisp.

Target Slot

digits-after-decimal.

Reader: numprint-digits-before-decimal (instance)
Writer: (setf numprint-digits-before-decimal) (instance)
Package

latex-table.

Source

latex-table.lisp.

Target Slot

digits-before-decimal.

Function: numprint-p (object)
Package

latex-table.

Source

latex-table.lisp.

Function: numprint-widths (cell)

Break the contents of cell into two parts around the decimal dot, return the length of each as a cons.

Package

latex-table.

Source

latex-table.lisp.

Function: table-to-raw (table)

Convert table to the ‘raw’ format. Users should not use the raw format as it may change without notice, tables should only be constructed using TABLE. Not exported, for internal use only.

Package

latex-table.

Source

latex-table.lisp.


5.2.4 Generic functions

Generic Function: format-cell (cell column-type)
Package

latex-table.

Source

latex-table.lisp.

Methods
Method: format-cell ((cell multicolumn) column-type)
Method: format-cell ((cell aligned) column-type)
Method: format-cell ((cell real) (numprint numprint))
Method: format-cell (cell column-type)
Generic Function: latex-cell (cell)

Write a cell in LaTeX format.

Package

latex-table.

Source

latex-table.lisp.

Methods
Method: latex-cell ((cell null))
Method: latex-cell ((cell multicolumn))
Method: latex-cell ((cell aligned))
Method: latex-cell ((cell string))

5.2.5 Classes

Class: raw-table

Internal representation of a table. CELLS may only contain
- strings,
- ALIGNED elements with string content,
- MULTICOLUMN elements with string content,
- the appropriate number of NILs after MULTICOLUMN, which are skipped.

This format is for internal use only, and RAW-TABLE is not exported.

Package

latex-table.

Source

latex-table.lisp.

Direct superclasses

table-mixin.

Direct methods
Class: table-mixin

Mixin class for table of values, stored in CELLS.
COLUMN-TYPES specify the column types, and RULES the rules (you one more than the rows in CELLS)

Package

latex-table.

Source

latex-table.lisp.

Direct subclasses
Direct methods
Direct slots
Slot: cells
Type

(array * (* *))

Initargs

:cells

Slot: column-types
Type

vector

Initargs

:column-types

Slot: rules
Type

vector

Initargs

:rules


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   &   (  
A   C   D   E   F   G   I   L   M   N   P   T   W  
Index Entry  Section

&
&aligned: Private macros
&aligned-r/o: Private macros
&multicolumn: Private macros
&multicolumn-r/o: Private macros
&numprint: Private macros
&numprint-r/o: Private macros

(
(setf aligned-alignment): Private ordinary functions
(setf aligned-content): Private ordinary functions
(setf multicolumn-alignment): Private ordinary functions
(setf multicolumn-content): Private ordinary functions
(setf multicolumn-number): Private ordinary functions
(setf numprint-digits-after-decimal): Private ordinary functions
(setf numprint-digits-before-decimal): Private ordinary functions

A
align: Public ordinary functions
aligned-alignment: Private ordinary functions
aligned-content: Private ordinary functions
aligned-p: Private ordinary functions
alignf: Private ordinary functions
ascii-absolute-positions: Private ordinary functions
ascii-buffer-write: Private ordinary functions
ascii-buffer-write-aligned: Private ordinary functions
ascii-column-widths: Private ordinary functions
ascii-row: Private ordinary functions
ascii-rule: Private ordinary functions

C
check-table-consistency: Private ordinary functions
copy-aligned: Private ordinary functions
copy-multicolumn: Private ordinary functions
copy-numprint: Private ordinary functions

D
decimal-position: Private ordinary functions
dump: Private ordinary functions

E
ensure-matrix: Private ordinary functions
ensure-vector: Private ordinary functions
expand-to-vector: Public ordinary functions

F
format-cell: Private generic functions
format-cell: Private generic functions
format-cell: Private generic functions
format-cell: Private generic functions
format-cell: Private generic functions
format-content: Public generic functions
format-content: Public generic functions
format-content: Public generic functions
format-content: Public generic functions
format-content: Public generic functions
format-content: Public generic functions
format-float: Private ordinary functions
fresh: Private ordinary functions
Function, (setf aligned-alignment): Private ordinary functions
Function, (setf aligned-content): Private ordinary functions
Function, (setf multicolumn-alignment): Private ordinary functions
Function, (setf multicolumn-content): Private ordinary functions
Function, (setf multicolumn-number): Private ordinary functions
Function, (setf numprint-digits-after-decimal): Private ordinary functions
Function, (setf numprint-digits-before-decimal): Private ordinary functions
Function, align: Public ordinary functions
Function, aligned-alignment: Private ordinary functions
Function, aligned-content: Private ordinary functions
Function, aligned-p: Private ordinary functions
Function, alignf: Private ordinary functions
Function, ascii-absolute-positions: Private ordinary functions
Function, ascii-buffer-write: Private ordinary functions
Function, ascii-buffer-write-aligned: Private ordinary functions
Function, ascii-column-widths: Private ordinary functions
Function, ascii-row: Private ordinary functions
Function, ascii-rule: Private ordinary functions
Function, check-table-consistency: Private ordinary functions
Function, copy-aligned: Private ordinary functions
Function, copy-multicolumn: Private ordinary functions
Function, copy-numprint: Private ordinary functions
Function, decimal-position: Private ordinary functions
Function, dump: Private ordinary functions
Function, ensure-matrix: Private ordinary functions
Function, ensure-vector: Private ordinary functions
Function, expand-to-vector: Public ordinary functions
Function, format-float: Private ordinary functions
Function, fresh: Private ordinary functions
Function, labeled-vertical: Public ordinary functions
Function, latex-column-type-string: Private ordinary functions
Function, latex-multicolumn: Private ordinary functions
Function, latex-rule: Private ordinary functions
Function, multicolumn: Public ordinary functions
Function, multicolumn-alignment: Private ordinary functions
Function, multicolumn-content: Private ordinary functions
Function, multicolumn-number: Private ordinary functions
Function, multicolumn-p: Private ordinary functions
Function, multicolumnf: Private ordinary functions
Function, numprint: Public ordinary functions
Function, numprint-digits-after-decimal: Private ordinary functions
Function, numprint-digits-before-decimal: Private ordinary functions
Function, numprint-p: Private ordinary functions
Function, numprint-widths: Private ordinary functions
Function, table: Public ordinary functions
Function, table-to-raw: Private ordinary functions

G
Generic Function, format-cell: Private generic functions
Generic Function, format-content: Public generic functions
Generic Function, latex-cell: Private generic functions
Generic Function, write-ascii: Public generic functions
Generic Function, write-latex: Public generic functions

I
initialize-instance: Public standalone methods

L
labeled-vertical: Public ordinary functions
latex-cell: Private generic functions
latex-cell: Private generic functions
latex-cell: Private generic functions
latex-cell: Private generic functions
latex-cell: Private generic functions
latex-column-type-string: Private ordinary functions
latex-multicolumn: Private ordinary functions
latex-rule: Private ordinary functions

M
Macro, &aligned: Private macros
Macro, &aligned-r/o: Private macros
Macro, &multicolumn: Private macros
Macro, &multicolumn-r/o: Private macros
Macro, &numprint: Private macros
Macro, &numprint-r/o: Private macros
Macro, with-output: Private macros
Method, format-cell: Private generic functions
Method, format-cell: Private generic functions
Method, format-cell: Private generic functions
Method, format-cell: Private generic functions
Method, format-content: Public generic functions
Method, format-content: Public generic functions
Method, format-content: Public generic functions
Method, format-content: Public generic functions
Method, format-content: Public generic functions
Method, initialize-instance: Public standalone methods
Method, latex-cell: Private generic functions
Method, latex-cell: Private generic functions
Method, latex-cell: Private generic functions
Method, latex-cell: Private generic functions
Method, print-object: Public standalone methods
Method, write-ascii: Public generic functions
Method, write-ascii: Public generic functions
Method, write-latex: Public generic functions
Method, write-latex: Public generic functions
multicolumn: Public ordinary functions
multicolumn-alignment: Private ordinary functions
multicolumn-content: Private ordinary functions
multicolumn-number: Private ordinary functions
multicolumn-p: Private ordinary functions
multicolumnf: Private ordinary functions

N
numprint: Public ordinary functions
numprint-digits-after-decimal: Private ordinary functions
numprint-digits-before-decimal: Private ordinary functions
numprint-p: Private ordinary functions
numprint-widths: Private ordinary functions

P
print-object: Public standalone methods

T
table: Public ordinary functions
table-to-raw: Private ordinary functions

W
with-output: Private macros
write-ascii: Public generic functions
write-ascii: Public generic functions
write-ascii: Public generic functions
write-latex: Public generic functions
write-latex: Public generic functions
write-latex: Public generic functions