Document Classes"Character table corrupted error" when compiling the dtxtut skeleton package code

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
juliendutant
Posts: 14
Joined: Sat Aug 27, 2016 1:46 pm

"Character table corrupted error" when compiling the dtxtut skeleton package code

Post by juliendutant »

Hi all,

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

Code, edit and compile here:
%%
%% 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{*}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
test.dtx

Code: Select all

Code, edit and compile here:
% \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) \#
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Finally, the output log.

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
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Any help much appreciated!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

"Character table corrupted error" when compiling the dtxtut skeleton package code

Post by Ijon Tichy »

Less than should be \< not \<<. Same for Greater than.

BTW: \CharacterTable was used decades ago, when the main internet file transfer protocol was ftp. If you forgot to use ftp in binary mode, character corruption could happen. But ftp is almost dead (because it is insecure) and if it is still used binary mode is usually the default and even in text mode character conversion is not used any longer. So \CharacterTable should not be needed any longer, at least if you encode your dtx files either US-ASCII or UTF8. AFAIK, For this reason, LaTeX Team does not use \Character Table for their dtx files.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
juliendutant
Posts: 14
Joined: Sat Aug 27, 2016 1:46 pm

"Character table corrupted error" when compiling the dtxtut skeleton package code

Post by juliendutant »

Brillant, thanks! The < and > get doubled when copying/pasting the code and I hadn't noticed it.

I saw somewhere that even if there's no risk of file transfer corruption keeping the Char table might help catch some bugs - but I can't find the link anymore.
Post Reply