-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tcblisting, hbox and minted #2
Comments
Sorry for the delay. |
Thanks for your answer. I will then use |
This is feasible by extending Full working example: \documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{hooks, minted}
\makeatletter
% "envname=<key>" will add "-P envname=<key>" as CLI option of "pygmentize"
\minted@def@optcl{envname}{-P envname}{#1}
\makeatother
\tcbset{minted options app={envname=BVerbatim}}
\begin{document}
\begin{tcblisting}{listing only, hbox}
$a + b = c$
\end{tcblisting}
\end{document} Explanations The restriction here is that, by default
For better user experience, some logic might be added to the internals of |
@muzimuzhi Very nice solution. I reopened this issue since an answer is now given. I tested your code and everything went smooth. Automated option setting is also possible and no further user interaction is needed, if |
Implemented in version 4.40 (2020/09/25). |
With
Line numbering is one of the things which are not supported by Maybe, the package author of |
Ok, thank you for this explanation and these details. |
An alternative implementation that \documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{hooks, minted}
\begin{document}
\begin{tcblisting}{listing only, hbox,
before app={\RecustomVerbatimEnvironment{Verbatim}{BVerbatim}{}}}
$a + b = c$
\end{tcblisting}
\end{document} This avoids adding options to |
The under-developing tcolorbox/tex/latex/tcolorbox/tcbminted.code.tex Lines 25 to 26 in f7f39a4
Although -\minted@def@optcl{envname}{-P envname}{#1}
+% 2024/08/25 is the date on which minted supported "envname" option, not the v3 released date
+\IfPackageAtLeastTF{minted}{2024/08/25}{}{
+ \minted@def@optcl{envname}{-P envname}{#1}
+} would make future releases of Update: Hmm the historic Se the compatibility code has to be a little more complex: \IfPackageLoadedTF{minted2}{
\minted@def@optcl{envname}{-P envname}{#1}
}{
\RequirePackage{minted}
\IfPackageAtLeastTF{minted}{2024-08-25}
{\minted@def@optcl{envname}{-P envname}{#1}}{}
} |
No immediate changes to |
@gpoore You're totally right. I missed the emulations in \@namedef{ver@minted.sty}{2023/12/18 v2.9 Yet another Pygments shim for LaTeX}
\expandafter\let\expandafter\minted@tmp\csname opt@minted2.sty\endcsname
\expandafter\let\csname opt@minted.sty\endcsname\minted@tmp BTW LaTeX provides a (light-weight) package rollback mechanism since LaTeX2e 2018-04-01. It enables using |
Thank you for reporting this future change of If I get the discussion right, the first proposal of @muzimuzhi should be added to avoid problems in one or two years when % 2024/08/25 is the date on which minted supported "envname" option, not the v3 released date
\IfPackageAtLeastTF{minted}{2024/08/25}{}{
\minted@def@optcl{envname}{-P envname}{#1}
} |
The incoming The effect of my first proposal is to silence that warning. |
And to avoid errors when Geoffrey Poore removes the deprecated code in the near or far future 👍 I will add this to the next version. |
Added to https://github.com/T-F-S/tcolorbox/releases/tag/v6.4.0 |
My OS is Windows 8.1, 64 bits and I use MikTeX 2.9.
I want to use the capture mode
hbox
in atcblisting
environment withminted
but it seems it doesn't work (but it does well withlistings
).Here is my code (with and without
hbox
), the result, and the error log.Thanks for any suggestions.
The text was updated successfully, but these errors were encountered: