The texp Reference Manual

This is the texp Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 18:04:32 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 texp

DSL for outputting TeX expressions using S-expressions.

Author

Max Rottenkolber <>

License

GNU Affero General Public License

Dependency

named-readtables (system).

Source

texp.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 texp/texp.asd

Source

texp.asd.

Parent Component

texp (system).

ASDF Systems

texp.


3.1.2 texp/texp.lisp

Source

texp.asd.

Parent Component

texp (system).

Packages

texp.

Public Interface
Internals

3.1.3 texp/syntax.lisp

Dependency

texp.lisp (file).

Source

texp.asd.

Parent Component

texp (system).

Internals

parenthesized-list-reader (function).


4 Packages

Packages are listed by definition order.


4.1 texp

DSL for outputting _TeX_ expressions using S-expressions.

Source

texp.lisp.

Use List
  • common-lisp.
  • editor-hints.named-readtables.
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: *escape-table*

*Description:*

_Alist_ mapping _TeX_ special characters to quoted equivalent.

Package

texp.

Source

texp.lisp.


5.1.2 Macros

Macro: deftex (name parameters &body forms)

_parameters_::= {(}{{}_var_{\}}\*{)}

*Arguments and Values:*

_name_—a _symbol_ or _string_.

_forms_—_forms_.

_var_—a _symbol_.

*Description:*

{deftex} prints the definition of a _TeX_ macro with _name_ that expands to _forms_ to {*standard-output*}. If _name_ is a _symbol_ it will be printed in lower case. _Forms_ are evaluated as if by {tex} with each _var_ in _parameters_ bound to a numeric _TeX_ parameter identifier.

*Examples:*

#code#
(deftex hello (name) "Hello " ($ name))
▷ \def \hello #1{Hello #1}
#

Package

texp.

Source

texp.lisp.

Macro: tex (&rest expressions)

_expressions_::= ↓_expression_\*

_expression_::= ↓_break-clause_ | ↓_interpolation-clause_ | ↓_brackets-clause_ | ↓_braces-clause_ | ↓_tex-clause_ | _literal_

_break-clause_::= {(br)}

_interpolation-clause_::= {($} _form_{)}

_brackets-clause_::= {([]} {{}_expression_{\}}\*{)}

_braces-clause_::= {({\}} {{}_expression_{\}}\*{)}

_tex-clause_::= {(} _tex-macro_ {{}_expression_{\}}\*{)}

*Arguments and Values:*

_literal_—a _string_, _symbol_ or _number_.

_form_—a _form_.

_tex-macro_—a _symbol_ or a _string_.

*Description:*

{tex} compiles _TeX expressions_ to {*standard-output*}.

A _Literal_ is printed as follows:

+ a _string_ is printed as it is
+ a _symbol_ is printed in lower case
+ a _number_ is printed _readably_

A _tex-clause_ prints a _TeX_ macro call of _tex-macro_ followed by _expressions_.

A _break-clause_ prints two newlines (e.g. a paragraph separator).

An _interpolation-clause_ evaluates _form_ and prints its result if the result is a _string_.

_Bracket-clause_ and _braces-clause_ print _expressions_ surrounded by brackets ({[}, {]}) and braces ({{}, {\}}) respectively. If the _readtable_ {texp:syntax} is used then _bracket-clause_ and _braces-clause_ can be written as {[} _expression_\* {]} and {{} _expression_\* {}}.

Package

texp.

Source

texp.lisp.


5.1.3 Ordinary functions

Function: escape (string)

*Arguments and Values:*

_string_—a _string_.

*Description:*

{escape} encodes _string_ as defined by {*escape-table*}. E.g. it quotes _TeX_ special characters.

Package

texp.

Source

texp.lisp.


5.2 Internals


5.2.1 Ordinary functions

Function: compile-break ()

Print double newline.

Package

texp.

Source

texp.lisp.

Function: compile-expression (expression)

Compile _TeX_ EXPRESSION.

Package

texp.

Source

texp.lisp.

Function: compile-expressions (expressions)

Compile _TeX_ EXPRESSIONS.

Package

texp.

Source

texp.lisp.

Function: compile-interpolation (expression)

Interpolate EXPRESSIONS into the TEX macro.

Package

texp.

Source

texp.lisp.

Function: compile-macro-call (name &rest arguments)

Compile call to macro with NAME and ARGUMENTS.

Package

texp.

Source

texp.lisp.

Function: compile-newline ()

Print explicit newline.

Package

texp.

Source

texp.lisp.

Function: compile-parameters (parameters)

Returns a map of PARAMETERS to _TeX_ macro parameter pointers of the form ’#<N>’ and a parameter string for _TeX_’s \\def.

Package

texp.

Source

texp.lisp.

Function: compile-parenthesized (open close expressions)

Compile EXPRESSIONS parenthesized by OPEN and CLOSE.

Package

texp.

Source

texp.lisp.

Function: compile-with-braces (expressions)

Compile EXPRESSIONS parenthesized by braces.

Package

texp.

Source

texp.lisp.

Function: compile-with-brackets (expressions)

Compile EXPRESSIONS parenthesized by brackets.

Package

texp.

Source

texp.lisp.

Function: escape-char (character)

Return escaped string for CHARACTER.

Package

texp.

Source

texp.lisp.

Function: escape-p (character)

Predicate to test if CHARACTER needs to be escaped.

Package

texp.

Source

texp.lisp.

Function: make-parameter-string (n)

Make parameter string for N parameters.

Package

texp.

Source

texp.lisp.

Function: parenthesized-list-reader (type close)

Return read macro function for parenthesized list terminated by CLOSE. It will be consed with TYPE.

Package

texp.

Source

syntax.lisp.

Function: symbol-identifier (symbol)

Return identifier string for SYMBOL.

Package

texp.

Source

texp.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   C   D   E   F   M   P   S   T  
Index Entry  Section

C
compile-break: Private ordinary functions
compile-expression: Private ordinary functions
compile-expressions: Private ordinary functions
compile-interpolation: Private ordinary functions
compile-macro-call: Private ordinary functions
compile-newline: Private ordinary functions
compile-parameters: Private ordinary functions
compile-parenthesized: Private ordinary functions
compile-with-braces: Private ordinary functions
compile-with-brackets: Private ordinary functions

D
deftex: Public macros

E
escape: Public ordinary functions
escape-char: Private ordinary functions
escape-p: Private ordinary functions

F
Function, compile-break: Private ordinary functions
Function, compile-expression: Private ordinary functions
Function, compile-expressions: Private ordinary functions
Function, compile-interpolation: Private ordinary functions
Function, compile-macro-call: Private ordinary functions
Function, compile-newline: Private ordinary functions
Function, compile-parameters: Private ordinary functions
Function, compile-parenthesized: Private ordinary functions
Function, compile-with-braces: Private ordinary functions
Function, compile-with-brackets: Private ordinary functions
Function, escape: Public ordinary functions
Function, escape-char: Private ordinary functions
Function, escape-p: Private ordinary functions
Function, make-parameter-string: Private ordinary functions
Function, parenthesized-list-reader: Private ordinary functions
Function, symbol-identifier: Private ordinary functions

M
Macro, deftex: Public macros
Macro, tex: Public macros
make-parameter-string: Private ordinary functions

P
parenthesized-list-reader: Private ordinary functions

S
symbol-identifier: Private ordinary functions

T
tex: Public macros


A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*escape-table*: Public special variables

S
Special Variable, *escape-table*: Public special variables