In Hebrew, there is a special punctuation mark, called Gershayim, that's used to indicate an acronym. It's written before the last character. It looks very similar to quotation mark, and since it doesn't exist in the Hebrew keyboard, usually the quotation mark is typed instead of it.

Example: ש״ב

I'd like to write a LaTeX package that will scan the document, and if it finds a hebrew word of the pattern אאאא"א (letters, with quotation mark before the last one [reminder - Hebrew is written from Right To Left]) it will replace the quotation mark with the Gershayim: אאאא״א.

It can be done in a few lines of Python with simple Regular expression. However, I don't want to process my .tex files in Python beforehand, I'm looking for some native Tex solution.

  • Is regular expression the recommended way to do it in LaTeX as well?
  • Are there some caveats?
  • Any better way to do it?
  • I have found l3regex package, but it looks cumbersome on quick reading... Is it the "standard" regular expression processing way in LaTeX?
  • How can I make l3regex to process all the text in my file?
  • Can anyone supply some example of something similar?

On the other hand, there is the mechanism that replaces `` and '' with the "smart quotation marks". Can I extend that mechanism somehow to solve also my problem?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.