changeset 565:6c09561c22f0 dev

Use YaTeX-package-alist-default for YaTeX::usepackage-alist-default
author HIROSE Yuuji <yuuji@gentei.org>
date Thu, 24 Jan 2019 15:16:07 +0900
parents 71697ec66240
children 2ef9f21dd13b
files help/YATEXHLP.eng help/YATEXHLP.jp yatex.el yatexadd.el yatexpkg.el
diffstat 5 files changed, 131 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/help/YATEXHLP.eng	Thu Jan 24 08:03:47 2019 +0900
+++ b/help/YATEXHLP.eng	Thu Jan 24 15:16:07 2019 +0900
@@ -1788,6 +1788,36 @@
 \textbackslash
 backslash(\) itself.
 
+geometry
+\geometry{params...}   or   \usepackage[params...]{geometry}
+From: geometry-samples.tex
+See below as examples:
+
+\geometry{centering}
+\geometry{width=10cm,vscale=.7}
+\geometry{margin=1cm, papersize={12cm,19cm}, resetpaper}
+\geometry{margin=1cm,includeheadfoot}
+\geometry{margin=1cm,includeheadfoot,includemp}
+\geometry{margin=1cm,bindingoffset=1cm,twoside}
+\geometry{hmarginratio=2:1, vmargin=2cm}
+\geometry{hscale=0.5,twoside}
+\geometry{hscale=0.5,asymmetric}
+\geometry{hscale=0.5,heightrounded}
+\geometry{left=1cm,right=4cm,top=2cm,includefoot}
+\geometry{lines=20,left=2cm,right=6cm,top=2cm,twoside}
+\geometry{width=15cm, marginparwidth=3cm, includemp}
+\geometry{hdivide={1cm,,2cm}, vdivide={3cm,8in,}, nohead}
+\geometry{headsep=20pt, head=40pt,foot=20pt,includeheadfoot}
+\geometry{text={6in,8in}, top=2cm, left=2cm}
+\geometry{centering,includemp,twoside,landscape}
+\geometry{mag=1414,margin=2cm}
+\geometry{mag=1414,margin=2truecm,truedimen}
+\geometry{a5paper, landscape, twocolumn, twoside,
+   left=2cm, hmarginratio=2:1, includemp, marginparwidth=43pt,
+   bottom=1cm, foot=.7cm, includefoot, textheight=11cm, heightrounded,
+   columnsep=1cm,verbose}
+
+	  
 YaTeX
 (setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist))
 The mode you are probably using now.
--- a/help/YATEXHLP.jp	Thu Jan 24 08:03:47 2019 +0900
+++ b/help/YATEXHLP.jp	Thu Jan 24 15:16:07 2019 +0900
@@ -1805,6 +1805,35 @@
 \textbackslash
 バックスラッシュそのもの
 
+geometry
+\geometry{params...}   or   \usepackage[params...]{geometry}
+From: geometry-samples.tex
+以下を参考に:
+
+\geometry{centering}
+\geometry{width=10cm,vscale=.7}
+\geometry{margin=1cm, papersize={12cm,19cm}, resetpaper}
+\geometry{margin=1cm,includeheadfoot}
+\geometry{margin=1cm,includeheadfoot,includemp}
+\geometry{margin=1cm,bindingoffset=1cm,twoside}
+\geometry{hmarginratio=2:1, vmargin=2cm}
+\geometry{hscale=0.5,twoside}
+\geometry{hscale=0.5,asymmetric}
+\geometry{hscale=0.5,heightrounded}
+\geometry{left=1cm,right=4cm,top=2cm,includefoot}
+\geometry{lines=20,left=2cm,right=6cm,top=2cm,twoside}
+\geometry{width=15cm, marginparwidth=3cm, includemp}
+\geometry{hdivide={1cm,,2cm}, vdivide={3cm,8in,}, nohead}
+\geometry{headsep=20pt, head=40pt,foot=20pt,includeheadfoot}
+\geometry{text={6in,8in}, top=2cm, left=2cm}
+\geometry{centering,includemp,twoside,landscape}
+\geometry{mag=1414,margin=2cm}
+\geometry{mag=1414,margin=2truecm,truedimen}
+\geometry{a5paper, landscape, twocolumn, twoside,
+   left=2cm, hmarginratio=2:1, includemp, marginparwidth=43pt,
+   bottom=1cm, foot=.7cm, includefoot, textheight=11cm, heightrounded,
+   columnsep=1cm,verbose}
+
 FILTER
 %#BEGIN FILTER{OUTPUT}{COMMANDLINE}  ... %#END
 \if0 から \fi までに囲まれた領域、もしくは %#SRC{...} で指定されたファイルを
