diff options
author | Karl Berry <karl@freefriends.org> | 2020-09-25 20:57:56 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2020-09-25 20:57:56 +0000 |
commit | 3c2b78a2680317a1a3a1d73e8ca3b39a46a21299 (patch) | |
tree | 568f7db0174929faad84dfe73971999e6a36db63 /Master/texmf-dist/tex | |
parent | bb1b3f8e561d48962c52f7d5aa057cd674520007 (diff) |
repltext (25sep20)
git-svn-id: svn://tug.org/texlive/trunk@56433 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/repltext/repltext.sty | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/latex/repltext/repltext.sty b/Master/texmf-dist/tex/latex/repltext/repltext.sty index 227473fd27f..fa39894411b 100644 --- a/Master/texmf-dist/tex/latex/repltext/repltext.sty +++ b/Master/texmf-dist/tex/latex/repltext/repltext.sty @@ -6,7 +6,7 @@ %% %% repltext.dtx (with options: `package') %% -%% Copyright (C) 2014 by Scott Pakin <scott+repl@pakin.org> +%% Copyright (C) 2014-2020 by Scott Pakin <scott+repl@pakin.org> %% %% This file may be distributed and/or modified under the conditions of %% the LaTeX Project Public License, either version 1.3c of this license @@ -20,8 +20,24 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{repltext} - [2014/04/11 v1.0 PDF replacement text] -\RequirePackage{ifpdf} + [2020/09/25 v1.1 PDF replacement text] +\providecommand{\@ifdefined}[3]{\@ifundefined{#1}{#3}{#2}} +\@ifdefined{pdfliteral}{% + \let\repl@literal=\pdfliteral +}{% + \@ifdefined{pdfextension}{% + \protected\def\repl@literal{\pdfextension literal}% + }{% + \PackageError{repltext}{Unrecognized TeX engine}{% + The repltext package currently works only with pdfLaTeX and\MessageBreak + LuaLaTeX.\space\space Please use of those engines to build your document.% + }% + }% +}% +\RequirePackage{etoolbox} +\AtEndPreamble{% + \@ifpackageloaded{hyperref}{}{\RequirePackage{hyperref}}% +} \RequirePackage{graphicx} \newtoks\repl@text@toks \newcommand{\repltext}{% @@ -38,13 +54,14 @@ \repl@text@ii } \newcommand{\repl@text@ii}[1]{% - \pdfliteral{ - /Span << /ActualText (\pdfescapestring{\the\repl@text@toks}) >> + \Hy@pstringdef\repl@escaped{\the\repl@text@toks}% + \repl@literal{ + /Span << /ActualText (\repl@escaped) >> BDC }% #1% \scalebox{0.000001}{-}% - \pdfliteral{EMC}% + \repl@literal{EMC}% } \newcommand{\prevrepl}{% \expandafter\scantokens\expandafter{\the\repl@text@toks}% |