Thread View: comp.text.tex
1 messages
1 total messages
Started by CTAN Announcements
Sun, 25 Oct 2026 17:36
New on CTAN: codemwe
Author: CTAN Announcements
Date: Sun, 25 Oct 2026 17:36
Date: Sun, 25 Oct 2026 17:36
87 lines
5605 bytes
5605 bytes
Nan Geng submitted the
codemwe
package.
Version: 1.1.0
License: lppl1.3c
Summary description: Typeset code with a result box and generate MWE files
Announcement text:
------------------------------------------------------------------------
codemwe typesets example code and its compiled result in one box and,
from the same source, writes a minimal independently compilable file
for the example. It is written in expl3 on top of tcolorbox, fancyvrb
and graphicx, and was developed while writing a package manual, where
every example must appear as code, as result, and as a file the reader
can compile.
Features
* example, example* and texcode environments for horizontal, vertical
and code-only layout, plus a ccode environment preset for C code.
Each example is numbered, labelled and cross-referenceable.
* Automatic generation of an MWE .tex file per example, with the
document class, the packages and optional extra preamble material
placed in the preamble and the body delimited by comment lines.
* Code backends: extension, comment character, compilability and
minted language name are kept together, so that non-LaTeX code
can be shown and saved.
LaTeX and C are built in; \codemweNewBackend registers more.
* Optional syntax highlighting through minted (“minted” and
“mintedstyle” options). minted is detected and loaded when
codemwe itself is loaded, so highlighting can be switched on
and off anywhere in the body or per environment with no preamble
preparation; when minted or -shell-escape is missing, the
package falls back to fancyvrb with a single warning.
* Six built-in box designs plus \codemweNewBox for user-defined
tcolorbox designs; optional titles.
* Language varieties for the transition phrases, the structural
comment words and the reference prefix, “en” and “zh” built in,
\codemweNewLang for further varieties.
* Fine control over what is printed in the code box (withcls,
withpkg, withextra, nobody, noshow) and over numbering,
line numbers, spacing and result figure size.
* All options usable as package options, environment options,
or with \codemweset in the current scope.
Requirements
* LaTeX2e 2020-10-01 or later, expl3, tcolorbox (2020-10-09 or later),
fancyvrb, graphicx.
* For the minted option only: the minted package and a compilation
with -shell-escape.
The bilingual (Chinese/English) manual, codemwe.pdf, is included.
It is typeset with codemwe itself and may serve as a gallery of
the package's output.
------------------------------------------------------------------------
The package’s Catalogue entry can be viewed at
https://ctan.org/pkg/codemwe
The package’s files themselves can be inspected at
https://mirrors.ctan.org/macros/latex/contrib/codemwe/
------------------------------------------------------------------------
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads