-
Hi, I trying to change some predefined LaTeX quotes: (require 'smartparens-config)
(smartparens-global-mode)
(sp-with-modes '(tex-mode plain-tex-mode latex-mode LaTeX-mode)
(sp-local-pair "`" "'" :actions nil) ; Remove this pair.
(sp-local-pair "``" "''" :actions nil) ; Remove this pair.
; New pair that appears when I press apostrophe char.
(sp-local-pair "\"`" "\"'"
:trigger "'"
:unless '(sp-latex-point-after-backslash sp-in-math-p)
:post-handlers '(sp-latex-skip-double-quote))
; New pair that appears when I press double quote char.
(sp-local-pair "<<" ">>"
:trigger "\""
:unless '(sp-latex-point-after-backslash sp-in-math-p)
:post-handlers '(sp-latex-skip-double-quote))
(sp-local-tag "\"" "<<" ">>" :actions '(wrap))
(sp-local-tag "'" "\"`" "\"'" :actions '(wrap))) But this code doesn't work (
What I want:
At least I want first and second (without Additional info:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi. Unfortunatelly the For the Then you must disable (sp-local-pair 'latex-mode "'" "'" :actions nil)
(sp-local-pair 'latex-mode "\"" "\"" :actions nil) After this, it works fine. For the |
Beta Was this translation helpful? Give feedback.
Hi. Unfortunatelly the
sp-tags
functionality was removed couple years ago and there is no replacement.For the
"
to be used as a trigger you must unbindTeX-insert-quote
because it does its own processing.Then you must disable
"
and'
pairs because they have special handling of string syntax and it messes things up. This is a latex compat issue.After this, it works fine. For the
\,
you can setup a post handler.