diff options
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/letgut/letgut.cls')
-rw-r--r-- | Master/texmf-dist/tex/lualatex/letgut/letgut.cls | 163 |
1 files changed, 83 insertions, 80 deletions
diff --git a/Master/texmf-dist/tex/lualatex/letgut/letgut.cls b/Master/texmf-dist/tex/lualatex/letgut/letgut.cls index 55157bc4b3c..721b776bf50 100644 --- a/Master/texmf-dist/tex/lualatex/letgut/letgut.cls +++ b/Master/texmf-dist/tex/lualatex/letgut/letgut.cls @@ -6,13 +6,13 @@ % -------:| ---------------------------------------------------- % letgut:| Class for the newsletter “La Lettre GUTenberg” % Author:| Association GUTenberg -% E-mail:| secretariat@gutenberg.eu.org +% E-mail:| secretariat@gutenberg-asso.fr % License:| Released under the LaTeX Project Public License % | v1.3c or later % See:| http://www.latex-project.org/lppl.txt % % Copyright (C) 1994-2024 by Association GUTenberg -% <secretariat@gutenberg.eu.org> +% <secretariat@gutenberg-asso.fr> % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License (LPPL), either @@ -31,15 +31,22 @@ % ]{expl3} \NeedsTeXFormat{LaTeX2e}[2020-10-01] \ExplSyntaxOn -\tl_const:Nn \c__letgut_Lettre_tl { \emph{ Lettre } } +\tl_const:Nn \c__letgut_Lettre_plain_tl { Lettre } +\tl_const:Nn \c__letgut_Lettre_tl { \emph{ \c__letgut_Lettre_plain_tl } } \tl_const:Nn \c__letgut_Lettres_tl { \c__letgut_Lettre_tl \emph{ s } } \tl_const:Nn \c__letgut_gutenberg_tl { GUTenberg } \tl_const:Nn \c__letgut_association_tl { association } +\tl_const:Nn \c__letgut_Lettre_gutenberg_plain_tl { + \c__letgut_Lettre_plain_tl~\c_space_tl \c__letgut_gutenberg_tl +} \tl_const:Nn \c__letgut_Lettre_gutenberg_tl { \c__letgut_Lettre_tl~\c_space_tl \c__letgut_gutenberg_tl } +\tl_const:Nn \c__letgut_la_lettre_gutenberg_plain_tl { + la~ \c__letgut_Lettre_gutenberg_plain_tl +} \tl_const:Nn \c__letgut_la_lettre_gutenberg_tl { la~ \c__letgut_Lettre_gutenberg_tl } @@ -48,8 +55,8 @@ } \ExplSyntaxOff \ProvidesExplClass{letgut} -{2024-03-07} -{0.9.9} +{2024-10-07} +{0.9.10} { Class for the newsletter “The GUTenberg Letter” } @@ -642,7 +649,7 @@ \pagecolor[rgb]{\c__letgut_default_pagecolor_screen_clist} \clist_set_eq:NN \g__letgut_pagecolor_clist \c__letgut_default_pagecolor_screen_clist -\DeclareKeys[ letgut ] +\keys_define:nn { letgut } { , for-readers .bool_gset:N = \g__letgut_for_readers_bool , for-readers .initial:n = { true } @@ -679,6 +686,10 @@ } } } + , watermark~ letter .tl_gset:N = \g__letgut_watermark_letter_tl + , watermark~ letter .initial:n = g + , watermark~ scale .tl_gset:N = \g__letgut_watermark_scale_tl + , watermark~ scale .initial:n = 1 , allcolorslinks .code:n = { \colorlet{letgut_allcolors_links}{#1}} , allcolorslinks .initial:V @@ -722,7 +733,7 @@ } \fancyhf{} \fancyhead[RO,LE]{\thepage} -\fancyhead[RE,LO]{\g__letgut_mark_tl} +\fancyhead[RE,LO]{\scshape \g__letgut_mark_tl} \fancyheadoffset[L]{\c__letgut_hoffset_dim} \pagestyle{fancy} \reversemarginpar @@ -838,6 +849,7 @@ #1, coltitle=\l__letgut_toc_color_announce_tl, } +\int_new:N \g__letgut_rebus_int \NewDocumentCommand{\solution}{}{\tcblower} \NewDocumentCommand{\displaysolutions}{}{% \tcbstoprecording\tcbinputrecords% @@ -872,25 +884,27 @@ }, } } -\NewTColorBox[auto~ counter]{rebus}{+!O{}}{% +\NewTColorBox{rebus}{+!O{}}{% + before~ title~ pre = {\int_gincr:N \g__letgut_rebus_int}, rebus~ style, fonttitle=\bfseries, title={Rébus}, - label={rebus@\thetcbcounter}, - after~ upper={\vpageref[ci-dessous]{solution@\thetcbcounter}}, + label={rebus@\int_use:N\g__letgut_rebus_int}, + after~ upper={\vpageref[ci-dessous]{solution@\int_use:N\g__letgut_rebus_int}}, after~ upper~ pre={ \par\bigskip\hfill\scriptsize\itshape Solution\c_space_tl }, lowerbox=ignored, - savelowerto=rebus-\thetcbcounter.tex, - record={\string\rebussolution*[\thetcbcounter][][]}, + savelowerto=rebus-\int_use:N\g__letgut_rebus_int.tex, + record={\string\rebussolution*[\int_use:N\g__letgut_rebus_int][][]}, #1 } \NewDocumentCommand{\rebussolution}{s +o o O{}}{% \IfValueTF{#2}{ \begin{tcolorbox}[ rebus~ style, + label=solution@\int_use:N\g__letgut_rebus_int, halign=justify, before~ title={\lefthand{}~Solution~ du~ rébus\c_space_tl}, title={ @@ -938,7 +952,7 @@ } \str_if_empty:NTF \g__letgut_@title_str { \tl_gset:Nn \g__letgut_mark_tl { - \textit{\c__letgut_La_lettre_gutenberg_tl} + \c__letgut_la_lettre_gutenberg_plain_tl } }{ \tl_gset:Nn \g__letgut_mark_tl { @@ -956,7 +970,7 @@ { \begin{picture}(0,0) \put(-2cm,-25.275cm){ - \includegraphics*[scale=0.96]{ + \__letgut_orig_includegraphics*[scale=0.96]{ \c__letgut_banner_file_tl.pdf } } @@ -964,9 +978,11 @@ } }{ \msg_term:nn{letgut}{Banner~file~not~provided} - \RequirePackage[pagecolor={\g__letgut_pagecolor_clist}]{ - letgut-banner - } + \RequirePackage[ + , pagecolor = { \g__letgut_pagecolor_clist } + , watermark~ letter = { \g__letgut_watermark_letter_tl } + , watermark~ scale = { \g__letgut_watermark_scale_tl } + ]{letgut-banner} } \AddToHook{begindocument/end} { @@ -1282,7 +1298,7 @@ } \NewDocumentCommand {\francophony} { } { \raisebox{-1.5pt}{ - \includegraphics*[width=\f@size pt]{ + \__letgut_orig_includegraphics*[width=\f@size pt]{ letgut-francophony-icon } } @@ -1850,15 +1866,19 @@ \citeauthor } \RenewDocumentCommand {\citeauthor} { O{} O{} m } { - \AtNextCite{\DeclareNameAlias{labelname}{given-family}} + \AtNextCite{ + \DeclareNameAlias{labelname}{given-family} + \protected\def\mkbibnamefamily#1{% + \textnohyphenation{#1}}% + } \__letgut_old_citeauthor[#1][#2]{#3} } -\tl_new:N \g__letgut_bookreview_frontcover_tl +\tl_new:N \l__letgut_bookreview_frontcover_tl \tl_new:N \g__letgut_bookreview_bibkey_tl \keys_define:nn { letgut/bookreview } { title .tl_gset:N = \g__letgut_bookreview_title_tl, - frontcover .tl_gset:N = \g__letgut_bookreview_frontcover_tl, + frontcover .tl_set:N = \l__letgut_bookreview_frontcover_tl, bibkey .tl_gset:N = \g__letgut_bookreview_bibkey_tl, reviewer .tl_gset:N = \g__letgut_bookreview_reviewer_tl, price .tl_gset:N = \g__letgut_bookreview_price_tl, @@ -1871,15 +1891,16 @@ title .value_required:n = true, \cs_generate_variant:Nn \msg_error:nnnn { nnVV } \NewDocumentEnvironment{bookreview}{ m } { + \tl_gclear:N \g__letgut_bookreview_price_tl \keys_set:nn { letgut/bookreview } { #1 } \section{\g__letgut_bookreview_title_tl} - \tl_if_empty:NTF \g__letgut_bookreview_frontcover_tl { + \tl_if_empty:NTF \l__letgut_bookreview_frontcover_tl { \msg_warning:nnV{letgut}{frontcover-missing}{ \g__letgut_bookreview_title_tl } }{ \clist_map_inline:Nn \Gin@extensions { - \file_if_exist:nT{\g__letgut_bookreview_frontcover_tl##1}{ + \file_if_exist:nT{\l__letgut_bookreview_frontcover_tl##1}{ \bool_set_true:N \l__letgut_tmpa_bool \clist_map_break: } @@ -1890,8 +1911,8 @@ title .value_required:n = true, % \raggedleft \raisebox{-\totalheight}{ \fbox{ - \includegraphics[width=-\c__letgut_title_hoffset_dim]{ - \g__letgut_bookreview_frontcover_tl + \includegraphics*[width=-\c__letgut_title_hoffset_dim]{ + \l__letgut_bookreview_frontcover_tl } } } @@ -1901,7 +1922,7 @@ title .value_required:n = true, {letgut} {frontcover-file-not-found} {\g__letgut_bookreview_title_tl} - {\g__letgut_bookreview_frontcover_tl} + {\l__letgut_bookreview_frontcover_tl} } } \noindent @@ -1991,9 +2012,9 @@ title .value_required:n = true, } } \cs_new_protected:Npn \__letgut_attach_non_empty_existing_file:n #1 { - \file_get_size:nN {./#1} \tmpa_tl - \quark_if_no_value:NF \tmpa_tl { - \tl_if_eq:NnF \tmpa_tl {0} { + \file_get_size:nN {./#1.tex} \l__letgut_tmpa_tl + \quark_if_no_value:NF \l__letgut_tmpa_tl { + \tl_if_eq:NnF \l__letgut_tmpa_tl {0} { \seq_gput_left:Nn \g__letgut_included_files_seq { \attachfile[ description={Source~ nécessaire~ (fichier~ `#1.tex`)}, @@ -2008,7 +2029,9 @@ title .value_required:n = true, \FloatBarrier \lstset{ style=__letgut_reset_listings_styles } \acresetall% - \input{#2}% + \begin{refsection} + \input{#2}% + \end{refsection} \bool_if:NT \g__letgut_included_files_attached_bool { \IfBooleanF {#1}{ \__letgut_attach_non_empty_existing_file:n { @@ -2034,7 +2057,7 @@ title .value_required:n = true, } } \seq_remove_duplicates:N \g__letgut_included_files_seq - \marginpar{\seq_use:Nn \g__letgut_included_files_seq { } } + \seq_use:Nn \g__letgut_included_files_seq { \c_space_tl } \seq_clear:N \g__letgut_included_files_seq \bool_gset_false:N \g__letgut_acronyms_file_attached_bool \bool_gset_false:N \g__letgut_lstlanguage_file_attached_bool @@ -2048,7 +2071,7 @@ title .value_required:n = true, \clist_set:Nx \l__letgut_tmpa_clist {\Gin@extensions} \cs_new_protected:Npn \__letgut_includegraphics:nnn #1 #2 #3 { - \file_if_exist:nTF {#3} { + \file_if_exist:nTF {./#3} { \bool_if:NT \g__letgut_included_files_attached_bool { \IfBooleanF {#1}{ \seq_gput_left:Nn \g__letgut_included_files_seq { @@ -2058,16 +2081,15 @@ title .value_required:n = true, présent~ article~ (fichier~ `#3`) }, mimetype=image - ] - {#3} + ]{./#3} } } } - \__letgut_orig_includegraphics[#2]{#3} + \__letgut_orig_includegraphics[#2]{./#3} }{ \bool_gset_false:N \g__letgut_tmpa_bool \clist_map_inline:Nn \l__letgut_tmpa_clist {% - \file_if_exist:nTF {#3##1} { + \file_if_exist:nT {./#3##1} { \clist_map_break:n { \bool_if:NT \g__letgut_included_files_attached_bool { \IfBooleanF {#1}{ @@ -2075,8 +2097,7 @@ title .value_required:n = true, \attachfile[ description={Fichier~ image~ inclus~ dans~ le~ présent~ article~ (fichier~ `#3##1`)}, mimetype=image/##1 - ] - {#3##1} + ]{./#3##1} } } } @@ -2085,11 +2106,11 @@ title .value_required:n = true, } } } - \bool_if:NF \g__letgut_tmpa_bool { - \@latex@error{File~ `#3'~ not~ found}% - {I~ could~ not~ locate~ the~ file~ with~ any~ of~ these~ extensions:^^J% - \clist_use:Nn \l__letgut_tmpa_clist { ~ }^^J\@ehc}% - } + % \bool_if:NF \g__letgut_tmpa_bool { + % \@latex@error{File~ `#3'~ not~ found}% + % {I~ could~ not~ locate~ the~ file~ with~ any~ of~ these~ extensions:^^J% + % \clist_use:Nn \l__letgut_tmpa_clist { ~ }^^J\@ehc}% + % } } } \RenewDocumentCommand {\includegraphics} {s O{} m } { @@ -2569,36 +2590,13 @@ overlay={ style=__letgut_terminal_listings_style, language=terminal, }, - every~ listing~ line={% - \textcolor{__letgut_terminal_prompt}{% - \ttfamily% - \bfseries% - \__letgut_unselectable:n {#1\c_space_tl} - } - }, + fontupper=\ttfamily, + fontlower=\ttfamily, }, } \cs_new_protected:Npn \__letgut_terminal:nnnn #1 #2 #3 #4 { \bool_set_false:N \l__letgut_tmpa_bool - \tl_if_empty:nF {#3}{ - \tcbset{tempfile=\jobname-stdin.tex} - \exp_args:Nx \scantokens - { - \token_to_str:N\begin{tcbwritetemp} - #3 - \token_to_str:N\end{tcbwritetemp} - } - } - \tl_if_empty:nF {#4}{ - \tcbset{tempfile=\jobname-stdout.tex} - \exp_args:Nx \scantokens - { - \token_to_str:N\begin{tcbwritetemp} - #4 - \token_to_str:N\end{tcbwritetemp} - } - } \tl_if_empty:nTF {#3}{ \tl_if_empty:nTF {#4}{ \bool_set_true:N \l__letgut_tmpa_bool @@ -2607,24 +2605,25 @@ overlay={ } }{ \tcbset{colback=__letgut_background_terminal_stdin} - \tl_if_empty:nTF {#4}{ - }{ + \tl_if_empty:nF {#4}{ \tcbset{ bicolor, - middle=0mm, - boxsep=0mm, colbacklower=__letgut_background_terminal_stdout, } } } \bool_if:NF \l__letgut_tmpa_bool { - \begin{tcolorbox}[terminal={#1},#2] + \begin{tcolorbox}[terminal,#2] \lstset{aboveskip=0pt} \tl_if_empty:nF {#3}{ - \tcbset{ - tempfile=\jobname-stdin.tex, + \tl_if_empty:nF {#1}{ + \textcolor{__letgut_terminal_prompt}{% + \ttfamily% + \bfseries% + \__letgut_unselectable:n {#1\c_space_tl} + } } - \tcbusetemplisting + #3 \tl_if_empty:nF {#4}{ \tcblower } @@ -2634,13 +2633,12 @@ overlay={ \lstset{aboveskip=0pt} } \tcbset{ - tempfile=\jobname-stdout.tex, every~ listing~ line={}, listing~ options~ app={ language={} } } - \tcbusetemplisting + #4 } \end{tcolorbox} } @@ -2651,7 +2649,7 @@ overlay={ } \lst@InputCatcodes \def\lst@DefEC{% - \lst@CCECUse \lst@ProcessLetter + \lst@CCECUse \lst@ProcessLetter ^^80^^81^^82^^83^^84^^85^^86^^87^^88^^89^^8a^^8b^^8c^^8d^^8e^^8f% ^^90^^91^^92^^93^^94^^95^^96^^97^^98^^99^^9a^^9b^^9c^^9d^^9e^^9f% ^^a0^^a1^^a2^^a3^^a4^^a5^^a6^^a7^^a8^^a9^^aa^^ab^^ac^^ad^^ae^^af% @@ -2660,11 +2658,16 @@ overlay={ ^^d0^^d1^^d2^^d3^^d4^^d5^^d6^^d7^^d8^^d9^^da^^db^^dc^^dd^^de^^df% ^^e0^^e1^^e2^^e3^^e4^^e5^^e6^^e7^^e8^^e9^^ea^^eb^^ec^^ed^^ee^^ef% ^^f0^^f1^^f2^^f3^^f4^^f5^^f6^^f7^^f8^^f9^^fa^^fb^^fc^^fd^^fe^^ff% - ^^^^201c^^^^201d% for “ and ” + ^^^^201c% for “ + ^^^^201d% for ” ^^^^215b% for ⅛ ^^^^2122% for ™ ^^^^2019% for ’ ^^^^0153% for œ + ^^^^0152% for Œ + ^^^^20ac% for € + ^^^^27e8% for ⟨ + ^^^^27e9% for ⟩ ^^00% } \lst@RestoreCatcodes |