Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Holzfeind, Daniel Georg
emacs-tools
Commits
4602553a
Commit
4602553a
authored
Mar 30, 2019
by
Holzfeind, Daniel Georg
💬
Browse files
auto bracket in LaTeX mode
parent
cd5fcd65
Changes
1
Show whitespace changes
Inline
Side-by-side
latex/fix-auto-bracket.el
0 → 100644
View file @
4602553a
;; Provides _{} and ^{} via _-_ and ^-^ in LaTeX Mode
;; source:
;; https://emacs.stackexchange.com/questions/7862/inserting-electric-braces-in-auctex
(
add-hook
'LaTeX-mode-hook
'fix-auto-bracket
)
(
defun
fix-auto-bracket
()
(
require
'tex-site
)
(
define-key
LaTeX-mode-map
"^"
(
lambda
()
(
interactive
)
(
if
(
equal
(
preceding-char
)
?^
)
(
progn
(
insert
"{}"
)(
backward-char
))
(
insert
"^"
))))
(
require
'tex-site
)
(
define-key
LaTeX-mode-map
"_"
(
lambda
()
(
interactive
)
(
if
(
equal
(
preceding-char
)
?_
)
(
progn
(
insert
"{}"
)(
backward-char
))
(
insert
"_"
)))))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment