New on CTAN: Tcode
This is a package for typesetting code (e.g., C, python, julia... ). It may be an alternative to the listings package. It is MUCH faster, specially when hundreds of words are defined. It has been tested on plain pdftex, luatex, and pdflatex. It was developed to replace listings for typesetting C code in one particular project. As a result, the support for C has been thoroughly developed: Proper recognition of C numbers, automatic detection of #define'd words, etc. It comes with support for python and julia, much less developed but still fully functional. In python, it recognizes the {} delimited format in f-prefixed strings. The package has a modular design, with a kernel on top of which the support for languages can be programmed. Thus, for example, there is nothing specific in the kernel to recognize {} formats within strings or words following #define. Similar features can be programmed for any language. Support for other languages is welcome. There is an example of a small language file for a faked language: Tcode_example.tex, that can serve as template for other languages. The support for julia, in Tcode_julia,tex, is also small enough that it can serve as template. A fast, user-oriented documentation is present in Tcode_users.html. A thorough documentation of the package can be found in Tcode_developers.html. The package includes a util, pdfcolor-rg.tex, that syntax highlighting files take advantage of, than can be used independently of Tcode. It defines the \color macro and \DefColor and \DefGray macros. It is only suitable for pdf backend, rgb and gray models. Small, easy to understand and debug, and fast. This package will not become part of TeX Live because of problems with filename conventions.
The package’s Catalogue entry can be viewed at https://ctan.org/pkg/tcode The package’s files themselves can be inspected at https://mirrors.ctan.org/macros/generic/tcode/
Thanks for the upload. For the CTAN Team Petra Rübe-Pugliese
CTAN is run entirely by volunteers and supported by TeX user groups. Please join a user group or donate to one, see https://ctan.org/lugs
Tcode – Typesetting verbatim code: C, python,…
This is a package for typesetting code (e.g., C, python, julia,…). pdfTeX is enough for it (you can use it with LaTeX, but it does not need it). The package has a kernel supporting no language in particular and comes with support (syntax highlighting and other) for C, python and julia, in decreasing order.
The inline macro is \ncode{}, and the display ones \Code … \endCode, or \begin{Code} … \end{Code}. This package is much faster than the listings package, though for the time being it only comes with full support for C and to a lesser extent for python and julia. You are welcome to add support for other languages. You may take Tcode_example.tex and Tcode_julia.tex as templates.
| Paket | Tcode |
| Version | 2026-10-07 |
| Betreuer | Javier A. Múgica |