AUCTeX – Specify full path on View command (alternative to %o)

auctexemacs

I'm trying to change the View command in AUCTeX to use my own PDF viewer.
However, my PDF viewer requires the full path of the .pdf file. By default, all solutions proposed on the Internet uses the construct %o to indicate the name of the file.

However, %o only indicates the name of the file, and not the full path. So, my questions are:

  1. Is there a %-construct (similar to %o) to indicate the full path of the file and the name?
  2. Where is the documentation for the %-constructs for AUCTeX? I cannot find it on the manual.

Thank you in advance!

PS. 1:
What I'm trying to do is something like this:

(setq TeX-view-program-list '(("MyReader" "C:\\...\Reader.exe full_path\\%o ")))
(setq TeX-view-program-selection '((output-pdf "MyReader")))

PS. 2:
I'm using Emacs 27.2 on a Windows machine

Best Answer

Here is my solution:

(add-to-list 'TeX-expand-list-builtin
             '("%F" (lambda nil (expand-file-name (TeX-active-master (TeX-output-extension) t)))))

So, this way, %F expands to the filename with the full path.

And, then, you can do:

(setq TeX-view-program-list '(("MyReader" "Reader.exe %F")))
(setq TeX-view-program-selection '((output-pdf "MyReader")))

Thank you very much!