2

In LaTeX mode, when I type \" (to produce a Umlaut like ö, ä or ü in the resulting PDF) emacs replaces it by ''\` (two single quotation marks, a backslash, and a backtick) which does not work for typesetting Umlaute. There is a related question here. However I want to turn off this replacing under all circumstances, so that pressing " always inserts a literal " for all languages and not two single ' or anything else.

M0M0
  • 143
  • 5
  • 1
    It does not happen here: I can say `Here is some "quoted material"` and the quotes will be replaced by double backticks on the left and double ticks (single quotes) on the right, but if I say `Here is an \"umlauted letter`, it is left as is. Processing it through `pdflatex` shows the expected. Do you have some yasnippet or some abbrev-like mechanism operating? You might want to try with `emacs -q -l minimal.el` where `minimal.el` just loads AucTeX without the rest of your configuration. If that works as expected, bisect your init file to find the culprit. – NickD Aug 05 '22 at 15:03
  • On a completely different level, you might want to investigate using a Unicode-capable version of LaTeX (XeLaTeX or LuaLaTex) and avoid the problem. – NickD Aug 05 '22 at 15:06
  • Can the accepted answer of https://emacs.stackexchange.com/questions/3546/typing-two-quote-characters-in-a-latex-document solve your problem? – Name Aug 05 '22 at 15:37
  • @NickD - You can process German umlaut also with `pdflatex`, try for example `\documentclass{article} \usepackage{lmodern} \usepackage[T1]{fontenc} \begin{document} foo föö \end{document}`. Just make sure you save the .tex file in UTF-8. No need for XeLaTeX or LuaLaTeX. – Arash Esbati Aug 05 '22 at 15:51
  • @ArashEsbati I know, but there are many limitations. If you use Unicode text (as most of us do nowadays?), you owe it to yourself to try one of the others. – NickD Aug 05 '22 at 15:59
  • @NickD - I know about the additional features you get with say LuaLaTeX, my point was that you don't have to switch only to insert `ö` in your .tex file. – Arash Esbati Aug 05 '22 at 16:05
  • That's why I said "On a completely different level...". But in any case, if you start with LaTeX today, you should *NOT* start with `pdflatex`: you should go directly to one of the Unicode variants. – NickD Aug 05 '22 at 16:11
  • 1
    This doesn't happen out of the box, and I doubt there's a setting of AUCTeX to do this (AUCTeX would be aware of TeX syntax, and doesn't replace the character after a backslash). So it's probably due to some other package or an unusual customization in your init file. We can't help you unless you post complete instructions to reproduce the problem, in particular an init file, preferably shrunk to a manageable size. – Gilles 'SO- stop being evil' Sep 04 '22 at 18:22

1 Answers1

1

You can try setting the following variables, which are defined in tex.el.

(setq TeX-open-quote "\""
      TeX-close-quote "\"")

This allows me to enter " literally with LaTeX-mode.

Swarnendu Biswas
  • 1,378
  • 1
  • 11
  • 24
  • this did not work for me. I still have the same issue. – M0M0 Aug 05 '22 at 14:41
  • 3
    Are you using some autopairing packages like `smartparens`? You can try disabling them if yes. You can also check what the `"` key is bound to in `LaTeX-mode`. That is how I identified the variables to customize. – Swarnendu Biswas Aug 05 '22 at 14:54