Debian Codegraph @

texmf-dist/tex/lualatex/lualatex-truncate/lualatex-truncate.sty

raw
1 %%
2 %% This is file `lualatex-truncate.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% lualatex-truncate.dtx (with options: `lualatex-truncate.sty,package')
8 %% lualatex-truncate.dtx
9 %% Copyright 2018 Sebastian Friedl
10 %%
11 %% This work may be distributed and/or modified under the
12 %% conditions of the LaTeX Project Public License, either version 1.3c
13 %% of this license of (at your option) any later version.
14 %% The latest version of this license is in
15 %% http://www.latex-project.org/lppl.txt
16 %% and version 1.3c or later is part of all distributions of LaTeX
17 %% version 2008/05/04 or later.
18 %%
19 %% This work has the LPPL maintenance status 'maintained'.
20 %% Current maintainer of the work is Sebastian Friedl
21 %%
22 %% This work consists of the files lualatex-truncate.dtx, lualatex-truncate.ins,
23 %% lualatex-truncate-doc.dtx and the derived file lualatex-truncate.sty
24 %%
25 %% \CharacterTable
26 %% {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
27 %% 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
28 %% Digits \0\1\2\3\4\5\6\7\8\9
29 %% Exclamation \! Double quote \" Hash (number) \#
30 %% Dollar \$ Percent \% Ampersand \&
31 %% Acute accent \' Left paren \( Right paren \)
32 %% Asterisk \* Plus \+ Comma \,
33 %% Minus \- Point \. Solidus \/
34 %% Colon \: Semicolon \; Less than \<
35 %% Equals \= Greater than \> Question mark \?
36 %% Commercial at \@ Left bracket \[ Backslash \\
37 %% Right bracket \] Circumflex \^ Underscore \_
38 %% Grave accent \` Left brace \{ Vertical bar \|
39 %% Right brace \} Tilde \~}
40 \ProvidesPackage{lualatex-truncate}%
41 [2018/08/22 v1.1 LuaLaTeX wrapper for the truncate package]
42 \NeedsTeXFormat{LaTeX2e}
43 \newif\if@lualtxtruncate@hackhyphen
44 \@lualtxtruncate@hackhyphenfalse
45 \newif\if@lualtxtruncate@breakall
46 \@lualtxtruncate@breakallfalse
47 \DeclareOption{breakwords}{%
48 \@lualtxtruncate@hackhyphentrue%
49 \PassOptionsToPackage{breakwords}{truncate}}
50 \DeclareOption{breakall}{%
51 \@lualtxtruncate@breakalltrue%
52 \@lualtxtruncate@hackhyphentrue%
53 \PassOptionsToPackage{breakall}{truncate}}
54 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{truncate}}
55 \ProcessOptions
56 \@ifpackageloaded{truncate}{%
57 \PackageError{lualatex-truncate}%
58 {Don't load the truncate package when using lualatex-truncate!}%
59 {Don't load the truncate package and pass all package options
60 to lualatex-truncate! Otherwise, the wrapper mechanism won't
61 be able to understand what you want.}%
62 }{\RequirePackage{truncate}}
63 \RequirePackage{iftex}
64 \ifLuaTeX\else%
65 \PackageWarningNoLine{lualatex-truncate}%
66 {Whoops! You don't want to use LuaLaTeX?}%
67 \endinput%
68 \fi%
69 \RequirePackage{letltxmacro}
70 \LetLtxMacro\lualtxtruncate@truncate\truncate
71 \renewcommand{\truncate}[3][\TruncateMarker]{{% two braces -> scope changes
72 \if@lualtxtruncate@breakall%
73 \language\z@% force US english
74 \fi%
75 \newcount\lualtxtruncate@tmp%
76 \lualtxtruncate@tmp=\the\prehyphenchar% remember current hyphen char
77 \if@lualtxtruncate@hackhyphen%
78 \prehyphenchar=0% invisible hyphen
79 \fi%
80 \lualtxtruncate@truncate[#1]{#2}{#3}% run the original \truncate macro
81 \if@lualtxtruncate@hackhyphen%
82 \prehyphenchar=\the\lualtxtruncate@tmp% restore hyphen
83 \fi%
84 }}
85 \endinput
86 %%
87 %% End of file `lualatex-truncate.sty'.