Re: [AUCTeX] font-locking problem

2019-02-09 Thread Greg Bognar
Hi Tassilo,

OK, I think I now understand what's going on.

`TeX-style-path' has the same value in both cases.  But *Messages* is
different.  In the bad version:

Automatic display of crossref information was turned on
Automatic recentering of TOC window was turned on
Starting new Ispell process aspell with en_US dictionary...
Applying style hooks...
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/article.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/titlesec.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/fontenc.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/inputenc.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/babel.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/multicol.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/mdframed.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/geometry.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/fancyhdr.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/paralist.elc...done
Applying style hooks...done

And in the good version:

Automatic display of crossref information was turned on
Automatic recentering of TOC window was turned on
Starting new Ispell process aspell with en_US dictionary...
Applying style hooks...
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/beamer.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/amsmath.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/amstext.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/amsbsy.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/amsopn.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/amssymb.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/amsfonts.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/amsthm.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/color.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/geometry.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/hyperref.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/url.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/nameref.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/inputenc.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/xcolor.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/fontenc.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/babel.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/multicol.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/mdframed.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/fancyhdr.elc...done
Loading /home/greg/.emacs.d/elpa/auctex-12.1.1/style/paralist.elc...done
Sorting xcolor-definecolor...done
Removing duplicates...done
Applying style hooks...done

So yes, beamer.el is loaded in the good version, but not in the bad version.  I
think the reason is because my preamble begins with:

%==8<==8<==8<==8<==8<==8<==8<==8<==%
%% SLIDES
% \documentclass[ignorenonframetext,t]{beamer} %

%% HANDOUT
% \documentclass[ignorenonframetext,t,handout]{beamer} %
% \usepackage{pgfpages} %
% \pgfpagesuselayout{4 on 1}[a4paper,landscape,border shrink=5mm] %

%% NOTES
% \documentclass[a4paper,twocolumn]{article} %
% \usepackage[tiny,noindentafter,compact]{titlesec} % must be loaded before
%   % beamerarticle
% \usepackage{beamerarticle} %
%==8<==8<==8<==8<==8<==8<==8<==8<==%

I use this template to generate material for lectures.  When I want to generate
the slides, I uncomment the \documentclass...{beamer} block; when I want to make
handouts for students, I uncomment the \documentclass...handout]{beamer} block;
and for notes for myself, the \documentclass...{article} block.

The lines for the bad version from *Messages* above are from a file with the
\documentclass...{article} block uncommented; the lines for the good version are
from the same file, but with the \documentclass...{beamer} block uncommented.

So I think what happens is that AUCTeX loads style files depending on which
block it finds uncommented when the file is visited.  The fontification seemed
random to me because it depends on which block I happened to leave uncommented
last time I closed the file.

So the solution might be something like:

- Is there a way to tell AUCTeX to load style files for stuff it finds commented
out?  E.g., when I leave the \documentclass...{article} block uncommented, it
could still load beamer.el?  After all, if you have a commented out
\documentclass or \usepackage in your preamble, you might want to uncomment it
later and its style file could be loaded when the file is visited.

- If that would create problems, is there a command to tell AUCTeX explicitly to
re-scan the file and load the style 

Re: [AUCTeX] Blurry preview-latex with HiDPI (esp. Apple's Retina display)

2019-02-09 Thread A540OJhQ3kS
Hello,

Thank for the suggestion. That was the first thing I tried actually and it 
worked well with Debian but not with MacOS. With a bit of hesitation for not 
using "pure" vanilla emacs I gave Mitsuharu Yamamoto’s Mac port version with 
patched AUCTeX a try and now it works perfect. But, thanks again!

Regards.

> On Feb 9, 2019, at 8:44 AM, Mosè Giordano  wrote:
> 
> Hi!
> 
> I've recently started using a computer with a HiDPI display and adding
> the following line to my init file does the trick for me:
> 
>(setq preview-scale-function 2.0)
> 
> Adjust the scaling value as necessary.
> 
> Bye,
> Mosè
> 
> On Sun, Feb 3, 2019 at 11:32 PM A540OJhQ3kS  wrote:
>> 
>> Hello,
>> 
>> I figured this topic was already raised before, like in 
>> https://lists.gnu.org/archive/html/auctex/2016-05/msg00030.html (starting 
>> from https://auctex.gnu.narkive.com/VIELjyjv/embedded-previews-in-high-dpi)
>> 
>> I was running Debian/Emacs/AUCTeX on my MacBookPro with "Retina display" 
>> with no problem at all once I set the right DPI for X Window. But I recently 
>> had to switch to MacOS and that blurry preview problem became quite an 
>> annoyance that I finally decided to do something about it so I started to 
>> fiddle with various configurations for days to no avail.
>> 
>> It seems the issue has been around for a while so I was wondering whether 
>> the fix is available or not as of now. I'm using Emacs 26.1 obtained from 
>> homebrew (brew cask install emacs), AUCTeX 12.1.1, MacTeX-2018, MacOS Mojave 
>> and MacBookPro with 15 inch retina display.
>> 
>> Thank you!___
>> auctex mailing list
>> auctex@gnu.org
>> https://lists.gnu.org/mailman/listinfo/auctex



publickey - 
Description: application/pgp-key


signature.asc
Description: OpenPGP digital signature
___
auctex mailing list
auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex


Re: [AUCTeX] Blurry preview-latex with HiDPI (esp. Apple's Retina display)

2019-02-09 Thread Mosè Giordano
Hi!

I've recently started using a computer with a HiDPI display and adding
the following line to my init file does the trick for me:

(setq preview-scale-function 2.0)

Adjust the scaling value as necessary.

Bye,
Mosè

On Sun, Feb 3, 2019 at 11:32 PM A540OJhQ3kS  wrote:
>
> Hello,
>
> I figured this topic was already raised before, like in 
> https://lists.gnu.org/archive/html/auctex/2016-05/msg00030.html (starting 
> from https://auctex.gnu.narkive.com/VIELjyjv/embedded-previews-in-high-dpi)
>
> I was running Debian/Emacs/AUCTeX on my MacBookPro with "Retina display" with 
> no problem at all once I set the right DPI for X Window. But I recently had 
> to switch to MacOS and that blurry preview problem became quite an annoyance 
> that I finally decided to do something about it so I started to fiddle with 
> various configurations for days to no avail.
>
> It seems the issue has been around for a while so I was wondering whether the 
> fix is available or not as of now. I'm using Emacs 26.1 obtained from 
> homebrew (brew cask install emacs), AUCTeX 12.1.1, MacTeX-2018, MacOS Mojave 
> and MacBookPro with 15 inch retina display.
>
> Thank you!___
> auctex mailing list
> auctex@gnu.org
> https://lists.gnu.org/mailman/listinfo/auctex

___
auctex mailing list
auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex


Re: [AUCTeX] font-locking problem

2019-02-09 Thread Tassilo Horn
Greg Bognar  writes:

Hi Greg,

> I have an odd font-locking problem in AUCTeX.  When I work on Beamer
> slides, sometimes the font-locking works as in the "good" version of
> the screenshot attached.

Thanks for the good description!  In the "bad" version, the beamer.el
style hasn't been loaded, or at least not the following snippet in it:

   ;; Fontification
   (when (and (featurep 'font-latex)
  (eq TeX-install-font-lock 'font-latex-setup))
 (font-latex-add-keywords '(("title" "[{")
("subtitle" "[{")
("author" "[{")
("date" "[{")
("frametitle" "<[{")) 'slide-title)

That would have told font-latex how to highlight \frametitle.

The question is just, why it sometimes fails to load.  In the bad case,
maybe there's something in *Messages*?  What's the value of
`TeX-style-path' in the good and the bad case?

Bye,
Tassilo


___
auctex mailing list
auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex