| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% File: listingsutf8.dtx |
| 4 |
% Version: 2019-12-10 v1.5 |
| 5 |
% Info: Allow UTF-8 in listings input |
| 6 |
% |
| 7 |
% Copyright (C) |
| 8 |
% 2007, 2011 Heiko Oberdiek |
| 9 |
% 2016-2019 Oberdiek Package Support Group |
| 10 |
% https://github.com/ho-tex/listingsutf8/issues |
| 11 |
% |
| 12 |
% This work may be distributed and/or modified under the |
| 13 |
% conditions of the LaTeX Project Public License, either |
| 14 |
% version 1.3c of this license or (at your option) any later |
| 15 |
% version. This version of this license is in |
| 16 |
% https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 17 |
% and the latest version of this license is in |
| 18 |
% https://www.latex-project.org/lppl.txt |
| 19 |
% and version 1.3 or later is part of all distributions of |
| 20 |
% LaTeX version 2005/12/01 or later. |
| 21 |
% |
| 22 |
% This work has the LPPL maintenance status "maintained". |
| 23 |
% |
| 24 |
% The Current Maintainers of this work are |
| 25 |
% Heiko Oberdiek and the Oberdiek Package Support Group |
| 26 |
% https://github.com/ho-tex/listingsutf8/issues |
| 27 |
% |
| 28 |
% This work consists of the main source file listingsutf8.dtx |
| 29 |
% and the derived files |
| 30 |
% listingsutf8.sty, listingsutf8.pdf, listingsutf8.ins, listingsutf8.drv, |
| 31 |
% listingsutf8-test1.tex, listingsutf8-test2.tex, |
| 32 |
% listingsutf8-test3.tex, listingsutf8-test4.tex, |
| 33 |
% listingsutf8-test5.tex. |
| 34 |
% |
| 35 |
% Distribution: |
| 36 |
% CTAN:macros/latex/contrib/listingsutf8/listingsutf8.dtx |
| 37 |
% CTAN:macros/latex/contrib/listingsutf8/listingsutf8.pdf |
| 38 |
% |
| 39 |
% Unpacking: |
| 40 |
% (a) If listingsutf8.ins is present: |
| 41 |
% tex listingsutf8.ins |
| 42 |
% (b) Without listingsutf8.ins: |
| 43 |
% tex listingsutf8.dtx |
| 44 |
% (c) If you insist on using LaTeX |
| 45 |
% latex \let\install=y\input{listingsutf8.dtx} |
| 46 |
% (quote the arguments according to the demands of your shell) |
| 47 |
% |
| 48 |
% Documentation: |
| 49 |
% (a) If listingsutf8.drv is present: |
| 50 |
% latex listingsutf8.drv |
| 51 |
% (b) Without listingsutf8.drv: |
| 52 |
% latex listingsutf8.dtx; ... |
| 53 |
% The class ltxdoc loads the configuration file ltxdoc.cfg |
| 54 |
% if available. Here you can specify further options, e.g. |
| 55 |
% use A4 as paper format: |
| 56 |
% \PassOptionsToClass{a4paper}{article} |
| 57 |
% |
| 58 |
% Programm calls to get the documentation (example): |
| 59 |
% pdflatex listingsutf8.dtx |
| 60 |
% makeindex -s gind.ist listingsutf8.idx |
| 61 |
% pdflatex listingsutf8.dtx |
| 62 |
% makeindex -s gind.ist listingsutf8.idx |
| 63 |
% pdflatex listingsutf8.dtx |
| 64 |
% |
| 65 |
% Installation: |
| 66 |
% TDS:tex/latex/listingsutf8/listingsutf8.sty |
| 67 |
% TDS:doc/latex/listingsutf8/listingsutf8.pdf |
| 68 |
% TDS:source/latex/listingsutf8/listingsutf8.dtx |
| 69 |
% |
| 70 |
%<*ignore> |
| 71 |
\begingroup |
| 72 |
\catcode123=1 % |
| 73 |
\catcode125=2 % |
| 74 |
\def\x{LaTeX2e}% |
| 75 |
\expandafter\endgroup |
| 76 |
\ifcase 0\ifx\install y1\fi\expandafter |
| 77 |
\ifx\csname processbatchFile\endcsname\relax\else1\fi |
| 78 |
\ifx\fmtname\x\else 1\fi\relax |
| 79 |
\else\csname fi\endcsname |
| 80 |
%</ignore> |
| 81 |
%<*install> |
| 82 |
\input docstrip.tex |
| 83 |
\Msg{************************************************************************} |
| 84 |
\Msg{* Installation} |
| 85 |
\Msg{* Package: listingsutf8 2019-12-10 v1.5 Allow UTF-8 in listings input (HO)} |
| 86 |
\Msg{************************************************************************} |
| 87 |
|
| 88 |
\keepsilent |
| 89 |
\askforoverwritefalse |
| 90 |
|
| 91 |
\let\MetaPrefix\relax |
| 92 |
\preamble |
| 93 |
|
| 94 |
This is a generated file. |
| 95 |
|
| 96 |
Project: listingsutf8 |
| 97 |
Version: 2019-12-10 v1.5 |
| 98 |
|
| 99 |
Copyright (C) |
| 100 |
2007, 2011 Heiko Oberdiek |
| 101 |
2016-2019 Oberdiek Package Support Group |
| 102 |
|
| 103 |
This work may be distributed and/or modified under the |
| 104 |
conditions of the LaTeX Project Public License, either |
| 105 |
version 1.3c of this license or (at your option) any later |
| 106 |
version. This version of this license is in |
| 107 |
https://www.latex-project.org/lppl/lppl-1-3c.txt |
| 108 |
and the latest version of this license is in |
| 109 |
https://www.latex-project.org/lppl.txt |
| 110 |
and version 1.3 or later is part of all distributions of |
| 111 |
LaTeX version 2005/12/01 or later. |
| 112 |
|
| 113 |
This work has the LPPL maintenance status "maintained". |
| 114 |
|
| 115 |
The Current Maintainers of this work are |
| 116 |
Heiko Oberdiek and the Oberdiek Package Support Group |
| 117 |
https://github.com/ho-tex/listingsutf8/issues |
| 118 |
|
| 119 |
|
| 120 |
This work consists of the main source file listingsutf8.dtx |
| 121 |
and the derived files |
| 122 |
listingsutf8.sty, listingsutf8.pdf, listingsutf8.ins, listingsutf8.drv, |
| 123 |
listingsutf8-test1.tex, listingsutf8-test2.tex, |
| 124 |
listingsutf8-test3.tex, listingsutf8-test4.tex, |
| 125 |
listingsutf8-test5.tex. |
| 126 |
|
| 127 |
\endpreamble |
| 128 |
\let\MetaPrefix\DoubleperCent |
| 129 |
|
| 130 |
\generate{% |
| 131 |
\file{listingsutf8.ins}{\from{listingsutf8.dtx}{install}}% |
| 132 |
\file{listingsutf8.drv}{\from{listingsutf8.dtx}{driver}}% |
| 133 |
\usedir{tex/latex/listingsutf8}% |
| 134 |
\file{listingsutf8.sty}{\from{listingsutf8.dtx}{package}}% |
| 135 |
} |
| 136 |
|
| 137 |
\catcode32=13\relax% active space |
| 138 |
\let =\space% |
| 139 |
\Msg{************************************************************************} |
| 140 |
\Msg{*} |
| 141 |
\Msg{* To finish the installation you have to move the following} |
| 142 |
\Msg{* file into a directory searched by TeX:} |
| 143 |
\Msg{*} |
| 144 |
\Msg{* listingsutf8.sty} |
| 145 |
\Msg{*} |
| 146 |
\Msg{* To produce the documentation run the file `listingsutf8.drv'} |
| 147 |
\Msg{* through LaTeX.} |
| 148 |
\Msg{*} |
| 149 |
\Msg{* Happy TeXing!} |
| 150 |
\Msg{*} |
| 151 |
\Msg{************************************************************************} |
| 152 |
|
| 153 |
\endbatchfile |
| 154 |
%</install> |
| 155 |
%<*ignore> |
| 156 |
\fi |
| 157 |
%</ignore> |
| 158 |
%<*driver> |
| 159 |
\NeedsTeXFormat{LaTeX2e} |
| 160 |
\ProvidesFile{listingsutf8.drv}% |
| 161 |
[2019-12-10 v1.5 Allow UTF-8 in listings input (HO)]% |
| 162 |
\documentclass{ltxdoc} |
| 163 |
\usepackage{holtxdoc}[2011/11/22] |
| 164 |
\begin{document} |
| 165 |
\DocInput{listingsutf8.dtx}% |
| 166 |
\end{document} |
| 167 |
%</driver> |
| 168 |
% \fi |
| 169 |
% |
| 170 |
% |
| 171 |
% |
| 172 |
% \GetFileInfo{listingsutf8.drv} |
| 173 |
% |
| 174 |
% \title{The \xpackage{listingsutf8} package} |
| 175 |
% \date{2019-12-10 v1.5} |
| 176 |
% \author{Heiko Oberdiek\thanks |
| 177 |
% {Please report any issues at \url{https://github.com/ho-tex/listingsutf8/issues}}} |
| 178 |
% |
| 179 |
% \maketitle |
| 180 |
% |
| 181 |
% \begin{abstract} |
| 182 |
% Package \xpackage{listings} does not support files with multi-byte |
| 183 |
% encodings such as UTF-8. In case of \cs{lstinputlisting} a simple |
| 184 |
% workaround is possible if an one-byte encoding exists that the file |
| 185 |
% can be converted to. Also \eTeX\ and \pdfTeX\ regardless of its mode |
| 186 |
% are required. |
| 187 |
% \end{abstract} |
| 188 |
% |
| 189 |
% \tableofcontents |
| 190 |
% |
| 191 |
% \section{Documentation} |
| 192 |
% |
| 193 |
% \subsection{User interface} |
| 194 |
% |
| 195 |
% Load this package after or instead of package \xpackage{listings} |
| 196 |
% \cite{listings}. |
| 197 |
% The package does not define own options and passes given options to |
| 198 |
% package \xpackage{listings}. |
| 199 |
% |
| 200 |
% The syntax of package \xpackage{listings}' key \xoption{inputencoding} |
| 201 |
% is extended: |
| 202 |
% \begin{quote} |
| 203 |
% |inputencoding=utf8/|\meta{one-byte-encoding}\\ |
| 204 |
% Example: |inputencoding=utf8/latin1| |
| 205 |
% \end{quote} |
| 206 |
% That means the file is encoded in UTF-8 and can |
| 207 |
% be converted to the given \meta{one-byte-encoding}. |
| 208 |
% The available encodings for \meta{one-byte-encoding} are |
| 209 |
% listed in section ``1.2 Supported encodings'' of |
| 210 |
% package \xpackage{stringenc}'s documentation \cite{stringenc}. |
| 211 |
% Of course, the encoding must encode its characters with |
| 212 |
% one byte exactly. This excludes the unicode encodings |
| 213 |
% (\xoption{utf8}, \xoption{utf16}, \dots). |
| 214 |
% |
| 215 |
% Only \cs{lstinputlisting} is supported by the syntax extension |
| 216 |
% of key \xoption{inputencoding}. |
| 217 |
% |
| 218 |
% Internally package \xpackage{listingsutf8} reads the file as binary file |
| 219 |
% via primitives of \pdfTeX\ (\cs{pdffiledump}). Then the file |
| 220 |
% contents is converted as string using package \xpackage{stringenc} and |
| 221 |
% finally the string is read as virtual file by \eTeX's \cs{scantokens}. |
| 222 |
% |
| 223 |
% \subsection{Future} |
| 224 |
% |
| 225 |
% Workarounds are not provided for |
| 226 |
% \begin{itemize} |
| 227 |
% \item \cs{lstinline} |
| 228 |
% \item Environment |lstlisting|. |
| 229 |
% \item Environments defined by \cs{lstnewenvironment}. |
| 230 |
% \end{itemize} |
| 231 |
% Perhaps someone will find time to extend package \xpackage{listings} |
| 232 |
% with full native support for UTF-8. Then this package would become obsolete. |
| 233 |
% |
| 234 |
% \StopEventually{ |
| 235 |
% } |
| 236 |
% |
| 237 |
% \section{Implementation} |
| 238 |
% |
| 239 |
% \begin{macrocode} |
| 240 |
%<*package> |
| 241 |
% \end{macrocode} |
| 242 |
% |
| 243 |
% \subsection{Catcodes and identification} |
| 244 |
% |
| 245 |
% \begin{macrocode} |
| 246 |
\begingroup\catcode61\catcode48\catcode32=10\relax% |
| 247 |
\catcode13=5 % ^^M |
| 248 |
\endlinechar=13 % |
| 249 |
\catcode123=1 % { |
| 250 |
\catcode125=2 % } |
| 251 |
\catcode64=11 % @ |
| 252 |
\def\x{\endgroup |
| 253 |
\expandafter\edef\csname lstU@AtEnd\endcsname{% |
| 254 |
\endlinechar=\the\endlinechar\relax |
| 255 |
\catcode13=\the\catcode13\relax |
| 256 |
\catcode32=\the\catcode32\relax |
| 257 |
\catcode35=\the\catcode35\relax |
| 258 |
\catcode61=\the\catcode61\relax |
| 259 |
\catcode64=\the\catcode64\relax |
| 260 |
\catcode123=\the\catcode123\relax |
| 261 |
\catcode125=\the\catcode125\relax |
| 262 |
}% |
| 263 |
}% |
| 264 |
\x\catcode61\catcode48\catcode32=10\relax% |
| 265 |
\catcode13=5 % ^^M |
| 266 |
\endlinechar=13 % |
| 267 |
\catcode35=6 % # |
| 268 |
\catcode64=11 % @ |
| 269 |
\catcode123=1 % { |
| 270 |
\catcode125=2 % } |
| 271 |
\def\TMP@EnsureCode#1#2{% |
| 272 |
\edef\lstU@AtEnd{% |
| 273 |
\lstU@AtEnd |
| 274 |
\catcode#1=\the\catcode#1\relax |
| 275 |
}% |
| 276 |
\catcode#1=#2\relax |
| 277 |
} |
| 278 |
\TMP@EnsureCode{10}{12}% ^^J |
| 279 |
\TMP@EnsureCode{33}{12}% ! |
| 280 |
\TMP@EnsureCode{36}{3}% $ |
| 281 |
\TMP@EnsureCode{38}{4}% & |
| 282 |
\TMP@EnsureCode{39}{12}% ' |
| 283 |
\TMP@EnsureCode{40}{12}% ( |
| 284 |
\TMP@EnsureCode{41}{12}% ) |
| 285 |
\TMP@EnsureCode{42}{12}% * |
| 286 |
\TMP@EnsureCode{43}{12}% + |
| 287 |
\TMP@EnsureCode{44}{12}% , |
| 288 |
\TMP@EnsureCode{45}{12}% - |
| 289 |
\TMP@EnsureCode{46}{12}% . |
| 290 |
\TMP@EnsureCode{47}{12}% / |
| 291 |
\TMP@EnsureCode{58}{12}% : |
| 292 |
\TMP@EnsureCode{60}{12}% < |
| 293 |
\TMP@EnsureCode{62}{12}% > |
| 294 |
\TMP@EnsureCode{91}{12}% [ |
| 295 |
\TMP@EnsureCode{93}{12}% ] |
| 296 |
\TMP@EnsureCode{94}{7}% ^ (superscript) |
| 297 |
\TMP@EnsureCode{95}{8}% _ (subscript) |
| 298 |
\TMP@EnsureCode{96}{12}% ` |
| 299 |
\TMP@EnsureCode{124}{12}% | |
| 300 |
\TMP@EnsureCode{126}{13}% ~ (active) |
| 301 |
\edef\lstU@AtEnd{\lstU@AtEnd\noexpand\endinput} |
| 302 |
% \end{macrocode} |
| 303 |
% |
| 304 |
% Package identification. |
| 305 |
% \begin{macrocode} |
| 306 |
\NeedsTeXFormat{LaTeX2e} |
| 307 |
\ProvidesPackage{listingsutf8}% |
| 308 |
[2019-12-10 v1.5 Allow UTF-8 in listings input (HO)] |
| 309 |
% \end{macrocode} |
| 310 |
% |
| 311 |
% \subsection{Package options} |
| 312 |
% |
| 313 |
% Just pass options to package listings. |
| 314 |
% |
| 315 |
% \begin{macrocode} |
| 316 |
\DeclareOption*{% |
| 317 |
\PassOptionsToPackage\CurrentOption{listings}% |
| 318 |
} |
| 319 |
\ProcessOptions* |
| 320 |
% \end{macrocode} |
| 321 |
% Key \xoption{inputencoding} was introduced in version |
| 322 |
% 2002/04/01 v1.0 of package \xpackage{listings}. |
| 323 |
% \begin{macrocode} |
| 324 |
\RequirePackage{listings}[2002/04/01] |
| 325 |
% \end{macrocode} |
| 326 |
% Ensure that \cs{inputencoding} is provided. |
| 327 |
% \begin{macrocode} |
| 328 |
\AtBeginDocument{% |
| 329 |
\@ifundefined{inputencoding}{% |
| 330 |
\RequirePackage{inputenc}% |
| 331 |
}{}% |
| 332 |
} |
| 333 |
% \end{macrocode} |
| 334 |
% |
| 335 |
% \subsection{Check prerequisites} |
| 336 |
% |
| 337 |
% \begin{macrocode} |
| 338 |
\RequirePackage{pdftexcmds}[2011/04/22] |
| 339 |
% \end{macrocode} |
| 340 |
% |
| 341 |
% \begin{macrocode} |
| 342 |
\def\lstU@temp#1#2{% |
| 343 |
\begingroup\expandafter\expandafter\expandafter\endgroup |
| 344 |
\expandafter\ifx\csname #1\endcsname\relax |
| 345 |
\PackageWarningNoLine{listingsutf8}{% |
| 346 |
Package loading is aborted because of missing % |
| 347 |
\@backslashchar#1.\MessageBreak |
| 348 |
#2% |
| 349 |
}% |
| 350 |
\expandafter\lstU@AtEnd |
| 351 |
\fi |
| 352 |
} |
| 353 |
\lstU@temp{scantokens}{It is provided by e-TeX}% |
| 354 |
\lstU@temp{pdf@unescapehex}{It is provided by pdfTeX >= 1.30}% |
| 355 |
\lstU@temp{pdf@filedump}{It is provided by pdfTeX >= 1.30}% |
| 356 |
\lstU@temp{pdf@filesize}{It is provided by pdfTeX >= 1.30}% |
| 357 |
% \end{macrocode} |
| 358 |
% |
| 359 |
% \begin{macrocode} |
| 360 |
\RequirePackage{stringenc}[2010/03/01] |
| 361 |
% \end{macrocode} |
| 362 |
% |
| 363 |
% \subsection{Add support for UTF-8} |
| 364 |
% |
| 365 |
% \begin{macro}{\iflstU@utfviii} |
| 366 |
% \begin{macrocode} |
| 367 |
\newif\iflstU@utfviii |
| 368 |
% \end{macrocode} |
| 369 |
% \end{macro} |
| 370 |
% |
| 371 |
% \begin{macro}{\lstU@inputenc} |
| 372 |
% \begin{macrocode} |
| 373 |
\def\lstU@inputenc#1{% |
| 374 |
\expandafter\lstU@@inputenc#1utf8/utf8/\@nil |
| 375 |
} |
| 376 |
% \end{macrocode} |
| 377 |
% \end{macro} |
| 378 |
% \begin{macro}{\lstU@@inputenc} |
| 379 |
\def\lstU@@inputenc#1utf8/#2utf8/#3\@nil{% |
| 380 |
\ifx\\#1\\% |
| 381 |
\lstU@utfviiitrue |
| 382 |
\def\lst@inputenc{#2}% |
| 383 |
\else |
| 384 |
\lstU@utfviiifalse |
| 385 |
\fi |
| 386 |
} |
| 387 |
% \begin{macrocode} |
| 388 |
% \end{macrocode} |
| 389 |
% \end{macro} |
| 390 |
% |
| 391 |
% \begin{macrocode} |
| 392 |
\lst@Key{inputencoding}\relax{% |
| 393 |
\def\lst@inputenc{#1}% |
| 394 |
\lstU@inputenc{#1}% |
| 395 |
} |
| 396 |
% \end{macrocode} |
| 397 |
% |
| 398 |
% \subsubsection{Conversion} |
| 399 |
% |
| 400 |
% \begin{macro}{\lstU@input} |
| 401 |
% \begin{macrocode} |
| 402 |
\def\lstU@input#1{% |
| 403 |
\iflstU@utfviii |
| 404 |
\edef\lstU@text{% |
| 405 |
\pdf@unescapehex{% |
| 406 |
\pdf@filedump{0}{\pdf@filesize{#1}}{#1}% |
| 407 |
}% |
| 408 |
}% |
| 409 |
\lstU@CRLFtoLF\lstU@text |
| 410 |
\StringEncodingConvert\lstU@text\lstU@text{utf8}\lst@inputenc |
| 411 |
\def\lstU@temp{% |
| 412 |
\scantokens\expandafter{\lstU@text}% |
| 413 |
}% |
| 414 |
\else |
| 415 |
\def\lstU@temp{% |
| 416 |
\input{#1}% |
| 417 |
}% |
| 418 |
\fi |
| 419 |
\lstU@temp |
| 420 |
} |
| 421 |
% \end{macrocode} |
| 422 |
% \end{macro} |
| 423 |
% |
| 424 |
% \subsubsection{Convert CR/LF pairs to LF} |
| 425 |
% |
| 426 |
% \begin{macro}{\lstU@CRLFtoLF} |
| 427 |
% \begin{macrocode} |
| 428 |
\begingroup |
| 429 |
\endlinechar=-1 % |
| 430 |
\@makeother\^^J % |
| 431 |
\@makeother\^^M % |
| 432 |
\gdef\lstU@CRLFtoLF#1{% |
| 433 |
\edef#1{% |
| 434 |
\expandafter\lstU@CRLFtoLF@aux#1^^M^^J\@nil |
| 435 |
}% |
| 436 |
}% |
| 437 |
\gdef\lstU@CRLFtoLF@aux#1^^M^^J#2\@nil{% |
| 438 |
#1% |
| 439 |
\ifx\relax#2\relax |
| 440 |
\@car |
| 441 |
\fi |
| 442 |
^^J% |
| 443 |
\lstU@CRLFtoLF@aux#2\@nil |
| 444 |
}% |
| 445 |
\endgroup % |
| 446 |
% \end{macrocode} |
| 447 |
% \end{macro} |
| 448 |
% |
| 449 |
% \subsubsection{Patch \cs{lst@InputListing}} |
| 450 |
% |
| 451 |
% \begin{macrocode} |
| 452 |
\def\lstU@temp#1\def\lst@next#2#3\@nil{% |
| 453 |
\def\lst@InputListing##1{% |
| 454 |
#1% |
| 455 |
\def\lst@next{\lstU@input{##1}}% |
| 456 |
#3% |
| 457 |
}% |
| 458 |
} |
| 459 |
\expandafter\lstU@temp\lst@InputListing{#1}\@nil |
| 460 |
% \end{macrocode} |
| 461 |
% |
| 462 |
% \begin{macrocode} |
| 463 |
\lstU@AtEnd% |
| 464 |
%</package> |
| 465 |
% \end{macrocode} |
| 466 |
%% \section{Installation} |
| 467 |
% |
| 468 |
% \subsection{Download} |
| 469 |
% |
| 470 |
% \paragraph{Package.} This package is available on |
| 471 |
% CTAN\footnote{\CTANpkg{listingsutf8}}: |
| 472 |
% \begin{description} |
| 473 |
% \item[\CTAN{macros/latex/contrib/listingsutf8/listingsutf8.dtx}] The source file. |
| 474 |
% \item[\CTAN{macros/latex/contrib/listingsutf8/listingsutf8.pdf}] Documentation. |
| 475 |
% \end{description} |
| 476 |
% |
| 477 |
% |
| 478 |
% \paragraph{Bundle.} All the packages of the bundle `listingsutf8' |
| 479 |
% are also available in a TDS compliant ZIP archive. There |
| 480 |
% the packages are already unpacked and the documentation files |
| 481 |
% are generated. The files and directories obey the TDS standard. |
| 482 |
% \begin{description} |
| 483 |
% \item[\CTANinstall{install/macros/latex/contrib/listingsutf8.tds.zip}] |
| 484 |
% \end{description} |
| 485 |
% \emph{TDS} refers to the standard ``A Directory Structure |
| 486 |
% for \TeX\ Files'' (\CTANpkg{tds}). Directories |
| 487 |
% with \xfile{texmf} in their name are usually organized this way. |
| 488 |
% |
| 489 |
% \subsection{Bundle installation} |
| 490 |
% |
| 491 |
% \paragraph{Unpacking.} Unpack the \xfile{listingsutf8.tds.zip} in the |
| 492 |
% TDS tree (also known as \xfile{texmf} tree) of your choice. |
| 493 |
% Example (linux): |
| 494 |
% \begin{quote} |
| 495 |
% |unzip listingsutf8.tds.zip -d ~/texmf| |
| 496 |
% \end{quote} |
| 497 |
% |
| 498 |
% \subsection{Package installation} |
| 499 |
% |
| 500 |
% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting |
| 501 |
% \docstrip\ archive. The files are extracted by running the |
| 502 |
% \xfile{.dtx} through \plainTeX: |
| 503 |
% \begin{quote} |
| 504 |
% \verb|tex listingsutf8.dtx| |
| 505 |
% \end{quote} |
| 506 |
% |
| 507 |
% \paragraph{TDS.} Now the different files must be moved into |
| 508 |
% the different directories in your installation TDS tree |
| 509 |
% (also known as \xfile{texmf} tree): |
| 510 |
% \begin{quote} |
| 511 |
% \def\t{^^A |
| 512 |
% \begin{tabular}{@{}>{\ttfamily}l@{ $\rightarrow$ }>{\ttfamily}l@{}} |
| 513 |
% listingsutf8.sty & tex/latex/listingsutf8/listingsutf8.sty\\ |
| 514 |
% listingsutf8.pdf & doc/latex/listingsutf8/listingsutf8.pdf\\ |
| 515 |
% listingsutf8.dtx & source/latex/listingsutf8/listingsutf8.dtx\\ |
| 516 |
% \end{tabular}^^A |
| 517 |
% }^^A |
| 518 |
% \sbox0{\t}^^A |
| 519 |
% \ifdim\wd0>\linewidth |
| 520 |
% \begingroup |
| 521 |
% \advance\linewidth by\leftmargin |
| 522 |
% \advance\linewidth by\rightmargin |
| 523 |
% \edef\x{\endgroup |
| 524 |
% \def\noexpand\lw{\the\linewidth}^^A |
| 525 |
% }\x |
| 526 |
% \def\lwbox{^^A |
| 527 |
% \leavevmode |
| 528 |
% \hbox to \linewidth{^^A |
| 529 |
% \kern-\leftmargin\relax |
| 530 |
% \hss |
| 531 |
% \usebox0 |
| 532 |
% \hss |
| 533 |
% \kern-\rightmargin\relax |
| 534 |
% }^^A |
| 535 |
% }^^A |
| 536 |
% \ifdim\wd0>\lw |
| 537 |
% \sbox0{\small\t}^^A |
| 538 |
% \ifdim\wd0>\linewidth |
| 539 |
% \ifdim\wd0>\lw |
| 540 |
% \sbox0{\footnotesize\t}^^A |
| 541 |
% \ifdim\wd0>\linewidth |
| 542 |
% \ifdim\wd0>\lw |
| 543 |
% \sbox0{\scriptsize\t}^^A |
| 544 |
% \ifdim\wd0>\linewidth |
| 545 |
% \ifdim\wd0>\lw |
| 546 |
% \sbox0{\tiny\t}^^A |
| 547 |
% \ifdim\wd0>\linewidth |
| 548 |
% \lwbox |
| 549 |
% \else |
| 550 |
% \usebox0 |
| 551 |
% \fi |
| 552 |
% \else |
| 553 |
% \lwbox |
| 554 |
% \fi |
| 555 |
% \else |
| 556 |
% \usebox0 |
| 557 |
% \fi |
| 558 |
% \else |
| 559 |
% \lwbox |
| 560 |
% \fi |
| 561 |
% \else |
| 562 |
% \usebox0 |
| 563 |
% \fi |
| 564 |
% \else |
| 565 |
% \lwbox |
| 566 |
% \fi |
| 567 |
% \else |
| 568 |
% \usebox0 |
| 569 |
% \fi |
| 570 |
% \else |
| 571 |
% \lwbox |
| 572 |
% \fi |
| 573 |
% \else |
| 574 |
% \usebox0 |
| 575 |
% \fi |
| 576 |
% \end{quote} |
| 577 |
% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's |
| 578 |
% TDS installing feature, then some files can already be in the right |
| 579 |
% place, see the documentation of \docstrip. |
| 580 |
% |
| 581 |
% \subsection{Refresh file name databases} |
| 582 |
% |
| 583 |
% If your \TeX~distribution |
| 584 |
% (\TeX\,Live, \mikTeX, \dots) relies on file name databases, you must refresh |
| 585 |
% these. For example, \TeX\,Live\ users run \verb|texhash| or |
| 586 |
% \verb|mktexlsr|. |
| 587 |
% |
| 588 |
% \subsection{Some details for the interested} |
| 589 |
% |
| 590 |
% \paragraph{Unpacking with \LaTeX.} |
| 591 |
% The \xfile{.dtx} chooses its action depending on the format: |
| 592 |
% \begin{description} |
| 593 |
% \item[\plainTeX:] Run \docstrip\ and extract the files. |
| 594 |
% \item[\LaTeX:] Generate the documentation. |
| 595 |
% \end{description} |
| 596 |
% If you insist on using \LaTeX\ for \docstrip\ (really, |
| 597 |
% \docstrip\ does not need \LaTeX), then inform the autodetect routine |
| 598 |
% about your intention: |
| 599 |
% \begin{quote} |
| 600 |
% \verb|latex \let\install=y\input{listingsutf8.dtx}| |
| 601 |
% \end{quote} |
| 602 |
% Do not forget to quote the argument according to the demands |
| 603 |
% of your shell. |
| 604 |
% |
| 605 |
% \paragraph{Generating the documentation.} |
| 606 |
% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate |
| 607 |
% the documentation. The process can be configured by the |
| 608 |
% configuration file \xfile{ltxdoc.cfg}. For instance, put this |
| 609 |
% line into this file, if you want to have A4 as paper format: |
| 610 |
% \begin{quote} |
| 611 |
% \verb|\PassOptionsToClass{a4paper}{article}| |
| 612 |
% \end{quote} |
| 613 |
% An example follows how to generate the |
| 614 |
% documentation with pdf\LaTeX: |
| 615 |
% \begin{quote} |
| 616 |
%\begin{verbatim} |
| 617 |
%pdflatex listingsutf8.dtx |
| 618 |
%makeindex -s gind.ist listingsutf8.idx |
| 619 |
%pdflatex listingsutf8.dtx |
| 620 |
%makeindex -s gind.ist listingsutf8.idx |
| 621 |
%pdflatex listingsutf8.dtx |
| 622 |
%\end{verbatim} |
| 623 |
% \end{quote} |
| 624 |
% |
| 625 |
% \begin{thebibliography}{9} |
| 626 |
% |
| 627 |
% \bibitem{inputenc} |
| 628 |
% Alan Jeffrey, Frank Mittelbach, |
| 629 |
% \textit{inputenc.sty}, 2006/05/05 v1.1b. |
| 630 |
% \CTANpkg{inputenc} |
| 631 |
% |
| 632 |
% \bibitem{listings} |
| 633 |
% Carsten Heinz, Brooks Moses: |
| 634 |
% \textit{The \xpackage{listings} package}; |
| 635 |
% 2007/02/22;\\ |
| 636 |
% \CTANpkg{listings}. |
| 637 |
% |
| 638 |
% \bibitem{stringenc} |
| 639 |
% Heiko Oberdiek: |
| 640 |
% \textit{The \xpackage{stringenc} package}; |
| 641 |
% 2007/10/22;\\ |
| 642 |
% \CTANpkg{stringenc}. |
| 643 |
% |
| 644 |
% \end{thebibliography} |
| 645 |
% |
| 646 |
% \begin{History} |
| 647 |
% \begin{Version}{2007/10/22 v1.0} |
| 648 |
% \item |
| 649 |
% First version. |
| 650 |
% \end{Version} |
| 651 |
% \begin{Version}{2007/11/11 v1.1} |
| 652 |
% \item |
| 653 |
% Use of package \xpackage{pdftexcmds}. |
| 654 |
% \end{Version} |
| 655 |
% \begin{Version}{2011/11/10 v1.2} |
| 656 |
% \item |
| 657 |
% DOS line ends CR/LF normalized to LF to avoid empty lines |
| 658 |
% (Bug report of Thomas Benkert in de.comp.text.tex). |
| 659 |
% \end{Version} |
| 660 |
% \begin{Version}{2016/05/16 v1.3} |
| 661 |
% \item |
| 662 |
% Documentation updates. |
| 663 |
% \end{Version} |
| 664 |
% \begin{Version}{2019/12/09 v1.4} |
| 665 |
% \item |
| 666 |
% Documentation updates. |
| 667 |
% \end{Version} |
| 668 |
% \begin{Version}{2019-12-10 v1.5} |
| 669 |
% \item Updated |
| 670 |
% \end{Version} |
| 671 |
% \end{History} |
| 672 |
% |
| 673 |
% \PrintIndex |
| 674 |
% |
| 675 |
% \Finale |
| 676 |
\endinput |