Remove tabs

This commit is contained in:
Óscar Nájera 2019-02-02 16:48:03 +01:00
parent c3b43b361e
commit fbf6dd3a67
3 changed files with 91 additions and 91 deletions

View file

@ -34,11 +34,11 @@
;; Install a default set-up for altacv export. ;; Install a default set-up for altacv export.
(unless (assoc "altacv" org-latex-classes) (unless (assoc "altacv" org-latex-classes)
(add-to-list 'org-latex-classes (add-to-list 'org-latex-classes
'("altacv" '("altacv"
"\\documentclass{altacv}" "\\documentclass{altacv}"
("\\section{%s}" . "\\section*{%s}") ("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
;;; User-Configurable Variables ;;; User-Configurable Variables
@ -66,7 +66,7 @@
(:latex-title-command nil nil "\\begin{fullwidth}\n\\makecvheader\n\\end{fullwidth}") (:latex-title-command nil nil "\\begin{fullwidth}\n\\makecvheader\n\\end{fullwidth}")
) )
:translate-alist '((template . org-altacv-template) :translate-alist '((template . org-altacv-template)
(headline . org-altacv-headline))) (headline . org-altacv-headline)))
(defun colorconf () (defun colorconf ()
"puts color" "puts color"
@ -94,11 +94,11 @@
CONTENTS is the transcoded contents string. INFO is a plist CONTENTS is the transcoded contents string. INFO is a plist
holding export options." holding export options."
(let ((title (org-export-data (plist-get info :title) info)) (let ((title (org-export-data (plist-get info :title) info))
(spec (org-latex--format-spec info))) (spec (org-latex--format-spec info)))
(concat (concat
;; Time-stamp. ;; Time-stamp.
(and (plist-get info :time-stamp-file) (and (plist-get info :time-stamp-file)
(format-time-string "%% Created %Y-%m-%d %a %H:%M\n")) (format-time-string "%% Created %Y-%m-%d %a %H:%M\n"))
;; LaTeX compiler. ;; LaTeX compiler.
(org-latex--insert-compiler info) (org-latex--insert-compiler info)
;; Document class and packages. ;; Document class and packages.
@ -107,20 +107,20 @@ holding export options."
;; Possibly limit depth for headline numbering. ;; Possibly limit depth for headline numbering.
(let ((sec-num (plist-get info :section-numbers))) (let ((sec-num (plist-get info :section-numbers)))
(when (integerp sec-num) (when (integerp sec-num)
(format "\\setcounter{secnumdepth}{%d}\n" sec-num))) (format "\\setcounter{secnumdepth}{%d}\n" sec-num)))
;; Title and subtitle. ;; Title and subtitle.
(let* ((subtitle (plist-get info :subtitle)) (let* ((subtitle (plist-get info :subtitle))
(formatted-subtitle (formatted-subtitle
(when subtitle (when subtitle
(format (plist-get info :latex-subtitle-format) (format (plist-get info :latex-subtitle-format)
(org-export-data subtitle info)))) (org-export-data subtitle info))))
(separate (plist-get info :latex-subtitle-separate))) (separate (plist-get info :latex-subtitle-separate)))
(concat (concat
(format "\\tagline{%s%s}\n" title (format "\\tagline{%s%s}\n" title
(if separate "" (or formatted-subtitle ""))) (if separate "" (or formatted-subtitle "")))
(when (and separate subtitle) (when (and separate subtitle)
(concat formatted-subtitle "\n")))) (concat formatted-subtitle "\n"))))
;; Hyperref options. ;; Hyperref options.
(let ((template (plist-get info :latex-hyperref-template))) (let ((template (plist-get info :latex-hyperref-template)))
(and (stringp template) (and (stringp template)
@ -129,8 +129,8 @@ holding export options."
"\\begin{document}\n\n" "\\begin{document}\n\n"
;; Author. ;; Author.
(let ((author (and (plist-get info :with-author) (let ((author (and (plist-get info :with-author)
(let ((auth (plist-get info :author))) (let ((auth (plist-get info :author)))
(and auth (org-export-data auth info)))))) (and auth (org-export-data auth info))))))
(format "\\name{%s}\n" author)) (format "\\name{%s}\n" author))
;; photo ;; photo
(let ((photo (org-export-data (plist-get info :photo) info))) (let ((photo (org-export-data (plist-get info :photo) info)))
@ -144,7 +144,7 @@ holding export options."
(split-string address "\n") " -- ")))) (split-string address "\n") " -- "))))
;; email ;; email
(let ((email (and (plist-get info :with-email) (let ((email (and (plist-get info :with-email)
(org-export-data (plist-get info :email) info)))) (org-export-data (plist-get info :email) info))))
(when email (format "\\email{%s}\n" email))) (when email (format "\\email{%s}\n" email)))
;; phone ;; phone
(let ((mobile (org-export-data (plist-get info :mobile) info))) (let ((mobile (org-export-data (plist-get info :mobile) info)))
@ -153,33 +153,33 @@ holding export options."
(let ((homepage (org-export-data (plist-get info :homepage) info))) (let ((homepage (org-export-data (plist-get info :homepage) info)))
(when homepage (format "\\homepage{%s}\n" homepage))) (when homepage (format "\\homepage{%s}\n" homepage)))
(mapconcat (lambda (social-network) (mapconcat (lambda (social-network)
(let ((command (org-export-data (plist-get info (let ((command (org-export-data (plist-get info
(car social-network)) (car social-network))
info))) info)))
(and command (format "\\%s{%s}\n" (and command (format "\\%s{%s}\n"
(nth 1 social-network) (nth 1 social-network)
command)))) command))))
'((:github "github") '((:github "github")
(:gitlab "gitlab") (:gitlab "gitlab")
(:linkedin "linkedin")) (:linkedin "linkedin"))
"") "")
"}\n" "}\n"
;; Title command. ;; Title command.
(let* ((title-command (plist-get info :latex-title-command)) (let* ((title-command (plist-get info :latex-title-command))
(command (and (stringp title-command) (command (and (stringp title-command)
(format-spec title-command spec)))) (format-spec title-command spec))))
(org-element-normalize-string (org-element-normalize-string
(cond ((not (plist-get info :with-title)) nil) (cond ((not (plist-get info :with-title)) nil)
((string= "" title) nil) ((string= "" title) nil)
((not (stringp command)) nil) ((not (stringp command)) nil)
((string-match "\\(?:[^%]\\|^\\)%s" command) ((string-match "\\(?:[^%]\\|^\\)%s" command)
(format command title)) (format command title))
(t command)))) (t command))))
;; Document's body. ;; Document's body.
contents contents
;; Creator. ;; Creator.
(and (plist-get info :with-creator) (and (plist-get info :with-creator)
(concat (plist-get info :creator) "\n")) (concat (plist-get info :creator) "\n"))
;; Document end. ;; Document end.
"\\end{document}"))) "\\end{document}")))
@ -189,11 +189,11 @@ holding export options."
e.g. <2002-08-12 Mon> => Aug 2012" e.g. <2002-08-12 Mon> => Aug 2012"
(let* ((abbreviate 't) (let* ((abbreviate 't)
(dte (org-parse-time-string date_str)) (dte (org-parse-time-string date_str))
(month (nth 4 dte)) (month (nth 4 dte))
(year (nth 5 dte)));;'(02 07 2015))) (year (nth 5 dte)));;'(02 07 2015)))
(concat (calendar-month-name month abbreviate) (concat (calendar-month-name month abbreviate)
" " " "
(number-to-string year)))) (number-to-string year))))
(defun org-altacv--format-cventry (headline contents info) (defun org-altacv--format-cventry (headline contents info)
@ -222,7 +222,7 @@ CONTENTS is the contents of the headline. INFO is a plist used
as a communication channel." as a communication channel."
(unless (org-element-property :footnote-section-p headline) (unless (org-element-property :footnote-section-p headline)
(let ((environment (let ((env (org-element-property :CV_ENV headline))) (let ((environment (let ((env (org-element-property :CV_ENV headline)))
(or (org-string-nw-p env) "block")))) (or (org-string-nw-p env) "block"))))
(cond (cond
;; is a cv entry ;; is a cv entry
((equal environment "cventry") ((equal environment "cventry")

View file

@ -59,11 +59,11 @@
e.g. <2002-08-12 Mon> => Aug 2012" e.g. <2002-08-12 Mon> => Aug 2012"
(let* ((abbreviate 't) (let* ((abbreviate 't)
(dte (org-parse-time-string date_str)) (dte (org-parse-time-string date_str))
(month (nth 4 dte)) (month (nth 4 dte))
(year (nth 5 dte)));;'(02 07 2015))) (year (nth 5 dte)));;'(02 07 2015)))
(concat (calendar-month-name month abbreviate) (concat (calendar-month-name month abbreviate)
" " " "
(number-to-string year)))) (number-to-string year))))
(defun org-hugocv--format-cventry (headline contents info) (defun org-hugocv--format-cventry (headline contents info)
@ -103,7 +103,7 @@ CONTENTS is the contents of the headline. INFO is a plist used
as a communication channel." as a communication channel."
(unless (org-element-property :footnote-section-p headline) (unless (org-element-property :footnote-section-p headline)
(let ((environment (let ((env (org-element-property :CV_ENV headline))) (let ((environment (let ((env (org-element-property :CV_ENV headline)))
(or (org-string-nw-p env) "block")))) (or (org-string-nw-p env) "block"))))
(cond (cond
;; is a cv entry ;; is a cv entry
((equal environment "cventry") ((equal environment "cventry")

View file

@ -34,11 +34,11 @@
;; Install a default set-up for moderncv export. ;; Install a default set-up for moderncv export.
(unless (assoc "moderncv" org-latex-classes) (unless (assoc "moderncv" org-latex-classes)
(add-to-list 'org-latex-classes (add-to-list 'org-latex-classes
'("moderncv" '("moderncv"
"\\documentclass{moderncv}" "\\documentclass{moderncv}"
("\\section{%s}" . "\\section*{%s}") ("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")))) ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
;;; User-Configurable Variables ;;; User-Configurable Variables
@ -65,7 +65,7 @@
(:with-email nil "email" t t) (:with-email nil "email" t t)
) )
:translate-alist '((template . org-moderncv-template) :translate-alist '((template . org-moderncv-template)
(headline . org-moderncv-headline))) (headline . org-moderncv-headline)))
;;;; Template ;;;; Template
@ -78,11 +78,11 @@
CONTENTS is the transcoded contents string. INFO is a plist CONTENTS is the transcoded contents string. INFO is a plist
holding export options." holding export options."
(let ((title (org-export-data (plist-get info :title) info)) (let ((title (org-export-data (plist-get info :title) info))
(spec (org-latex--format-spec info))) (spec (org-latex--format-spec info)))
(concat (concat
;; Time-stamp. ;; Time-stamp.
(and (plist-get info :time-stamp-file) (and (plist-get info :time-stamp-file)
(format-time-string "%% Created %Y-%m-%d %a %H:%M\n")) (format-time-string "%% Created %Y-%m-%d %a %H:%M\n"))
;; LaTeX compiler. ;; LaTeX compiler.
(org-latex--insert-compiler info) (org-latex--insert-compiler info)
;; Document class and packages. ;; Document class and packages.
@ -96,18 +96,18 @@ holding export options."
;; Possibly limit depth for headline numbering. ;; Possibly limit depth for headline numbering.
(let ((sec-num (plist-get info :section-numbers))) (let ((sec-num (plist-get info :section-numbers)))
(when (integerp sec-num) (when (integerp sec-num)
(format "\\setcounter{secnumdepth}{%d}\n" sec-num))) (format "\\setcounter{secnumdepth}{%d}\n" sec-num)))
;; Author. ;; Author.
(let ((author (and (plist-get info :with-author) (let ((author (and (plist-get info :with-author)
(let ((auth (plist-get info :author))) (let ((auth (plist-get info :author)))
(and auth (org-export-data auth info)))))) (and auth (org-export-data auth info))))))
(format "\\name{%s}{}\n" author)) (format "\\name{%s}{}\n" author))
;; photo ;; photo
(let ((photo (org-export-data (plist-get info :photo) info))) (let ((photo (org-export-data (plist-get info :photo) info)))
(when (org-string-nw-p photo) (format "\\photo{%s}\n" photo))) (when (org-string-nw-p photo) (format "\\photo{%s}\n" photo)))
;; email ;; email
(let ((email (and (plist-get info :with-email) (let ((email (and (plist-get info :with-email)
(org-export-data (plist-get info :email) info)))) (org-export-data (plist-get info :email) info))))
(when email (format "\\email{%s}\n" email))) (when email (format "\\email{%s}\n" email)))
;; phone ;; phone
(let ((mobile (org-export-data (plist-get info :mobile) info))) (let ((mobile (org-export-data (plist-get info :mobile) info)))
@ -120,16 +120,16 @@ holding export options."
(when address (format "\\address%s\n" (mapconcat (lambda (line) (format "{%s}" line)) (when address (format "\\address%s\n" (mapconcat (lambda (line) (format "{%s}" line))
(split-string address "\n") "")))) (split-string address "\n") ""))))
(mapconcat (lambda (social-network) (mapconcat (lambda (social-network)
(let ((command (org-export-data (plist-get info (let ((command (org-export-data (plist-get info
(car social-network)) (car social-network))
info))) info)))
(and command (format "\\social[%s]{%s}\n" (and command (format "\\social[%s]{%s}\n"
(nth 1 social-network) (nth 1 social-network)
command)))) command))))
'((:github "github") '((:github "github")
(:gitlab "gitlab") (:gitlab "gitlab")
(:linkedin "linkedin")) (:linkedin "linkedin"))
"") "")
;; Date. ;; Date.
(let ((date (and (plist-get info :with-date) (org-export-get-date info)))) (let ((date (and (plist-get info :with-date) (org-export-get-date info))))
@ -137,16 +137,16 @@ holding export options."
;; Title and subtitle. ;; Title and subtitle.
(let* ((subtitle (plist-get info :subtitle)) (let* ((subtitle (plist-get info :subtitle))
(formatted-subtitle (formatted-subtitle
(when subtitle (when subtitle
(format (plist-get info :latex-subtitle-format) (format (plist-get info :latex-subtitle-format)
(org-export-data subtitle info)))) (org-export-data subtitle info))))
(separate (plist-get info :latex-subtitle-separate))) (separate (plist-get info :latex-subtitle-separate)))
(concat (concat
(format "\\title{%s%s}\n" title (format "\\title{%s%s}\n" title
(if separate "" (or formatted-subtitle ""))) (if separate "" (or formatted-subtitle "")))
(when (and separate subtitle) (when (and separate subtitle)
(concat formatted-subtitle "\n")))) (concat formatted-subtitle "\n"))))
;; Hyperref options. ;; Hyperref options.
(let ((template (plist-get info :latex-hyperref-template))) (let ((template (plist-get info :latex-hyperref-template)))
(and (stringp template) (and (stringp template)
@ -158,17 +158,17 @@ holding export options."
(command (and (stringp title-command) (command (and (stringp title-command)
(format-spec title-command spec)))) (format-spec title-command spec))))
(org-element-normalize-string (org-element-normalize-string
(cond ((not (plist-get info :with-title)) nil) (cond ((not (plist-get info :with-title)) nil)
((string= "" title) nil) ((string= "" title) nil)
((not (stringp command)) nil) ((not (stringp command)) nil)
((string-match "\\(?:[^%]\\|^\\)%s" command) ((string-match "\\(?:[^%]\\|^\\)%s" command)
(format command title)) (format command title))
(t command)))) (t command))))
;; Document's body. ;; Document's body.
contents contents
;; Creator. ;; Creator.
(and (plist-get info :with-creator) (and (plist-get info :with-creator)
(concat (plist-get info :creator) "\n")) (concat (plist-get info :creator) "\n"))
;; Document end. ;; Document end.
"\\end{document}"))) "\\end{document}")))
@ -178,11 +178,11 @@ holding export options."
e.g. <2002-08-12 Mon> => Aug 2012" e.g. <2002-08-12 Mon> => Aug 2012"
(let* ((abbreviate 't) (let* ((abbreviate 't)
(dte (org-parse-time-string date_str)) (dte (org-parse-time-string date_str))
(month (nth 4 dte)) (month (nth 4 dte))
(year (nth 5 dte)));;'(02 07 2015))) (year (nth 5 dte)));;'(02 07 2015)))
(concat (calendar-month-name month abbreviate) (concat (calendar-month-name month abbreviate)
" " " "
(number-to-string year)))) (number-to-string year))))
(defun org-moderncv--format-cventry (headline contents info) (defun org-moderncv--format-cventry (headline contents info)
@ -209,7 +209,7 @@ CONTENTS is the contents of the headline. INFO is a plist used
as a communication channel." as a communication channel."
(unless (org-element-property :footnote-section-p headline) (unless (org-element-property :footnote-section-p headline)
(let ((environment (let ((env (org-element-property :CV_ENV headline))) (let ((environment (let ((env (org-element-property :CV_ENV headline)))
(or (org-string-nw-p env) "block")))) (or (org-string-nw-p env) "block"))))
(cond (cond
;; is a cv entry ;; is a cv entry
((equal environment "cventry") ((equal environment "cventry")