auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] GNU AUCTeX branch, master, updated. 225badee0ec3f169a1a87


From: Arash Esbati
Subject: [AUCTeX-diffs] GNU AUCTeX branch, master, updated. 225badee0ec3f169a1a87227fce14cb5b326d054
Date: Thu, 29 Dec 2016 08:24:48 +0000 (UTC)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  225badee0ec3f169a1a87227fce14cb5b326d054 (commit)
       via  1de2359a3dda4488c714ced5d801b5f14143db32 (commit)
       via  5ddbd048163fd1b0c19fc09320aeac1dc3bf2cfe (commit)
       via  bdc5d0d13e2ba257fc9a597eb236cc42f81cb110 (commit)
       via  a943b6ceac9612d6b602e4268bbfce7970fbc34d (commit)
       via  74c5ac9f28ed789998d6f3c0939718e83882b042 (commit)
       via  ec3996d7ff1d9e0f2a404a74f1f6305c6e1a9e5b (commit)
       via  a55b66ddaeaf59590db6a1c3198cfbc56b6360d8 (commit)
      from  8186490a25d2e3ab2affe0a8e1f048aa1a92ce2d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 225badee0ec3f169a1a87227fce14cb5b326d054
Author: Arash Esbati <address@hidden>
Date:   Thu Dec 29 09:22:13 2016 +0100

    Add new style/titletoc.el
    
    * style/titletoc.el: New file.
    
    * Makefile.in (STYLESRC): Add new style.

diff --git a/Makefile.in b/Makefile.in
index 5a4aea4..1efcdd1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -160,7 +160,7 @@ STYLESRC = style/prosper.el \
           style/bidi.el      style/FiraMono.el  style/FiraSans.el \
           style/bicaption.el style/amsfonts.el  style/subfiles.el \
           style/dcolumn.el   style/mdframed.el  style/tcolorboxlib-raster.el \
-          style/titleps.el   style/titlesec.el
+          style/titleps.el   style/titlesec.el  style/titletoc.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/titletoc.el b/style/titletoc.el
new file mode 100644
index 0000000..5cad560
--- /dev/null
+++ b/style/titletoc.el
@@ -0,0 +1,206 @@
+;;; titletoc.el --- AUCTeX style for `titletoc.sty' (v1.6)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash.esbati'at'gmail.com>
+;; Maintainer: address@hidden
+;; Created: 2015-09-19
+;; 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 `titletoc.sty' (v1.6) from
+;; 2011/12/15.  `titletoc.sty' is part of TeXLive.
+
+;;; Code:
+
+(defvar LaTeX-titletoc-section-command-list
+  '("part"
+    "chapter"
+    "section"
+    "subsection"
+    "subsubsection"
+    "paragraph"
+    "subparagraph"
+    "figure"
+    "table")
+  "List of sectioning commands available in \"titletoc.sty\".
+Other environments producing a \"Table of ENVIRONMENT\" (figure,
+table) are also available in this variable.")
+
+(defun LaTeX-titletoc-section-command-list ()
+  "Remove \"chapter\" from variable
+`LaTeX-titletoc-section-command-list' and return the remainder.
+Removal is based on the return value of function
+`LaTeX-largest-level'."
+  (if (< (LaTeX-largest-level) 2)
+      (symbol-value 'LaTeX-titletoc-section-command-list)
+    (remove "chapter" LaTeX-titletoc-section-command-list)))
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+;; Setup for \contentsuse:
+(TeX-auto-add-type "titletoc-contentsuse" "LaTeX")
+
+(defvar LaTeX-titletoc-contentsuse-regexp
+  '("\\\\contentsuse{\\([^}]+\\)}"
+    1 LaTeX-auto-titletoc-contentsuse)
+  "Matches the argument of \\contentsuse from titletoc package.")
+
+(defun LaTeX-titletoc-auto-prepare ()
+  "Clear `LaTeX-auto-titletoc-contentsuse' before parsing."
+  (setq LaTeX-auto-titletoc-contentsuse nil))
+
+(defun LaTeX-titletoc-auto-cleanup ()
+  "Move parsed arguments of \"\\contentsuse\" to the variable
+`LaTeX-titletoc-section-command-list'."
+  (when (LaTeX-titletoc-contentsuse-list)
+    (make-local-variable 'LaTeX-titletoc-section-command-list)
+    (dolist (content (mapcar #'car (LaTeX-titletoc-contentsuse-list)))
+      (add-to-list 'LaTeX-titletoc-section-command-list content))))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-titletoc-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-titletoc-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(TeX-add-style-hook
+ "titletoc"
+ (lambda ()
+
+   ;; Add titletoc to the parser
+   (TeX-auto-add-regexp LaTeX-titletoc-contentsuse-regexp)
+
+   (TeX-add-symbols
+    ;; Basic macros
+    ;; \dottedcontents{<section>}[<left>]{<above-code>}
+    ;;                {<label width>}{<leader width>}
+    '("dottedcontents"
+      (TeX-arg-eval completing-read
+                    (TeX-argument-prompt optional nil "Sectioning command")
+                    (LaTeX-titletoc-section-command-list))
+      [ TeX-arg-eval
+       (lambda ()
+         (let ((length (TeX-read-string
+                        (TeX-argument-prompt nil nil "Left margin"))))
+           (format "%s" length))) ]
+      3)
+
+    ;; \titlecontents{<section>}[<left>]{<above-code>}
+    ;;               {<numbered-entry-format>}{<numberless-entry-format>}
+    ;;               {<filler-page-format>}[<below-code>]
+    '("titlecontents"
+      (TeX-arg-eval completing-read
+                    (TeX-argument-prompt optional nil "Sectioning command")
+                    (LaTeX-titletoc-section-command-list))
+      [ TeX-arg-eval
+       (lambda ()
+         (let ((length (TeX-read-string
+                        (TeX-argument-prompt nil nil "Left margin"))))
+           (format "%s" length))) ]
+      (TeX-arg-conditional (y-or-n-p "With optional below code argument? ")
+                          (4 [nil])
+                        (4)))
+
+    ;; \titlecontents*{<section>}[<left>]{<above-code>}
+    ;;                {<numbered-entry-format>}{<numberless-entry-format>}
+    ;;                {<filler-page-format>}[<separator>]
+    '("titlecontents*"
+      (TeX-arg-eval completing-read
+                    (TeX-argument-prompt optional nil "Sectioning command")
+                    (LaTeX-titletoc-section-command-list))
+      [ TeX-arg-eval
+       (lambda ()
+         (let ((length (TeX-read-string
+                        (TeX-argument-prompt nil nil "Left margin"))))
+           (format "%s" length))) ]
+      (TeX-arg-conditional (y-or-n-p "With optional separator argument? ")
+                          (4 [nil])
+                        (4)))
+
+    ;; \contentsmargin[<correction>]{<right>}
+    '("contentsmargin" [ "Correction" ] "Right margin")
+
+    '("thecontentslabel" 0)
+
+    '("thecontentspage" 0)
+
+    '("contentslabel" [ "Format" ] (TeX-arg-length "Space"))
+
+    '("contentspage" [ "Format" ])
+
+    '("contentspush" t)
+
+    ;; Check if newfloat.el is loaded and any new environment is
+    ;; defined with it.  titletoc.sty can also be used to customize
+    ;; new environments defined with newfloat.sty.  As a prerequisite,
+    ;; the environments must be introduced to titletoc.sty with
+    ;; \contentuse{ENV} and then can be used as argument to \titlecontents.
+    '("contentsuse"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((name (if (and (member "newfloat" (TeX-active-styles))
+                             (LaTeX-newfloat-DeclareFloatingEnvironment-list))
+                        (completing-read
+                         (TeX-argument-prompt optional nil "Name of contents")
+                         (mapcar #'car
+                                 
(LaTeX-newfloat-DeclareFloatingEnvironment-list)))
+                      (TeX-read-string
+                       (TeX-argument-prompt optional nil "Name of 
contents")))))
+          (make-local-variable 'LaTeX-titletoc-section-command-list)
+          (add-to-list 'LaTeX-titletoc-section-command-list name)
+          (format "%s" name))))
+      "File extension")
+
+    ;; 6.3. Partial TOC's
+    '("startcontents" [ "Name" ])
+
+    '("stopcontents" [ "Name" ])
+
+    '("resumecontents" [ "Name" ])
+
+    '("printcontents" [ "Name" ] "Prefix" "Start level" t)
+
+    ;; 6.4. Partial lists
+    '("startlist" [ "Name" ] "List")
+
+    '("stoplist" [ "Name" ] "List")
+
+    '("resumelist" [ "Name" ] "List")
+
+    '("printlist" [ "Name" ] "Prefix" t) )
+
+   ;; Fontification: We only add macros which are used at top level;
+   ;; most of macros definded above are intended to be used in
+   ;; arguments of \dottedcontents or \titlecontents
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("dottedcontents"  "{[{{{")
+                               ("titlecontents"   "*{[{{{[[[")
+                               ("contentsmargin"  "[{")
+                               ("contentsuse"     "{{"))
+                             'function)) )
+ LaTeX-dialect)
+
+(defvar LaTeX-titletoc-package-options
+  '("leftlabels" "rightlabels" "dotinlabels")
+  "Package options for the titletoc package.")
+
+;;; titletoc.el ends here

commit 1de2359a3dda4488c714ced5d801b5f14143db32
Author: Arash Esbati <address@hidden>
Date:   Thu Dec 29 09:20:13 2016 +0100

    Add new style/titlesec.el
    
    * Makefile.in (STYLESRC): Add new style.
    
    * style/titlesec.el: New file.

diff --git a/Makefile.in b/Makefile.in
index 35d7753..5a4aea4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -160,7 +160,7 @@ STYLESRC = style/prosper.el \
           style/bidi.el      style/FiraMono.el  style/FiraSans.el \
           style/bicaption.el style/amsfonts.el  style/subfiles.el \
           style/dcolumn.el   style/mdframed.el  style/tcolorboxlib-raster.el \
-          style/titleps.el
+          style/titleps.el   style/titlesec.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/titlesec.el b/style/titlesec.el
new file mode 100644
index 0000000..c17d8bb
--- /dev/null
+++ b/style/titlesec.el
@@ -0,0 +1,255 @@
+;;; titlesec.el --- AUCTeX style for `titlesec.sty' (v2.10.0)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash.esbati'at'gmail.com>
+;; Maintainer: address@hidden
+;; Created: 2015-09-19
+;; 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 `titlesec.sty' (v2.10.0) from
+;; 2011/12/15.  `titlesec.sty' is part of TeXLive.
+
+;;; Code:
+
+(defvar LaTeX-titlesec-key-val-options
+  '(("page" ("even" "odd"))
+    ("numberless"))
+  "Key=value options for \"\\titleformat\" and \"\\titlespacing\"
+macros provided by \"titlesec.sty\".")
+
+(defvar LaTeX-titlesec-section-command-list
+  '("part"
+    "chapter"
+    "section"
+    "subsection"
+    "subsubsection"
+    "paragraph"
+    "subparagraph")
+  "List of sectioning commands available in \"titlesec.sty\".")
+
+(defvar LaTeX-titlesec-section-shape-list
+  '("hang"
+    "block"
+    "display"
+    "runin"
+    "leftmargin"
+    "rightmargin"
+    "drop"
+    "wrap"
+    "frame")
+  "List of sectioning shapes available for \"\\titleformat\" command.")
+
+(defun LaTeX-titlesec-section-command-list ()
+  "Remove \"chapter\" from variable
+`LaTeX-titlesec-section-command-list' and return the remainder.
+Removal is based on the return value of function
+`LaTeX-largest-level'.  Items returned are prefixed with
+`TeX-esc'."
+  (mapcar (lambda (elt) (concat TeX-esc elt))
+         (if (< (LaTeX-largest-level) 2)
+             (symbol-value 'LaTeX-titlesec-section-command-list)
+           (remove "chapter" LaTeX-titlesec-section-command-list))))
+
+(defun LaTeX-arg-titlesec-titlespec (optional)
+  "Insert the first argument of \"\\titleformat\" and \"\\titlespacing\".
+Depending on returned value of function `LaTeX-largest-level',
+append a \"name\" key with corresponding values to
+`LaTeX-titlesec-key-val-options'.  The values are retrieved from
+`LaTeX-titlesec-section-command-list'.  The values of this list
+are also added stand-alone as keys.  If OPTIONAL is non-nil,
+insert the argument in brackets."
+  (let ((keyvals
+        (TeX-read-key-val
+         optional
+         (append
+          `(("name"
+             ,(mapcar (lambda (elt) (concat TeX-esc elt))
+                      (if (< (LaTeX-largest-level) 2)
+                          (symbol-value 'LaTeX-titlesec-section-command-list)
+                        (remove "chapter" 
LaTeX-titlesec-section-command-list)))))
+          (mapcar #'list
+                  (mapcar (lambda (elt) (concat TeX-esc elt))
+                          (if (< (LaTeX-largest-level) 2)
+                              (symbol-value 
'LaTeX-titlesec-section-command-list)
+                            (remove "chapter" 
LaTeX-titlesec-section-command-list))))
+          LaTeX-titlesec-key-val-options)
+         "Sectioning command")))
+    (TeX-argument-insert keyvals optional)))
+
+(TeX-add-style-hook
+ "titlesec"
+ (lambda ()
+
+   ;; Load "titleps.el" when "pagestyles" package option is given
+   (when (LaTeX-provided-package-options-member "titlesec" "pagestyles")
+     (TeX-run-style-hooks "titleps"))
+
+   (TeX-add-symbols
+    ;; 2.4. Tools
+    '("titlelabel" t)
+
+    ;; \titleformat*{<command>}{<format>}
+    '("titleformat*" (LaTeX-arg-titlesec-titlespec) t)
+
+    ;; 3. Advanced Interface
+    ;; 
\titleformat{<command>}[<shape>]{<format>}{<label>}{<sep>}{<before-code>}[<after-code>]
+    '("titleformat"
+      (LaTeX-arg-titlesec-titlespec)
+      [TeX-arg-eval completing-read
+                    (TeX-argument-prompt optional nil "Shape")
+                    LaTeX-titlesec-section-shape-list]
+      (TeX-arg-conditional (y-or-n-p "With optional after-code? ")
+                          (4 [nil])
+                        (4)))
+
+    '("chaptertitlename" 0)
+
+    ;; 3.2. Spacing
+    ;; \titlespacing{<command>}{<left>}{<before-sep>}{<after-sep>}[<right-sep>]
+    '("titlespacing"
+      (LaTeX-arg-titlesec-titlespec)
+      (TeX-arg-length "Left margin")
+      (TeX-arg-length "Before vertical space")
+      (TeX-arg-length "Space between title and text")
+      [TeX-arg-length "Right margin"])
+
+    '("titlespacing*"
+      (LaTeX-arg-titlesec-titlespec)
+      (TeX-arg-length "Left margin")
+      (TeX-arg-length "Before vertical space")
+      (TeX-arg-length "Space between title and text")
+      [TeX-arg-length "Right margin"])
+
+    ;; 3.3. Spacing related tools
+    '("filright"  0)
+    '("filcenter" 0)
+    '("filleft"          0)
+    '("fillast"   0)
+    '("filinner"  0)
+    '("filouter"  0)
+    '("wordsep"          0)
+
+    ;; 3.4. Rules
+    '("titleline"
+      [TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Alignment")
+                   '("l" "r" "c")]
+      t)
+
+    '("titlerule" [TeX-arg-length "Rule height"])
+
+    '("titlerule*" [TeX-arg-length "Box width"] "Text")
+
+    '("iftitlemeasuring" 2)
+
+    ;; 3.5. Page styles
+    '("assignpagestyle"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Sectioning command")
+                   (LaTeX-titlesec-section-command-list))
+      (TeX-arg-pagestyle))
+
+    ;; 3.9. Creating new levels and changing the class
+    '("titleclass"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Sectioning command")
+                   (LaTeX-titlesec-section-command-list))
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Class")
+                   '("page" "top" "straight"))
+      [TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Super level command")
+                   (LaTeX-titlesec-section-command-list)]) )
+
+   ;; 3.4. Rules: A variant of \titleline to be used only with calcwidth
+   (when (LaTeX-provided-package-options-member "titlesec" "calcwidth")
+     (TeX-add-symbols
+      '("titleline*"
+       (TeX-arg-eval completing-read
+                     (TeX-argument-prompt optional nil "Alignment")
+                     '("l" "r" "c"))
+       t)))
+
+   ;; The length of the longest line is returned in \titlewidth
+   (LaTeX-add-lengths "titlewidth"
+                     "titlewidthlast"
+                     "titlewidthfirst")
+
+   ;; Fontification: We only add macros which are used at top level;
+   ;; most of macros definded above are intended to be used in
+   ;; arguments of \titleformat
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("titlelabel"        "{")
+                               ;;
+                               ;; \titleformat comes in 2 flavors:
+                               ;; with *, it takes only 2 mandatory
+                               ;; argument; w/o *, a lot more.  It is
+                               ;; not (yet) possible to realize this
+                               ;; behaviour within font-latex.  Hence
+                               ;; we reduce the fontification to the
+                               ;; first 2 mandatory arguments and
+                               ;; ignore the rest.  *[ are optional anyway.
+                               ("titleformat"       "*{[{")
+                               ("titlespacing"      "*{{{{[")
+                               ("iftitlemeasuring"  "{{")
+                               ("assignpagestyle"   "{{")
+                               ("titleclass"        "{[{["))
+                             'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-titlesec-package-options
+  '(;; 2.1. Format
+    "rm" "sf" "tt" "md" "bf" "up" "it" "sl" "sc"
+    "big" "medium" "small" "tiny"
+    "raggedleft" "center" "raggedright"
+
+    ;; 2.2. Spacing
+    "compact"
+
+    ;; 2.3. Uppercase
+    "uppercase"
+
+    ;; 3.3. Spacing related tools
+    "indentafter"   "noindentafter"
+    "rigidchapters" "rubberchapters"
+    "bottomtitles"  "nobottomtitles" "nobottomtitles*"
+    "aftersep"      "largestsep"     "pageatnewline"
+
+    ;; 3.4. Rules
+    "calcwidth"
+
+    ;; 3.7. Other Package Options
+    "explicit"
+    "newparttoc"
+    "oldparttoc"
+    "clearempty"
+    "toctitles"
+    "newlinetospace"
+    "loadonly"
+
+    ;; 5. titleps and Page Styles
+    "pagestyles")
+  "Package options for the titlesec package.")
+
+;;; titlesec.el ends here

commit 5ddbd048163fd1b0c19fc09320aeac1dc3bf2cfe
Author: Arash Esbati <address@hidden>
Date:   Thu Dec 29 09:16:18 2016 +0100

    Add new style/titleps.el
    
    * Makefile.in (STYLESRC): Add new style.
    
    * style/titleps.el: New file.

diff --git a/Makefile.in b/Makefile.in
index 0db7ff1..35d7753 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -159,7 +159,8 @@ STYLESRC = style/prosper.el \
           style/framed.el    style/paracol.el   style/menukeys.el \
           style/bidi.el      style/FiraMono.el  style/FiraSans.el \
           style/bicaption.el style/amsfonts.el  style/subfiles.el \
-          style/dcolumn.el   style/mdframed.el  style/tcolorboxlib-raster.el
+          style/dcolumn.el   style/mdframed.el  style/tcolorboxlib-raster.el \
+          style/titleps.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/titleps.el b/style/titleps.el
new file mode 100644
index 0000000..8ef46a8
--- /dev/null
+++ b/style/titleps.el
@@ -0,0 +1,233 @@
+;;; titleps.el --- AUCTeX style for `titleps.sty' (v1.1.1)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash.esbati'at'gmail.com>
+;; Maintainer: address@hidden
+;; Created: 2016-06-22
+;; 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 `titleps.sty' (v1.1.1) from 2016/03/15.
+;; `titleps.sty' is part of TeXLive.
+
+;;; Code:
+
+(defvar LaTeX-titleps-section-command-list
+  '("part"
+    "chapter"
+    "section"
+    "subsection"
+    "subsubsection"
+    "paragraph"
+    "subparagraph")
+  "List of sectioning commands available in \"titleps.sty\".")
+
+(defun LaTeX-titleps-section-command-list ()
+  "Remove \"chapter\" from variable
+`LaTeX-titleps-section-command-list' and return the remainder.
+Removal is based on the return value of function
+`LaTeX-largest-level'."
+  (if (< (LaTeX-largest-level) 2)
+      (symbol-value 'LaTeX-titleps-section-command-list)
+    (remove "chapter" LaTeX-titleps-section-command-list)))
+
+(defvar LaTeX-titleps-newpagestyle-regexp
+  '("\\\\newpagestyle[ \t\n\r%]*{\\([^}]+\\)}" 1 LaTeX-auto-pagestyle)
+  "Match the argument of \"\\newpagestyle\" from titleps.sty.")
+
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(TeX-add-style-hook
+ "titleps"
+ (lambda ()
+
+   ;; Add titleps to the parser.
+   (TeX-auto-add-regexp LaTeX-titleps-newpagestyle-regexp)
+
+   ;; Add \<section>title's
+   (dolist (sec (LaTeX-titleps-section-command-list))
+     (TeX-add-symbols `(,(concat sec "title") 0)))
+
+   (TeX-add-symbols
+   ;; 2. Defining Page Styles
+    '("newpagestyle"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((ps (TeX-read-string
+                   (TeX-argument-prompt optional nil "Page style"))))
+          (LaTeX-add-pagestyles ps)
+          (format "%s" ps))))
+      (TeX-arg-conditional (y-or-n-p "With optional global style? ")
+                          ( [ t ] nil)
+                        ( t )))
+
+    '("renewpagestyle" TeX-arg-pagestyle
+      (TeX-arg-conditional (y-or-n-p "With optional global style? ")
+                          ( [ t ] nil)
+                        ( t )))
+
+    '("sethead"
+      (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
+                          ( [ 3 ] nil nil nil)
+                        ( 3 )))
+
+    '("setfoot"
+      (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
+                          ( [ 3 ] nil nil nil)
+                        ( 3 )))
+
+    '("sethead*" 3)
+    '("setfoot*" 3)
+
+    '("settitlemarks"
+      (TeX-arg-eval mapconcat #'identity
+                   (TeX-completing-read-multiple
+                    (TeX-argument-prompt optional nil "Level names")
+                    (LaTeX-titleps-section-command-list))
+                   ","))
+
+    '("settitlemarks"
+      (TeX-arg-eval mapconcat #'identity
+                   (TeX-completing-read-multiple
+                    (TeX-argument-prompt optional nil "Level names")
+                    (LaTeX-titleps-section-command-list))
+                   ","))
+
+    '("headrule" 0)
+    '("setheadrule" "Thickness")
+
+    '("footrule" 0)
+    '("setfootrule" "Thickness")
+
+    '("makeheadrule" 0)
+    '("makefootrule" 0)
+
+    ;; 3. On \markboth and \markleft
+    '("setmarkboth" t)
+    '("resetmarkboth" 0)
+
+    ;; 4. Headline/footline width
+    '("widenhead"
+      (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
+                          ( [ 2 ] nil nil)
+                        ( 2 )))
+
+    '("widenhead*" 2)
+
+    '("TitlepsPatchSection"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Sectioning command")
+                   (LaTeX-titleps-section-command-list)))
+
+    '("TitlepsPatchSection*"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Sectioning command")
+                   (LaTeX-titleps-section-command-list)))
+
+    ;; 5. Marks
+    '("bottitlemarks"     0)
+    '("toptitlemarks"     0)
+    '("firsttitlemarks"          0)
+    '("nexttoptitlemarks" 0)
+    '("outertitlemarks"   0)
+    '("innertitlemarks"   0)
+
+    '("newtitlemark" (TeX-arg-macro "Command name"))
+    '("newtitlemark*" (TeX-arg-counter "Variable name"))
+
+    '("pretitlemark"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Sectioning command")
+                   (LaTeX-titleps-section-command-list))
+      "Text")
+
+    '("pretitlemark*"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Sectioning command")
+                   (LaTeX-titleps-section-command-list))
+      "Text")
+
+    '("ifsamemark"
+      (TeX-arg-macro "Marks group: \\")
+      (TeX-arg-macro "Command: \\")
+      2)
+
+    ;; 6. Running heads with floats
+    '("setfloathead"
+      (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
+                          ( [ 3 ] nil nil nil nil [ nil ] )
+                        ( 4 [ nil ] )))
+
+    '("setfloatfoot"
+      (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
+                          ( [ 3 ] nil nil nil nil [ nil ] )
+                        ( 4 [ nil ] )))
+
+    '("setfloathead*" 4 [ nil ] )
+    '("setfloatfoot*" 4 [ nil ] )
+
+    '("nextfloathead"
+      (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
+                          ( [ 3 ] nil nil nil nil [ nil ] )
+                        ( 4 [ nil ] )))
+
+    '("nextfloatfoot"
+      (TeX-arg-conditional (y-or-n-p "With optional even pages? ")
+                          ( [ 3 ] nil nil nil nil [ nil ] )
+                        ( 4 [ nil ] )))
+
+    '("nextfloathead*" 4 [ nil ] )
+    '("nextfloatfoot*" 4 [ nil ] )
+
+    ;; 7. Extra marks: I'm not clear how the marks commands work;
+    ;; until then, I ignore them
+    )
+
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("newpagestyle"         "{[{")
+                               ("renewpagestyle"       "{[{")
+                               ("settitlemarks"        "*{")
+                               ("widenhead"            "*[[{{")
+                               ("TitlepsPatchSection"  "*{")
+                               ("newtitlemark"         "*{")
+                               ("pretitlemark"         "*{{")
+                               ("nextfloathead"        "*[[[{{{{[")
+                               ("nextfloatfoot"        "*[[[{{{{["))
+                             'function)))
+ LaTeX-dialect)
+
+(defvar LaTeX-titleps-package-options
+  '(;; 4. Headline/footline width
+    "nopatches"
+
+    ;; 5. Marks
+    "outermarks" "innermarks" "topmarks" "botmarks"
+
+    ;; 6. Running heads with floats
+    "psfloats"
+
+    ;; 7. Extra marks
+    "extramarks")
+  "Package options for the titleps package.")
+
+;;; titleps.el ends here

commit bdc5d0d13e2ba257fc9a597eb236cc42f81cb110
Author: Arash Esbati <address@hidden>
Date:   Thu Dec 29 09:14:10 2016 +0100

    Add new style/mdframed.el
    
    * Makefile.in (STYLESRC): Add new style.
    
    * style/mdframed.el: New file.

diff --git a/Makefile.in b/Makefile.in
index 1ca078d..0db7ff1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -159,7 +159,7 @@ STYLESRC = style/prosper.el \
           style/framed.el    style/paracol.el   style/menukeys.el \
           style/bidi.el      style/FiraMono.el  style/FiraSans.el \
           style/bicaption.el style/amsfonts.el  style/subfiles.el \
-          style/dcolumn.el   style/tcolorboxlib-raster.el
+          style/dcolumn.el   style/mdframed.el  style/tcolorboxlib-raster.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/mdframed.el b/style/mdframed.el
new file mode 100644
index 0000000..c55bd52
--- /dev/null
+++ b/style/mdframed.el
@@ -0,0 +1,421 @@
+;;; mdframed.el --- AUCTeX style for `mdframed.sty' (v1.9b)
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash.esbati'at'gmail.com>
+;; Maintainer: address@hidden
+;; Created: 2016-06-26
+;; 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 `mdframed.sty' (v1.9b) from 2013/07/01.
+;; `mdframed.sty' is part of TeXLive.
+
+;; This style offers only a set of mandatory options for completion
+;; while loading the package
+;; (cf. `LaTeX-mdframed-package-options-list').  All other options are
+;; offered for completion as part of `\mdfsetup'.  Please use this
+;; command to set options of the package.
+
+;;; Code:
+
+;; Needed for compiling `pushnew':
+(eval-when-compile (require 'cl))
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+(defvar LaTeX-mdframed-key-val-options
+  '(;; 6.2. Restoring the settings
+    ("style" ("defaultoptions"))
+    ("default")
+    ;; 6.3. Options with lengths
+    ("defaultunit" ("pt" "pc" "in" "bp" "cm" "mm" "dd" "cc" "sp" "ex" "em"))
+    ("skipabove")
+    ("skipbelow")
+    ("leftmargin")
+    ("rightmargin")
+    ("innerleftmargin")
+    ("innerrightmargin")
+    ("innertopmargin")
+    ("innerbottommargin")
+    ("linewidth")
+    ("innerlinewidth")
+    ("middlelinewidth")
+    ("outerlinewidth")
+    ("roundcorner")
+    ;; 6.4. Colored Options
+    ("linecolor")
+    ("innerlinecolor")
+    ("middlelinecolor")
+    ("outerlinecolor")
+    ("backgroundcolor")
+    ("fontcolor")
+    ("font")
+    ;; 6.5. Shadows
+    ("shadowsize")
+    ("shadowcolor")
+    ;; 6.6. Hidden Lines
+    ("topline" ("true" "false"))
+    ("rightline" ("true" "false"))
+    ("leftline" ("true" "false"))
+    ("bottomline" ("true" "false"))
+    ("hidealllines" ("true" "false"))
+    ;; 6.7. Working in twoside-mode
+    ("outermargin")
+    ("innermargin")
+    ("usetwoside" ("true" "false"))
+    ;; 6.8. Footnotes
+    ("footnotedistance")
+    ("footnoteinside" ("true" "false"))
+    ;; 6.9. Page breaks
+    ("nobreak" ("true" "false"))
+    ("everyline" ("true" "false"))
+    ("splittopskip")
+    ("splitbottomskip")
+    ;; 6.10. Frametitle
+    ("frametitle")
+    ("frametitlefont")
+    ("frametitlealignment" ("\\raggedleft" "\\raggedright" "\\centering"))
+    ("frametitlerule" ("true" "false"))
+    ("frametitlerulewidth")
+    ("frametitleaboveskip")
+    ("frametitlebelowskip")
+    ("frametitlebackgroundcolor")
+    ("repeatframetitle" ("true" "false"))
+    ;; 6.11. Title commands inside the environment
+    ("subtitleaboveline" ("true" "false"))
+    ("subtitlebelowline" ("true" "false"))
+    ("subtitlefont")
+    ("subtitlebackgroundcolor")
+    ("subtitleabovelinecolor")
+    ("subtitlebelowlinecolor")
+    ("subtitleabovelinewidth")
+    ("subtitlebelowlinewidth")
+    ("subtitleaboveskip")
+    ("subtitlebelowskip")
+    ("subtitleinneraboveskip")
+    ("subtitleinnerbelowskip")
+    ;; 6.12. General options
+    ("ntheorem" ("true" "false"))
+    ("needspace")
+    ("ignorelastdescenders" ("true" "false"))
+    ("userdefinedwidth" ("\\linewidth" "\\columnwidth"))
+    ("align" ("left" "right" "center"))
+    ;; 6.13. TikZ options
+    ("tikzsetting")
+    ("apptotikzsetting")
+    ;; 6.14. PSTricks options
+    ("pstrickssetting")
+    ("pstricksappsetting")
+    ;; 7. Hooks and Bools
+    ("settings")
+    ("extra")
+    ("singleextra")
+    ("firstextra")
+    ("middleextra")
+    ("secondextra")
+    ("mdfsingleframe" ("true" "false"))
+    ("mdffirstframe" ("true" "false"))
+    ("mdfmiddleframe" ("true" "false"))
+    ("mdflastframe" ("true" "false"))
+    ("beforesingleframe")
+    ("aftersingleframe")
+    ("beforebreak")
+    ("afterbreak")
+    ("beforelastframe")
+    ("afterlastframe")
+    ("startcode")
+    ("startinnercode")
+    ("endinnercode")
+    ("endcode")
+    ;; 8. Theorems
+    ("theoremseparator")
+    ("theoremtitlefont")
+    ("theoremspace"))
+  "Key=value options for mdframed macros and environments.")
+
+(defvar LaTeX-mdframed-key-val-options-local nil
+  "Buffer-local key=value options for mdframed macros and environments.")
+(make-variable-buffer-local 'LaTeX-mdframed-key-val-options-local)
+
+;; Setup for \newmdenv
+
+(TeX-auto-add-type "mdframed-newmdenv" "LaTeX")
+
+(defvar LaTeX-mdframed-newmdenv-regexp
+  `(,(concat
+      "\\\\newmdenv"
+      "[ \t\n\r%]*"
+      "\\(?:\\[[^][]*"
+        "\\(?:{[^}{]*"
+         "\\(?:{[^}{]*"
+           "\\(?:{[^}{]*}[^}{]*\\)*"
+         "}[^}{]*\\)*"
+       "}[^][]*\\)*"
+      "\\]\\)?"
+      "[ \t\n\r%]*"
+      "{\\([^}]+\\)}")
+    1 LaTeX-auto-mdframed-newmdenv)
+  "Matches the argument of \\newmdenv from mdframed package.")
+
+;; Setup for \mdfdefinestyle
+
+(TeX-auto-add-type "mdframed-mdfdefinestyle" "LaTeX")
+
+(defvar LaTeX-mdframed-mdfdefinestyle-regexp
+  '("\\\\mdfdefinestyle[ \t\n\r%]*{\\([^}]+\\)}"
+    1 LaTeX-auto-mdframed-mdfdefinestyle)
+  "Matches the argument of \\mdfdefinestyle from mdframed package.")
+
+;; Setup for \newmdtheoremenv & \mdtheorem
+
+(TeX-auto-add-type "mdframed-mdtheorem" "LaTeX")
+
+(defvar LaTeX-mdframed-mdtheorem-regexp
+  `(,(concat
+      "\\\\\\(new\\)?mdtheorem\\(?:env\\)?"
+      "[ \t\n\r%]*"
+      "\\(?:\\[[^][]*"
+        "\\(?:{[^}{]*"
+         "\\(?:{[^}{]*"
+           "\\(?:{[^}{]*}[^}{]*\\)*"
+         "}[^}{]*\\)*"
+       "}[^][]*\\)*"
+      "\\]\\)?"
+      "[ \t\n\r%]*"
+      "{\\([^}]+\\)}")
+    (2 1) LaTeX-auto-mdframed-mdtheorem)
+  "Matches the argument of \\newmdtheoremenv and \\mdtheorem from mdframed 
package.")
+
+(defun LaTeX-mdframed-update-style-key ()
+  "Update some key=values in `LaTeX-mdframed-key-val-options-local'."
+  ;; Add new "style"s to key=vals:
+  (when (LaTeX-mdframed-mdfdefinestyle-list)
+    (let* ((key (car (assoc "style" LaTeX-mdframed-key-val-options-local)))
+          (val (cadr (assoc "style" LaTeX-mdframed-key-val-options)))
+          (temp (copy-alist LaTeX-mdframed-key-val-options-local))
+          (opts (assq-delete-all (car (assoc key temp)) temp)))
+      (pushnew (list key (delete-dups
+                         (append val (mapcar #'car 
(LaTeX-mdframed-mdfdefinestyle-list)))))
+              opts :test #'equal)
+      (setq LaTeX-mdframed-key-val-options-local
+           (copy-alist opts))))
+  ;;
+  ;; Check if any color defininig package is loaded and update the
+  ;; key=values for coloring.  Prefer xcolor.sty if both packages are
+  ;; loaded.
+  (when (or (member "xcolor" (TeX-style-list))
+           (member "color" (TeX-style-list)))
+    (let* ((colorcmd (if (member "xcolor" (TeX-style-list))
+                        #'LaTeX-xcolor-definecolor-list
+                      #'LaTeX-color-definecolor-list))
+          (keys '("linecolor"
+                  "innerlinecolor"
+                  "middlelinecolor"
+                  "outerlinecolor"
+                  "backgroundcolor"
+                  "fontcolor"
+                  "shadowcolor"
+                  "frametitlebackgroundcolor"
+                  "subtitlebackgroundcolor"
+                  "subtitleabovelinecolor"
+                  "subtitlebelowlinecolor"))
+          (tmp (copy-alist LaTeX-mdframed-key-val-options-local)))
+      (dolist (x keys)
+       (assq-delete-all (car (assoc x tmp)) tmp)
+       (pushnew (list x (mapcar #'car (funcall colorcmd))) tmp :test #'equal))
+      (setq LaTeX-mdframed-key-val-options-local
+           (copy-alist tmp)))))
+
+(defun LaTeX-mdframed-auto-prepare ()
+  "Clear variables before parsing for mdframed package."
+  (setq LaTeX-auto-mdframed-newmdenv       nil
+       LaTeX-auto-mdframed-mdfdefinestyle nil
+       LaTeX-auto-mdframed-mdtheorem      nil))
+
+(defun LaTeX-mdframed-auto-cleanup ()
+  "Process parsed elements for mdframed package."
+  (dolist (env (mapcar #'car (LaTeX-mdframed-newmdenv-list)))
+    (LaTeX-add-environments
+     `(,env LaTeX-env-args [ TeX-arg-key-val 
LaTeX-mdframed-key-val-options-local ] ))
+    (TeX-ispell-skip-setcdr `((,env ispell-tex-skip-alist 0))))
+  (dolist (newenv (LaTeX-mdframed-mdtheorem-list))
+    (let ((env (car newenv))
+         (new (cadr newenv)))
+      (LaTeX-add-environments (list env (vector "Heading")))
+      (unless (and new (not (string= new "")))
+       (LaTeX-add-environments (list (concat env "*") (vector "Heading"))))))
+  (LaTeX-mdframed-update-style-key))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-mdframed-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-mdframed-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
+
+(TeX-add-style-hook
+ "mdframed"
+ (lambda ()
+
+   ;; Add mdframed to the parser
+   (TeX-auto-add-regexp LaTeX-mdframed-newmdenv-regexp)
+   (TeX-auto-add-regexp LaTeX-mdframed-mdfdefinestyle-regexp)
+   (TeX-auto-add-regexp LaTeX-mdframed-mdtheorem-regexp)
+
+   ;; Local version of key-val options
+   (setq LaTeX-mdframed-key-val-options-local
+        (copy-alist LaTeX-mdframed-key-val-options))
+
+   ;; 4. Commands
+   (TeX-add-symbols
+    '("mdfsetup"
+      (TeX-arg-key-val LaTeX-mdframed-key-val-options-local))
+
+    '("newmdenv"
+      [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ]
+      (TeX-arg-eval
+       (lambda ()
+        (let ((env (TeX-read-string
+                    (TeX-argument-prompt optional nil "Environment"))))
+          (LaTeX-add-environments
+           `(,env LaTeX-env-args [ TeX-arg-key-val 
LaTeX-mdframed-key-val-options-local ]))
+          ;; Add new env's to `ispell-tex-skip-alist': skip the optional 
argument
+          (TeX-ispell-skip-setcdr `((,env ispell-tex-skip-alist 0)))
+          (format "%s" env)))))
+
+    '("renewmdenv"
+      [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ]
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Environment")
+                   (LaTeX-mdframed-newmdenv-list)))
+
+    '("surroundwithmdframed"
+      [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ]
+      TeX-arg-environment)
+
+    '("mdflength"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Length")
+                   '(("skipabove")
+                     ("skipbelow")
+                     ("leftmargin")
+                     ("rightmargin")
+                     ("innerleftmargin")
+                     ("innerrightmargin")
+                     ("innertopmargin")
+                     ("innerbottommargin")
+                     ("linewidth")
+                     ("innerlinewidth")
+                     ("middlelinewidth")
+                     ("outerlinewidth"))))
+
+    ;; 5. Defining your own style
+    '("mdfdefinestyle"
+      (TeX-arg-eval
+       (lambda ()
+        (let ((style (TeX-read-string
+                      (TeX-argument-prompt optional nil "Style name"))))
+          (LaTeX-add-mdframed-mdfdefinestyles style)
+          (LaTeX-mdframed-update-style-key)
+          (format "%s" style))))
+      (TeX-arg-key-val LaTeX-mdframed-key-val-options-local))
+
+    '("mdfapptodefinestyle"
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Style name")
+                   (LaTeX-mdframed-mdfdefinestyle-list))
+      (TeX-arg-key-val LaTeX-mdframed-key-val-options-local))
+
+    ;; 6.11. Title commands inside the environment
+    '("mdfsubtitle"
+      [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ]
+      "Subtitle")
+
+    ;; 8. Theorems
+    '("newmdtheoremenv"
+      [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ]
+      (TeX-arg-eval
+       (lambda ()
+        (let ((nthm (TeX-read-string
+                     (TeX-argument-prompt optional nil "Environment"))))
+          (LaTeX-add-environments (list nthm (vector "Heading")))
+          (format "%s" nthm))))
+      [ TeX-arg-environment "Numbered like" ]
+      t [ (TeX-arg-eval progn (if (eq (save-excursion
+                                       (backward-char 2)
+                                       (preceding-char)) ?\])
+                                 ()
+                               (TeX-arg-counter t "Within counter"))
+                       "") ])
+
+    '("mdtheorem"
+      [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ]
+      (TeX-arg-eval
+       (lambda ()
+        (let ((nthm (TeX-read-string
+                     (TeX-argument-prompt optional nil "Environment"))))
+          (LaTeX-add-environments (list nthm (vector "Heading"))
+                                  (list (concat nthm "*") (vector "Heading")))
+          (format "%s" nthm))))
+      [ TeX-arg-environment "Numbered like" ]
+      t [ (TeX-arg-eval progn (if (eq (save-excursion
+                                       (backward-char 2)
+                                       (preceding-char)) ?\])
+                                 ()
+                               (TeX-arg-counter t "Within counter"))
+                       "") ]))
+
+   ;; Main environment defined by mdframed.sty
+   (LaTeX-add-environments
+    '("mdframed" LaTeX-env-args
+      [ TeX-arg-key-val LaTeX-mdframed-key-val-options-local ] ))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("newmdenv"             "[{")
+                               ("renewmdenv"           "[{")
+                               ("surroundwithmdframed" "[{")
+                               ("mdfsetup"             "[{")
+                               ("mdfdefinestyle"       "{{")
+                               ("mdfapptodefinestyle"  "{{")
+                               ("newmdtheoremenv"      "[{[{[")
+                               ("mdtheorem"            "[{[{["))
+                             'function)
+     (font-latex-add-keywords '(("mdfsubtitle"          "[{"))
+                             'sectioning-5)
+     (font-latex-add-keywords '(("mdflength"            "{"))
+                             'variable)))
+ LaTeX-dialect)
+
+(defvar LaTeX-mdframed-package-options-list
+  '(("xcolor")
+    ("framemethod" ("default" "tex" "latex" "none" "0"
+                   "tikz" "pgf" "1"
+                   "pstricks" "ps" "postscript" "2"))
+    ("tikz") ("TikZ")
+    ("ps") ("pstricks") ("PSTricks"))
+  "Package options for the framed package.")
+
+(defun LaTeX-mdframed-package-options ()
+  "Prompt for package options for the mdframed package."
+  (TeX-read-key-val t LaTeX-mdframed-package-options-list))
+
+;;; mdframed.el ends here

commit a943b6ceac9612d6b602e4268bbfce7970fbc34d
Author: Arash Esbati <address@hidden>
Date:   Thu Dec 29 09:10:47 2016 +0100

    Add new tcolorbox library style/tcolorboxlib-raster.el
    
    * Makefile.in (STYLESRC): Add new style.
    
    * style/tcolorboxlib-raster.el: New file.

diff --git a/Makefile.in b/Makefile.in
index c038460..1ca078d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -159,7 +159,7 @@ STYLESRC = style/prosper.el \
           style/framed.el    style/paracol.el   style/menukeys.el \
           style/bidi.el      style/FiraMono.el  style/FiraSans.el \
           style/bicaption.el style/amsfonts.el  style/subfiles.el \
-          style/dcolumn.el
+          style/dcolumn.el   style/tcolorboxlib-raster.el
 
 STYLEELC = $(STYLESRC:.el=.elc)
 
diff --git a/style/tcolorboxlib-raster.el b/style/tcolorboxlib-raster.el
new file mode 100644
index 0000000..979f0b9
--- /dev/null
+++ b/style/tcolorboxlib-raster.el
@@ -0,0 +1,192 @@
+;;; tcolorboxlib-raster.el --- AUCTeX style for `raster' library from tcolorbox
+
+;; Copyright (C) 2016 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <arash.esbati'at'gmail.com>
+;; Maintainer: address@hidden
+;; 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 `raster' library from tcolorbox.sty.
+
+;;; Code:
+
+(defvar LaTeX-tcolorbox-lib-raster-keyval-options
+  '(;; 14.3 Option Keys of the Library
+    ("raster columns")
+    ("raster rows")
+    ("raster width")
+    ("raster height")
+    ("raster before skip")
+    ("raster after skip")
+    ("raster equal skip")
+    ("raster left skip")
+    ("raster right skip")
+    ("raster column skip")
+    ("raster row skip")
+    ("raster halign" ("left" "center" "right"))
+    ("raster valign" ("top" "center" "bottom"))
+    ("raster equal height" ("noe" "rows" "all"))
+    ("raster equal height group")
+    ("raster force size" ("true" "false"))
+    ("raster reset")
+    ;; 14.4 Adding Styles for Specific Boxes
+    ("raster every box")
+    ("raster odd column")
+    ("raster even column")
+    ("raster column 1")
+    ("raster column 2")
+    ("raster column 3")
+    ("raster column 4")
+    ("raster odd row")
+    ("raster even row")
+    ("raster row 1")
+    ("raster row 2")
+    ("raster row 3")
+    ("raster row 4")
+    ("raster odd number")
+    ("raster even number")
+    ;; raster row m column n is left to user
+    ("raster number 1")
+    ("raster number 2")
+    ("raster number 3")
+    ("raster number 4")
+    ;; 14.5 Combining Columns or Rows
+    ("raster multicolumn")
+    ("raster multirow"))
+  "Key=value options for raster library from tcolorbox.")
+
+(defun LaTeX-tcolorbox-lib-raster-env-item (environment)
+  "Insert ENVIRONMENT, ask for arguments and the first item."
+  (LaTeX-insert-environment
+   environment
+   (let ((opts (TeX-read-key-val t (append
+                                   LaTeX-tcolorbox-lib-raster-keyval-options
+                                   LaTeX-tcolorbox-keyval-options-local)
+                                (when (string= environment "tcboxeditemize")
+                                  "Raster options (k=v)")))
+        (box-opts (when (string= environment "tcboxeditemize")
+                    (TeX-read-key-val nil LaTeX-tcolorbox-keyval-options-local
+                                      "Box options (k=v)"))))
+     (concat
+      (when (and opts (not (string= opts "")))
+       (format "[%s]" opts))
+      (when (string= environment "tcboxeditemize")
+       (format "{%s}" box-opts)))))
+  (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)))
+
+(defun LaTeX-tcolorbox-lib-raster-insert-item ()
+  "Insert \"tcbitem\" and query for optional argument."
+  (TeX-insert-macro "tcbitem"))
+
+(TeX-add-style-hook
+ "tcolorboxlib-raster"
+ (lambda ()
+
+   ;; Append key-vals from library to `LaTeX-tcolorbox-keyval-options-full':
+   (setq LaTeX-tcolorbox-keyval-options-full
+        (append LaTeX-tcolorbox-lib-raster-keyval-options
+                LaTeX-tcolorbox-keyval-options-full))
+
+   (TeX-add-symbols
+    ;; 14.2 Macros of the Library
+    '("tcbitem"
+      [ TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local "Item options 
(k=v)" ]
+      (TeX-arg-literal " ")))
+
+   (LaTeX-add-environments
+    ;; 14.2 Macros of the Library
+    '("tcbraster"
+      (lambda (env)
+       (LaTeX-insert-environment
+        env
+        (let ((raster-opts
+               (TeX-read-key-val t (append
+                                    LaTeX-tcolorbox-lib-raster-keyval-options
+                                    LaTeX-tcolorbox-keyval-options-local))))
+          (when (and raster-opts (not (string= raster-opts "")))
+            (concat LaTeX-optop raster-opts LaTeX-optcl))))))
+
+    '("tcbitemize" LaTeX-tcolorbox-lib-raster-env-item)
+
+    '("tcboxedraster"
+      (lambda (env)
+       (LaTeX-insert-environment
+        env
+        (let ((raster-opts
+               (TeX-read-key-val t (append
+                                    LaTeX-tcolorbox-lib-raster-keyval-options
+                                    LaTeX-tcolorbox-keyval-options-local)
+                                 "Raster options (k=v)"))
+              (box-opts
+               (TeX-read-key-val nil LaTeX-tcolorbox-keyval-options-local
+                                 "Box options (k=v)")))
+          (concat
+           (when (and raster-opts (not (string= raster-opts "")))
+             (concat LaTeX-optop raster-opts LaTeX-optcl))
+           TeX-grop box-opts TeX-grcl)))))
+
+    '("tcboxeditemize" LaTeX-tcolorbox-lib-raster-env-item))
+
+   ;; Append tcb(oxed)?itemize to `LaTeX-item-list':
+   (add-to-list 'LaTeX-item-list
+               '("tcbitemize" . LaTeX-tcolorbox-lib-raster-insert-item) t)
+   (add-to-list 'LaTeX-item-list
+               '("tcboxeditemize" . LaTeX-tcolorbox-lib-raster-insert-item) t)
+
+   ;; Append tcbitem to `LaTeX-item-regexp':
+   (unless (string-match "tcbitem" LaTeX-item-regexp)
+     (set (make-local-variable 'LaTeX-item-regexp)
+         (concat
+          LaTeX-item-regexp
+          "\\|"
+          "tcbitem\\b"))
+     (LaTeX-set-paragraph-start))
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("tcbitem" "["))
+                             'textual)))
+ LaTeX-dialect)
+
+;;; tcolorboxlib-raster.el ends here

commit 74c5ac9f28ed789998d6f3c0939718e83882b042
Author: Arash Esbati <address@hidden>
Date:   Thu Dec 29 09:08:11 2016 +0100

    Update style/tcolorbox.el to package v3.96
    
    * style/tcolorbox.el: Update style to package v3.96.

diff --git a/style/tcolorbox.el b/style/tcolorbox.el
index 73c8555..493565a 100644
--- a/style/tcolorbox.el
+++ b/style/tcolorbox.el
@@ -1,6 +1,6 @@
-;;; tcolorbox.el --- AUCTeX style for `tcolorbox.sty'
+;;; tcolorbox.el --- AUCTeX style for `tcolorbox.sty' (v3.96)
 
-;; Copyright (C) 2015 Free Software Foundation, Inc.
+;; Copyright (C) 2015, 2016 Free Software Foundation, Inc.
 
 ;; Author: Tassilo Horn <address@hidden>
 ;; Maintainer: address@hidden
@@ -26,13 +26,30 @@
 
 ;;; Commentary:
 
-;; This file adds support for `tcolorbox.sty'.
+;; This file adds support for `tcolorbox.sty' (v3.96) from 2016/11/18.
+
+;; This style file adds support for core macros and environments and
+;; their options provided by `tcolorbox.sty'.  Macros and environments
+;; provided by libraries should go in their own style files where the
+;; file is prefixed with `tcolorboxlib-',
+;; e.g. `tcolorboxlib-raster.el'.
+
+;; Libraries should also append their key=val option to variable
+;; `LaTeX-tcolorbox-keyval-options-full'.  This variable is called
+;; with macro `\tcbset'.
 
 ;;; Code:
 
-;; TODO: There are tons of more options...
+;; Needed for compiling `pushnew':
+(eval-when-compile (require 'cl))
+
+;; Needed for auto-parsing.
+(require 'tex)
+
+;; FIXME: Anything missing?
 (defvar LaTeX-tcolorbox-keyval-options
-  '(("title")
+  '(;; 4.1 Title
+    ("title")
     ("notitle")
     ("adjusted title")
     ("adjust text")
@@ -41,13 +58,19 @@
     ("detach title")
     ("attach title")
     ("attach title to upper")
+    ;; 4.2 Subtitle
+    ("subtitle style")
+    ;; 4.3 Upper Part
     ("upperbox" ("visible" "invisible"))
     ("visible")
     ("invisible")
+    ("saveto")
+    ;; 4.4 Lower Part
     ("lowerbox" ("visible" "invisible" "ignored"))
     ("savelowerto")
     ("lower separated" ("true" "false"))
     ("savedelimiter")
+    ;; 4.5 Colors and Fonts
     ("colframe")
     ("colback")
     ("title filled" ("true" "false"))
@@ -56,27 +79,612 @@
     ("collower")
     ("coltext")
     ("coltitle")
-    ("fontupper")
-    ("fontlower")
-    ("fonttitle")
+    ("fontupper" ("\\rmfamily" "\\sffamily" "\\ttfamily" "\\mdseries" 
"\\bfseries"
+                 "\\upshape" "\\itshape" "\\slshape" "\\scshape"
+                 "\\tiny"  "\\scriptsize" "\\footnotesize"
+                 "\\small" "\\normalsize" "\\large"
+                 "\\Large" "\\LARGE" "\\huge" "\\Huge" "\\normalfont"))
+    ("fontlower" ("\\rmfamily" "\\sffamily" "\\ttfamily" "\\mdseries" 
"\\bfseries"
+                 "\\upshape" "\\itshape" "\\slshape" "\\scshape"
+                 "\\tiny"  "\\scriptsize" "\\footnotesize"
+                 "\\small" "\\normalsize" "\\large"
+                 "\\Large" "\\LARGE" "\\huge" "\\Huge" "\\normalfont"))
+    ("fonttitle" ("\\rmfamily" "\\sffamily" "\\ttfamily" "\\mdseries" 
"\\bfseries"
+                 "\\upshape" "\\itshape" "\\slshape" "\\scshape"
+                 "\\tiny"  "\\scriptsize" "\\footnotesize"
+                 "\\small" "\\normalsize" "\\large"
+                 "\\Large" "\\LARGE" "\\huge" "\\Huge" "\\normalfont"))
+    ;; 4.6 Text Alignment
+    ("halign" ("justify" "left" "flush left" "right"
+              "flush right" "center" "flush center"))
+    ("halign lower" ("justify" "left" "flush left" "right"
+                    "flush right" "center" "flush center"))
+    ("halign title" ("justify" "left" "flush left" "right"
+                    "flush right" "center" "flush center"))
+    ("flushleft upper")
+    ("center upper")
+    ("flushright upper")
+    ("flushleft lower")
+    ("center lower")
+    ("flushright lower")
+    ("flushleft title")
+    ("center title")
+    ("flushright title")
+    ("valign" ("top" "center" "bottom" "scale" "scale*"))
+    ("valign upper" ("top" "center" "bottom" "scale" "scale*"))
+    ("valign lower" ("top" "center" "bottom" "scale" "scale*"))
+    ("valign scale limit")
+    ;; 4.7 Geometry:
+    ;; 4.7.1 Width
     ("width")
+    ("text width")
+    ("add to width")
+    ;; 4.7.2 Rules
+    ("toprule")
+    ("bottomrule")
+    ("leftrule")
+    ("rightrule")
+    ("titlerule")
+    ("boxrule")
+    ;; 4.7.3 Arcs
+    ("arc")
+    ("circular arc")
+    ("bean arc")
+    ("octogon arc")
+    ("arc is angular")
+    ("arc is curved")
+    ("outer arc")
+    ("auto outer arc")
+    ;; 4.7.4 Spacing
+    ("boxsep")
+    ("left")
+    ("lefttitle")
+    ("leftupper")
+    ("leftlower")
+    ("right")
+    ("righttitle")
+    ("rightupper")
+    ("rightlower")
+    ("top")
+    ("toptitle")
+    ("bottom")
+    ("bottomtitle")
+    ("middle")
+    ;; 4.7.5 Size Shortcuts
+    ("size" ("normal" "title" "small" "fbox" "tight" "minimal"))
+    ("oversize")
+    ("toggle left and right" ("none" "forced" "evenpage"))
+    ;; 4.8 Corners
+    ("sharp corners" ("northwest" "northeast" "southwest" "southeast"
+                     "north" "south" "east" "west" "downhill" "uphill" "all"))
+    ("rounded corners" ("northwest" "northeast" "southwest" "southeast"
+                       "north" "south" "east" "west" "downhill" "uphill" 
"all"))
+    ("sharpish corners")
+    ;; 4.9 Transparency
+    ("opacityframe")
+    ("opacityback")
+    ("opacitybacktitle")
+    ("opacityfill")
+    ("opacityupper")
+    ("opacitylower")
+    ("opacitytext")
+    ("opacitytitle")
+    ;; 4.10 Height Control
+    ("natural height")
     ("height")
+    ("height plus")
+    ("height from")
+    ("text height")
+    ("add to height")
+    ("add to natural height")
+    ("height fill" ("true" "false" "maximum"))
+    ("square")
+    ("space")
+    ("space to upper")
+    ("space to lower")
+    ("space to both")
+    ("space to")
+    ("split")
+    ("equal height group")
+    ("minimum for equal height group")
+    ("minimum for current equal height group")
+    ("use height from group")
+    ;; 4.11 Box Content Additions
+    ("before title")
+    ("after title")
+    ("before upper")
+    ("after upper")
+    ("after upper*")
+    ("before lower")
+    ("after lower")
+    ("after lower*")
+    ("text fill")
+    ("tabularx")
+    ("tabularx*")
+    ("tikz upper")
+    ("tikz lower")
+    ("tikznode upper")
+    ("tikznode lower")
+    ("tikznode")
+    ("varwidth upper")
+    ;; 4.12 Overlays
+    ("overlay")
+    ("no overlay")
+    ("overlay broken")
+    ("overlay unbroken")
+    ("overlay first")
+    ("overlay middle")
+    ("overlay last")
+    ("overlay unbroken and first")
+    ("overlay middle and last")
+    ("overlay unbroken and last")
+    ("overlay first and middle")
+    ;; 4.13 Floating Objects
+    ("floatplacement" ("htbp" "t" "b" "h" "p"))
+    ("float" ("htbp" "t" "b" "h" "p"))
+    ("float*" ("htbp" "t" "b" "h" "p"))
+    ("nofloat")
+    ("every float" ("\\centering" "\\raggedleft" "\\raggedright"))
+    ;; 4.14 Embedding into the Surroundings
+    ("before")
     ("after")
-    ("before")))
+    ("parskip")
+    ("noparskip")
+    ("autoparskip")
+    ("nobeforeafter")
+    ("forces nobeforeafter")
+    ("baseline")
+    ("box align" ("bottom" "top" "center" "base"  ))
+    ("before skip")
+    ("after skip")
+    ("beforeafter skip")
+    ("left skip")
+    ("right skip")
+    ("leftright skip")
+    ("ignore nobreak" ("true" "false"))
+    ("before nobreak")
+    ;; 4.15 Bounding Box
+    ("enlarge top initially by")
+    ("enlarge bottom finally by")
+    ("enlarge top at break by")
+    ("enlarge bottom at break by")
+    ("enlarge top by")
+    ("enlarge bottom by")
+    ("enlarge left by")
+    ("enlarge right by")
+    ("enlarge by")
+    ("flush left")
+    ("flush right")
+    ("center")
+    ("grow to left by")
+    ("grow to right by")
+    ("toggle enlargement" ("none" "forced" "evenpage"))
+    ("shrink tight")
+    ("extrude left by")
+    ("extrude right by")
+    ("extrude top by")
+    ("extrude bottom by")
+    ("extrude by")
+    ;; 4.16 Layered Boxes and Every Box Settings
+    ("every box")
+    ("every box on layer 1")
+    ("every box on layer 2")
+    ("every box on layer 3")
+    ("every box on layer 4")
+    ("every box on higher layers")
+    ;; 4.17 Capture Mode
+    ("capture" ("minipage" "hbox" "fitbox"))
+    ("hbox")
+    ("minipage")
+    ;; 4.18 Text Characteristics
+    ("parbox" ("true" "false"))
+    ("hyphenationfix" ("true" "false"))
+    ;; 4.19 Files
+    ("tempfile")
+    ;; 4.21 Counters, Labels, and References
+    ("phantom")
+    ("nophantom")
+    ("label")
+    ("phantomlabel")
+    ;; FIXME: Are these types documented somewhere in cleveref.pdf?
+    ("label type")
+    ("no label type")
+    ("step")
+    ("step and label")
+    ("list entry")
+    ("list text")
+    ("add to list")
+    ("nameref")
+    ;; 4.22 Even and Odd Pages
+    ("check odd page" ("true" "false"))
+    ("if odd page")
+    ("if odd page or oneside")
+    ;; FIXME: This one should be added w/ `breakable' lib:
+    ;; ("if odd page*")
+    ;; 4.24 Miscellaneous
+    ("reset")
+    ("only")
+    ("code")
+    ("void")
+    ;; 6 Side by Side
+    ("sidebyside" ("true" "false"))
+    ("sidebyside align" ("center" "top" "bottom" "center seam"
+                        "top seam" "bottom seam"))
+    ("sidebyside gap")
+    ("lefthand width")
+    ("righthand width")
+    ("lefthand ratio")
+    ("righthand ratio")
+    ;; 8 Recording options
+    ("record")
+    ("no recording"))
+  "Key=value options for tcolorbox macros and environments.")
+
+(defvar LaTeX-tcolorbox-keyval-options-local nil
+   "Buffer-local key=value options for tcolorbox macros and environments.")
+(make-variable-buffer-local 'LaTeX-tcolorbox-keyval-options-local)
+
+(defvar LaTeX-tcolorbox-keyval-options-full nil
+  "Key=value options of tcolorbox core and all loaded libraries.")
+(make-variable-buffer-local 'LaTeX-tcolorbox-keyval-options-full)
+
+(defvar LaTeX-tcolorbox-tcbox-options
+  '(;; 4.20 \tcbox Specials
+    ("tcbox raise")
+    ("tcbox raise base")
+    ("on line")
+    ("tcbox width" ("auto" "auto limited" "forced center"
+                   "forced left" "forced right" "minimum center"
+                   "minimum left" "minimum right")))
+  "Key=value options only for \\tcbox and \\tcboxmath from tcolorbox.sty.")
+
+(defvar LaTeX-tcolorbox-init-options
+  '(;; 5 Initialization Option Keys
+    ;; 5.1 Numbered Boxes
+    ("auto counter")
+    ("use counter from")
+    ("use counter")
+    ("use counter*")
+    ("no counter")
+    ("number within" ("part" "chapter" "section" "subsection"))
+    ("number format" ("\\arabic" "\\roman" "\\Roman" "\\Alph" "\\alph"))
+    ("number freestyle")
+    ("crefname")
+    ("Crefname")
+    ("blend into" ("figures" "tables" "listings"))
+    ("blend before title" ("colon" "dash" "colon hang" "dash hang"))
+    ("blend before title code")
+    ;; 5.2 Lists of tcolorboxes
+    ("list inside")
+    ("list type"))
+  "Initialization key=value options for tcolorbox macros.")
+
+(defvar LaTeX-tcolorbox-library-list
+  '("skins"
+    "vignette"
+    "raster"
+    "listings"
+    "listingsutf8"
+    "minted"
+    "theorems"
+    "breakable"
+    "magazine"
+    "fitting"
+    "hooks"
+    "xparse"
+    "external"
+    "documentation"
+    "many" "most" "all")
+  "List with libraries provided by tcolorbox package.")
+
+;; Setup for \newtcolorbox:
+(TeX-auto-add-type "tcolorbox-newtcolorbox" "LaTeX" "tcolorbox-newtcolorboxes")
+
+(defvar LaTeX-tcolorbox-newtcolorbox-regexp
+  `(,(concat "\\\\\\(re\\)?newtcolorbox"
+            "[ \t\n\r%]*"
+            "\\(?:\\[[^][]*"
+              "\\(?:{[^}{]*"
+                "\\(?:{[^}{]*"
+                  "\\(?:{[^}{]*}[^}{]*\\)*"
+                "}[^}{]*\\)*"
+              "}[^][]*\\)*"
+            "\\]\\)?"
+            "[ \t\n\r%]*"
+            "{\\([a-zA-Z0-9]+\\)}"
+            "[ \t\n\r%]*"
+            "\\(?:\\[\\([0-9]*\\)\\]\\)?"
+            "[ \t\n\r%]*"
+            "\\(\\[\\)?")
+    (2 3 4 1) LaTeX-auto-tcolorbox-newtcolorbox)
+  "Matches the arguments of \\newtcolorbox from tcolorbox package.")
+
+;; Setup for \newtcbox:
+(TeX-auto-add-type "tcolorbox-newtcbox" "LaTeX" "tcolorbox-newtcboxes")
+
+(defvar LaTeX-tcolorbox-newtcbox-regexp
+  `(,(concat "\\\\\\(re\\)?newtcbox"
+            "[ \t\n\r%]*"
+            "\\(?:\\[[^][]*"
+              "\\(?:{[^}{]*"
+                "\\(?:{[^}{]*"
+                  "\\(?:{[^}{]*}[^}{]*\\)*"
+                "}[^}{]*\\)*"
+              "}[^][]*\\)*"
+            "\\]\\)?"
+            "[ \t\n\r%]*"
+            "{\\\\\\([a-zA-Z]+\\)}"
+            "[ \t\n\r%]*"
+            "\\(?:\\[\\([0-9]*\\)\\]\\)?"
+            "[ \t\n\r%]*"
+            "\\(\\[\\)?")
+    (2 3 4 1) LaTeX-auto-tcolorbox-newtcbox)
+  "Matches the arguments of \\newtcbox from tcolorbox package.")
+
+;; Setup for \tcbuselibrary:
+(TeX-auto-add-type "tcolorbox-tcbuselibrary" "LaTeX" "tcbuselibraries")
+
+(defvar LaTeX-tcolorbox-tcbuselibrary-regexp
+  '("\\\\tcbuselibrary{\\([^}]+\\)}"
+    1 LaTeX-auto-tcolorbox-tcbuselibrary)
+  "Matches the arguments of \\tcbuselibrary from tcolorbox package.")
+
+(defun LaTeX-tcolorbox-load-used-libraries ()
+  "Check which tcolorbox libraries are loaded and run respective style hooks.
+This functions checks the arguments of \\tcbuselibrary and the
+name of libraries given in the optional argument of \\usepackage
+call for tcolorbox and runs the style hook for them.  The file
+for style must have the prefix \"tcolorboxlib-\" in the name,
+e.g. \"tcolorboxlib-raster.el\"."
+  (when (LaTeX-tcolorbox-tcbuselibrary-list)
+    (let (libs)
+      (dolist (x (LaTeX-tcolorbox-tcbuselibrary-list))
+       (push (replace-regexp-in-string "[ %\n\r\t]" "" (car x)) libs))
+      (setq libs (mapconcat #'identity libs ","))
+      (dolist (x (split-string libs "," t))
+       (TeX-run-style-hooks (concat "tcolorboxlib-" x)))))
+  (when (assoc "tcolorbox" LaTeX-provided-package-options)
+    (let ((opts (cdr (assoc "tcolorbox" LaTeX-provided-package-options))))
+      (dolist (x opts)
+       (when (member x LaTeX-tcolorbox-library-list)
+         (TeX-run-style-hooks (concat "tcolorboxlib-" x)))))))
+
+(defun LaTeX-tcolorbox-update-style-key ()
+  "Update some key=values in `LaTeX-tcolorbox-keyval-options-local'."
+  ;; Update the key=values for coloring.
+  (let* ((keys '("colframe"
+                "colback"
+                "colbacktitle"
+                "colupper"
+                "collower"
+                "coltext"
+                "coltitle"))
+        (tmp (copy-alist LaTeX-tcolorbox-keyval-options-local)))
+    (dolist (key keys)
+      (assq-delete-all (car (assoc key tmp)) tmp)
+      (pushnew
+       (list key (mapcar #'car (LaTeX-xcolor-definecolor-list))) tmp :test 
#'equal))
+    (setq LaTeX-tcolorbox-keyval-options-local (copy-alist tmp)))
+  (setq LaTeX-tcolorbox-keyval-options-full
+       (copy-alist LaTeX-tcolorbox-keyval-options-local)))
+
+(defun LaTeX-tcolorbox-auto-prepare ()
+  "Clear various LaTeX-tcolorbox-* variables before parsing."
+  (setq LaTeX-auto-tcolorbox-newtcolorbox  nil
+       LaTeX-auto-tcolorbox-newtcbox      nil
+       LaTeX-auto-tcolorbox-tcbuselibrary nil))
+
+(defun LaTeX-tcolorbox-auto-cleanup ()
+  "Process parsed results."
+  ;; Process new env's from \newtcolorbox
+  (dolist (newtcbox (apply #'append LaTeX-tcolorbox-newtcolorbox-list))
+    (let ((box (nth 0 newtcbox))
+         (arg (nth 1 newtcbox))
+         (opt (nth 2 newtcbox))
+         (renew (when (string= (nth 3 newtcbox) "re")
+                  (nth 3 newtcbox))))
+      ;; When renew'ing, delete any entry from
+      ;; `LaTeX-environment-list' first:
+      (when renew
+       (setq LaTeX-environment-list
+             (assq-delete-all
+              (car (assoc box (LaTeX-environment-list)))
+              LaTeX-environment-list)))
+      (cond (;; opt. 1st argument and mandatory argument(s)
+            (and arg (not (string= arg ""))
+                 opt (not (string= opt  "")))
+            (LaTeX-add-environments
+             (list box
+                   'LaTeX-env-args
+                   (vector 'TeX-arg-key-val 
'LaTeX-tcolorbox-keyval-options-local)
+                   (1- (string-to-number arg)))))
+           (;; mandatory argument(s) only
+            (and arg (not (string= arg ""))
+                 (string-equal opt ""))
+            (LaTeX-add-environments
+             (list box (string-to-number arg))))
+           (t ; No args
+            (LaTeX-add-environments (list box))))))
+  ;;
+  ;; Process new macros from \newtcbox
+  (dolist (newtcbox (apply #'append LaTeX-tcolorbox-newtcbox-list))
+    (let ((box (nth 0 newtcbox))
+         (arg (nth 1 newtcbox))
+         (opt (nth 2 newtcbox))
+         (renew (when (string= (nth 3 newtcbox) "re")
+                  (nth 3 newtcbox))))
+      ;; When renew'ing, delete any entry from `TeX-symbol-list'
+      ;; first:
+      (when renew
+       (setq TeX-symbol-list
+             (assq-delete-all
+              (car (assoc box (TeX-symbol-list)))
+              TeX-symbol-list)))
+      (cond (;; opt. 1st argument and mandatory argument(s)
+            (and arg (not (string= arg ""))
+                 opt (not (string= opt  "")))
+            (TeX-add-symbols (list box
+                              (vector 'TeX-arg-key-val 
'LaTeX-tcolorbox-keyval-options-local)
+                              (1- (string-to-number arg)))))
+           (;; mandatory argument(s) only
+            (and arg (not (string= arg ""))
+                 (string-equal opt ""))
+            (TeX-add-symbols (list box (string-to-number arg))))
+           (t ; No args -- in pratice, this will probably never happen
+            (TeX-add-symbols (list box))))))
+  ;;
+  ;; Update key=vals
+  (LaTeX-tcolorbox-update-style-key)
+  ;;
+  ;; Load style hooks for libraries, if any.
+  (LaTeX-tcolorbox-load-used-libraries))
+
+(add-hook 'TeX-auto-prepare-hook #'LaTeX-tcolorbox-auto-prepare t)
+(add-hook 'TeX-auto-cleanup-hook #'LaTeX-tcolorbox-auto-cleanup t)
+(add-hook 'TeX-update-style-hook #'TeX-auto-parse t)
 
 (TeX-add-style-hook
  "tcolorbox"
  (lambda ()
-   ;; TODO: There are many more macros
+
+   ;; Activate the buffer-local version of key-vals.
+   (setq LaTeX-tcolorbox-keyval-options-local
+        (copy-alist LaTeX-tcolorbox-keyval-options))
+
+   ;; Collect key=val's from libraries in
+   ;; `LaTeX-tcolorbox-keyval-options-full'; \tcbset needs this:
+   (setq LaTeX-tcolorbox-keyval-options-full
+        (copy-alist LaTeX-tcolorbox-keyval-options-local))
+
+   ;; Add tcolorbox to the parser.
+   (TeX-auto-add-regexp LaTeX-tcolorbox-newtcolorbox-regexp)
+   (TeX-auto-add-regexp LaTeX-tcolorbox-newtcbox-regexp)
+   (TeX-auto-add-regexp LaTeX-tcolorbox-tcbuselibrary-regexp)
+
+   ;; We just run the style hook for `xcolor' which is loaded by pgf.sty
+   (TeX-run-style-hooks "xcolor")
+
+   ;; FIXME: Anything missing?
    (TeX-add-symbols
-    "tcblower"
+
+    ;; 1.3 Libraries
+    '("tcbuselibrary"
+      (TeX-arg-eval mapconcat #'identity
+                   (TeX-completing-read-multiple
+                    (TeX-argument-prompt optional nil "Libraries")
+                    LaTeX-tcolorbox-library-list) ","))
+
+    ;; 3 Macros for Box Creation
+    '("tcblower" 0)
+
     '("tcbset"
-      (TeX-arg-key-val LaTeX-tcolorbox-keyval-options))
+      (TeX-arg-key-val LaTeX-tcolorbox-keyval-options-full))
+
     '("tcbsetforeverylayer"
-      (TeX-arg-key-val LaTeX-tcolorbox-keyval-options)))
+      (TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local))
+
+    '("tcbox"
+      [ TeX-arg-eval TeX-read-key-val optional
+                    (append
+                     LaTeX-tcolorbox-tcbox-options
+                     LaTeX-tcolorbox-keyval-options-local) ]
+      t)
+
+    '("newtcolorbox"
+      [ TeX-arg-key-val LaTeX-tcolorbox-init-options ]
+      "Name"
+      [ TeX-arg-define-macro-arguments ]
+      (TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local))
+
+    '("renewtcolorbox"
+      [ TeX-arg-key-val LaTeX-tcolorbox-init-options ]
+      (TeX-arg-eval completing-read
+                   (TeX-argument-prompt optional nil "Color box")
+                   (LaTeX-tcolorbox-newtcolorbox-list))
+      [ TeX-arg-define-macro-arguments ]
+      (TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local))
+
+    '("newtcbox"
+      [ TeX-arg-key-val LaTeX-tcolorbox-init-options ]
+      TeX-arg-macro
+      [ TeX-arg-define-macro-arguments ]
+      (TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local))
+
+    '("renewtcbox"
+      [ TeX-arg-key-val LaTeX-tcolorbox-init-options ]
+      (TeX-arg-eval
+       (lambda ()
+        (let ((macro (completing-read
+                      (TeX-argument-prompt optional nil "Macro: \\" t)
+                      (LaTeX-tcolorbox-newtcbox-list))))
+          (concat TeX-esc macro))))
+      [ TeX-arg-define-macro-arguments ]
+      (TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local))
+
+    '("tcolorboxenvironment"
+      TeX-arg-environment
+      (TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local))
+
+    ;; 4.16 Layered Boxes and Every Box Settings
+    '("tcbsetmanagedlayer" "Number")
+
+    ;; 4.22 Even and Odd Pages
+    '("tcbifoddpage" 2)
+    '("tcbifoddpageoroneside" 2)
+    '("thetcolorboxnumber" 0)
+    '("thetcolorboxpage" 0)
+
+    ;; 5.2 Lists of tcolorboxes
+    '("tcblistof"
+      [ TeX-arg-eval completing-read
+                    (TeX-argument-prompt optional nil "Macro")
+                    (if (< (LaTeX-largest-level) 2)
+                        '("\\chapter" "\\section" "\\subsection" 
"\\subsubsection")
+                      '("\\section" "\\subsection" "\\subsubsection")) ]
+      2)
+
+    ;; 7 Saving and Loading of Verbatim Texts
+    '("tcbusetemp")
+
+    ;; 8 Recording
+    '("tcbstartrecording" [ "File name" ])
+    '("tcbstoprecording")
+    '("tcbrecord" t)
+    '("tcbinputrecords" [ TeX-arg-file ]) ) ; Terminate TeX-add-symbols
+
    (LaTeX-add-environments
+    ;; 3 Macros for Box Creation: Main env
     '("tcolorbox" LaTeX-env-args
-      [TeX-arg-key-val LaTeX-tcolorbox-keyval-options])))
+      [ TeX-arg-key-val LaTeX-tcolorbox-keyval-options-local ])
+
+    ;; 7 Saving and Loading of Verbatim Texts
+    '("tcbverbatimwrite" "File name")
+    '("tcbwritetemp"))
+
+   ;; Do not indent text in verbatim environments:
+   (make-local-variable 'LaTeX-indent-environment-list)
+   (add-to-list 'LaTeX-indent-environment-list
+               '("tcbverbatimwrite" current-indentation) t)
+   (add-to-list 'LaTeX-indent-environment-list
+               '("tcbwritetemp" current-indentation) t)
+
+   ;; Fontification
+   (when (and (featurep 'font-latex)
+             (eq TeX-install-font-lock 'font-latex-setup))
+     (font-latex-add-keywords '(("tcbuselibrary"        "{")
+                               ("tcbset"               "{")
+                               ("tcbsetforeverylayer"  "{")
+                               ("tcbox"                "[{")
+                               ("newtcolorbox"         "[{[[{")
+                               ("renewtcolorbox"       "[{[[{")
+                               ("newtcbox"             "[{[[{")
+                               ("renewtcbox"           "[{[[{")
+                               ("tcolorboxenvironment" "{{")
+                               ("tcbsetmanagedlayer"   "{"))
+                             'function)))
  LaTeX-dialect)
 
+(defvar LaTeX-tcolorbox-package-options LaTeX-tcolorbox-library-list
+  "Package options for the tcolorbox package.")
+
 ;;; tcolorbox.el ends here

commit ec3996d7ff1d9e0f2a404a74f1f6305c6e1a9e5b
Author: Arash Esbati <address@hidden>
Date:   Thu Dec 29 08:59:41 2016 +0100

    Query for optional float position
    
    * style/newfloat.el (LaTeX-newfloat-auto-cleanup): Query for
    optional float position.

diff --git a/style/newfloat.el b/style/newfloat.el
index 166eff5..41d2b52 100644
--- a/style/newfloat.el
+++ b/style/newfloat.el
@@ -116,7 +116,7 @@ If `caption.el' is loaded, add the new floating environment 
to
               (reftex-add-label-environments
                `((,flt ?t ,LaTeX-table-label "~\\ref{%s}" caption nil nil)))))
            ((string-equal type "verbatim")
-            (LaTeX-add-environments flt)
+            (LaTeX-add-environments `(,flt ["Float Position"]))
             (add-to-list (make-local-variable 'LaTeX-indent-environment-list)
                          `(,flt current-indentation) t)
             (add-to-list 'LaTeX-label-alist `(,flt . "lst:") t)
@@ -124,7 +124,7 @@ If `caption.el' is loaded, add the new floating environment 
to
               (reftex-add-label-environments
                `((,flt ?l "lst:" "~\\ref{%s}" caption nil nil)))))
            (t
-            (LaTeX-add-environments flt)))
+            (LaTeX-add-environments `(,flt ["Float Position"]))))
       (when (boundp 'LaTeX-caption-supported-float-types)
        (add-to-list (make-local-variable 'LaTeX-caption-supported-float-types)
                     flt))

commit a55b66ddaeaf59590db6a1c3198cfbc56b6360d8
Author: Arash Esbati <address@hidden>
Date:   Thu Dec 29 08:57:39 2016 +0100

    Improve inserting arguments of \captionof macro
    
    * style/caption.el (LaTeX-arg-caption-captionof): New function
    improving query and insert of caption and label acc. to float
    type.
    ("caption"): Use it.

diff --git a/style/caption.el b/style/caption.el
index d8699fa..f4b2ab0 100644
--- a/style/caption.el
+++ b/style/caption.el
@@ -270,6 +270,46 @@ caption, insert only a caption."
   ;; (cf. `paragraph-start').
   (LaTeX-fill-paragraph))
 
+(defun LaTeX-arg-caption-captionof (optional &optional star)
+  "Query for the arguments of \"\\captionof\" macro and insert them.
+If OPTIONAL is non-nil, insert the arguments in brackets.  If
+STAR is non-nil, do not query for a short-caption and a label."
+  (let* ((envtype (completing-read (TeX-argument-prompt optional nil "Float 
type")
+                                  LaTeX-caption-supported-float-types))
+        (figtypes '("figure" "subfigure" "floatingfigure"
+                    "figwindow" "SCfigure" "measuredfigure" "wrapfigure"))
+        (tabtypes '("table"  "subtable" "floatingtable"  "tabwindow" "SCtable"
+                    "supertabular" "xtabular" "threeparttable"  "wraptable"))
+        (caption (TeX-read-string
+                  (TeX-argument-prompt optional nil "Caption")))
+        (short-caption
+         (when (and (not star)
+                    (>= (length caption) LaTeX-short-caption-prompt-length))
+           (TeX-read-string
+            (TeX-argument-prompt t nil "Short caption")))))
+    (indent-according-to-mode)
+    (TeX-argument-insert envtype optional)
+    (when (and short-caption (not (string= short-caption "")))
+      (insert LaTeX-optop short-caption LaTeX-optcl))
+    (TeX-argument-insert caption optional)
+    (LaTeX-fill-paragraph)
+    (unless star
+      (LaTeX-newline)
+      (indent-according-to-mode)
+      ;; Check if `envtype' is a figure or a table, also consult
+      ;; `LaTeX-label-alist' for additions from user or newfloat.el,
+      ;; then run `LaTeX-label' w/ 'environment arg, otherwise w/o.
+      (if (or (member envtype figtypes)
+             (member envtype tabtypes)
+             (assoc envtype LaTeX-label-alist))
+         (LaTeX-label (cond ((member envtype figtypes)
+                             "figure")
+                            ((member envtype tabtypes)
+                             "table")
+                            (t envtype))
+                      'environment)
+       (LaTeX-label envtype)))))
+
 (TeX-add-style-hook
  "caption"
  (lambda ()
@@ -305,15 +345,9 @@ caption, insert only a caption."
                    LaTeX-caption-supported-float-types]
       t)
 
-    '("captionof"
-      (TeX-arg-eval completing-read (TeX-argument-prompt nil nil "Float type")
-                   LaTeX-caption-supported-float-types)
-      ["Short caption"] t)
+    '("captionof" LaTeX-arg-caption-captionof)
 
-    '("captionof*"
-      (TeX-arg-eval completing-read (TeX-argument-prompt nil nil "Float type")
-                   LaTeX-caption-supported-float-types)
-      t)
+    '("captionof*" (LaTeX-arg-caption-captionof t))
 
     '("captionsetup"
       (TeX-arg-conditional (member "bicaption" (TeX-style-list))

-----------------------------------------------------------------------

Summary of changes:
 Makefile.in                  |    3 +-
 style/caption.el             |   50 +++-
 style/mdframed.el            |  421 ++++++++++++++++++++++++++++
 style/newfloat.el            |    4 +-
 style/tcolorbox.el           |  636 +++++++++++++++++++++++++++++++++++++++++-
 style/tcolorboxlib-raster.el |  192 +++++++++++++
 style/titleps.el             |  233 ++++++++++++++++
 style/titlesec.el            |  255 +++++++++++++++++
 style/titletoc.el            |  206 ++++++++++++++
 9 files changed, 1975 insertions(+), 25 deletions(-)
 create mode 100644 style/mdframed.el
 create mode 100644 style/tcolorboxlib-raster.el
 create mode 100644 style/titleps.el
 create mode 100644 style/titlesec.el
 create mode 100644 style/titletoc.el


hooks/post-receive
-- 
GNU AUCTeX



reply via email to

[Prev in Thread] Current Thread [Next in Thread]