Closed note286 closed 1 year ago
It seems %
characters are still there when codehigh
environment is executed. But I know little about docstrip
, so I am not sure it is a bug of docstrip
or codehigh
. Hope @FrankMittelbach has a little time to see this issue?
I tested listings
package, and I found the same problem, but listings
package has a parameter gobble
that can be set, namely \lstset{gobble=2}
.
% \iffalse
%<*driver>
\ProvidesFile{test.dtx}
%</driver>
%<class>\NeedsTeXFormat{LaTeX2e}
%<class>\ProvidesClass{test}[2022/11/22 v1.0.0 Test]
%<*driver>
\documentclass{l3doc}
\usepackage{ninecolors}
\usepackage{listings}
\lstset{
gobble = 2,
language = [LaTeX]TeX,
basicstyle = \small\ttfamily,
backgroundcolor = \color{azure9!25},
keywordstyle = \color{red6}
}
\begin{document}
\DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
% This is document.
% \begin{lstlisting}
% \documentclass{test}
% \begin{document}
% Test
% \end{document}
% \end{lstlisting}
% This is document.
% \section{Implementation}
% \begin{macrocode}
%<*class>
\LoadClass{ctexart}
%</class>
% \end{macrocode}
% \Finale
\endinput
If don't set \lstset{gobble=2}
, it will be
Can codehigh
package provide interface like gobble
? The default configuration provided by codehigh
package is really beautiful, and I like it very much. It would be appreciated if the author could add this interface.
@lvjr time? not really :-) .. see https://tex.stackexchange.com/a/612586/10109 (there are still the odds and ends, sigh). But in general here is the issue:
%
when typesetting%
in column 1verbatim
that handles that.@FrankMittelbach Thank you very much for the explanation!
@note286 It is a good idea to add gobble
option in codehigh
package. I have no time to update this package recently. But if you would like to help you could make a pull request, then I will upload a new release to CTAN.
I'll give it a try, but my level is limited, and there is a high probability that I can't realize this gobble
in codehigh
. Finally, thank you again for your answers.
beside that you may want (perhaps) something like \AddToHook{package/doc/after}{ arrange for "gobble=2" as default }
in the package
This is
test.dtx
file.This is
test.ins
file.With
pdflatex test.dtx
andpdflatex test.ins
, we gettest.cls
as below:and
test.pdf
as below:I don't know why
codehigh
recognizes the%
. According to my understanding,\DocInput
swallows the%
. So what is the cause of this situation?