summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty')
-rw-r--r--Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty27
1 files changed, 19 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty
index c5982eb3de4..a41f8e2d322 100644
--- a/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty
+++ b/Master/texmf-dist/tex/xelatex/xecjk/xeCJK-listings.sty
@@ -29,10 +29,10 @@
%%
\NeedsTeXFormat{LaTeX2e}
\RequirePackage{expl3}
-\GetIdInfo$Id: xeCJK.dtx 832988e 2017-04-01 21:33:23 +0800 Qing Lee <sobenlee@gmail.com> $
+\GetIdInfo$Id: xeCJK.dtx 18af4a5 2017-05-15 20:12:35 +0800 Qing Lee <sobenlee@gmail.com> $
{xeCJK patch file for listings}
\ProvidesExplPackage{xeCJK-listings}
- {\ExplFileDate}{3.4.7}{\ExplFileDescription}
+ {\ExplFileDate}{3.4.8}{\ExplFileDescription}
\DeclareOption* { \PassOptionsToPackage { \CurrentOption } { xeCJK } }
\ProcessOptions \scan_stop:
\RequirePackage { xeCJK }
@@ -293,11 +293,17 @@
}
}
\cs_set_eq:NN \lst@IfNextCharActive \__xeCJK_listings_peek_active_loop:TF
+\cs_new_protected:Npn \__xeCJK_listings_rescan:Nn #1#2
+ {
+ \__xeCJK_listings_set_escape:
+ \tl_set:Nn \l__xeCJK_tmp_tl {#2}
+ \__xeCJK_listings_escape_backslash:
+ \tl_set_rescan:Nno #1 { } { \l__xeCJK_tmp_tl }
+ }
\cs_new_protected:Npn \__xeCJK_listings_inside_convert:nw #1 ~ \@empty
{
- \tl_set_rescan:Nnn \l__xeCJK_tmp_tl { } {#1}
- \__xeCJK_set_listings_escape:
- \tl_put_right:NV \lst@arg \l__xeCJK_tmp_tl
+ \__xeCJK_listings_rescan:Nn \l__xeCJK_tmp_tl {#1}
+ \tl_put_right:No \lst@arg { \l__xeCJK_tmp_tl }
}
\cs_set_eq:NN \lst@InsideConvert@ \__xeCJK_listings_inside_convert:nw
\cs_new_protected_nopar:Npn \__xeCJK_listings_inline_group:w
@@ -308,15 +314,14 @@
\cs_set_eq:NN \lst@InlineGJ \__xeCJK_listings_inline_group:w
\cs_new_protected:Npn \__xeCJK_listings_inline_group:n #1
{
- \tl_set_rescan:Nnn \lst@arg { } {#1}
- \__xeCJK_set_listings_escape:
+ \__xeCJK_listings_rescan:Nn \lst@arg {#1}
\lst@InlineGJEnd
}
\group_begin:
\cs_set:Npn \__xeCJK_tmp:w #1
{
\group_end:
- \cs_new_protected:Npn \__xeCJK_set_listings_escape:
+ \cs_new_protected_nopar:Npn \__xeCJK_listings_set_escape:
{ \xeCJK_swap_cs:NN #1 \__xeCJK_listings_escape:N }
\cs_new_protected:Npn \__xeCJK_listings_escape:N ##1
{ \cs_if_eq:NNTF #1 ##1 { \__xeCJK_listings_escape:N } {##1} }
@@ -327,6 +332,12 @@
\__xeCJK_tmp:w
}
{ \ }
+\cs_new_protected_nopar:Npx \__xeCJK_listings_escape_backslash:
+ {
+ \tl_replace_all:Nnn \exp_not:N \l__xeCJK_tmp_tl
+ { \c_backslash_str }
+ { \c_backslash_str \c_backslash_str }
+ }
%%
%% This package consists of the files xeCJK.dtx,
%% full-stop.map,