summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2025-02-13 21:00:56 +0000
committerKarl Berry <karl@freefriends.org>2025-02-13 21:00:56 +0000
commite0a45f161811ca2bc3c7d5cd2283d8c1b4bbcc43 (patch)
tree06b0c2d704a9aa44c3d00f0b738a673c3561bfc3
parent09abf2f4478101fd04926b6d92219d5350641152 (diff)
sim-os-menus (13feb25)
git-svn-id: svn://tug.org/texlive/trunk@73954 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc-fr.pdfbin430723 -> 506458 bytes
-rw-r--r--Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc-fr.tex85
-rw-r--r--Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc.pdfbin422751 -> 498061 bytes
-rw-r--r--Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc.tex89
-rw-r--r--Master/texmf-dist/tex/latex/sim-os-menus/sim-os-menus.sty85
5 files changed, 249 insertions, 10 deletions
diff --git a/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc-fr.pdf b/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc-fr.pdf
index 916164bc452..9ed5b0122b8 100644
--- a/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc-fr.pdf
+++ b/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc-fr.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc-fr.tex b/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc-fr.tex
index e6abbcb3a75..abc9bb52b0d 100644
--- a/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc-fr.tex
+++ b/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc-fr.tex
@@ -23,8 +23,8 @@
\hypersetup{pdfborder=0 0 0}
\usepackage[margin=2cm]{geometry}
\setlength{\parindent}{0pt}
-\def\TPversion{0.1.3}
-\def\TPdate{28/09/2024}
+\def\TPversion{0.1.4}
+\def\TPdate{13/02/2025}
\usepackage{soul}
\sethlcolor{lightgray!25}
\NewDocumentCommand\MontreCode{ m }{%
@@ -59,7 +59,7 @@
\begin{tabular}{c}
\texttt{Cédric Pierquet}\\
{\ttfamily c pierquet -- at -- outlook . fr}\\
- \texttt{\url{https://github.com/cpierquet/sim-os-menus}} \\
+ \texttt{\url{https://forge.apps.education.fr/pierquetcedric/packages-latex}} \\
\end{tabular}
\end{center}
@@ -490,4 +490,83 @@ Les styles sont définis de manière globale, et ils peuvent être redéfinis si
\end{ArborDossiers}
\end{tcblisting}
+\pagebreak
+
+\subsection{Pouets comme sous Mastodon ou BlueSky}
+
+Il est possible de présenter des messages comme sur les plateformes Mastodon ou BlueSky.
+
+\begin{quote}
+\begin{verbatim}
+\begin{MastodonPost}[clés]<options tcolorbox>
+...
+\end{MastodonPost}
+
+\begin{BlueSkyPost}[clés]<options tcolorbox>
+...
+\end{BlueSkyPost}
+\end{verbatim}
+\end{quote}
+
+Les \textsf{clés} disponibles sont, à donner entre \MontreCode{[...]} :
+\begin{itemize}
+ \item \MontreCode{width} : largeur de la boîte ;
+ \item \MontreCode{avatar} : avatar du compte (si possible en format \textit{carré});
+ \item \MontreCode{name} : pseudo du compte ;
+ \item \MontreCode{account} : compte ;
+ \item \MontreCode{time} : temps passé depuis le post ;
+ \item \MontreCode{counters} : compteurs pour les views/likes/shares ;
+ \item \MontreCode{font} : police du message ;
+ \item \MontreCode{colbg} : couleur de fond de la boîte.
+\end{itemize}
+
+Les entêtes et pies peuvent être redéfinis grâce aux macros suivante :
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5,listing only}
+\newcommand\mastodonheader{%
+ \begin{tblr}{width=\linewidth,colspec={Q[c,m]X[m,l]Q[m,l]},
+ colsep=0pt,cells={font=\scriptsize\sffamily}}
+ $\vcenter{\hbox{\includegraphics[height=4ex]{\mastodonaccountavatar}}}$& {\hspace*{1.25ex}\mastodonaccountname \\ \hspace*{1.25ex}\color{darkgray}{\mastodonaccountadress}} & \color{darkgray}{\faGlobeAmericas~\mastodontime} \\
+ \end{tblr}\par\medskip
+}
+
+\newcommand\blueskyheader{%
+ {\scriptsize\sffamily\textbf{\mastodonaccountname}~
+ \textcolor{darkgray}{\mastodonaccountadress~
+ \textperiodcentered~\mastodontime}}\par\medskip
+}
+
+\newcommand\mastodonfooter{%
+ \textcolor{darkgray}{\scriptsize\scalebox{-1}[1]{\faShare}~\mastodonnumbers[1] \hfill \faRetweet~\mastodonnumbers[2] \hfill \faStar[regular]~\mastodonnumbers[3] \hfill \faBookmark[regular] \hfill \faEllipsisH}
+}
+
+\newcommand\blueskyfooter{%
+ \textcolor{darkgray}{\scriptsize\faComment*[regular]~\mastodonnumbers[1] \hfill \faRetweet~\mastodonnumbers[2] \hfill \faHeart[regular]~\mastodonnumbers[3] \hfill \faEllipsisH \hfill~}
+}
+\end{tcblisting}
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
+\begin{MastodonPost}
+\textbf{TeX} est un système logiciel libre de composition de documents, indépendant du matériel utilisé pour la visualisation ou l'impression. Il a été créé à partir de 1977 par le mathématicien et informaticien Donald Knuth, excédé par la piètre qualité de la typographie des logiciels d'édition de l'époque. \TeX\ a vu le jour pour la première fois en 1978. Il est principalement conçu pour l'édition de documents techniques et est largement utilisé par les scientifiques, particulièrement en mathématiques, physique, bio-informatique, astronomie et informatique. Il est également extensible et permet notamment l'édition de documents plus complexes (affiches, plaquettes publicitaires, partitions musicales\ldots).
+
+\medskip
+
+\url{https://www.latex-project.org}
+\end{MastodonPost}
+\end{tcblisting}
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
+\begin{BlueSkyPost}[width=12cm,account={\symbol{64}TeX.bluesky.social}]
+\textbf{TeX} est un système logiciel libre de composition de documents, indépendant du matériel utilisé pour la visualisation ou l'impression. Il a été créé à partir de 1977 par le mathématicien et informaticien Donald Knuth, excédé par la piètre qualité de la typographie des logiciels d'édition de l'époque. \TeX\ a vu le jour pour la première fois en 1978. Il est principalement conçu pour l'édition de documents techniques et est largement utilisé par les scientifiques, particulièrement en mathématiques, physique, bio-informatique, astronomie et informatique. Il est également extensible et permet notamment l'édition de documents plus complexes (affiches, plaquettes publicitaires, partitions musicales\ldots).
+
+\smallskip
+
+\hfill\includegraphics[width=0.667\linewidth]{example-image-16x9.pdf}\hfill~
+
+\smallskip
+
+\url{https://www.latex-project.org}
+\end{BlueSkyPost}
+\end{tcblisting}
+
\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc.pdf b/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc.pdf
index e350684ab68..438380cca4e 100644
--- a/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc.pdf
+++ b/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc.tex b/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc.tex
index ab3e44596f8..59b3b8b4218 100644
--- a/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc.tex
+++ b/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc.tex
@@ -23,8 +23,8 @@
\hypersetup{pdfborder=0 0 0}
\usepackage[margin=2cm]{geometry}
\setlength{\parindent}{0pt}
-\def\TPversion{0.1.3}
-\def\TPdate{28/09/2024}
+\def\TPversion{0.1.4}
+\def\TPdate{13/02/2025}
\usepackage{soul}
\sethlcolor{lightgray!25}
\NewDocumentCommand\MontreCode{ m }{%
@@ -58,7 +58,7 @@
\begin{tabular}{c}
\texttt{Cédric Pierquet}\\
{\ttfamily c pierquet -- at -- outlook . fr}\\
- \texttt{\url{https://github.com/cpierquet/sim-os-menus}} \\
+ \texttt{\url{https://forge.apps.education.fr/pierquetcedric/packages-latex}} \\
\end{tabular}
\end{center}
@@ -146,6 +146,7 @@ The package loads the packages:
\begin{quote}
\begin{verbatim}
+0.1.4: Mastodon or BlueSky posts 'like'
0.1.3: Fofders/Files like in explorer
0.1.2: Script editor viewer 'like'
0.1.1: French version of the commands
@@ -399,7 +400,7 @@ n2 = suivant
\pagebreak
-\subsection{Folders/files as in explrer}
+\subsection{Folders/files as in explorer}
The \MontreCode{forest} package, with his library \MontreCode{edges}, can present foldertrees.
@@ -488,4 +489,84 @@ Styles are global, but can be locally defined.
\end{ForestDirTree}
\end{tcblisting}
+\pagebreak
+
+\subsection{Posts as in Mastodon or BlueSky}
+
+It's possible to present posts as in Mastodon or BlueSky.
+
+\begin{quote}
+\begin{verbatim}
+\begin{MastodonPost}[options]<tcolorbox keys>
+...
+\end{MastodonPost}
+
+\begin{BlueSkyPost}[options]<tcolorbox keys>
+...
+\end{BlueSkyPost}
+\end{verbatim}
+\end{quote}
+
+Available \textsf{keys}, betweeen \MontreCode{[...]}, are:
+
+\begin{itemize}
+ \item \MontreCode{width}: width of box;
+ \item \MontreCode{avatar}: image of the avatar (square if possible !);
+ \item \MontreCode{name}: pseudo of the account
+ \item \MontreCode{account}: account name;
+ \item \MontreCode{time}: time of post;
+ \item \MontreCode{counters}: counters for views/likes/shares;
+ \item \MontreCode{font}: font fir main text;
+ \item \MontreCode{colbg}: background color of box.
+\end{itemize}
+
+Headers and footers are given by following macros, and can be redefined if necessary !
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5,listing only}
+\newcommand\mastodonheader{%
+ \begin{tblr}{width=\linewidth,colspec={Q[c,m]X[m,l]Q[m,l]},
+ colsep=0pt,cells={font=\scriptsize\sffamily}}
+ $\vcenter{\hbox{\includegraphics[height=4ex]{\mastodonaccountavatar}}}$& {\hspace*{1.25ex}\mastodonaccountname \\ \hspace*{1.25ex}\color{darkgray}{\mastodonaccountadress}} & \color{darkgray}{\faGlobeAmericas~\mastodontime} \\
+ \end{tblr}\par\medskip
+}
+
+\newcommand\blueskyheader{%
+ {\scriptsize\sffamily\textbf{\mastodonaccountname}~
+ \textcolor{darkgray}{\mastodonaccountadress~
+ \textperiodcentered~\mastodontime}}\par\medskip
+}
+
+\newcommand\mastodonfooter{%
+ \textcolor{darkgray}{\scriptsize\scalebox{-1}[1]{\faShare}~\mastodonnumbers[1] \hfill \faRetweet~\mastodonnumbers[2] \hfill \faStar[regular]~\mastodonnumbers[3] \hfill \faBookmark[regular] \hfill \faEllipsisH}
+}
+
+\newcommand\blueskyfooter{%
+ \textcolor{darkgray}{\scriptsize\faComment*[regular]~\mastodonnumbers[1] \hfill \faRetweet~\mastodonnumbers[2] \hfill \faHeart[regular]~\mastodonnumbers[3] \hfill \faEllipsisH \hfill~}
+}
+\end{tcblisting}
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
+\begin{MastodonPost}
+\textbf{TeX}, stylized within the system as \TeX, is a typesetting program which was designed and written by computer scientist and Stanford University professor Donald Knuth and first released in 1978. The term now refers to the system of extensions – which includes software programs called TeX engines, sets of TeX macros, and packages which provide extra typesetting functionality – built around the original TeX language. \TeX\ is a popular means of typesetting complex mathematical formulae; it has been noted as one of the most sophisticated digital typographical systems.
+
+\medskip
+
+\url{https://www.latex-project.org}
+\end{MastodonPost}
+\end{tcblisting}
+
+\begin{tcblisting}{colframe=lightgray,colback=lightgray!5}
+\begin{BlueSkyPost}[width=12cm,account={\symbol{64}TeX.bluesky.social}]
+\textbf{TeX}, stylized within the system as \TeX, is a typesetting program which was designed and written by computer scientist and Stanford University professor Donald Knuth and first released in 1978. The term now refers to the system of extensions – which includes software programs called TeX engines, sets of TeX macros, and packages which provide extra typesetting functionality – built around the original TeX language. \TeX\ is a popular means of typesetting complex mathematical formulae; it has been noted as one of the most sophisticated digital typographical systems.
+
+\smallskip
+
+\hfill\includegraphics[width=0.667\linewidth]{example-image-16x9.pdf}\hfill~
+
+\smallskip
+
+\url{https://www.latex-project.org}
+\end{BlueSkyPost}
+\end{tcblisting}
+
\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/tex/latex/sim-os-menus/sim-os-menus.sty b/Master/texmf-dist/tex/latex/sim-os-menus/sim-os-menus.sty
index ee8a15a8eba..83735177a1c 100644
--- a/Master/texmf-dist/tex/latex/sim-os-menus/sim-os-menus.sty
+++ b/Master/texmf-dist/tex/latex/sim-os-menus/sim-os-menus.sty
@@ -1,9 +1,10 @@
% Author : C. Pierquet
-% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf
+% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{sim-os-menus}[2024/09/28 0.1.3 Present 'context menu'/'terminal'/'windows', with TikZ or tcolorbox (en or fr commands)]
-% 0.1.3 DirTree avec forest
+\ProvidesPackage{sim-os-menus}[2025/02/13 0.1.4 Present 'context menu'/'terminal'/'windows', with TikZ or tcolorbox (en or fr commands)]
+% 0.1.4 Mastodon/BlueSky posts 'like'
+% 0.1.3 DirTree with forest
% 0.1.2 Ajout d'une visionneuse type python
% 0.1.1 French version of the commands
% 0.1.0 Initial version
@@ -972,4 +973,82 @@
\endforest%
}
+%====mastodon & bluesky
+\newcommand\mastodonheader{%
+ \begin{tblr}{width=\linewidth,colspec={Q[c,m]X[m,l]Q[m,l]},colsep=0pt,cells={font=\scriptsize\sffamily}}
+ $\vcenter{\hbox{\includegraphics[height=4ex]{\mastodonaccountavatar}}}$& {\hspace*{1.25ex}\mastodonaccountname \\ \hspace*{1.25ex}\color{darkgray}{\mastodonaccountadress}} & \color{darkgray}{\faGlobeAmericas~\mastodontime} \\
+ \end{tblr}\par\medskip
+}
+
+\newcommand\blueskyheader{%
+ {\scriptsize\sffamily\textbf{\mastodonaccountname}~\textcolor{darkgray}{\mastodonaccountadress~\textperiodcentered~\mastodontime}}\par\medskip
+}
+
+\newcommand\mastodonfooter{%
+ \textcolor{darkgray}{\scriptsize\scalebox{-1}[1]{\faShare}~\mastodonnumbers[1] \hfill \faRetweet~\mastodonnumbers[2] \hfill \faStar[regular]~\mastodonnumbers[3] \hfill \faBookmark[regular] \hfill \faEllipsisH}
+}
+
+\newcommand\blueskyfooter{%
+ \textcolor{darkgray}{\scriptsize\faComment*[regular]~\mastodonnumbers[1] \hfill \faRetweet~\mastodonnumbers[2] \hfill \faHeart[regular]~\mastodonnumbers[3] \hfill \faEllipsisH \hfill~}
+}
+
+\tcbset{StyleMastodon/.style={%
+ nobeforeafter,enhanced,size=small,boxrule=0.5pt,arc=0.5pt,colframe=gray,colback=\mastodoncolbg,before upper={\readlist*\mastodonnumbers\mastodondata\mastodonheader},after upper={\par\medskip\mastodonfooter}
+ }
+}
+
+\tcbset{StyleBluesky/.style={%
+ nobeforeafter,enhanced,size=small,left=11.5mm,top=1.5mm,bottom=1.5mm,right=2mm,boxrule=0.5pt,arc=0.5pt,colframe=gray,colback=\mastodoncolbg,before upper={\readlist*\mastodonnumbers\mastodondata\blueskyheader},after upper={\par\medskip\blueskyfooter},
+ overlay={%
+ \begin{tcbclipinterior}%
+ \draw (interior.north west) node[below right=1.25mm] {\includegraphics[width=7.5mm]{\mastodonaccountavatar}};% {\includegraphics[height=10mm]{\mastodonaccountavatar}};%
+ %\clip ($(interior.north west)+(0.5em,-0.5em)$) rectangle++ (2em,-2em);
+ %\draw ($(interior.north west)+(1.5em,-1.5em)$) node {\includegraphics[height=10mm]{\mastodonaccountavatar}};%
+ \end{tcbclipinterior}
+ }
+ }
+}
+
+\newlength\mastodonwidth
+\defKV[envmastodon]{%
+ width=\setlength{\mastodonwidth}{#1},%
+ avatar=\def\mastodonaccountavatar{#1},%
+ name=\def\mastodonaccountname{#1},%
+ account=\def\mastodonaccountadress{#1},%
+ time=\def\mastodontime{#1},%
+ counters=\def\mastodondata{#1},%
+ font=\def\mastodonfont{#1},%
+ colbg=\def\mastodoncolbg{#1}
+}
+\setKVdefault[envmastodon]{%
+ width=8cm,%
+ avatar={example-grid-100x100pt.pdf},%
+ name={DK},%
+ account={\symbol{64}TeX},%
+ time={59 min},%
+ counters={1,6,4},%
+ font=\footnotesize\sffamily,%
+ colbg=lightgray!5
+}
+
+\NewDocumentEnvironment{MastodonPost}{ O{} D<>{} }%
+{%
+ \restoreKV[envmastodon]%
+ \setKV[envmastodon]{#1}%
+ \tcolorbox[StyleMastodon,width=\mastodonwidth,fontupper=\mastodonfont,#2]
+}%
+{%
+ \endtcolorbox
+}
+
+\NewDocumentEnvironment{BlueSkyPost}{ O{} D<>{} }%
+{%
+ \restoreKV[envmastodon]%
+ \setKV[envmastodon]{#1}%
+ \tcolorbox[StyleBluesky,width=\mastodonwidth,fontupper=\mastodonfont,#2]
+}%
+{%
+ \endtcolorbox
+}
+
\endinput \ No newline at end of file