[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex e301b71 22/28: Add new style textpos.el.
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex e301b71 22/28: Add new style textpos.el. |
Date: |
Fri, 07 Aug 2015 15:59:26 +0000 |
branch: externals/auctex
commit e301b716c93418f8de5f03bb3d5d3d6b121f5085
Author: Arash Esbati <address@hidden>
Commit: Mosè Giordano <address@hidden>
Add new style textpos.el.
Signed-off-by: Mosè Giordano <address@hidden>
---
ChangeLog | 4 ++
Makefile.in | 2 +-
style/textpos.el | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 116 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 13d1120..9832d21 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
* Makefile.in (STYLESRC): Add new style.
+ * style/textpos.el: New file.
+
+ * Makefile.in (STYLESRC): Add new style.
+
* style/environ.el: New file.
* style/tabulary.el ("tabulary"): Add `LCRJ' to
diff --git a/Makefile.in b/Makefile.in
index 0552e52..03ff367 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -149,7 +149,7 @@ STYLESRC = style/prosper.el \
style/geometry.el style/ltablex.el style/ltxtable.el \
style/mn2e.el style/colortbl.el style/attachfile.el \
style/newpxtext.el style/newpxmath.el style/pdfpages.el \
- style/mnras.el style/environ.el
+ style/mnras.el style/environ.el style/textpos.el
STYLEELC = $(STYLESRC:.el=.elc)
diff --git a/style/textpos.el b/style/textpos.el
new file mode 100644
index 0000000..6732361
--- /dev/null
+++ b/style/textpos.el
@@ -0,0 +1,111 @@
+;;; textpos.el --- AUCTeX style for `textpos.sty' version v1.7j
+
+;; Copyright (C) 2015 Free Software Foundation, Inc.
+
+;; Author: Arash Esbati <esbati'at'gmx.de>
+;; Maintainer: address@hidden
+;; Created: 2015-07-04
+;; 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 `textpos.sty' version v1.7j from
+;; 2014/01/03. `textpos.sty' is part of TeXLive.
+
+;;; Code:
+
+(defun LaTeX-env-arg-textpos (env)
+ "Query for the arguments of `textpos' environment and insert
+them."
+ (let* ((hsize (TeX-read-string "Width: "))
+ (ho (TeX-read-string "(Optional) X reference point: "))
+ (vo (when (not (string-equal ho ""))
+ (TeX-read-string "Y reference point: ")))
+ (hpos (TeX-read-string "X placement point: "))
+ (vpos (TeX-read-string "Y placement point: ")))
+ (LaTeX-insert-environment
+ env
+ (concat
+ (when (and hsize (not (string-equal hsize "")))
+ (format "{%s}" hsize))
+ (when (and ho (not (string-equal ho ""))
+ vo (not (string-equal vo "")))
+ (format "[%s,%s]" ho vo))
+ (when (and hpos (not (string-equal hpos ""))
+ vpos (not (string-equal vpos "")))
+ (format "(%s,%s)" hpos vpos))))))
+
+(defun LaTeX-arg-textpos-tpgrid (optional)
+ "Query and insert the optional argument of `\\TPGrid'."
+ (let* ((x (TeX-read-string "(Optional) X start coordinate: "))
+ (y (when (not (string-equal x ""))
+ (TeX-read-string "Y start coordinate: "))))
+ (when (and (not (string-equal x ""))
+ (not (string-equal y "")))
+ (TeX-argument-insert (format "%s,%s" x y) optional))))
+
+(TeX-add-style-hook
+ "textpos"
+ (lambda ()
+
+ (TeX-run-style-hooks "everyshi" "color")
+
+ (LaTeX-add-environments
+ ;; \begin{textpos}{<hsize>}[<ho>,<vo>](<hpos>,<vpos>) ... \end{textpos}
+ '("textpos" LaTeX-env-arg-textpos)
+ '("textpos*" LaTeX-env-arg-textpos))
+
+ (TeX-add-symbols
+ '("TPGrid" [ LaTeX-arg-textpos-tpgrid ]
+ "Horizontal fraction" "Vertical fraction")
+
+ '("TPMargin" (TeX-arg-length "Margin around textblock"))
+ '("TPMargin*" (TeX-arg-length "Margin around textblock"))
+
+ ;; We ignore the `\textblock...color' (i.e. without `u') versions
+ '("textblockcolour"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((color (completing-read "Color name: "
+ (LaTeX-color-definecolor-list))))
+ (format "%s" color)))))
+
+ '("textblockrulecolour"
+ (TeX-arg-eval
+ (lambda ()
+ (let ((color (completing-read "Color name: "
+ (LaTeX-color-definecolor-list))))
+ (format "%s" color)))))
+
+ '("TPshowboxestrue")
+ '("TPshowboxesfalse")
+
+ '("textblocklabel" t)
+ '("textblockorigin" "Horizontal position" "Vertical position"))
+
+ ;; Add the lengths defined by textpos.sty
+ (LaTeX-add-lengths "TPHorizModule" "TPVertModule" "TPboxrulesize"))
+ LaTeX-dialect)
+
+(defvar LaTeX-textpos-package-options
+ '("showboxes" "noshowtext" "absolute" "overlay" "verbose" "quiet")
+ "Package options for the textpos package.")
+
+;;; textpos.el ends here
- [elpa] externals/auctex 3cd3e72 08/28: Restore Emacs 22 compatibility, (continued)
- [elpa] externals/auctex 3cd3e72 08/28: Restore Emacs 22 compatibility, Tassilo Horn, 2015/08/07
- [elpa] externals/auctex 8426ca5 12/28: Missing ConTeXt-(un)numbered-section-list-nl variables., Tassilo Horn, 2015/08/07
- [elpa] externals/auctex 0efe678 14/28: Improve completion of includepdf macro., Tassilo Horn, 2015/08/07
- [elpa] externals/auctex 8052cd5 13/28: Find warnings emitted by a package with digits in its name., Tassilo Horn, 2015/08/07
- [elpa] externals/auctex 24a2a9d 20/28: Add `LCRJ' to `LaTeX-array-column-letters'., Tassilo Horn, 2015/08/07
- [elpa] externals/auctex b9eddc9 11/28: Really ignore dbus errors, Tassilo Horn, 2015/08/07
- [elpa] externals/auctex 1202f83 19/28: Add `X' to `LaTeX-array-column-letters'., Tassilo Horn, 2015/08/07
- [elpa] externals/auctex 5178ba6 16/28: Parse hf-tikz messages suggesting to rerun LaTeX., Tassilo Horn, 2015/08/07
- [elpa] externals/auctex bb195ae 15/28: Add new style file for mnras class., Tassilo Horn, 2015/08/07
- [elpa] externals/auctex c2c7dd9 18/28: Parse user-defined new column types., Tassilo Horn, 2015/08/07
- [elpa] externals/auctex e301b71 22/28: Add new style textpos.el.,
Tassilo Horn <=
- [elpa] externals/auctex d27e773 21/28: Add new style environ.el., Tassilo Horn, 2015/08/07
- [elpa] externals/auctex 482dddb 24/28: Query for default first arg when (re-)defining env's., Tassilo Horn, 2015/08/07
- [elpa] externals/auctex 107f106 23/28: Add new style vwcol.el., Tassilo Horn, 2015/08/07
- [elpa] externals/auctex e351a3a 26/28: Add missing commands `\nameref*' and `\Nameref'., Tassilo Horn, 2015/08/07
- [elpa] externals/auctex 6094700 17/28: Restore deleted preview README., Tassilo Horn, 2015/08/07
- [elpa] externals/auctex 166e14b 25/28: Fix a typo in the name of provided env's., Tassilo Horn, 2015/08/07
- [elpa] externals/auctex 3fdeb4b 27/28: Setup preview differently; fixes bug#21188, Tassilo Horn, 2015/08/07
- [elpa] externals/auctex 1fc2c7a 28/28: Merge branch 'master' into elpa, Tassilo Horn, 2015/08/07