Add function to convert tab-seperated values to LaTex tables
This commit is contained in:
parent
c490c1920e
commit
899461b5fc
@ -137,7 +137,17 @@
|
||||
(add-hook 'LaTeX-mode-hook
|
||||
(lambda () (local-set-key (kbd "C-z") 'my-tex)
|
||||
(local-set-key (kbd "C-c e") 'tex-close-latex-block)
|
||||
(TeX-source-correlate-mode))))
|
||||
(TeX-source-correlate-mode)))
|
||||
(defun latex-tsv-to-table ()
|
||||
"Converts tab-seperated-values to a LaTeX table."
|
||||
(interactive)
|
||||
(let ((beg (region-beginning)) (lines (count-lines (region-beginning) (region-end))))
|
||||
(save-excursion
|
||||
(goto-char beg)
|
||||
(indent-region beg (point))
|
||||
(replace-regexp "\t" " & " nil beg (point))
|
||||
(replace-regexp "$" " \\\\\\\\" nil beg (point))
|
||||
(align beg (point)))))
|
||||
(use-package fasd
|
||||
:config
|
||||
(global-set-key (kbd "C-x C-S-f") 'fasd-find-file)
|
||||
|
Loading…
Reference in New Issue
Block a user