6

A useful feature of TeXworks is the smart quote. Does TeXstudio have a similar feature? (to replace "" and '' with their Unicode opening and closing counterparts)

2
  • 2
    Options > Configure TeXStudio... > Editor > Replace Double Quotes > English Quotes. I don't know if there is an equivalent for single quotes.
    – hpesoj626
    May 9, 2013 at 6:57
  • For more detail on @hpe 's answer consider this answer: tex.stackexchange.com/a/315360/110394 This question also generalizes to all the different quotation styles. German, french, etc.
    – Cadoiz
    Aug 18, 2020 at 2:17

3 Answers 3

1

Currently TeXStudio does not support Unicode quote substitution, only TeX and csquotes quotes. I contacted the maintainer a while ago about the same issue and he told me he added that feature to the svn.

3
7

TexStudio provides a better method to covert your text into LaTeX directly by going to

Idefix->Paste as Latex / Covert to Latex

or if your are writing in the TexStudio itself then please go the options

Options->Configure TexStudio -> Editor ->Replace Double Quotes -> Select English quote

After pressing OK, whenever you write a double quote in the editor it will automatically changed to smart quotes.

enter image description here

1
  • That is a helpful feature, but in the times of XeTeX and LuaTeX I'd wish the developers would get around to add the other main traditions (« French », »reverse French«, „German“) as Unicode, too. Seeing that they have it for English, it shouldn't be too difficult to add the others. On top of that a customizable menu or even support for inner quotes would be really helpful, but that might mean considerable rework.
    – Florian
    Jun 18, 2016 at 18:05
3

Besides the feature to replace double quotes with their TeX companions (e.g. ```` `` and '') or their Unicode equivalents which is only available in the SVN version, you can use User Macros. Single Quotes can currently only be replaced by them.

enter image description here

Overview:

    Trigger      LaTeX Content/Tag
   (?<=\s|^)"           “
   (?<=\S)"             ”
   (?<=\s|^)'           ‘
   (?<=\S|^)'           ’

You may also look into the csquotes package which is very powerful when it comes to nested quotations or making " a trigger for quotes.

1
  • Great solution, considering TeXstudio allows for regex triggered macros (gladly +1'd). One remark/question: technically, you only need one macro -- the third line of your overview -- right? Double quotes are already handled if TeXstudio "double quote replacement" is enabled. And replacing "single quote, straight" at the end by a "single quote, thick end up" doesn't change the latex output, as far as I can tell. I'm simply asking to learn something new in case I'm wrong, not trying to criticize your elegant solution. Apr 19, 2017 at 13:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .