summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-08-23 21:58:27 +0000
committerKarl Berry <karl@freefriends.org>2018-08-23 21:58:27 +0000
commitab5a34bb0e115a822ce300baee997608c943af86 (patch)
tree7ccf57a1236f1274ed23590bd563c2d9b3b4e79d /Master/texmf-dist/tex/lualatex
parent14b9c74b24ab667050881bb540464c1593f7e3c9 (diff)
lualatex-truncate (23aug18)
git-svn-id: svn://tug.org/texlive/trunk@48469 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/lualatex')
-rw-r--r--Master/texmf-dist/tex/lualatex/lualatex-truncate/lualatex-truncate.sty32
1 files changed, 23 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/lualatex/lualatex-truncate/lualatex-truncate.sty b/Master/texmf-dist/tex/lualatex/lualatex-truncate/lualatex-truncate.sty
index 70b742bc7f7..9036f400a97 100644
--- a/Master/texmf-dist/tex/lualatex/lualatex-truncate/lualatex-truncate.sty
+++ b/Master/texmf-dist/tex/lualatex/lualatex-truncate/lualatex-truncate.sty
@@ -38,19 +38,28 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\ProvidesPackage{lualatex-truncate}%
- [2018/06/03 v1.0 LuaLaTeX wrapper for the truncate package]
+ [2018/08/22 v1.1 LuaLaTeX wrapper for the truncate package]
\NeedsTeXFormat{LaTeX2e}
\newif\if@lualtxtruncate@hackhyphen
\@lualtxtruncate@hackhyphenfalse
+\newif\if@lualtxtruncate@breakall
+\@lualtxtruncate@breakallfalse
\DeclareOption{breakwords}{%
- \@lualtxtruncate@hackhyphentrue
+ \@lualtxtruncate@hackhyphentrue%
\PassOptionsToPackage{breakwords}{truncate}}
\DeclareOption{breakall}{%
- \@lualtxtruncate@hackhyphentrue
+ \@lualtxtruncate@breakalltrue%
+ \@lualtxtruncate@hackhyphentrue%
\PassOptionsToPackage{breakall}{truncate}}
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{truncate}}
\ProcessOptions
-\RequirePackage{truncate}
+\@ifpackageloaded{truncate}{%
+ \PackageError{lualatex-truncate}%
+ {Don't load the truncate package when using lualatex-truncate!}%
+ {Don't load the truncate package and pass all package options
+ to lualatex-truncate! Otherwise, the wrapper mechanism won't
+ be able to understand what you want.}%
+}{\RequirePackage{truncate}}
\RequirePackage{iftex}
\ifLuaTeX\else%
\PackageWarningNoLine{lualatex-truncate}%
@@ -59,15 +68,20 @@
\fi%
\RequirePackage{letltxmacro}
\LetLtxMacro\lualtxtruncate@truncate\truncate
-\renewcommand{\truncate}[3][\TruncateMarker]{%
+\renewcommand{\truncate}[3][\TruncateMarker]{{% two braces -> scope changes
+ \if@lualtxtruncate@breakall%
+ \language\z@% force US english
+ \fi%
+ \newcount\lualtxtruncate@tmp%
+ \lualtxtruncate@tmp=\the\prehyphenchar% remember current hyphen char
\if@lualtxtruncate@hackhyphen%
- \prehyphenchar=0%
+ \prehyphenchar=0% invisible hyphen
\fi%
- \lualtxtruncate@truncate[#1]{#2}{#3}%
+ \lualtxtruncate@truncate[#1]{#2}{#3}% run the original \truncate macro
\if@lualtxtruncate@hackhyphen%
- \prehyphenchar=`\-%
+ \prehyphenchar=\the\lualtxtruncate@tmp% restore hyphen
\fi%
-}
+}}
\endinput
%%
%% End of file `lualatex-truncate.sty'.