TobiasZawada / texfrag

Emacs package for previewing LaTeX fragments such as in doxygen comments.
GNU General Public License v3.0
68 stars 4 forks source link

Font size does not affect latex previews #29

Open Eloitor opened 2 years ago

Eloitor commented 2 years ago

I find the previews too small, but increasing the size of the font does not increase the size of the previews.

TobiasZawada commented 2 years ago

Thanks for the report. Previews should be scaled in text-scale-mode.

  1. Please add your Emacs version
  2. Can you reproduce the effect with a minimal init file and attach this file here? Or maybe, it is already reproducible with an empty init file?
Eloitor commented 2 years ago

My emacs version is 28.1 I was in text-scale-mode and the images did not scale with the text.

My minimal init file is the one recomended in melpa

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
;; Comment/uncomment this line to enable MELPA Stable if desired.  See `package-archive-priorities`
;; and `package-pinned-packages`. Most users will not need or want to do this.
;;(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
(package-initialize)

I opened emacs and installed markdown-mode and texfrag-mode. I then opened this markdown file:

# Test

$x^2$ A

And after zooming in I see this:

image

TobiasZawada commented 2 years ago

Thanks for the infos. As workaround, you can customize texfrag-scale to a factor larger than 1.0. Please, report whether this works for you.

Eloitor commented 2 years ago

The workaround works for me, thanks.

TobiasZawada commented 2 years ago

When you scaled up the text with text-scale-mode, did you regenerate the previews with C-c C-p C-d? If you do that, does the font size of the formula adapt to that one of the text?

Eloitor commented 2 years ago

Yes, I didn't do C-c C-p C-d after scaling the text. Now I did and the font size of the formula adapted fine. I will add a hook to run texfrag-document after tex-scale-mode. I think this could be added in the README for reference.

TobiasZawada commented 2 years ago

Adding texfrag-document after each rescaling of the text might become problematic for large documents. Therefore, it is not implemented. But, maybe, one could regenerate only all currently visible fragments.

I have to think about that feature. But, I am rather busy right now. So, this will take some time. I keep the ticket open.