--- a/yatex.el	Thu Jan 24 08:03:47 2019 +0900
+++ b/yatex.el	Thu Jan 24 15:16:07 2019 +0900
@@ -1,6 +1,6 @@
 ;;; yatex.el --- Yet Another tex-mode for emacs //野鳥// -*- coding: sjis -*-
 ;;; (c)1991-2018 by HIROSE Yuuji.[yuuji@yatex.org]
-;;; Last modified Thu Jan 24 08:00:29 2019 on firestorm
+;;; Last modified Thu Jan 24 15:14:47 2019 on firestorm
 ;;; $Id$
 ;;; The latest version of this software is always available at;
 ;;; https://www.yatex.org/
@@ -326,6 +326,7 @@
      ("frametitle") ("framesubtitle") 				;; beamer
      ("subfigure")						;; subfigure
      ("ruby" 2) ("kenten")					;; okumacro
+     ("geometry") ("path")
      )
    (if YaTeX-use-LaTeX2e
        '(("documentclass") ("usepackage")
@@ -398,9 +399,8 @@
      ("eqnarray") ("eqnarray*") ("figure") ("equation") ("equation*")
      ("abstract") ("array")
      ("thebibliography") ("theindex") ("flushleft") ("flushright")
-     ("minipage")
-     ("supertabular")
-     ("wrapfigure") ("wraptable")
+     ("minipage") ("landscape")
+     ("supertabular") ("floatingfigure") ("wrapfigure") ("wraptable")
      ("frame") ("block") ("example") ("columns") ("column")	;beamer
      )
    (if YaTeX-use-LaTeX2e
--- a/yatexadd.el	Thu Jan 24 08:03:47 2019 +0900
+++ b/yatexadd.el	Thu Jan 24 15:16:07 2019 +0900
@@ -1,6 +1,6 @@
 ;;; yatexadd.el --- YaTeX add-in functions -*- coding: sjis -*-
 ;;; (c)1991-2018 by HIROSE Yuuji.[yuuji@yatex.org]
-;;; Last modified Wed Jan 16 08:23:13 2019 on firestorm
+;;; Last modified Thu Jan 24 13:57:49 2019 on firestorm
 ;;; $Id$
 
 ;;; Code:
@@ -2040,8 +2040,7 @@
 				 (format "%s=%s" s (symbol-value s)))))
 			 '(width height scale angle)))
 	   ","))
-    (if (string= "" str) ""
-      (concat "[" str "]"))))
+    (concat "{" str "}")))
 
 (defvar YaTeX::get-boundingbox-cmd YaTeX-cmd-gs
   "Command to get bounding box from PDF files.
@@ -2148,34 +2147,11 @@
    ((= argp 1) (YaTeX-read-string-or-skip "Kanji: ")) 
    ((= argp 2) (YaTeX-read-string-or-skip "Yomi: "))))
 
