summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/denisbdoc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-12-11 22:33:19 +0000
committerKarl Berry <karl@freefriends.org>2016-12-11 22:33:19 +0000
commita2c69b93923864902448a34553df6db873ca3600 (patch)
tree3edc48c14457016a5fcb6fd8287edb319acda9f7 /Master/texmf-dist/tex/latex/denisbdoc
parentb61c39de9d5fba4e780315259a21990f6c9b1807 (diff)
denisbdoc
git-svn-id: svn://tug.org/texlive/trunk@42682 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/denisbdoc')
-rw-r--r--Master/texmf-dist/tex/latex/denisbdoc/denisbdoc.sty202
1 files changed, 171 insertions, 31 deletions
diff --git a/Master/texmf-dist/tex/latex/denisbdoc/denisbdoc.sty b/Master/texmf-dist/tex/latex/denisbdoc/denisbdoc.sty
index b2e0a167616..9a30f786df4 100644
--- a/Master/texmf-dist/tex/latex/denisbdoc/denisbdoc.sty
+++ b/Master/texmf-dist/tex/latex/denisbdoc/denisbdoc.sty
@@ -6,7 +6,7 @@
%%
%% denisbdoc.dtx (with options: `package')
%% -----------------------------------------------------------------------------
-%% denisbdoc --- A personal dirty package for documenting packages, version 0.5
+%% denisbdoc --- A personal dirty package for documenting packages, version 0.6
%%
%% Maintained by Denis Bitouz'e
%% E-mail: denis.bitouze@lmpa.univ-littoral.fr
@@ -15,7 +15,7 @@
%% -----------------------------------------------------------------------------
%%
\RequirePackage{expl3,l3keys2e,xparse}
-\ProvidesExplPackage {denisbdoc} {2016/10/30} {0.5}
+\ProvidesExplPackage {denisbdoc} {2016/12/08} {0.6}
{A personal package for documenting packages}
\@ifpackagelater { expl3 } { 2012/11/21 }
{ }
@@ -55,6 +55,7 @@
\RequirePackage{calc}%
\RequirePackage{siunitx}%
\RequirePackage{booktabs}%
+\RequirePackage{multirow}%
\RequirePackage[xr]{zref}%
\RequirePackage[multiple]{footmisc}%
\RequirePackage{rotating}%
@@ -202,11 +203,37 @@
},
}
}
+\tcbset{doc marginnote={if odd page or oneside={flushright upper}{flushright upper}}}
\patchcmd{\@mn@margintest}{\@tempswafalse}{\@tempswatrue}{}{}
\patchcmd{\@mn@margintest}{\@tempswafalse}{\@tempswatrue}{}{}
\reversemarginpar
\DeclareTotalTCBox{\commandshell}{ v }
{ commandshell}{#1}
+\newtcblisting{listingshell}[1][]{%
+ % colback=black,
+ % colupper=white,
+ colback=white,
+ colupper=black,
+ colframe=yellow!75!black,
+ breakable,
+ listing only,
+ listing options={%
+ style=tcblatex,
+ language=bash,
+ escapeinside={(*@}{@*)},
+ upquote=true,
+ showstringspaces=false
+ },
+ every listing line={%
+ \textcolor{red}{%
+ \small\ttfamily\bfseries%
+ \BeginAccSupp{method=plain,ActualText={}}
+ \$
+ \EndAccSupp{}%
+ }
+ },
+ #1
+}
\usetikzlibrary{trees,backgrounds,fit,calc,positioning}
\attachfilesetup{color=Hyperlink}
\newcommand{\indexmark}[1]{\hypertarget{index:#1}{#1}\markboth{#1}{#1}}
@@ -246,15 +273,18 @@
\hyperlink{#2:#1}{\textbf{#1}}%
}%
}
-\ExplSyntaxOn
\DeclareUrlCommand\urldirectory{\urlstyle{tt}}
\ExplSyntaxOn
-\tl_const:Nn \c__denisbdoc_template_string_tl {../exemples/canevas}
-\tl_const:Nn \c__denisbdoc_sample_string_tl {../exemples/specimen}
+\tl_const:Nn \c__denisbdoc_examples_path_tl {../exemples}
+\tl_const:Nn \c__denisbdoc_template_string_tl {\c__denisbdoc_examples_path_tl/canevas}
+\tl_const:Nn \c__denisbdoc_sample_string_tl {\c__denisbdoc_examples_path_tl/specimen}
\tl_const:Nn \c__denisbdoc_flattemplate_string_tl {\c__denisbdoc_template_string_tl/a-plat}
\tl_const:Nn \c__denisbdoc_flatsample_string_tl {\c__denisbdoc_sample_string_tl/a-plat}
\tl_const:Nn \c__denisbdoc_treetemplate_string_tl {\c__denisbdoc_template_string_tl/en-arborescence}
\tl_const:Nn \c__denisbdoc_treesample_string_tl {\c__denisbdoc_sample_string_tl/en-arborescence}
+\tl_const:Nn \c__denisbdoc_template_sample_zip_string_tl {canevas-specimen.zip}
+\tl_const:Nn \c__denisbdoc_these_aux_string_tl {these.aux}
+\tl_const:Nn \c__denisbdoc_these_snippets_directory_tl {extraits-these}
\tl_const:Nn \c__denisbdoc_unixtldirectory_string_tl {/usr/local/}
\tl_const:Nn \c__denisbdoc_tlversion_string_tl {2016}
\tl_const:Nn \c__denisbdoc_wintldirectory_string_tl {c:/}
@@ -297,7 +327,7 @@
@pnumwidth,bookmarksetup,DeclareTextCommand,text,iiint,NewPairedDelimiter,%
norm,lnorm,llnorm,lpnorm,supnorm,abs,prt,brk,brc,lrangle,leqgeq,%
norm*,lnorm*,llnorm*,lpnorm*,supnorm*,abs*,prt*,brk*,brc*,lrangle*,leqgeq*,%
- pdfobjcompresslevel%
+ pdfobjcompresslevel,chaptermark%
},%
morekeywords=[1]{% Environments' names
tabular,tabulary,math,document,minipage,eqnarray,eqnarray*,align,align*,%
@@ -688,6 +718,17 @@
}%
}%
\tcbset{%
+ doc~head={%
+ % boxsep=4pt,arc=4pt,boxrule=0.6pt,%
+ % frame~style=fill,%
+ % colframe=red!50!black,%
+ interior~style={%
+ fill,%
+ color=yellow!10!white,%
+ }%
+ }%
+}
+\tcbset{%
/tcb/doclang/environment~content=contenu~de~l'environnement,
/tcb/doclang/color=~(couleur),
/tcb/doclang/colors=Couleurs,
@@ -752,6 +793,42 @@ Nouv.~:}~#1}
\expandafter\AtBeginDocument\expandafter{%
\expandafter\def\expandafter\endtheindex\expandafter{\endtheindex}%
}
+\ExplSyntaxOff
+\def\imki@finalmessage#1{}% since you're using latexmk
+\def\imki@startidx#1#2{%
+ \if@filesw
+ \def\index{\@bsphack
+ \@ifnextchar [{\@index}{\@index[\imki@jobname]}}
+ \expandafter\newwrite\csname #1@idxfile\endcsname
+ \immediate\openout \csname #1@idxfile\endcsname #1.#2\relax
+ \typeout{Writing index file #1.#2}%
+ \fi}
+\xpatchcmd\imki@makeindex
+ {\imki@startidx\imki@name}
+ {\imki@startidx\imki@name\imki@extout}
+ {}{}
+\xpatchcmd\imki@build
+ {\imki@dokey\imki@title}
+ {\imki@dokey\imki@title
+ \imki@dokey\imki@extin
+ \imki@dokey\imki@extout}
+ {}{}
+\xpatchcmd{\imki@putindex}
+ {\imki@options}
+ {\space~ -o~ #1.\imki@extin\imki@options}
+ {}{}
+\xpatchcmd{\imki@putindex}
+ {.idx}
+ {.\imki@extout}
+ {}{}
+\xpatchcmd{\imki@putindex}
+ {.ind}
+ {.\imki@extin}
+ {}{}
+\def\imki@extout{idx}\def\imki@extin{ind}
+\define@key{imki}{extout}{\def\imki@extout{#1}}
+\define@key{imki}{extin}{\def\imki@extin{#1}}
+\ExplSyntaxOn
\cs_new_protected:Nn \__denisbdoc_alert:n
{
\begingroup
@@ -763,7 +840,6 @@ Nouv.~:}~#1}
{
\__denisbdoc_alert:n {#1}
}%
-\makeindex[name=\jobname-changes,title=Historique~des~changements,options=-L~french~-M~denisbdoc-chng.xdy]
\DeclareDocumentCommand \changes { smmm } {
\IfBooleanTF {#1}
{
@@ -890,6 +966,30 @@ Nouv.~:}~#1}
\__denisbdoc_file:n {#1}%
\IfLanguageName{english}{~directory}{}%
}%
+\NewDocumentCommand \ie { s } {%
+ \IfBooleanTF {#1}
+ {
+ \IfLanguageName{french}{%
+ c'est-\`{a}-dire
+ }{}%
+ \IfLanguageName{english}{%
+ id est
+ }{}%
+ }
+ {
+ \IfLanguageName{french}{%
+ c.-^^c3^^a0-d
+ }{}%
+ \IfLanguageName{english}{%
+ i.e
+ }{}%
+ \@ifnextchar.%
+ {
+ }{
+ .\xspace
+ }%
+ }
+}
\NewDocumentCommand{\program}{ m }
{
\__denisbdoc_file:n {#1}%
@@ -1073,45 +1173,72 @@ Nouv.~:}~#1}
}
}
\bool_if:nT {\g__denisbdoc_yad_bool} {%
+ %
\zexternaldocument{\c__denisbdoc_flatsample_string_tl/these}%
- \bool_new:N \g__denisbdoc_these_aux_exists
- \msg_new:nnn{denisbdoc}{File~these.aux~needed}{%
- File ~`these.aux' ~needed ~(otherwise ~this ~document ~will ~be ~incomplete)!\space
- ~Please ~go ~to ~`\c__denisbdoc_flatsample_string_tl'\space
- directory ~and ~run~first:\\\\
+ \bool_new:N \g__denisbdoc_these_aux_exists%
+ \msg_new:nnn{denisbdoc}{File~ `\c__denisbdoc_these_aux_string_tl'~ needed}{%
+ File~ `\c__denisbdoc_these_aux_string_tl'~ needed~ (otherwise~ this~ document~ will~
+ be~ incomplete)!~ Please~ go~ to~ `\c__denisbdoc_flatsample_string_tl'~
+ directory~ and~ run~ first:\\\\
- \ \ latexmk ~-f ~-pdf ~-jobname=these ~-pdflatex="pdflatex ~\%O ~ \string\ \\
- \ \ '\string\RequirePackage\{etoolbox\} ~ \string\ \\
- \ \ \string\AtEndPreamble\{\string\RequirePackage\{yathesis-demo\}\} ~ \string\ \\
- \ \ \string\input\{\%S\}'"~these.tex
+ \ \ latexmk~ -g~ -pdf~ -jobname=these~ -pdflatex="pdflatex~ \%O~ \string\ \\
+ \ \ '\string\RequirePackage\{etoolbox\}~ \string\ \\
+ \ \ \string\AtEndPreamble\{\string\RequirePackage\{yathesis-demo\}\}~ \string\ \\
+ \ \ \string\input\{\%S\}'"~ these.tex
\\\\
- Afterwards,~recompile~this~document.%
+ Afterwards,~ recompile~ this~ document.%
}%
- \file_if_exist:nTF {\c__denisbdoc_flatsample_string_tl/these.aux} {
- \bool_gset_true:N \g__denisbdoc_these_aux_exists
- }{
+ \file_if_exist:nTF {\c__denisbdoc_flatsample_string_tl/\c__denisbdoc_these_aux_string_tl} { \bool_gset_true:N
+ \g__denisbdoc_these_aux_exists }{
% \bool_gset_false:N \g__denisbdoc_these_aux_exists
- \msg_warning:nn{denisbdoc}{File~these.aux~needed}
+ \msg_warning:nn{denisbdoc}{File~ `\c__denisbdoc_these_aux_string_tl'~ needed}
\AfterEndPreamble{%
\begin{dbwarning}{Documentation~incompl^^c3^^a8te~!}{documentation-incomplete}
- La ~pr^^c3^^a9sente ~documentation ~est ~incompl^^c3^^a8te ~car ~le ~\File{these.aux}\space
- ~est ~absent ~du ~\Folder{specimen/a-plat}. ~Pour ~r^^c3^^a9gler ~le ~probl^^c3^^a8me,\space
- ~rendez-vous ~dans ~ce ~dossier ~et ~compilez ~le ~\File{these.tex} ~au\space
- ~moyen ~de ~la ~commande ~suivante ~(sur ~une ~seule ~ligne) ~:\par\medskip
+ La~ pr^^c3^^a9sente~ documentation~ est~ incompl^^c3^^a8te~ car~ le~
+ \File{\c__denisbdoc_these_aux_string_tl}~ est~ absent~ du~
+ \Folder{\c__denisbdoc_flatsample_string_tl}.~ Pour~ r^^c3^^a9gler~ le~ probl^^c3^^a8me,~
+ rendez-vous~ dans~ ce~ dossier~ et~ compilez~ le~ \File{these.tex}~ au~
+ moyen~ de~ la~ commande~ suivante\footnote{Sur~ une~ seule~ ligne.}~ :
+ \par\medskip
- \lstinline[language=bash,upquote=true,commentstyle=,stringstyle=,showstringspaces=false]+latexmk~-f~-pdf~-jobname=these~-pdflatex="pdflatex~\%O~'\\RequirePackage\{etoolbox\}\\AtEndPreamble\{\\RequirePackage\{yathesis-demo\}\}\\input\{\%S\}'"~these+
+ \lstinline[language=bash,upquote=true,commentstyle=,stringstyle=,showstringspaces=false]+latexmk~-g~ -norc~ -r~ ./latexmkrc~-jobname=these-pdflatex="pdflatex~\%O~'\\RequirePackage\{etoolbox\}\\AtEndPreamble\{\\RequirePackage\{yathesis-demo\}\}\\input\{\%S\}'"~these+
+ \end{dbwarning}
+ }
+ }
+ %
+ \msg_new:nnn{denisbdoc}{File~ `\c__denisbdoc_template_sample_zip_string_tl'~ needed}{%
+ File~ `canevas-specimen.zip'~ needed~ (otherwise~ this~ document~ will~ be~
+ incomplete)!~ Please~ get~ this~ file~ from~ the~ orignal~ yathesis'~
+ documentation~ and~ save~ it~ in~ `../exemples/'~ folder.~ Afterwards,~
+ recompile~ this~ document.%
+ }%
+ \file_if_exist:nTF {../\c__denisbdoc_template_sample_zip_string_tl} {}{
+ \msg_warning:nn{denisbdoc}{File~ `\c__denisbdoc_template_sample_zip_string_tl'~ needed}
+ \AfterEndPreamble{%
+ \begin{dbwarning}{Documentation~incompl^^c3^^a8te~!}{}
+ La~ version~ ^^c3^^a9lectronique~ (\pdf{})~ de~ la~ pr^^c3^^a9sente~ documentation~
+ est~ incompl^^c3^^a8te~ :~ normalement,~ les~ canevas~ et~ sp^^c3^^a9cimens~ y~ sont~
+ int^^c3^^a9gr^^c3^^a9s~ par~ le~ biais~ de~ l'archive~ \gls{zip}~
+ \file{\c__denisbdoc_template_sample_zip_string_tl}~ (alors~ accessible~ par~
+ simple~ clic)~ mais~ ce~ n'est~ pas~ le~ cas~ ici,~ ce~ fichier~ ^^c3^^a9tant~
+ absent~ du~ dossier~ parent.~ % \Folder{\c__denisbdoc_examples_path_tl}.~
+ Pour~ r^^c3^^a9gler~ le~ probl^^c3^^a8me,~ acc^^c3^^a9dez~ ^^c3^^a0~ ce~ fichier~ attach^^c3^^a9~ ^^c3^^a0~ la~
+ version~ ^^c3^^a9lectronique~ originale~ de~ la~ documentation~ de~
+ \yatcl{}\footnote{Disponible~ ^^c3^^a0~ l'adresse~
+ \url{http://ctan.org/pkg/yathesis},~ si~ besoin~ est.}~ et~ placez-le~
+ dans~ le~ \Folder{\c__denisbdoc_examples_path_tl}.
\end{dbwarning}
}
}
+ %
\cs_new_protected:Nn \__denisbdoc_screenshot:nn
{
\bool_if:NTF {\g__denisbdoc_these_aux_exists} {
\fbox{\includegraphics[bylabel=#2,width=#1\linewidth-2\fboxsep-2\fboxrule]{\c__denisbdoc_flatsample_string_tl/these}}%
}{%
\begin{dbwarning}{Copie~d'^^c3^^a9cran~manquante~!}{}
- Il ~devrait ~ici ~y ~avoir ~une ~copie\space
- ~d'^^c3^^a9cran. ~Cf. ~\vref{wa-documentation-incomplete} ~pour ~plus ~de\space
- ~d^^c3^^a9tails.
+ Il~ devrait~ ici~ y~ avoir~ une~ copie\space ~ d'^^c3^^a9cran.~ Cf.~
+ \vref{wa-documentation-incomplete}~ pour~ plus~ de~ d^^c3^^a9tails.
\end{dbwarning}
}
}
@@ -1142,19 +1269,32 @@ Nouv.~:}~#1}
codes,%
#1%
}
-\NewTCBInputListing{\preamblesample}{ O{these.tex} m m }{%
+\NewTCBInputListing{\preamblesampleold}{ O{these.tex} m m }{%
samples,
drop~lifted~shadow,
listing~file={\c__denisbdoc_treesample_string_tl/#1},
listing~options={rangebeginprefix=\\,rangeendsuffix=\},#2},
#3,
}%
-\NewTCBInputListing{\bodysample}{ O{these.tex} m m }{%
+\NewTCBInputListing{\preamblesample}{ m m m }{%
+ samples,
+ drop~lifted~shadow,
+ listing~file={\c__denisbdoc_these_snippets_directory_tl/#1},
+ listing~options={#2},
+ #3,
+}%
+\NewTCBInputListing{\bodysampleold}{ O{these.tex} m m }{%
samples,
listing~file={\c__denisbdoc_treesample_string_tl/#1},
listing~options={rangebeginprefix=\\,rangeendsuffix=\},#2},
#3,
}%
+\NewTCBInputListing{\bodysample}{ m m m }{%
+ samples,
+ listing~file={\c__denisbdoc_these_snippets_directory_tl/#1},
+ listing~options={#2},
+ #3,
+}%
\tl_new:N \g__denisbdoc_number_within_tl
\tl_set:Nn \g__denisbdoc_number_within_tl {chapter}
\@ifclassloaded{gztarticle}{\tl_set:Nn \g__denisbdoc_number_within_tl {section}}{}%