From becff06c71d277647eda4378203d03ab36e141eb Mon Sep 17 00:00:00 2001 From: mattkae Date: Tue, 17 May 2022 07:07:37 -0400 Subject: Evil mode and latex support --- elpa/auctex-13.1.3/style/titlesec.el | 269 +++++++++++++++++++++++++++++++++++ 1 file changed, 269 insertions(+) create mode 100644 elpa/auctex-13.1.3/style/titlesec.el (limited to 'elpa/auctex-13.1.3/style/titlesec.el') diff --git a/elpa/auctex-13.1.3/style/titlesec.el b/elpa/auctex-13.1.3/style/titlesec.el new file mode 100644 index 0000000..c3af038 --- /dev/null +++ b/elpa/auctex-13.1.3/style/titlesec.el @@ -0,0 +1,269 @@ +;;; titlesec.el --- AUCTeX style for `titlesec.sty' (v2.11) -*- lexical-binding: t; -*- + +;; Copyright (C) 2016--2022 Free Software Foundation, Inc. + +;; Author: Arash Esbati +;; Maintainer: auctex-devel@gnu.org +;; 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.11) from +;; 2019/07/16. `titlesec.sty' is part of TeXLive. + +;;; Code: + +(require 'tex) +(require 'latex) + +;; Silence the compiler: +(declare-function font-latex-add-keywords + "font-latex" + (keywords class)) + +(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*{}{} + '("titleformat*" (LaTeX-arg-titlesec-titlespec) t) + + ;; 3. Advanced Interface + ;; \titleformat{}[]{}{