Dear Everyone,

 

I have recently discovered TeX-fold-mode and tried to set it. Before I used prettify-symbols-mode.

 

There seem to be a problem with propagating text properties when folding. šThere seem to be two wrong behaviors (related or unrelated?).

 

  1. When folding a macro that includes its text arguments when the arguments are fontified the fontification gets propagated incorrectly. I think it gets applied twice, that is wrong when the fontification is not idempotent e.g. relative size specification
  2. In math mode (maybe not only) all macros (math and non-math) when folded completely disregard fontification. This looks really bad if you have a subscript of, say, a sum or an integral and there you have a macro. The folded version is of the wrong size.

 

I illustrate with examples

 

Consider the following LaTeX file (attached as main.tex):

 

\documentclass{amsart}

\begin{document}

\title{Simple AMSart}

\author{Author McAuthorface}

 

\maketitle

 

\section{Section \textit{a} : a \LaTeX macro}

\begin{equation*}

š \int_{\alpha + \beta = \LaTeX + \dots }

\end{equation*}

\end{document}

 

With theš following configuration of auctex (a complete init.el is attached)

(setq TeX-parse-self t)

(require 'tex)

(add-hook 'LaTeX-mode-hook (lambda ()

šššššššššššššššššššššššššššš (TeX-fold-mode 1)))

 

  1. The default fontification makes “Section …” slightly larger than normal. This is correct.

 

  1. Auctex makes the subscript of the integral in the equation small and lowered.

 

 

Thanks!

 

Gennady

 

 

Emacsš : GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)

of 2019-12-25

Package: 12.2.4

 

current state:

==============

(setq

AUCTeX-date "2020-06-29"

window-system 'w32

LaTeX-version "2e"

TeX-style-path '("~/.emacs.d/auctex"

šššššššššššššššššššššššššššš š "c:/Users/guraltsev/.config/emacsen/clean/straight/build/auctex/style" "c:/Users/guraltsev/.config/emacsen/clean/auctex/auto" "c:/Users/guraltsev/.config/emacsen/clean/auctex/style" "auto" "style")

TeX-auto-save nil

TeX-parse-self t

TeX-master t

TeX-command-list '(("TeX"

šššššššššššššššššššššššššššš šššš "%(PDF)%(tex) %(file-line-error) %`%(extraopts) %S%(PDFout)%(mode)%' %t"

šššššššššššššššššššššššššššš šššš TeX-run-TeX nil

šššššššššššššššššššššššššššš šššš (plain-tex-mode ams-tex-mode texinfo-mode) :help

šššššššššššššššššššššššššššš šššš "Run plain TeX")

šššššššššššššššššššššššššššš ššš ("LaTeX" "%`%l%(mode)%' %T" TeX-run-TeX nil

šššššššššššššššššššššššššššš šššš (latex-mode doctex-mode) :help "Run LaTeX")

šššššššššššššššššššššššššššš ššš ("Makeinfo" "makeinfo %(extraopts) %t" TeX-run-compile nil

šššššššššššššššššššššššššššš šššš (texinfo-mode) :help "Run Makeinfo with Info output")

šššššššššššššššššššššššššššš ššš ("Makeinfo HTML" "makeinfo %(extraopts) --html %t"

šššššššššššššššššššššššššššš šššš TeX-run-compile nil (texinfo-mode) :help

šššššššššššššššššššššššššššš šššš "Run Makeinfo with HTML output")

šššššššššššššššššššššššššššš ššš ("AmSTeX" "amstex %(PDFout) %`%(extraopts) %S%(mode)%' %t"

šššššššššššššššššššššššššššš šššš TeX-run-TeX nil (ams-tex-mode) :help "Run AMSTeX")

šššššššššššššššššššššššššššš ššš ("ConTeXt"

šššššššššššššššššššššššššššš šššš "%(cntxcom) --once --texutil %(extraopts) %(execopts)%t"

šššššššššššššššššššššššššššš šššš TeX-run-TeX nil (context-mode) :help "Run ConTeXt once")

šššššššššššššššššššššššššššš ššš ("ConTeXt Full" "%(cntxcom) %(extraopts) %(execopts)%t"

šššššššššššššššššššššššššššš šššš TeX-run-TeX nil (context-mode) :help

šššššššššššššššššššššššššššš šššš "Run ConTeXt until completion")

šššššššššššššššššššššššššššš ššš ("BibTeX" "%(bibtex) %s" TeX-run-BibTeX nil

šššššššššššššššššššššššššššš šššš (plain-tex-mode latex-mode doctex-mode ams-tex-mode

šššššššššššššššššššššššššššš ššššš texinfo-mode context-mode)

šššššššššššššššššššššššššššš šššš :help "Run BibTeX")

šššššššššššššššššššššššššššš ššš ("Biber" "biber %s" TeX-run-Biber nil

šššššššššššššššššššššššššššš šššš (plain-tex-mode latex-mode doctex-mode ams-tex-mode

šššššššššššššššššššššššššššš ššššš texinfo-mode)

šššššššššššššššššššššššššššš šššš :help "Run Biber")

šššššššššššššššššššššššššššš ššš ("View" "%V" TeX-run-discard-or-function t t :help

šššššššššššššššššššššššššššš šššš "Run Viewer")

šššššššššššššššššššššššššššš ššš ("Print" "%p" TeX-run-command t t :help "Print the file")

šššššššššššššššššššššššššššš ššš ("Queue" "%q" TeX-run-background nil t :help

šššššššššššššššššššššššššššš šššš "View the printer queue" :visible TeX-queue-command)

šššššššššššššššššššššššššššš ššš ("File" "%(o?)dvips %d -o %f " TeX-run-dvips t

šššššššššššššššššššššššššššš šššš (plain-tex-mode latex-mode doctex-mode ams-tex-mode

šššššššššššššššššššššššššššš ššššš texinfo-mode)

šššššššššššššššššššššššššššš šššš :help "Generate PostScript file")

šššššššššššššššššššššššššššš ššš ("Dvips" "%(o?)dvips %d -o %f " TeX-run-dvips nil

šššššššššššššššššššššššššššš šššš (plain-tex-mode latex-mode doctex-mode ams-tex-mode

šššššššššššššššššššššššššššš ššššš texinfo-mode)

šššššššššššššššššššššššššššš šššš :help "Convert DVI file to PostScript")

šššššššššššššššššššššššššššš ššš ("Dvipdfmx" "dvipdfmx %d" TeX-run-dvipdfmx nil

šššššššššššššššššššššššššššš šššš (plain-tex-mode latex-mode doctex-mode ams-tex-mode

šššššššššššššššššššššššššššš ššššš texinfo-mode)

šššššššššššššššššššššššššššš šššš :help "Convert DVI file to PDF with dvipdfmx")

šššššššššššššššššššššššššššš ššš ("Ps2pdf" "ps2pdf %f" TeX-run-ps2pdf nil

šššššššššššššššššššššššššššš šššš (plain-tex-mode latex-mode doctex-mode ams-tex-mode

šššššššššššššššššššššššššššš ššššš texinfo-mode)

šššššššššššššššššššššššššššš šššš :help "Convert PostScript file to PDF")

šššššššššššššššššššššššššššš ššš ("Glossaries" "makeglossaries %s" TeX-run-command nil

šššššššššššššššššššššššššššš šššš (plain-tex-mode latex-mode doctex-mode ams-tex-mode

šššššššššššššššššššššššššššš ššššš texinfo-mode)

šššššššššššššššššššššššššššš šššš :help "Run makeglossaries to create glossary\nšššš file")

šššššššššššššššššššššššššššš ššš ("Index" "%(makeindex) %s" TeX-run-index nil

šššššššššššššššššššššššššššš šššš (plain-tex-mode latex-mode doctex-mode ams-tex-mode

šššššššššššššššššššššššššššš ššššš texinfo-mode)

šššššššššššššššššššššššššššš šššš :help "Run makeindex to create index file")

šššššššššššššššššššššššššššš ššš ("upMendex" "upmendex %s" TeX-run-index t

šššššššššššššššššššššššššššš šššš (plain-tex-mode latex-mode doctex-mode ams-tex-mode

šššššššššššššššššššššššššššš ššššš texinfo-mode)

šššššššššššššššššššššššššššš šššš :help "Run upmendex to create index file")

šššššššššššššššššššššššššššš ššš ("Xindy" "texindy %s" TeX-run-command nil

šššššššššššššššššššššššššššš šššš (plain-tex-mode latex-mode doctex-mode ams-tex-mode

šššššššššššššššššššššššššššš ššššš texinfo-mode)

šššššššššššššššššššššššššššš šššš :help "Run xindy to create index file")

šššššššššššššššššššššššššššš ššš ("Check" "lacheck %s" TeX-run-compile nil (latex-mode)

šššššššššššššššššššššššššššš šššš :help "Check LaTeX file for correctness")

šššššššššššššššššššššššššššš ššš ("ChkTeX" "chktex -v6 %s" TeX-run-compile nil (latex-mode)

šššššššššššššššššššššššššššš šššš :help "Check LaTeX file for common mistakes")

šššššššššššššššššššššššššššš ššš ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil

šššššššššššššššššššššššššššš šššš t :help "Spell-check the document")

šššššššššššššššššššššššššššš ššš ("Clean" "TeX-clean" TeX-run-function nil t :help

šššššššššššššššššššššššššššš šššš "Delete generated intermediate files")

šššššššššššššššššššššššššššš ššš ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help

šššššššššššššššššššššššššššš šššš "Delete generated intermediate and output files")

šššššššššššššššššššššššššššš ššš ("Other" "" TeX-run-command t t :help

šššššššššššššššššššššššššššš šššš "Run an arbitrary command")

šššššššššššššššššššššššššššš ššš )

TeX-fold-macro-spec-list š' (("[f]"

š ("footnote" "marginpar"))

("[c]"

š ("cite"))

("[l]"

š ("label"))

("[r]"

š ("ref" "pageref" "eqref"))

("[i]"

š ("index" "glossary"))

("[1]:||*"

š ("item"))

("..."

š ("dots"))

("(C)"

š ("copyright"))

("(R)"

š ("textregistered"))

("TM"

š ("texttrademark"))

(1

š ("part" "chapter" "section" "subsection" "subsubsection" "paragraph" "subparagraph" "part*" "chapter*" "section*" "subsection*" "subsubsection*" "paragraph*" "subparagraph*" "emph" "textit" "textsl" "textmd" "textrm" "textsf" "texttt" "textbf" "textsc" "textup")))

)