-(defvar YaTeX::usepackage-alist-default
-  '(("version") ("plext") ("url") ("fancybox") ("pifont") ("longtable")
-    ("ascmac") ("bm") ("graphics") ("graphicx") ("alltt") ("misc") ("eclbkbox")
-    ("amsmath") ("amssymb") ("xymtex") ("chemist")
-    ("a4j") ("array") ("epsf") ("color") ("xcolor") ("epsfig") ("floatfig")
-    ("landscape") ("path") ("supertabular") ("twocolumn")
-    ("latexsym") ("times") ("makeidx") ("geometry") ("type1cm")
-    ("subfigure") ("okumacro"))
-  "Default completion table for arguments of \\usepackage")
-
-(defvar YaTeX::usepackage-alist-private nil
-  "*Private completion list of the argument for usepackage")
+;;(require 'yatexpkg)
+(autoload 'YaTeX::usepackage "yatexpkg" "Add-in for \\usepackage{}")
+;;; (defun YaTeX::usepackage()...) MOVED to yatexpkg.el
+;;; See yatexpkg.el
 
-(defvar YaTeX::usepackage-alist-local nil
-  "Directory local  completion list of the argument for usepackage")
-
-(defun YaTeX::usepackage (&optional argp)
-  (cond
-   ((equal argp 1)
-    (setq YaTeX-env-name "document")
-    (let ((minibuffer-local-completion-map YaTeX-minibuffer-completion-map)
-	  (delim ","))
-      (YaTeX-cplread-with-learning
-       (if YaTeX-japan "Use package(カンマで区切ってOK): "
-	 "Use package(delimitable by comma): ")
-       'YaTeX::usepackage-alist-default
-       'YaTeX::usepackage-alist-private
-       'YaTeX::usepackage-alist-local)))))
 
 (defun YaTeX::mask (argp)
   (cond
--- a/yatexpkg.el	Thu Jan 24 08:03:47 2019 +0900
+++ b/yatexpkg.el	Thu Jan 24 15:16:07 2019 +0900
@@ -1,7 +1,7 @@
 ;;; yatexpkg.el --- YaTeX package manager -*- coding: sjis -*-
 ;;; 
 ;;; (c)2003-2018 by HIROSE, Yuuji [yuuji@yatex.org]
-;;; Last modified Thu Jan 24 08:00:20 2019 on firestorm
+;;; Last modified Thu Jan 24 14:13:01 2019 on firestorm
 ;;; $Id$
 
 ;;; Code:
@@ -40,10 +40,26 @@
 			   "varDelta" "varTheta" "varLambda" "varXi" "varPi"
 			   "varSigma" "varUpsilon" "varPhi" "varPsi" "varOmega"
 			   "lll" "ggg")) ;very few.  Please tell us!
+    ("latexsym"	(maketitle "mho" "Join" "Box" "Diamond" "leadsto"
+			   "sqsubset" "sqsupset" "lhd" "unlhd" "rhd" "unrhd"))
     ("mathrsfs"	(section "mathscr"))
     ("graphicx" (section "includegraphics"
 			 "rotatebox" "scalebox" "resizebox" "reflectbox")
      		(option . YaTeX-package-graphics-driver-alist))
+    ("xymtex"	(section "Ycyclohexaneh"))	;;XXX we need more and more...
+    ("chemist"	nil)				;;XXX we need completions...
+    ("a4j"	nil)
+    ("array"	nil)
+    ("times"	nil)
+    ("newtx"	nil)
+    ("makeidx"	nil)
+    ("geometry"	(section "geometry"))
+    ("lscape"	(env "landscape"))
+    ("path"	(section "path"))
+    ("epsf"	(section "epsfbox"))
+    ("epsfig"	(section "epsfig"))
+    ("floatflt"	(env "floatingfigure"))
+    ("type1cm"	(section "fontsize"))
     ("svg"	(section "includesvg"))
     ("color"	(section "textcolor" "colorbox" "pagecolor" "color")
      		(option . YaTeX-package-graphics-driver-alist)
@@ -52,11 +68,8 @@
     ("ulem"	(section "uline" "uuline" "uwave")
 		(option ("normalem")))
     ("multicol"	(env "multicols"))
-    ("cref"	(section "cleveref"))
-    ("crefrange"	(same-as . "cref"))
-    ("cpageref"		(same-as . "cref"))
-    ("labelcref"	(same-as . "cref"))
-    ("labelcpageref"	(same-as . "cref"))
+    ("cleveref"	(section "cref" "crefrange" "cpageref" "labelcref"
+			 "labelpageref"))
     ("wrapfig"	(env "wrapfigure" "wraptable"))
     ("setspace"	(env "spacing") (section "setstretch"))
     ("cases"	(env "numcases" "subnumcases"))
@@ -239,4 +252,46 @@
 	      (funcall register)
 	      (message "Don't forget to put \\usepackage{%s} yourself later"
 		       (car (car pkglist)))) ;doing car car is negligence...
-    ))))))
+	    ))))))
+
+(defvar YaTeX::usepackage-alist-private nil
+  "*Private completion list of the argument for usepackage")
+
+(defvar YaTeX::usepackage-alist-local nil
+  "Directory local  completion list of the argument for usepackage")
+
+(defun YaTeX::usepackage (&optional argp)
+  (cond
+   ((equal argp 1)
+    (setq YaTeX-env-name "document")
+    (let ((minibuffer-local-completion-map YaTeX-minibuffer-completion-map)
+	  (delim ","))
+      (YaTeX-cplread-with-learning
+       (if YaTeX-japan "Use package(カンマで区切ってOK): "
+	 "Use package(delimitable by comma): ")
+       ;; 'YaTeX::usepackage-alist-default	;; OBSOLETED at 1.82
+       'YaTeX-package-alist-default
+       'YaTeX::usepackage-alist-private
+       'YaTeX::usepackage-alist-local)))))
+
+
+;;;
+;; Add-ins for auxiliary package handled here
+;;;
+(defun YaTeX:floatingfigure ()
+  (concat (YaTeX:read-position "rlpv")
+	  (YaTeX:read-length "Width: ")))
+
+(defvar YaTeX:geometry-default "margin=1.5cm,includeheadfoot,includemp"
+  "*Default options for \\geometry{}")
+(defun YaTeX::geometry (argp)
+  "Add-in for \\geometry's option"
+  ;; cf. https://dayinthelife.at.webry.info/201401/article_2.html
+  (cond
+   ((= argp 1)
+    (YaTeX-help "geometry")
+    (message "Change default by setting YaTeX:geometry-default")
+    (if (string= YaTeX:geometry-default "") ""
+      YaTeX:geometry-default))))
+
+(provide 'yatexpkg)

yatex.org