>From 9dd3ee94acdd57659ff9e99016d9657ab29c9bab Mon Sep 17 00:00:00 2001 From: Arash Date: Sat, 31 Jan 2015 20:15:20 +0100 Subject: [PATCH] Add new style currvita.el. * Makefile.in (STYLESRC): Add new style. * style/currvita.el: New file. --- ChangeLog | 6 ++++ Makefile.in | 2 +- style/currvita.el | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 style/currvita.el diff --git a/ChangeLog b/ChangeLog index dab2cad..7c73af6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-01-31 Arash Esbati + + * Makefile.in (STYLESRC): Add new style. + + * style/currvita.el: New file. + 2015-01-27 Tassilo Horn * tex.el (TeX-view-program-list-builtin): Remove "start" as diff --git a/Makefile.in b/Makefile.in index 39402e7..ceef32e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -143,7 +143,7 @@ STYLESRC = style/prosper.el \ style/luatextra.el style/erewhon.el style/baskervaldx.el \ style/fbb.el style/newtxmath.el style/newtxsf.el \ style/newtxtext.el style/newtxttt.el style/minted.el \ - style/wrapfig.el style/relsize.el + style/wrapfig.el style/relsize.el style/currvita.el STYLEELC = $(STYLESRC:.el=.elc) ifeq (@preview_enabled@,yes) diff --git a/style/currvita.el b/style/currvita.el new file mode 100644 index 0000000..f2a1d55 --- /dev/null +++ b/style/currvita.el @@ -0,0 +1,94 @@ +;;; currvita.el --- AUCTeX style for `currvita.sty' (v0.9i) + +;; Copyright (C) 2015 Free Software Foundation, Inc. + +;; Author: Arash Esbati +;; Maintainer: address@hidden +;; Created: 2015-01-05 +;; Keywords: tex + +;; This file is part of AUCTeX. + +;; AUCTeX is free software; you can redistribute it and/or modify it +;; under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; AUCTeX is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with AUCTeX; see the file COPYING. If not, write to the Free +;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +;; 02110-1301, USA. + +;;; Commentary: + +;; This file adds support for `currvita.sty' (v0.9i) from 1999/09/13. +;; `currvita.sty' is part of TeXLive. + +;;; Code: + +;; This is a modified version of `LaTeX-env-item'. +(defun LaTeX-currvita-env-with-label (env) + "Insert ENV, a mandatory label and the first item." + (LaTeX-insert-environment + env + (let ((heading (read-string "Heading of list: "))) + (format "{%s}" heading))) + (if (TeX-active-mark) + (progn + (LaTeX-find-matching-begin) + (end-of-line 1)) + (end-of-line 0)) + (delete-char 1) + (when (looking-at (concat "^[ \t]+$\\|" + "^[ \t]*" TeX-comment-start-regexp "+[ \t]*$")) + (delete-region (point) (line-end-position))) + (delete-horizontal-space) + ;; Deactivate the mark here in order to prevent `TeX-parse-macro' + ;; from swapping point and mark and the \item ending up right after + ;; \begin{...}. + (TeX-deactivate-mark) + (LaTeX-insert-item) + ;; The inserted \item may have outdented the first line to the + ;; right. Fill it, if appropriate. + (when (and (not (looking-at "$")) + (not (assoc environment LaTeX-indent-environment-list)) + (> (- (line-end-position) (line-beginning-position)) + (current-fill-column))) + (LaTeX-fill-paragraph nil))) + + +(TeX-add-style-hook + "currvita" + (lambda () + + ;; env's defined by currvita.sty + (LaTeX-add-environments + '("cv" "Heading of CV") + '("cvlist" LaTeX-currvita-env-with-label)) + + ;; Add "cvlist" to the list of environments which have an optional + ;; argument for each item + (add-to-list 'LaTeX-item-list '("cvlist" . LaTeX-item-argument)) + + ;; General commands: "\date" is already provided by AUCTeX + (TeX-add-symbols + '("cvplace" t) + '("cvheadingfont" 0) + '("cvlistheadingfont" 0) + '("cvlabelfont" 0) + '("cvbibname" 0)) + + ;; Add new lengths defined by currvita.sty + (LaTeX-add-lengths "cvlabelwidth" "cvlabelskip" "cvlabelsep")) + LaTeX-dialect) + +(defvar LaTeX-currvita-package-options + '("LabelsAligned" "TextAligned" "openbib" "ManyBibs" "NoDate") + "Package options for the currvita package.") + +;;; currvita.el ends here -- 2.2.2