summaryrefslogtreecommitdiff
path: root/macros/luatex/latex/autopuncitems/autopuncitems.lua
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/latex/autopuncitems/autopuncitems.lua')
-rw-r--r--macros/luatex/latex/autopuncitems/autopuncitems.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/macros/luatex/latex/autopuncitems/autopuncitems.lua b/macros/luatex/latex/autopuncitems/autopuncitems.lua
index 07b68e3ed4..4eabc5868d 100644
--- a/macros/luatex/latex/autopuncitems/autopuncitems.lua
+++ b/macros/luatex/latex/autopuncitems/autopuncitems.lua
@@ -1,5 +1,5 @@
--% Kale Ewasiuk (kalekje@gmail.com)
---% 2022-01-30
+--% 2022-04-16
--% Copyright (C) 2021-2022 Kale Ewasiuk
--%
--% Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -110,4 +110,17 @@ function ap.go(s)
return s
end
+function ap.gotab(s)
+ -- very simple, does not work if \\ in tabular, doesn't factor in header or footer
+ local s, c = s:gsub('%s*\\\\', '\0')
+ if c > 2 then
+ s = s:gsub('\0', ap.punc[0]..'\\\\', c-2)
+ end
+ if c > 1 then
+ s = s:gsub('\0', ap.punc[2]..'\\\\', 1)
+ end
+ s = s:gsub('\0', ap.punc[1]..'\\\\', 1)
+ return s
+end
+
return ap \ No newline at end of file