# HG changeset patch # User HIROSE Yuuji # Date 1664413471 -32400 # Node ID 6f69504f9cbeddba2fe7fdf8a6f10f9513aa251c # Parent b9ba8aacbea60f2b275d7f3903f08524e6da1033# Parent 638284a7a9d09e64cfd9ff9bfee5afa57397f7ff merged diff -r b9ba8aacbea6 -r 6f69504f9cbe docs/qanda --- a/docs/qanda Thu Dec 26 12:53:40 2019 +0859 +++ b/docs/qanda Thu Sep 29 10:04:31 2022 +0900 @@ -427,8 +427,9 @@ しばらく使うとこちらの方が便利だと感じると思います。もしそれでも 肌に合わない時は、C-c w m で常に修正モードをONにして使って下さい。 - 変数 YaTeX-close-paren-always の値を nil にセットすると起動時か - ら括弧の自動クローズをOFFにします。 + 変数 YaTeX-close-paren-always の値を 'never にセットすると起動時 + から括弧の自動クローズをOFFにします。nil にセットするとポイント + が行末にないときの自動クローズOFFにします。 ・; を押すと変なのがでて来たりする。 diff -r b9ba8aacbea6 -r 6f69504f9cbe docs/qanda.eng --- a/docs/qanda.eng Thu Dec 26 12:53:40 2019 +0859 +++ b/docs/qanda.eng Thu Sep 29 10:04:31 2022 +0900 @@ -292,10 +292,10 @@ *An open parenthesis always get entered in pairs. - This should be better, once you get used to it. If you still - don't like it, turn on modify-mode using C-c w m. Setting - YaTeX-close-paren-always to nil will give this feature from the - start. + This should be better, once you get used to it. If you still + don't like it, turn on modify-mode using C-c w m. Setting + YaTeX-close-paren-always to 'never will give this feature from + the start, nil will stop closing when not at end of line. *Funny things happen when I hit ;. diff -r b9ba8aacbea6 -r 6f69504f9cbe help/YATEXHLP.eng --- a/help/YATEXHLP.eng Thu Dec 26 12:53:40 2019 +0859 +++ b/help/YATEXHLP.eng Thu Sep 29 10:04:31 2022 +0900 @@ -1765,6 +1765,12 @@ \caption{foo image}\label{foo-jpg} \end{wrapfigure} +wraptable +\begin{wraptable}[LINES]{POS}[OVH]{WIDTH} ...TABULAR... \end{wraptable} +Create floating tabular. +Usage is the same as wrapfigure environment except enclosing tabular. + + abstract \begin{abstract} ... \end{abstract} diff -r b9ba8aacbea6 -r 6f69504f9cbe help/YATEXHLP.jp --- a/help/YATEXHLP.jp Thu Dec 26 12:53:40 2019 +0859 +++ b/help/YATEXHLP.jp Thu Sep 29 10:04:31 2022 +0900 @@ -1771,6 +1771,7 @@ OVH(省略可) 画像の張り出しマージン(\wrapoverhang 通常0) WIDTH 回り込みする(画像込みの)幅 + 【使用例】 % プリアンブル \usepackage{wrapfig} @@ -1780,6 +1781,13 @@ \caption{ほげほげ}\label{hoge-jpg} \end{wrapfigure} +wraptable +\begin{wraptable}[LINES]{POS}[OVH]{WIDTH} ...表... \end{wraptable} +左右回り込みの表を出力する(table環境と同様のフロート作成)。 +内部にtabular系を入れる点以外についてはwrapfigureと同様。 + + + abstract \begin{abstract} ... \end{abstract} 抄録(アブストラクト)を出力する。 diff -r b9ba8aacbea6 -r 6f69504f9cbe yahtml.el --- a/yahtml.el Thu Dec 26 12:53:40 2019 +0859 +++ b/yahtml.el Thu Sep 29 10:04:31 2022 +0900 @@ -446,6 +446,7 @@ ("option") ("datalist") ;;HTML5 ("video") ("audio") ("figure") ("iframe") + ("header") ("footer") ("article") ("section") ("nav") ("main") ("aside") )) (if yahtml-html4-strict @@ -1714,6 +1715,9 @@ (yahtml-make-optional-argument "value" (yahtml-read-parameter "value")))) +(defun yahtml::article () + (setq yahtml-last-typeface-cmd "h1" yahtml-last-begend "h1")) + ;;; ---------- Simple tag ---------- (defun yahtml-insert-tag (region-mode &optional tag) "Insert and put cursor inside of them." diff -r b9ba8aacbea6 -r 6f69504f9cbe yatex.el --- a/yatex.el Thu Dec 26 12:53:40 2019 +0859 +++ b/yatex.el Thu Sep 29 10:04:31 2022 +0900 @@ -1,6 +1,6 @@ ;;; yatex.el --- Yet Another tex-mode for emacs //野鳥// -*- coding: sjis -*- -;;; (c)1991-2019 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Thu Dec 26 12:46:41 2019 on firestorm +;;; (c)1991-2020 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Fri Sep 23 06:28:18 2022 on firestorm ;;; $Id$ ;;; The latest version of this software is always available at; ;;; https://www.yatex.org/ @@ -16,7 +16,7 @@ ;;; Code: (require 'yatexlib) -(defconst YaTeX-revision-number "1.82" +(defconst YaTeX-revision-number "1.82.1" "Revision number of running yatex.el") ;---------- Local variables ---------- @@ -182,7 +182,7 @@ YaTeX-sectioning-regexp ;sectioning commands "\\|[A-z]*item\\|begin{\\|end{" ;special declaration "\\|\\[\\|\\]" - "\\|newpage\\b\\|vspace\\b" + "\\|newpage\\b\\|vspace\\b\\|par\\b" "\\)") "*Paragraph starting regexp of common LaTeX source. Use this value for YaTeX-uncomment-paragraph.") @@ -192,7 +192,7 @@ YaTeX-sectioning-regexp ;sectioning commands "\\|begin{\\|end{" ;special declaration "\\|\\[\\|\\]" - "\\|newpage\\b\\|vspace\\b" + "\\|newpage\\b\\|vspace\\b\\|par\\b" "\\)") "*Paragraph delimiter regexp of common LaTeX source. Use this value for YaTeX-uncomment-paragraph.") @@ -315,6 +315,7 @@ ("cline") ("framebox") ("savebox" 2) ("sbox" 2) ("newsavebox") ("usebox") ("date") ("put") ("ref") ("pageref") ("tabref") ("figref") ("raisebox" 2) ("multicolumn" 3) ("shortstack") ("parbox" 2) + ("textcircled") ("fbox") ;; for mathmode accent ("tilde") ("hat") ("check") ("bar") ("dot") ("ddot") ("vec") ("widetilde") ("widehat") ("overline") ("overrightarrow") @@ -327,6 +328,8 @@ ("subfigure") ;; subfigure ("ruby" 2) ("kenten") ;; okumacro ("geometry") ("path") + ("setstretch") + ("columncolor") ("rowcolor") ("cellcolor") ;; colortbl ) (if YaTeX-use-LaTeX2e '(("documentclass") ("usepackage") @@ -402,7 +405,7 @@ ("minipage") ("landscape") ("supertabular") ("floatingfigure") ("wrapfigure") ("wraptable") ("frame") ("block") ("example") ("columns") ("column") ;beamer - ("tabularx") + ("tabularx") ("spacing") ) (if YaTeX-use-LaTeX2e '(("comment") ;defined in version @@ -424,7 +427,7 @@ ; Set {\Large }-like completion (defvar fontsize-table '(("rm") ("em") ("bf") ("boldmath") ("it") ("sl") ("sf") ("sc") ("tt") - ("dg") ("dm") + ("dg") ("dm") ("mc") ("mcfamily") ("gt") ("gtfamily") ("tiny") ("scriptsize") ("footnotesize") ("small")("normalsize") ("large") ("Large") ("LARGE") ("huge") ("Huge") ("rmfamily") ("sffamily") ("ttfamily") @@ -437,6 +440,8 @@ '(("rm" . "rmfamily") ("sf" . "sffamily") ("tt" . "ttfamily") + ("mc" . "mcfamily") + ("gt" . "gtfamily") ("md" . "mdseries") ("bf" . "bfseries") ("up" . "upshape") @@ -451,6 +456,7 @@ (append '(("maketitle") ("makeindex") ("sloppy") ("protect") ("par") ("and") ("LaTeX") ("TeX") ("item") ("item[]") ("appendix") ("hline") ("kill") + ("textbar") ("textbackslash") ;;("rightarrow") ("Rightarrow") ("leftarrow") ("Leftarrow") ("onecolumn") ("twocolumn") ("pagebreak") ("nopagebreak") ("tableofcontents") @@ -878,7 +884,7 @@ ;; YaTeX-mode functions ;;; (defun YaTeX-insert-begin-end (env region-mode) - "Insert \\begin{mode-name} and \\end{mode-name}. + "Insert \\begin{env-name} and \\end{env-name}. This works also for other defined begin/end tokens to define the structure." (setq YaTeX-current-completion-type 'begin) (let*((ccol (current-column)) beg beg2 exchange diff -r b9ba8aacbea6 -r 6f69504f9cbe yatexadd.el --- a/yatexadd.el Thu Dec 26 12:53:40 2019 +0859 +++ b/yatexadd.el Thu Sep 29 10:04:31 2022 +0900 @@ -1,6 +1,6 @@ ;;; yatexadd.el --- YaTeX add-in functions -*- coding: sjis -*- ;;; (c)1991-2019 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Thu Oct 17 09:44:48 2019 on firestorm +;;; Last modified Thu Sep 22 11:41:04 2022 on firestorm ;;; $Id$ ;;; Code: @@ -193,15 +193,22 @@ ;; wrapfig.sty -(defun YaTeX:wrapfigure () - (YaTeX-help "wrapfigure") - (concat - (let ((lines (YaTeX-read-string-or-skip "Wrap Lines(Optional): "))) - (if (string< "" lines) - (concat "[" lines "]"))) - "{" (YaTeX:read-oneof "rlioRLIO" t) "}" - "{" (YaTeX:read-length "Image width: ") "}")) - +(defun YaTeX:wrapfigure (&optional kind) + (setq kind (or kind "figure")) + (YaTeX-help (concat "wrap" kind)) + (prog1 + (concat + (let ((lines (YaTeX-read-string-or-skip "Wrap Lines(Optional): "))) + (if (string< "" lines) + (concat "[" lines "]"))) + "{" (YaTeX:read-oneof "rlioRLIO" t) "}" + "{" (YaTeX:read-length (concat (capitalize kind) " width: ")) "}") + (setq YaTeX-section-name "includegraphics"))) + +(defun YaTeX:wraptable () + (prog1 + (YaTeX:wrapfigure "table") + (setq YaTeX-env-name "tabular"))) ;;; ;;Sample functions for section-type command. @@ -306,6 +313,11 @@ (defun YaTeX:itembox () (concat "{" (YaTeX-read-string-or-skip "Item heading string: ") "}")) +(defun YaTeX:spacing () + (concat "{" (read-string-with-history "Line spacing by: ") "}")) +(defun YaTeX::setstretch (argp) + (read-string-with-history "Page global Line stretch factor: ")) + ;;; ;;Sample functions for maketitle-type command. ;;; @@ -1981,6 +1993,48 @@ ((= argp 2) (YaTeX::color-completing-read "Inner color: ")) ((= argp 3) (YaTeX-read-string-or-skip "Colored string: ")))) +(defun YaTeX:columncolor () + (let ((model (YaTeX-completing-read-or-skip + "Color model: " '(("rgb") ("gray") ("named"))))) + (put 'YaTeX:columncolor 'model model) + (if (string= "" model) "" (concat "[" model "]")))) + +(fset 'YaTeX:rowcolor 'YaTeX:columncolor) +(fset 'YaTeX:cellcolor 'YaTeX:columncolor) + +(defun YaTeX::columncolor (argp) + (let ((model (get 'YaTeX:columncolor 'model)) + (type (cond ((string-match "column" YaTeX-section-name) "Column") + ((string-match "row" YaTeX-section-name) "Row") + ((string-match "cell" YaTeX-section-name) "Cell") + (t "Table"))) + (last (get 'YaTeX::columncolor 'last-color)) + str) + (put 'YaTeX::columncolor 'last-color + (cond + ((equal model "rgb") + (setq str (YaTeX-read-string-or-skip + "R, G, B values: " + (cons (or last "0.6, 0.8, 0.9") 0))) + (cond + ((string-match ",.*," str) str) + ((string-match "\\(\\S +\\)\\s +\\(\\S +\\)\\s +\\(\\S +\\)" str) + (format "%s, %s, %s" (YaTeX-match-string 1 1 str) + (YaTeX-match-string 2 2 str)(YaTeX-match-string 3 3 str))) + (t (message "%s may cause error on typesetting" str) + str))) + ((equal model "gray") + (setq str (YaTeX-read-string-or-skip "Grayscale values(0.0 - 1.0): ")) + (if (<= (string-to-number str) 1) + str + (message "%s may be an error. Values from 0.0 to 1.0 are acceptable") + str)) + ((equal model "named") + (YaTeX::color-completing-read (concat type " color"))) + )))) +(fset 'YaTeX::rowcolor 'YaTeX::columncolor) +(fset 'YaTeX::cellcolor 'YaTeX::columncolor) + (defun YaTeX:scalebox () "Add-in for \\scalebox" (let ((vmag (YaTeX-read-string-or-skip (if YaTeX-japan "倍率(負で反転): " diff -r b9ba8aacbea6 -r 6f69504f9cbe yatexlib.el --- a/yatexlib.el Thu Dec 26 12:53:40 2019 +0859 +++ b/yatexlib.el Thu Sep 29 10:04:31 2022 +0900 @@ -1,7 +1,7 @@ ;;; yatexlib.el --- YaTeX and yahtml common libraries -*- coding: sjis -*- ;;; ;;; (c)1994-2019 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Thu Dec 26 12:47:45 2019 on firestorm +;;; Last modified Fri Sep 23 06:43:32 2022 on firestorm ;;; $Id$ ;;; Code: @@ -119,6 +119,38 @@ "*Main LaTeX source file name used when %#! expression doesn't exist.") (make-variable-buffer-local 'YaTeX-parent-file) +;;; +;; Emacs 21 compensational wrapper +;;; +(defun YaTeX-minibuffer-begin () + (if (fboundp 'field-beginning) + (field-beginning (point-max)) + (point-min))) + +(defun YaTeX-minibuffer-end () + (if (fboundp 'field-end) + (field-end (point-max)) + (point-max))) + +(defun YaTeX-minibuffer-string () + (buffer-substring (YaTeX-minibuffer-begin) (YaTeX-minibuffer-end))) + +(defun YaTeX-minibuffer-erase () + (if (eq (selected-window) (minibuffer-window)) + (if (fboundp 'delete-field) (delete-field) (erase-buffer)))) + +(fset 'YaTeX-buffer-substring + (if (fboundp 'buffer-substring-no-properties) + 'buffer-substring-no-properties + 'buffer-substring)) +(fset 'YaTeX-substring + (if (fboundp 'substring-no-properties) + 'substring-no-properties + 'substing)) + +(defun YaTeX-region-active-p () + (and (fboundp 'region-active-p) (region-active-p))) + ;---------- Define default key bindings on YaTeX mode map ---------- ;;;###autoload (defun YaTeX-kanji-ptex-mnemonic () @@ -627,11 +659,14 @@ (where-is-internal olddef keymap)))) ;;;###autoload -(defun YaTeX-match-string (n &optional m) - "Return (buffer-substring (match-beginning n) (match-beginning m))." +(defun YaTeX-match-string (n &optional m str) + "Return (buffer-substring (match-beginning n) (match-beginning m)). +Optional third argument STR gives substring from string STR." (if (match-beginning n) - (YaTeX-buffer-substring (match-beginning n) - (match-end (or m n))))) + (if str (YaTeX-substring + str (match-beginning m) (match-end (or m n))) + (YaTeX-buffer-substring (match-beginning n) + (match-end (or m n)))))) ;;;###autoload (defun YaTeX-minibuffer-complete () @@ -1385,34 +1420,6 @@ bindlist)))) ;;; -;; Emacs 21 compensational wrapper -;;; -(defun YaTeX-minibuffer-begin () - (if (fboundp 'field-beginning) - (field-beginning (point-max)) - (point-min))) - -(defun YaTeX-minibuffer-end () - (if (fboundp 'field-end) - (field-end (point-max)) - (point-max))) - -(defun YaTeX-minibuffer-string () - (buffer-substring (YaTeX-minibuffer-begin) (YaTeX-minibuffer-end))) - -(defun YaTeX-minibuffer-erase () - (if (eq (selected-window) (minibuffer-window)) - (if (fboundp 'delete-field) (delete-field) (erase-buffer)))) - -(fset 'YaTeX-buffer-substring - (if (fboundp 'buffer-substring-no-properties) - 'buffer-substring-no-properties - 'buffer-substring)) - -(defun YaTeX-region-active-p () - (and (fboundp 'region-active-p) (region-active-p))) - -;;; ;; hilit19 vs. font-lock ;;; (defvar YaTeX-19-functions-font-lock-direct diff -r b9ba8aacbea6 -r 6f69504f9cbe yatexpkg.el --- a/yatexpkg.el Thu Dec 26 12:53:40 2019 +0859 +++ b/yatexpkg.el Thu Sep 29 10:04:31 2022 +0900 @@ -1,7 +1,7 @@ ;;; yatexpkg.el --- YaTeX package manager -*- coding: sjis -*- ;;; ;;; (c)2003-2019 by HIROSE, Yuuji [yuuji@yatex.org] -;;; Last modified Sat May 25 14:46:27 2019 on firestorm +;;; Last modified Thu Sep 22 20:20:37 2022 on firestorm ;;; $Id$ ;;; Code: @@ -76,6 +76,7 @@ ("cases" (env "numcases" "subnumcases")) ("subfigure" (section "subfigure")) ("okumacro" (section "ruby" "kenten")) + ("colortbl" (section "columncolor" "rowcolor")) ) "Default package vs. macro list. Alists contains '(PACKAGENAME . MACROLIST) diff -r b9ba8aacbea6 -r 6f69504f9cbe yatexprc.el --- a/yatexprc.el Thu Dec 26 12:53:40 2019 +0859 +++ b/yatexprc.el Thu Sep 29 10:04:31 2022 +0900 @@ -1,7 +1,7 @@ ;;; yatexprc.el --- YaTeX process handler -*- coding: sjis -*- ;;; -;;; (c)1993-2019 by HIROSE Yuuji.[yuuji@yatex.org] -;;; Last modified Thu Dec 26 12:48:12 2019 on firestorm +;;; (c)1993-2022 by HIROSE Yuuji.[yuuji@yatex.org] +;;; Last modified Thu Sep 29 09:56:02 2022 on firestorm ;;; $Id$ ;;; Code: @@ -39,7 +39,8 @@ (cond (YaTeX-dos (cdr (assq 1 YaTeX-kanji-code-alist))) (YaTeX-emacs-20 - (cdr (assoc latex-message-kanji-code YaTeX-kanji-code-alist))) + (let ((sym (cdr (assoc latex-message-kanji-code YaTeX-kanji-code-alist)))) + (if (eq sym 'no-conversion) 'undecided sym))) ((boundp 'MULE) (symbol-value (cdr (assoc latex-message-kanji-code YaTeX-kanji-code-alist)))) @@ -1149,6 +1150,37 @@ t) ;for YaTeX-goto-corresponding-* nil))) +(and (or (featurep 'dbus) (load "dbus" t)) + ;; Cannot load dbus on emacs without dbus module + (fboundp 'url-unhex-string) + (fboundp 'dbus-register-signal) + ;; From https://texwiki.texjp.org/?Emacs#vecb4fd9 + (progn + (fset 'YaTeX-evince-inverse-search + (if (fboundp 'evince-inverse) + 'evince-inverse ;Use previously defined one + (function + (lambda (file linecol &rest args) + (let* ((fn (decode-coding-string + (url-unhex-string + (if (string-match "^file:///" file) + (substring file 7) file)) + 'utf-8)) + (buf (YaTeX-switch-to-buffer fn)) + (ln (car linecol)) + (col (car (cdr linecol)))) + (if (null buf) + (error "[Synctex]: Not found [%s]" file) + (goto-line ln) + (move-to-column (max 0 col)))))))) + (condition-case () + (dbus-register-signal + :session nil "/org/gnome/evince/Window/0" + "org.gnome.evince.Window" "SyncSource" + 'YaTeX-evince-inverse-search) + (error + (message "Reverse search not available on this system."))))) + (defun YaTeX-set-virtual-error-position (file-sym line-sym) "Replace the value of FILE-SYM, LINE-SYM by virtual error position." (cond