Werner LEMBERG <[email protected]> writes:

> the 'bigfoot' package provides variations of the `\footnote` macro:
>
>   \footnote+
>   \footnote-
>
> [FYI, this currently can't be deduced while reading the package
> documentation.]  It would be great if AUCTeX could support that!

Please find attached an AUCTeX style for bigfoot.sty.  But I think we
need a style for manyfoot.sty as well.  Before you can use this style,
you need to apply the patch attached to font-latex.el and recompile that
file.

> Another thing I would really like to have is more sophisticated color
> highlighting within footnotes.  Right now, macros within a footnote
> completely lose any associated colors; everything is shown as green.
>
> Currently, I have to work on a literature history book, which has
> really huge footnotes (sometimes covering a few hundred input lines),
> and which are filled with `\emph` and friends – it would be much
> easier to the eye if they were marked with colours, too.

I'm not sure if that is doable without breaking other things.  But maybe
you can go the other way and disable fontification for \footnote like
this:

--8<---------------cut here---------------start------------->8---
(with-eval-after-load 'font-latex
  (setq-default
   font-latex-match-reference-keywords-local
   (remove (assoc-string "footnote"
                         font-latex-match-reference-keywords-local)
           font-latex-match-reference-keywords-local)))
--8<---------------cut here---------------end--------------->8---

> Associated packages with 'bigfoot' are 'suffix' and 'perpage', just in
> case you want to round up the support :-)

Maybe I can give it a try if you promise to test :-)

Best, Arash

Attachment: bigfoot.el
Description: application/emacs-lisp

diff --git a/font-latex.el b/font-latex.el
index 0908d78e..d8ea2441 100644
--- a/font-latex.el
+++ b/font-latex.el
@@ -1622,10 +1622,11 @@ Returns nil if none of KEYWORDS is found."
           (goto-char (match-end 0))
           ;; Check for starred macro if first spec is an asterisk or a
           ;; plus sign in case of \defaultfontfeatures+ provided by
-          ;; fontspec.sty
-          (when (memql (car spec-list) '(?* ?+))
+          ;; fontspec.sty or a minus sign in case of \footnote- provided
+          ;; by bigfoot.sty:
+          (when (memql (car spec-list) '(?* ?+ ?-))
             (setq spec-list (cdr spec-list))
-            (skip-chars-forward "*+" (1+ (point))))
+            (skip-chars-forward "*+-" (1+ (point))))
           ;; Add current point to match data and use keyword face for
           ;; region from start to point.
           (nconc match-data (list (point)))
@@ -1652,7 +1653,7 @@ Returns nil if none of KEYWORDS is found."
                                      (forward-char)
                                      (if (zerop (skip-syntax-forward "_w"))
                                          (forward-char) ; Single-char macro.
-                                       (skip-chars-forward "*+"))
+                                       (skip-chars-forward "*+-"))
                                      (point))))
                       (nconc font-latex-matched-faces (list face))
                       (setq end (max end (point)))
_______________________________________________
bug-auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-auctex

Reply via email to