Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using with Auctex #88

Open
Sparsa opened this issue Nov 5, 2022 · 2 comments
Open

Using with Auctex #88

Sparsa opened this issue Nov 5, 2022 · 2 comments

Comments

@Sparsa
Copy link

Sparsa commented Nov 5, 2022

Describe alternatives you've considered
I have configured it with Auctex, and it is working as expected. I come from a pdf-tools background, it works much better than pdf-tools in fact I love to use dark mode to view the pdf. The only thing that bothers me is the accuracy of "Double click the left button to edit backward" which is only showing the line but not the word, but in pdf-tools, it was accurate up to words in most cases. In fact, auctex supports this accuracy. It would be great if EAF could be configured to word-level accuracy for reverse searching.

Additional context
My auctex setup is as follows
`(load "auctex.el" nil t t); it loads auctex

(add-hook 'LaTeX-mode-hook ;this are the hooks I want to enable during LaTeX-mode
(lambda()
(turn-on-reftex) ;enable reftex
(set (make-local-variable 'company-backends) '((separate: company-reftex-labels company-reftex-citations) (separate: company-auctex-symbols company-auctex-environments company-capf company-auctex-macros) company-math-symbols-latex
company-latex-commands ))
(rainbow-delimiters-mode)
(setq TeX-auto-save t) ;enable autosave on during LaTeX-mode
(setq TeX-parse-self t) ; enable autoparsing
(setq TeX-save-query nil) ;
(setq TeX-source-correlate-method 'synctex) ; enable synctex
(setq TeX-source-correlate-mode t) ; enable text-source-correlate using synctex
(add-to-list 'TeX-view-program-list '("eaf" eaf-pdf-synctex-forward-view ))
(add-to-list 'TeX-view-program-selection '(output-pdf "eaf"))
(setq predictive-latex-electric-environments 1)
(TeX-fold-mode 1); enabling tex fold mode for better readability.
(setq-default TeX-master nil)
(global-set-key (kbd "C-c C-g") 'pdf-sync-forward-search) ;sync from text to pdf
(add-hook 'TeX-after-compilation-finished-functions
#'TeX-revert-document-buffer) ; reload pdf buffer
(setq reftex-plug-into-AUCTeX t) ; enable auctex
(setq reftex-bibliography-commands '("bibliography" "nobibliography" "addbibresource"))
(local-set-key [C-tab] 'TeX-complete-symbol) ;tex complete symbol
; could be ispell as well, depending on your preferences
(setq ispell-program-name "aspell")
; this can obviously be set to any language your spell-checking program supports
(setq ispell-dictionary "english")
(flyspell-mode) ; flyspell mode enable
(flyspell-buffer); flyspell buffer
(turn-on-auto-fill)
(visual-line-mode)
(LaTeX-math-mode)
)
)
`

@luhuaei
Copy link
Collaborator

luhuaei commented Nov 6, 2022

pdf-view return (page-index, x, y) clicked page index, coordinates x and y are counted from the top left corner of the page.

Then using synctex edit get position in .tex file. For my testing, synctex output column field always -1. If synctex edit can return the correct column value, it will so simple to support jump to word (see eaf-pdf-synctex-backward-edit

@Sparsa
Copy link
Author

Sparsa commented Nov 13, 2022

I see you have kept the x and y co-ordinates in the functions, so some how it should work, and it is not working with synctex. I will try to see if I can find something.

I have also found another issue,
(add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer)
does not refresh the pdf buffer, can you check? or it is not needed when using with eaf?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants