[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Manually enable package completion
From: |
Denis Bitouzé |
Subject: |
Re: Manually enable package completion |
Date: |
Fri, 13 May 2022 12:23:28 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Le 13/05/22 à 11h15, Arash Esbati a écrit :
> Hi Denis,
Hi Arash and Mandar,
many thanks to both of you!
>> Is there a way to manually enable the completion of these packages?
>
> The easiest way is to write a small AUCTeX style file for your custom
> class like this:
>
> (TeX-add-style-hook
> "name-of-your-custom-class"
> (lambda ()
> ;; Name of the styles you want to load:
> (TeX-run-style-hooks "article" "amsmath" "enumitem"))
> TeX-dialect)
Thanks to Mandar's (excellent!) suggestion, I easily obtained the joined
style file.
> Save this snippet as 'name-of-your-custom-class.el' in the directory
> you have in `TeX-style-private'.
`C-h v TeX-style-private` returns:
┌────
│ TeX-style-private is a variable defined in ‘tex.el’.
│ Its value is ("/home/bitouze/.emacs.d/auctex/style")
└────
Hence the file was saved as (`letgut` being the name of the class):
┌────
│ /home/bitouze/.emacs.d/auctex/style/letgut.el
└────
> AUCTeX should load the style next time you open your .tex file
> (assuming you have set `TeX-parse-self' to t).
`C-h v TeX-parse-self` returns:
┌────
│ TeX-parse-self is a variable defined in ‘tex.el’.
│ Its value is t
└────
You can see that `TeX-run-style-hooks` contains
`"listings"`. Nevertheless, with the following file:
--8<---------------cut here---------------start------------->8---
\documentclass{letgut}
\begin{document}
Foo
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% TeX-engine: luatex
%%% End:
--8<---------------cut here---------------end--------------->8---
I do not benefit from any completion (e.g. for `\lstinline`). By
contrast, I do benefit from completion with the following file:
--8<---------------cut here---------------start------------->8---
\documentclass{letgut}
\usepackage{listings}
\begin{document}
Foo
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% TeX-engine: luatex
%%% End:
--8<---------------cut here---------------end--------------->8---
Thanks.
--
Denis
(TeX-add-style-hook
"letgut"
(lambda ()
(TeX-add-to-alist 'LaTeX-provided-class-options
'(("letgut" "for-readers" "for-authors")))
(TeX-add-to-alist 'LaTeX-provided-package-options
'(("microtype" "" "stretch=30" "shrink=25"
"letterspace=150") ("geometry" "a4paper") ("placeins" "section" "above")
("mathtools" "fleqn") ("xcolor" "table") ("babel" "english" "french")
("varioref" "nospace" "french") ("eurosym" "right") ("biblatex" "sorting=none"
"datamodel=letgut" "citestyle=letgut") ("hypcap" "all") ("cleveref" "french")))
(add-to-list 'LaTeX-verbatim-environments-local "ltx-code")
(add-to-list 'LaTeX-verbatim-environments-local "ltx-code-result")
(add-to-list 'LaTeX-verbatim-environments-local "ltx-code-external-result")
(add-to-list 'LaTeX-verbatim-macros-with-braces-local "href")
(add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperref")
(add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperimage")
(add-to-list 'LaTeX-verbatim-macros-with-braces-local "hyperbaseurl")
(add-to-list 'LaTeX-verbatim-macros-with-braces-local "nolinkurl")
(add-to-list 'LaTeX-verbatim-macros-with-braces-local "url")
(add-to-list 'LaTeX-verbatim-macros-with-braces-local "path")
(add-to-list 'LaTeX-verbatim-macros-with-braces-local "lstinline")
(add-to-list 'LaTeX-verbatim-macros-with-delims-local "path")
(add-to-list 'LaTeX-verbatim-macros-with-delims-local "lstinline")
(add-to-list 'LaTeX-verbatim-macros-with-delims-local "Verb*")
(add-to-list 'LaTeX-verbatim-macros-with-delims-local "Verb")
(TeX-run-style-hooks
"latex2e"
"l3keys2e"
"article"
"art11"
"fontspec"
"microtype"
"parskip"
"fancyhdr"
"geometry"
"graphicx"
"array"
"etoc"
"enumitem"
"titlesec"
"fourier-orns"
"placeins"
"fancyvrb"
"booktabs"
"csquotes"
"mathtools"
"accsupp"
"siunitx"
"hologo"
"xcolor"
"tcolorbox"
"refcount"
"ninecolors"
"tabularray"
"babel"
"varioref"
"eurosym"
"listings"
"floatrow"
"biblatex"
"acro"
"hyperref"
"hypcap"
"cleveref")
(TeX-add-symbols
"person"
"author"
"package"
"class"
"file"
"software"
"foreignloc"
"lettre"
"gutenberg"
"gut"
"lettregut"
"Cahier"
"Cahiers"
"letgut"
"letgutcls"
"knuth"
"lamport"
"latinloc"
"cs")
(LaTeX-add-xparse-macros
'("\\RenewDocumentCommand {\\printbibliography} { O{} }"
"printbibliography" " O{} " "Renew")
'("\\RenewDocumentCommand\\author{ m }" "author" " m " "Renew")
'("\\NewDocumentCommand \\letgutsetup { m }" "letgutsetup" " m " "New")
'("\\RenewDocumentCommand {\\item} { s O{} }" "item" " s O{} " "Renew")
'("\\NewDocumentCommand {\\francophony} { }" "francophony" " " "New")
'("\\NewDocumentCommand {\\person} { m }" "person" " m " "New")
'("\\NewDocumentCommand {\\separator} { }" "separator" " " "New")
'("\\NewDocumentCommand \\alertbox {
O{letgut_default_alert_box_color} +m
}" "alertbox" "
O{letgut_default_alert_box_color} +m
" "New")
'("\\NewDocumentCommand{\\package}{ s o m O{package} }" "package" " s o m
O{package} " "New")
'("\\NewDocumentCommand{\\class}{ s o m O{classe} }" "class" " s o m
O{classe} " "New")
'("\\NewDocumentCommand{\\file}{ s m O{fichier} }" "file" " s m O{fichier}
" "New")
'("\\NewDocumentCommand {\\software} { s O{} m O{logiciel} }" "software" "
s O{} m O{logiciel} " "New")
'("\\NewExpandableDocumentCommand { \\gutenberg } { }" "gutenberg" " "
"New")
'("\\NewExpandableDocumentCommand { \\gut } { }" "gut" " " "New")
'("\\NewExpandableDocumentCommand { \\lettre } { }" "lettre" " " "New")
'("\\NewExpandableDocumentCommand { \\lettregut } { }" "lettregut" " "
"New")
'("\\NewExpandableDocumentCommand { \\Cahier } { }" "Cahier" " " "New")
'("\\NewExpandableDocumentCommand { \\Cahiers } { }" "Cahiers" " " "New")
'("\\NewExpandableDocumentCommand { \\letgut } { }" "letgut" " " "New")
'("\\NewExpandableDocumentCommand { \\letgutcls } { }" "letgutcls" " "
"New")
'("\\NewExpandableDocumentCommand { \\tugboat } { }" "tugboat" " " "New")
'("\\NewExpandableDocumentCommand { \\knuth } { }" "knuth" " " "New")
'("\\NewExpandableDocumentCommand { \\lamport } { }" "lamport" " " "New")
'("\\NewDocumentCommand { \\foreignloc } { m }" "foreignloc" " m " "New")
'("\\NewDocumentCommand { \\latinloc } { m }" "latinloc" " m " "New")
'("\\RenewDocumentCommand {\\footnote} { m }" "footnote" " m " "Renew")
'("\\NewDocumentCommand{\\letgutacro}{ O{} m m o }" "letgutacro" " O{} m m
o " "New")
'("\\RenewDocumentCommand {\\citeauthor} { O{} O{} m }" "citeauthor" " O{}
O{} m " "Renew")
'("\\DeclareDocumentCommand{\\meta}{ O{__letgut_meta} m }" "meta" "
O{__letgut_meta} m " "Declare")
'("\\NewDocumentCommand{\\terminal}{ O{\\$} O{} +v +v}" "terminal" " O{\\$}
O{} +v +v" "New"))
(LaTeX-add-xparse-environments
'("\\NewDocumentEnvironment{bookreview}{ m }" "bookreview" " m " "New"))
(LaTeX-add-enumitem-newlists
'("ctannews" "description"))
(LaTeX-add-xcolor-definecolors
"letgut_pagecolor"
"letgut_allcolors_links"
"__letgut_texcs"
"__letgut_comment"
"__letgut_argument-specification-separator"
"__letgut_argument-specification"
"__letgut_mandatory-argument"
"__letgut_environment"
"__letgut_key"
"__letgut_value"
"__letgut_optional-argument"
"__letgut_math"
"__letgut_backgroundCode"
"__letgut_borderCode"
"__letgut_foregroundLinenumber"
"__letgut_foregroundMention"
"__letgut_backgroundResult"
"__letgut_terminal_comment"
"__letgut_terminal_commands"
"__letgut_terminal_keywords"
"__letgut_terminal_variables"
"__letgut_terminal_utilities"
"__letgut_terminal_strings"
"__letgut_foreground_terminal_dark"
"__letgut_background_terminal_dark_stdin"
"__letgut_background_terminal_dark_stdout"
"__letgut_foreground_terminal_light"
"__letgut_background_terminal_light_stdin"
"__letgut_background_terminal_light_stdout"
"__letgut_foreground_terminal"
"__letgut_background_terminal_stdin"
"__letgut_background_terminal_stdout")
(LaTeX-add-tcolorbox-tcbuselibraries
"listings,xparse,breakable,skins,hooks")
(LaTeX-add-listings-lstdefinestyles
"__letgut_reset_listings_styles"
"__letgut_latex_listings_style"
"__letgut_terminal_listings_style")
(LaTeX-add-floatrow-DeclareNewOptions
'("\\DeclareMarginSet{hangleft}" "MarginSet" "hangleft")
'("\\DeclareFloatVCode{__letgut_ruleabove}" "FloatVCode"
"__letgut_ruleabove")
'("\\DeclareFloatVCode{__letgut_rulebelow}" "FloatVCode"
"__letgut_rulebelow")
'("\\DeclareFloatStyle{__letgut_ruled}" "FloatStyle" "__letgut_ruled")))
:latex)
- Manually enable package completion, Denis Bitouzé, 2022/05/13
- Re: Manually enable package completion, Arash Esbati, 2022/05/13
- Re: Manually enable package completion,
Denis Bitouzé <=
- Re: Manually enable package completion, Arash Esbati, 2022/05/13
- Re: Manually enable package completion, Denis Bitouzé, 2022/05/23
- Re: Manually enable package completion, Arash Esbati, 2022/05/24
- Re: Manually enable package completion, Denis Bitouzé, 2022/05/30
- Re: Manually enable package completion, Denis Bitouzé, 2022/05/30
- Re: Manually enable package completion, Arash Esbati, 2022/05/30
Re: Manually enable package completion, Mandar Mitra, 2022/05/13