1

In my manual, I've wrapped many words with single quotes, like this: 'bear', 'apple' and 'country'.

My goal is to replace all single quotes with \emph{}, so 'bear' becomes \emph{bear} and 'apple' becomes \emph{apple}.

I think this is not possible with an ordinary find & replace action.

Is there any other way, or should I replace everything by hand?

Edit: Can I use some sort of joker? Like: replace everything where 'joker' with \emph{joker}.

jub0bs
  • 58,916
  • 2
    Have you tried find and replace with " '" (this is a space and a ') to "\emph{"? I'm assuming that all words have a space in front of them and there is no space between the words and the quotes. If this works, the only remaining thing to do is replacing all the leftover quotes with a } – Herthog Nov 07 '13 at 17:01
  • It depends on what editor you're using. If it has ‘regular expression’ facilities it can be done. – egreg Nov 07 '13 at 17:08
  • 1
    One of the main reasons behind writing macros - it allows for consistency and easy changes. – Werner Nov 07 '13 at 17:16
  • 3
    any reasonable editor should let you replace the regular expression '([a-zA-Z]+)' by \emph{$1} But you have not said which editor you are using. – David Carlisle Nov 07 '13 at 17:18
  • In any decent editor with macros (see here) will be easy record find & replace " by \emph{ and find the next " and replace by }. Then simply repeat the macro until the end of the document. Note that one missing " will cause that the next words are changed in the wrong order, so follow that is working correctly. – Fran Nov 07 '13 at 17:21
  • @MaartenHartman I have never used it but it apparently does do regular expression replace http://stackoverflow.com/questions/11819886/regular-expression-search-replace-in-sublime-text-2 – David Carlisle Nov 07 '13 at 22:20

0 Answers0