Directory macros/latex/contrib/fox-listings
fox-listings — Listings language definition for COSYScript (COSY INFINITY)
A LaTeX package providing listings language support for COSYScript, the programming language of COSY INFINITY, a beam dynamics code using high-order differential-algebraic (DA) transfer maps and methods. COSYScript source files use the .fox extension; this package uses FOX as the listings language identifier.
Features
- Complete keyword coverage: control flow, intrinsic functions, DA procedures, beam physics commands, graphics, constants
- Case-insensitive matching (FOX is case-insensitive)
- Nested
{...}comment support - Single-quoted string literals
- Two predefined styles:
FOXcolor(screen) andFOXmono(print) - Six keyword groups with independent styling
Usage
\usepackage{fox-listings} \begin{lstlisting}[style=FOXcolor] INCLUDE 'COSY' ; VARIABLE X 1 ; X := SIN(0.5) ; WRITE 6 X ; END ; \end{lstlisting}
Or with just the language (bring your own style):
\begin{lstlisting}[language=FOX] ... \end{lstlisting}
Installation
From CTAN (when available): Install via your TeX distribution's package manager (tlmgr install fox-listings).
Manual install: Copy fox-listings.sty to your local texmf tree and refresh the filename database:
cp fox-listings.sty $(kpsewhich -var-value=TEXMFHOME)/tex/latex/fox-listings/ texhash
Per-project: Place fox-listings.sty alongside your .tex file — no installation needed.
Requirements
listingspackagexcolorpackage (loaded automatically)
Known limitations
The listings package does not highlight in-code numbers for user-defined languages. Fortran-style D-exponent notation (e.g., 1.5D-3) and standard decimal literals (0.5, 1E-3) are rendered in the base style. This is a listings limitation, not a fox-listings bug.
The listings tokenizer has no scope or context awareness, so a user variable that shares its name with a keyword (e.g., OV, MQ, CR) will be highlighted as a keyword.
License
This material is subject to the LaTeX Project Public License 1.3c. See https://www.latex-project.org/lppl/lppl-1-3c/
Author
Eremey Valetov — https://github.com/evvaletov
Links
- COSY INFINITY: https://cosyinfinity.org
- foxkernel (Jupyter kernel for FOX): https://github.com/evvaletov/foxkernel
- cosy-vim (Vim/Neovim syntax): https://github.com/evvaletov/cosy-vim
Download the contents of this package in one zip archive (222.7k).
fox-listings – Listings language definition for COSYScript (COSY INFINITY)
The fox-listings package provides a listings language definition for COSYScript, the programming language of COSY INFINITY, a beam dynamics code using high-order differential-algebraic (DA) transfer maps and methods. It defines six keyword groups with independent styling, supports nested {...} comments and single-quoted strings, and provides two predefined styles: FOXcolor (screen) and FOXmono (print).
| Package | fox-listings |
| Version | 1.4 2026-03-21 |
| Licenses | The LaTeX Project Public License 1.3c |
| Copyright | 2026 Eremey Valetov |
| Maintainer | Eremey Valetov |
| Contained in | TeX Live as fox-listings MiKTeX as fox-listings |
| Topics | Listing |