I'm trying to write a package from .dtx and .ins, following the dtx tutorial. However even when I merely try to compile the skeleton provided, I get a "! Package doc Error: Character table corrupted." I wonder why. My .dtx and .ins are saved in UTF-8; I have tried latin1 and get the same error.
Commands I run:
[cmd]
latex test.ins
latex test.dtx
[/cmd]
The first runs normally, the second throws a "! Package doc Error: Character table corrupted" error. I've tried pdflatex instead, same outcome.
Searching forums I've only found one potential explanation: during compilation some package changes some char's catcode. However in this MWE the only packages loaded are the .sty istelf and the packages loaded by ltxdoc, such as multicol.sty.
I know I could remove the character table, but I suspect the corrupted table is a symptom of hidden issue.
Here are my test.ins and test.dtx files. I'm merely removing the <...> fields of the dtxut example:
Code: Select all
%%
%% Copyright (C) 2021 by Julien Dutant
%%
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3 of this license or (at your option) any later
%% version. The latest version of this license is in:
%%
%% http://www.latex-project.org/lppl.txt
%%
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%%
\input docstrip.tex
\keepsilent
\usedir{tex/latex/test}
\preamble
This is a generated file.
Copyright (C) 2021 by Julien Dutant
This file may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
version 1.3 of this license or (at your option) any later
version. The latest version of this license is in:
http://www.latex-project.org/lppl.txt
and version 1.3 or later is part of all distributions of
LaTeX version 2005/12/01 or later.
\endpreamble
\generate{\file{test.sty}{\from{test.dtx}{package}}}
\Msg{*********************************************************}
\Msg{*}
\Msg{* To finish the installation you have to move the}
\Msg{* following file into a directory searched by TeX:}
\Msg{*}
\Msg{* \space\space test.sty}
\Msg{*}
\Msg{* To produce the documentation run the file test.dtx}
\Msg{* through LaTeX.}
\Msg{*}
\Msg{* Happy TeXing!}
\Msg{*********************************************************}
\endbatchfile
Code: Select all
% \iffalse meta-comment
%
% Copyright (C) 2021 by Julien Dutant
% -----------------------------------
%
% This file may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in:
%
% http://www.latex-project.org/lppl.txt
%
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% \fi
%
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
%<package>\ProvidesPackage{test}
%<package> [2021/02/03 v0.1 test dtx file]
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{test}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{test.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{0}
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
% Digits \0\1\2\3\4\5\6\7\8\9
% Exclamation \! Double quote \" Hash (number) \#
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<<
% Equals \= Greater than \>> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
% Right bracket \] Circumflex \^ Underscore \_
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
%
% \changes{v1.0}{2021/02/03}{Initial version}
%
% \GetFileInfo{test.sty}
%
% \DoNotIndex{<list of control sequences>}
%
% \title{The \textsf{test} package\thanks{This document
% corresponds to \textsf{test}~\fileversion,
% dated \filedate.}}
% \author{Julien Dutant \\ \texttt{julien.dutant@kcl.ac.uk}}
%
% \maketitle
%
% \begin{abstract}
% Put text here.
% \end{abstract}
%
% \section{Introduction}
%
% Put text here.
%
% \section{Usage}
%
% \DescribeMacro{\YOURMACRO}
% Put description of |\YOURMACRO| here.
%
% \DescribeEnv{YOURENV}
% Put description of |YOURENV| here.
%
% \StopEventually{\PrintIndex}
%
% \section{Implementation}
%
% \begin{macro}{\YOURMACRO}
% Put explanation of |\YOURMACRO|'s implementation here.
% \begin{macrocode}
\newcommand{\YOURMACRO}{}
% \end{macrocode}
% \end{macro}
%
% \begin{environment}{YOURENV}
% Put explanation of |YOURENV|'s implementation here.
% \begin{macrocode}
\newenvironment{YOURENV}{}{}
% \end{macrocode}
% \end{environment}
%
% \Finale
\endinput
Code: Select all
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=latex 2020.10.20) 4 FEB 2021 20:03
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**test.dtx
(./test.dtx
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-03-06>
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/ltxdoc.cls
Document Class: ltxdoc 2019/09/16 v2.0y Standard LaTeX documentation class
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2019/12/20 v1.4l Standard LaTeX file (size option)
)
\c@part=\count167
\c@section=\count168
\c@subsection=\count169
\c@subsubsection=\count170
\c@paragraph=\count171
\c@subparagraph=\count172
\c@figure=\count173
\c@table=\count174
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen134
)
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/doc.sty
Package: doc 2019/12/16 v2.1l Standard LaTeX documentation package (FMi)
\c@StandardModuleDepth=\count175
\guard@level=\count176
\MacrocodeTopsep=\skip49
\MacroIndent=\dimen135
\macro@cnt=\count177
\MacroTopsep=\skip50
\index@excludelist=\toks15
(/usr/local/texlive/2020/texmf-dist/tex/latex/tools/multicol.sty
Package: multicol 2019/12/09 v1.8y multicolumn formatting (FMi)
\c@tracingmulticols=\count178
\mult@box=\box45
\multicol@leftmargin=\dimen136
\c@unbalance=\count179
\c@collectmore=\count180
\doublecol@number=\count181
\multicoltolerance=\count182
\multicolpretolerance=\count183
\full@width=\dimen137
\page@free=\dimen138
\premulticols=\dimen139
\postmulticols=\dimen140
\multicolsep=\skip51
\multicolbaselineskip=\skip52
\partial@page=\box46
\last@line=\box47
\maxbalancingoverflow=\dimen141
\mult@rightbox=\box48
\mult@grightbox=\box49
\mult@gfirstbox=\box50
\mult@firstbox=\box51
\@tempa=\box52
\@tempa=\box53
\@tempa=\box54
\@tempa=\box55
\@tempa=\box56
\@tempa=\box57
\@tempa=\box58
\@tempa=\box59
\@tempa=\box60
\@tempa=\box61
\@tempa=\box62
\@tempa=\box63
\@tempa=\box64
\@tempa=\box65
\@tempa=\box66
\@tempa=\box67
\@tempa=\box68
\@tempa=\box69
\@tempa=\box70
\@tempa=\box71
\@tempa=\box72
\@tempa=\box73
\@tempa=\box74
\@tempa=\box75
\@tempa=\box76
\@tempa=\box77
\@tempa=\box78
\@tempa=\box79
\@tempa=\box80
\@tempa=\box81
\@tempa=\box82
\@tempa=\box83
\@tempa=\box84
\@tempa=\box85
\@tempa=\box86
\@tempa=\box87
\@tempa=\box88
\c@minrows=\count184
\c@columnbadness=\count185
\c@finalcolumnbadness=\count186
\last@try=\dimen142
\multicolovershoot=\dimen143
\multicolundershoot=\dimen144
\mult@nat@firstbox=\box89
\colbreak@box=\box90
\mc@col@check@num=\count187
)
\IndexMin=\dimen145
\c@IndexColumns=\count188
\GlossaryMin=\dimen146
\c@GlossaryColumns=\count189
\check@sum=\count190
\bslash@cnt=\count191
\wrong@table=\toks16
\c@CodelineNo=\count192
)) (./test.sty
Package: test 2021/02/03 v0.1 test dtx file
)
\@indexfile=\write3
\openout3 = `test.idx'.
Writing index file test.idx
\@glossaryfile=\write4
\openout4 = `test.glo'.
Writing glossary file test.glo
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-dvips.def
File: l3backend-dvips.def 2020-03-12 L3 backend support: dvips
\l__pdf_internal_box=\box91
\g__pdf_backend_object_int=\count193
\l__pdf_backend_content_box=\box92
\l__pdf_backend_model_box=\box93
\g__pdf_backend_annotation_int=\count194
\g__pdf_backend_link_int=\count195
\g__pdf_backend_link_sf_int=\count196
)
No file test.aux.
\openout1 = `test.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 29.
LaTeX Font Info: ... okay on input line 29.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 29.
LaTeX Font Info: ... okay on input line 29.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 29.
LaTeX Font Info: ... okay on input line 29.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 29.
LaTeX Font Info: ... okay on input line 29.
LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 29.
LaTeX Font Info: ... okay on input line 29.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 29.
LaTeX Font Info: ... okay on input line 29.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 29.
LaTeX Font Info: ... okay on input line 29.
Package doc Info: Made | a short reference for \verb on input line 29.
(./test.dtx
! Package doc Error: Character table corrupted.
See the doc package documentation for explanation.
Type H <return> for immediate help.
...
l.51 % Right brace \} Tilde \~}
? x
Here is how much of TeX's memory you used:
736 strings out of 480609
11438 string characters out of 5903655
248825 words of memory out of 5000000
16698 multiletter control sequences out of 15000+600000
532338 words of font info for 24 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
33i,1n,27p,224b,86s stack positions out of 5000i,500n,10000p,200000b,80000s
No pages of output.