GNU bug report logs - #73840
[PATCH] Improved folding for citations

Previous Next

Package: auctex;

Reported by: Paul Nelson <ultrono <at> gmail.com>

Date: Wed, 16 Oct 2024 20:01:01 UTC

Severity: normal

Tags: patch

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Arash Esbati <arash <at> gnu.org>
To: Paul Nelson <ultrono <at> gmail.com>
Cc: 73840 <at> debbugs.gnu.org
Subject: bug#73840: [PATCH] Improved folding for citations
Date: Wed, 16 Oct 2024 22:30:08 +0200
Paul Nelson <ultrono <at> gmail.com> writes:

> I hope you're not too disappointed to hear that I only anticipate
> three further tex-fold.el patches.

Sad news, but hey, AUCTeX has also other files ;-)

> Citation macros \cite{...} are currently folded as [c].  This patch
> gives more descriptive folding when possible, using author names and
> publication years, like [Ne21] or [ABC99].  These are extracted from
> any bib files referenced in the document or specified by a user
> option.
>
> QUESTION: the new code uses reftex and bibtex.  Are we allowed to just
> require those in tex-fold.el?  I wasn't sure, since AUCTeX in general
> seems careful about (require) statements.

I didn't read the code carefuly, but Why can't we conditionalize this,
i.e., use RefTeX/BibTeX code if the libraries are loaded and plugged
into AUCTeX (RefTeX mainly), otherwise stick with what we have?  This is
actually AUCTeX mostly does.

>  doc/auctex.texi | 11 ++++++
>  tex-fold.el     | 96 ++++++++++++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 106 insertions(+), 1 deletion(-)
>
> diff --git a/doc/auctex.texi b/doc/auctex.texi
> index 0356b96d..43d672d1 100644
> --- a/doc/auctex.texi
> +++ b/doc/auctex.texi
> @@ -2955,6 +2955,17 @@ specifications for @samp{begin} and @samp{end} from
>  @code{TeX-fold-macro-spec-list}.
>  @end defopt
>  
> +@defopt TeX-fold-bib-file
> +The default folding behavior for @samp{\cite{...@}} macros that point to a
                                               ^@{
> +BibTeX entry is to replace them with a string of the form [XYZ99], formed
> +using the authors' last names and the publication year.  If we cannot find
> +the required BibTeX entries in any bib files included in the current
> +document, then, as a backup, we search the files specified in
> +@code{TeX-fold-bib-file}.  This may be useful when using
> +@samp{\thebibliography{...@}} rather than BibTeX, or when working in
                         ^@{

Best, Arash




This bug report was last modified 212 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.