Hi,
On 16/01/2021 00:24, Arash Esbati wrote:
> Actually, it doesn't run the style hook, it only loads the style file.
> You can check this by eval'ing (TeX-style-list) once you load that .tex
> file and/or try to get completion for tikzpicture with `C-c C-e'.
For me, the simple test file actually calls the following hook (in
style/tikz.el):
(TeX-add-style-hook
"tikz"
(lambda ()
(TeX-add-symbols
'("draw" (TeX-TikZ-draw-arg))
'("coordinate" (TeX-TikZ-coordinate-arg))
'("node" (TeX-TikZ-node-arg)))
(LaTeX-add-environments
'("tikzpicture"))))
Thus, I already get completion for tikzpicture. As I wrote before, the
hook was called when processing the `tikz` class option of the
declaration `\documentclass[tikz,border=5pt]{standalone}` (I found this
out using the elisp debugger).
----
> A style file standalone.el which runs the style hooks based on given
> class options can look like this:
[...]
> ,(or LaTeX-global-class-files
> (let ((TeX-file-extensions '("cls")))
> (prog2
> (message "Searching for LaTeX classes...")
> (TeX-search-files-by-type 'texinputs 'global t t)
> (message "Searching for LaTeX classes...done"))))
I am a bit surprised that there is no function for this already.
Otherwise, I think the code looks good. I am not familiar with all the
options, and honestly I've never used the standalone *package* (only the
document class to create a PDF).
Thanks
Maximilian