aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2017-12-30 17:58:41 +0100
committerRobert Alessi <alessi@robertalessi.net>2017-12-30 17:58:41 +0100
commita11be346f0676235ac7ef2fce518fc38cd4417a7 (patch)
treeb923822ea7d351c73ffb2bb8db131b52e9dff13a
parentf7468f0f433dc2a26934159a9cf085b9730549fe (diff)
downloadarabluatex-a11be346f0676235ac7ef2fce518fc38cd4417a7.tar.gz
\cap{} should handle proper names made of several words
-rw-r--r--arabluatex.lua19
1 files changed, 14 insertions, 5 deletions
diff --git a/arabluatex.lua b/arabluatex.lua
index f6890ed..593dc6c 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -674,15 +674,24 @@ function cap(str)
674 str = string.gsub(str, "([^\\]%-['`])", "%1\\MakeUppercase ") 674 str = string.gsub(str, "([^\\]%-['`])", "%1\\MakeUppercase ")
675 str = string.gsub(str, "([^\\]%-ʿ)", "%1\\MakeUppercase ") 675 str = string.gsub(str, "([^\\]%-ʿ)", "%1\\MakeUppercase ")
676 str = string.gsub(str, "([^\\]%-ʾ)", "%1\\MakeUppercase ") 676 str = string.gsub(str, "([^\\]%-ʾ)", "%1\\MakeUppercase ")
677 elseif string.find(str, "[^\\]%-[^'`ʾʿ]") then 677 end
678 str = string.gsub(str, "([^\\]%-)", "%1\\MakeUppercase ") 678 if string.find(str, "[^\\]a?%-[^'`ʾʿ]") then
679 elseif string.find(str, "^['`ʾʿ]") then 679 str = string.gsub(str, "([^\\]a?%-)", "%1\\MakeUppercase ")
680 end
681 if string.find(str, "^['`ʾʿ]") then
680 str = string.gsub(str, "^(['`])", "%1\\MakeUppercase ") 682 str = string.gsub(str, "^(['`])", "%1\\MakeUppercase ")
681 str = string.gsub(str, "^(ʿ)", "%1\\MakeUppercase ") 683 str = string.gsub(str, "^(ʿ)", "%1\\MakeUppercase ")
682 str = string.gsub(str, "^(ʾ)", "%1\\MakeUppercase ") 684 str = string.gsub(str, "^(ʾ)", "%1\\MakeUppercase ")
683 else
684 str = "\\MakeUppercase "..str
685 end 685 end
686 if string.find(str, "%s['`ʾʿ]") then
687 str = string.gsub(str, "(%s['`][^%-])", "%1\\MakeUppercase ")
688 str = string.gsub(str, "(%sʿ)", "%1\\MakeUppercase ")
689 str = string.gsub(str, "(%sʾ)", "%1\\MakeUppercase ")
690 end
691-- str = string.gsub(str, "(%s[^'`ʾʿ])", "%1\\MakeUppercase ")
692-- else
693 str = "\\MakeUppercase "..str
694-- end
686return "\\txtrans{"..str.."}" 695return "\\txtrans{"..str.."}"
687end 696end
688 697