Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: One-liner to fix LaTeX quotation marks

by CountZero (Bishop)
on Oct 15, 2012 at 07:50 UTC ( #999021=note: print w/replies, xml ) Need Help??

in reply to One-liner to fix LaTeX quotation marks

Perhaps not directly applicable to your post, but nevertheless very useful if you use LaTeX a lot and have to transform non-LaTeX to properly formatted LaTeX: LaTeX::Encode. It has an "intelligent quotes - iquotes" option in its main latex_encode routine.

single or double quotes around words will be changed to LaTeX single or double quotes; double quotes around a phrase will be converted to "``" and "''" and single quotes to "`" and "'". This is sometimes called "intelligent quotes"
So once you have replaced your double quotes by single quotes where necessary, you can run your text through latex_encode to get proper opening and closing quotes.


A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics