Skip to content

Releases: gpoore/minted

latex/v3.1.2

08 Oct 03:58
Compare
Choose a tag to compare
  • There is now only a single \read allocation for reading temporary files
    when highlightmode is set to fast or fastfirst. Previously, there
    was one allocation per temp file, which could cause allocation errors when
    several temp files were highlighted during the same compile (#413).

python/v0.2.0

03 Oct 14:32
Compare
Choose a tag to compare
  • All config data passed back to LaTeX is now processed with \detokenize
    (#405).

  • In a cache, *.index.minted files are now overwritten only when the data
    they contain is modified. This fixes compatibility with build tools
    (T-F-S/tcolorbox/issues/294).

  • Fixed a bug that could prevent a cache from being fully cleaned when it is
    shared by multiple documents.

  • All file reading and writing for files received from/sent to LaTeX is now
    UTF-8 (#411).

  • The cache path is now processed correctly when it is an empty string,
    instead of resulting in an error, so the minted package will now function
    when cache=false.

  • Refactored the cleanfile subcommand into cleanconfig. This is more
    descriptive for actual usage and allows all subcommands to take the same
    arguments.

  • Added subcommand cleantemp, which only cleans temp files, not cache
    files.

  • All subcommands now take exactly the same arguments.

  • Added short summary and links to latexminted --version (#404).

latex/v3.1.1

03 Oct 19:50
Compare
Choose a tag to compare
  • Fixed bugs in processing temporary files regardless of highlightmode from
    v3.1.0. With highlightmode=fastfirst (default), this would cause an
    error during the first compile, but then all subsequent compiles would
    complete correctly.

latex/v3.1.0

03 Oct 14:42
Compare
Choose a tag to compare
  • All timestamp comparisons that are part of communicating with the
    latexminted Python executable now use timestamps that have been processed
    with \detokenize (#405).

  • Option processing now wraps values in curly braces to prevent escaping
    issues when options are passed on to other packages for further processing
    (#407).

  • Fixed compatibility with dvilualatex (#406).

  • Temporary files with common file extensions are now automatically detected
    and processed correctly regardless of highlightmode (#401). Previously,
    highlightmode=immediate was needed for working with temp files that are
    overwritten or deleted during compilation; the default
    highlightmode=fastfirst gave an error message during the first compile
    but worked correctly during subsequent compiles.

  • Fixed bug when cache=false. When caching is disabled, highlightmode is
    now set to immediate.

  • The minimum supported latexminted version is now 0.2.0. The new
    latexminted subcommand cleantemp is now used instead of clean when
    the cache does not require cleaning. This prevents errors when
    cache=false.

  • Fixed docs for breakbeforeinrun and breakafterinrun (#408). These had
    not been properly updated after fvextra renamed the options.

[python] latexminted v0.1.0

23 Sep 03:35
Compare
Choose a tag to compare
  • Initial release.

[latex] minted v3.0.0

23 Sep 04:05
Compare
Choose a tag to compare
  • Backward compatibility: The new minted2 package provides the features of
    minted v2.9, the final release before v3. No additional v2 releases are
    planned; no changes to the minted2 package are expected.

  • minted v3 is a complete rewrite from v2.9. minted v3 includes
    significant changes from minted v2 on the LaTeX side, and also uses a new
    minted-specific Python executable called latexminted to perform syntax
    highlighting. This executable is specifically designed to meet the
    security requirements for restricted shell escape programs. Once it has
    passed a security review and is accepted by TeX distributions, it will be
    possible to highlight code without -shell-escape and its attendant
    security vulnerabilities.

    Syntax highlighting is still performed with Pygments, but the pygmentize
    executable included with Pygments is no longer used.

  • Installing the minted package now also installs the latexminted Python
    executable and all required Python libraries, including Pygments, within
    your TeX distribution. These require Python >= 3.8. If the default Python
    version on PATH is < 3.8, then the latexminted Python executable will
    attempt to locate a more recent version and run itself with that version in
    a subprocess.

    Manually installing Python libraries is only necessary if you want to use
    plugin packages for Pygments. In that case, install the latexminted
    Python package in a Python installation. This automatically installs
    latex2pydata, latexrestricted, and Pygments as dependencies.
    latexminted is available from the
    Python Package Index (PyPI). Then
    install plugin packages for Pygments within the same Python installation.

  • The new latexminted Python executable is designed to be compatible with
    the security requirements for restricted shell escape, so that in the
    future TeX distributions can enable latexminted without requiring
    -shell-escape. It is possible to benefit from these enhanced security
    capabilities immediately and avoid the need for -shell-escape.

    • TeX Live: Copy the variable shell_escape_commands from the
      distribution texmf.cnf (typically something like
      <tex_distro>/texmf-dist/web2c/texmf.cnf) into the user texmf.cnf
      (typically something like <tex_distro>/texmf.cnf), and then add
      latexminted to the end of the shell_escape_commands list. The
      location of the texmf.cnf files can be determined by running
      kpsewhich -all texmf.cnf.

    • MiKTeX: Add a line AllowedShellCommands[] = latexminted to the
      existing list of allowed commands in miktex.ini. You may want to
      modify the user-scoped configuration instead of the system-wide
      configuration. See the
      MiKTeX documentation
      for more details, particularly initexmf --edit-config-file <file>.

  • Errors and warnings that occur within Python are now reported as minted
    package errors and warnings within LaTeX in nearly all cases. It should no
    longer be necessary to look through the compile log for Python errors and
    warnings. A temp file *.errlog.minted containing Python traceback
    information is created in some cases when errors cannot be fully reported
    within LaTeX or more details may be needed.

  • latex2pydata is now required
    for passing data from LaTeX to Python and then processing it within Python.
    This consists of a LaTeX package, available from
    CTAN, and a Python package, available
    from PyPI. The LaTeX package can
    typically be installed with your TeX distribution's package manager. The
    Python package is automatically installed within your TeX distribution when
    minted is installed.

  • On the LaTeX side, all syntax highlighting settings are now serialized in
    Python literal format using latex2pydata and then saved to a temp file,
    which is loaded on the Python side. Settings are no longer passed to the
    Python side using command-line arguments. Temp files for passing data to
    Python are now named using MD5 hashes, instead of using a sanitized version
    of document \jobname. This eliminates an entire class of security issues
    and bugs related to escaping and quoting command-line arguments (#180,
    #276, #298, #322, #338, #354). It also eliminates bugs related to
    processing settings as a sequence of command-line options, since
    pygmentize accumulates some options that are used multiple times rather
    than overwriting earlier values with later values (#258, #337).

  • Options are now handled with pgfkeys and pgfopts, instead of
    keyval and kvoptions.

  • Temporary files are no longer created unless the cache needs to be updated
    (or caching is disabled). All MD5 hashing of code now takes place in
    memory instead of using one temp file per command/environment.

    All temporary files are cleaned up automatically when compiling completes
    without interruption. All temporary files now have names of the form
    _<hash>.<role>.minted. <hash> is an MD5 hash of \jobname (if
    \jobname is wrapped in double or single quotation marks, these are
    stripped before the MD5 is computed). <role> is the role of the temp
    file: data (data passed to Python), config (detected system
    configuration), style (highlighting style definition), highlight
    (highlighted code), or message (message passed back to LaTeX by Python
    executable). <role> can also be errlog when the Python executable
    encounters an unexpected error that it is not designed to report to the
    LaTeX side; this is not automatically cleaned up. There are no more
    <jobname>.pyg and <jobname>.out.pyg files.

  • Several package options are no longer supported and result in errors or
    warnings.

    • finalizecache: No longer needed. The frozencache package option now
      uses the regular cache, rather than requiring a new, special cache
      containing files with sequentially numbered names (#342). When using
      frozencache with -output-directory, the cachedir package option
      should be used to specify a full relative path to the cache (for
      example, cachedir=./<output_directory>/_minted).

    • outputdir: No longer needed (#268). TeX Live 2024+ saves a custom
      output directory from -output-directory in the environment variable
      TEXMF_OUTPUT_DIRECTORY.
      The environment variable TEXMF_OUTPUT_DIRECTORY can be set manually in
      other cases.

    • kpsewhich: No longer needed. kpsewhich is now automatically
      invoked as necessary by the latexminted Python executable in locating
      files.

    • draft and final: These no longer have any effect and result in a
      warning. They will soon be removed altogether. Improvements in caching
      have largely eliminated the overhead that draft mode was designed to
      avoid, while new features that are implemented purely within Python have
      made it impossible in some cases to typeset code using only LaTeX. The
      new package options placeholder and verbatim offer alternatives when
      maximum compilation speed is needed or the latexminted Python
      executable is unavailable.

  • New package options:

    • debug: Keep temp files from highlighting to aid in debugging. Also
      write current file name and line number to log before \input of
      highlighted code (#348).

    • highlightmode: Determines when code is highlighted. The default is
      fastfirst. If a cache for the document exists, then code is
      highlighted immediately. If a cache for the document does not exist,
      then typeset a placeholder instead of code and highlight all code at the
      end of the document. This will require a second compile before code is
      typeset, but because all code is highlighted at once, there is less
      overhead and the total time required can be significantly less for
      documents that include many code snippets. The alternatives are fast
      (always highlight at end of document, requiring a second compile) and
      immediate (always highlight immediately, so no second compile is
      needed). immediate should be used when typesetting code in external
      temp files that are overwritten during compilation.

      When code is highlighted at the end of the document with fast or
      fastfirst, any error and warning messages will refer to a location at
      the end of the document rather than the original code location, since
      highlighting occurred at the end of the document. In this case, messages
      are supplemented with original LaTeX source file names and line numbers
      to aid in debugging.

    • placeholder: Instead of typesetting code, insert a placeholder. This
      is enabled automatically when working with PGF/TikZ externalization.

    • verbatim: Instead of highlighting code, attempt to typeset it verbatim
      without using the latexminted Python executable. This is not
      guaranteed to be an accurate representation of the code, since some
      features such as autogobble require Python.

  • bgcolor now uses the new bgcolor option from fvextra v1.8, rather
    than snugshade* from framed. This resolves incompatibilities between
    bgcolor and xleftmargin/xrightmargin (#214), eliminates unneeded
    whitespace before/after the background (#220), prevents text from
    overflowing the background (#278), and provides uniform ...

Read more

v2.9

18 Dec 14:41
Compare
Choose a tag to compare
  • This is expected to be the last release of minted v2.x. If so, it will
    then become the new package minted2 for backward compatibility.

  • Added new option ignorelexererrors. When lexer errors are shown in
    highlighted output (default), they are typically displayed as red boxes
    that surround the relevant text. When lexer errors are ignored, the
    literal text that caused lexer errors is shown but there is no indication
    that it caused errors (#374).

  • There is now a warning if fvextra version is less than 1.5.

v2.8

12 Sep 18:32
Compare
Choose a tag to compare
  • Under non-Windows operating systems, detect executables with command -v
    rather than which to provide better cross-platform support (#345).

  • Added new package option inputlanglinenos. This extends the existing
    langlinenos to cover \inputminted as well (#361).

  • Improved and updated Pygments documentation (#339).

  • Improved \mintinline documentation to address packages that redefine
    \section (#368).

  • Added support for fvextra options breakafterinrun and
    breakbeforeinrun (#358). In fvextra version 1.5, breakaftergroup
    and breakbeforegroup were renamed to breakafterinrun and
    breakbeforeinrun to avoid naming ambiguity with new options. The old
    options breakaftergroup and breakbeforegroup are no longer supported.

  • Added DEPENDS.txt (#331).

  • Removed unnecessary dependency on calc package (#313).

  • Added documentation in FAQ about copy and paste limitations (#302).

  • Added note on text lexer to documentation (#274).

v2.7

12 Dec 14:46
Compare
Choose a tag to compare
  • Reimplemented \mintinline to use fvextra's argument reading and
    processing macros, and to use fvextra's \Verb internally.
    \mintinline now works with all line breaking options supported by
    fvextra's \Verb, including breakanywhere (#329, #340). It now
    gives better results when used inside other commands, since it uses
    fvextra's retokenization macros. It is now compatible with hyperref
    for PDF strings such as bookmarks.

  • Reimplemented \newmintinline based on new \mintinline.

  • Reimplemented \mint to use fvextra's argument reading and processing
    macros. It now gives better results when used inside other commands,
    since it uses fvextra's retokenization macros. Fixed a bug that caused
    a continued paragraph after \mint to be indented (#218).

  • Reimplemented \newmint based on new \mint. Commands created with
    \newmint can now use curly braces as delimiters, just like \mint
    (#254).

  • Settings passed to pygmentize as command-line options are now quoted.
    This prevents escapeinside characters from being interpreted as special
    shell characters (#179, #262).

  • Fixed bug with autogobble that produced incorrect dedent when using
    lastline with the lines beyond lastline having less indentation than
    the selected range (#326).

  • Fixed unintended line breaks after hyphens under LuaTeX (#263).

  • Added warning to documentation of \inputminted regarding filenames
    and shell command execution (#338).

v2.6

24 Dec 19:10
Compare
Choose a tag to compare
  • autogobble automatically uses python or python3 executables,
    depending on availability, instead of requiring python. A custom
    executable can be specified by redefining \MintedPython (#277, #287).

  • Fixed autogobble compatibility with fancyvrb 4.0+ (#315, #316).

  • Pygments style names may now contain arbitrary non-whitespace characters.
    Previously, style names containing digits and some punctuation characters
    were incompatible (#210, #294, #299, #317). Pygments macros are now only
    defined just before use locally within minted commands and environments,
    rather than globally. Pygments macros now always use a \PYG prefix
    regardless of style, rather than a prefix of the form \PYG<style> (for
    example, what was previously \PYGdefault is now simply \PYG).

  • Removed Python-based MD5 hashing for XeTeX, which was necessary before
    XeTeX added \mdfivesum in 2017.

  • The default for stripnl is now false, so that original code is
    preserved exactly by default (#198).

  • Added support for fontencoding option from fvextra (#208).

  • Added note to FAQ about getting texi2pdf to work with minted given
    texi2pdf's assumptions about temp files (#186).

  • Reimplemented bgcolor option to be compatible with color package.