Created
September 17, 2015 18:03
-
-
Save pr00thmatic/ea3a6b56b8483635bf47 to your computer and use it in GitHub Desktop.
si por alguna extraña razón quieres copiar cosas de un pdf a un .tex, esto es para tí!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun purge-pdf () | |
(interactive) | |
(progn | |
(goto-char 1) | |
;; párrafos a salto auxiliar | |
(while (search-forward-regexp "\\([.\)]\\)\\($\\)\\([^\-]\\)" nil t) | |
(goto-char (match-end 0)) | |
(insert "ZOMGZALIENZ")) | |
;; saltos dentro del párrafo | |
(goto-char 1) | |
(while (search-forward-regexp "\\($\\)\\([^$]\\)" nil t) | |
(replace-match " ")) | |
;; salto auxiliar a doble salto | |
(goto-char 1) | |
(while (search-forward "ZOMGZALIENZ" nil t) (replace-match "\n\n")) | |
;; vocales y eñes | |
(goto-char 1) | |
(while (search-forward-regexp " ́\\(\s\\)?a" nil t) (replace-match "á")) | |
(goto-char 1) | |
(while (search-forward-regexp " ́\\(\s\\)?e" nil t) (replace-match "é")) | |
(goto-char 1) | |
(while (search-forward-regexp " ́\\(\s\\)?ı" nil t) (replace-match "í")) | |
(goto-char 1) | |
(while (search-forward-regexp " ́\\(\s\\)?o" nil t) (replace-match "ó")) | |
(goto-char 1) | |
(while (search-forward-regexp " ́\\(\s\\)?u" nil t) (replace-match "ú")) | |
(goto-char 1) | |
(while (search-forward-regexp " ̃\\(\s\\)?n" nil t) (replace-match "ñ")) | |
;; comillas feas, a comillas latex | |
(goto-char 1) | |
(while (search-forward "“" nil t) (replace-match "``")) | |
(goto-char 1) | |
(while (search-forward "”" nil t) (replace-match "''")) | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment