[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex a943b6c 10/57: Add new tcolorbox library style/t
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex a943b6c 10/57: Add new tcolorbox library style/tcolorboxlib-raster.el |
Date: |
Wed, 11 Jan 2017 18:01:37 +0000 (UTC) |
branch: externals/auctex
commit a943b6ceac9612d6b602e4268bbfce7970fbc34d
Author: Arash Esbati <address@hidden>
Commit: Arash Esbati <address@hidden>
Add new tcolorbox library style/tcolorboxlib-raster.el
* Makefile.in (STYLESRC): Add new style.
* style/tcolorboxlib-raster.el: New file.
---
Makefile.in | 2 +-
style/tcolorboxlib-raster.el | 192 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 193 insertions(+), 1 deletion(-)
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
- [elpa] externals/auctex d185bcb 49/57: * Makefile.in (release-commit): Fix name of preview ChangeLog., (continued)
- [elpa] externals/auctex d185bcb 49/57: * Makefile.in (release-commit): Fix name of preview ChangeLog., Tassilo Horn, 2017/01/11
- [elpa] externals/auctex e9c4b68 35/57: ; * doc/auctex.texi (Completion): Use @defun and not @deffn., Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 74c5ac9 09/57: Update style/tcolorbox.el to package v3.96, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 0b16551 51/57: * Makefile.in (release-commit): Use UTF-8 coding for ChangeLog entry., Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 826f17a 54/57: Release_11.90, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 61e56f2 40/57: Fix bug where font-latex-sub/superscript-face was not applied to ^_, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex bc47cb0 39/57: Fontify script characters with a new face, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 6fe7a2e 43/57: Prepare for upcoming release, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 33a6ff8 48/57: ; Change email address., Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 5af3c8e 15/57: Add \switchcolumn to paragraph commands, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex a943b6c 10/57: Add new tcolorbox library style/tcolorboxlib-raster.el,
Tassilo Horn <=
- [elpa] externals/auctex 3a5ed08 38/57: Support biblatex cite format in all Emacsen, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 436371c 31/57: Add completion-at-point support, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex a181b14 55/57: ; make change-history-commit, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 4ebbf90 56/57: Make gitlog-to-changelog ignore release-commit, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex a9ec6ba 01/57: Update style/minted.el to package version 2.4.1., Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 4c59f77 42/57: Adapt Makefile to new ChangeLog file name, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex c541d75 20/57: Fix the names also in expert macros, Tassilo Horn, 2017/01/11
- [elpa] externals/auctex 93b1163 50/57: * ChangeLog-preview: Change encoding to UTF-8., Tassilo Horn, 2017/01/11
- [elpa] externals/auctex fb6333b 45/57: ; * doc/install.texi (Installation): Guard reference in "@ifclear rawfile"., Tassilo Horn, 2017/01/11
- [elpa] externals/auctex ea7f427 28/57: Improve multi-level script fontification, Tassilo Horn, 2017/01/11