diff options
-rw-r--r-- | Master/texmf-dist/doc/latex/sim-os-menus/README.md | 7 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc.pdf | bin | 0 -> 399589 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc.tex | 362 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/sim-os-menus/sim-os-menus.sty | 469 | ||||
-rwxr-xr-x | Master/tlpkg/bin/tlpkg-ctan-check | 3 | ||||
-rwxr-xr-x | Master/tlpkg/libexec/ctan2tds | 1 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc | 1 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/sim-os-menus.tlpsrc | 0 |
8 files changed, 842 insertions, 1 deletions
diff --git a/Master/texmf-dist/doc/latex/sim-os-menus/README.md b/Master/texmf-dist/doc/latex/sim-os-menus/README.md new file mode 100644 index 00000000000..8367c7746d5 --- /dev/null +++ b/Master/texmf-dist/doc/latex/sim-os-menus/README.md @@ -0,0 +1,7 @@ +sim-os-menus is a package to present a window/context menu/terminal like in an OS +------------------------------------------------------------------------------------------------------- +sim-os-menus est un pakage pour afficher une fenêtre, un terminal, un menu contextuel comme dans un OS. +------------------------------------------------------------------------------------------------------- +Author : Cédric Pierquet +email : cpierquet@outlook.fr +Licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt
\ 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 Binary files differnew file mode 100644 index 00000000000..d7e7c69c9b9 --- /dev/null +++ b/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc.pdf 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 new file mode 100644 index 00000000000..677a0883c53 --- /dev/null +++ b/Master/texmf-dist/doc/latex/sim-os-menus/sim-os-menus-doc.tex @@ -0,0 +1,362 @@ +% !TeX TXS-program:compile = txs:///pdflatex + +\documentclass[11pt,a4paper]{ltxdoc} +\usepackage{sim-os-menus} +\usepackage{graphicx} +\usepackage{fancyvrb} +\usepackage{fancyhdr} +\usepackage{hyperref} +\fancyhf{} +\renewcommand{\headrulewidth}{0pt} +%\rhead{\sffamily\small\affloetalab[Legende]} +\lfoot{\sffamily\small [sim-os-menus]} +\rfoot{\sffamily\small - \thepage{} -} +%\rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}} +\usepackage{hologo} +\providecommand\tikzlogo{Ti\textit{k}Z} +\providecommand\TeXLive{\TeX{}Live\xspace} +\providecommand\PSTricks{\textsf{PSTricks}\xspace} +\let\pstricks\PSTricks +\let\TikZ\tikzlogo + +\urlstyle{same} +\hypersetup{pdfborder=0 0 0} +\usepackage[margin=2cm]{geometry} +\setlength{\parindent}{0pt} +\def\TPversion{0.1.0} +\def\TPdate{13/11/2023} +\usepackage{soul} +\sethlcolor{lightgray!25} +\NewDocumentCommand\MontreCode{ m }{% + \hl{\vphantom{\texttt{pf}}\texttt{#1}}% +} + +\begin{document} + +\pagestyle{fancy} + +\thispagestyle{empty} + +\begin{center} + \begin{minipage}{0.88\linewidth} + \begin{tcolorbox}[colframe=yellow,colback=yellow!15] + \begin{center} + \begin{tabular}{c} + {\Huge \texttt{sim-os-menus}}\\ + \\ + {\LARGE Simulate 'windows', 'terminal' or} \\ + {\LARGE 'context menu' like in an OS.} \\ + \\ + {\small \texttt{Version \TPversion{} -- \TPdate}} + \end{tabular} + \end{center} + \end{tcolorbox} +\end{minipage} +\end{center} + +\begin{center} + \begin{tabular}{c} + \texttt{Cédric Pierquet}\\ + {\ttfamily c pierquet -- at -- outlook . fr}\\ + \texttt{\url{https://github.com/cpierquet/sim-os-menus}} \\ +\end{tabular} +\end{center} + +\hrule + +\vfill + +\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5] +\ContextMenu[Font=\sffamily,ListSeps={1,3/1/4/1/},ListOffsets={1,2,1,0}]{% + Menu1(>),Menu2,Menu3(>)(*),Menu4 § + SubMenuA(>),SubMenuB(>)(*) § + SubSubMenu1,SubSubMenu2,SubSubMenu3(>)(*),SubSubMenu4,SubSubMenu5(>) § + SSSSMa,SSSSMa(>)(*),SSSSMc § + OK(*),KO +} +\end{tcolorbox} + +\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5] +\begin{TermUnix}[Width=12cm,Align=center]{} +test@DESKTOP:~$ ping -c 2 ctan.org +PING ctan.org (5.35.249.60) 56(84) bytes of data. +\end{TermUnix} +\end{tcolorbox} + +\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5] +\begin{IMGViewer}[Width=12cm]{} +\includegraphics[width=5cm]{example-image-b} +\end{IMGViewer} +\end{tcolorbox} + +\begin{tcolorbox}[colframe=lightgray,colback=lightgray!5] +\begin{TermMac}[Width=14cm,Align=flush left]{} +[test@server]$ ping -c 2 ctan.org +PING ctan.org (5.35.249.60) 56(84) bytes of data. +\end{TermMac} +\end{tcolorbox} + +\vfill~ + +\pagebreak + +\phantomsection + +\hypertarget{matoc}{} + +\tableofcontents + +\vspace*{5mm} + +\hrule + +\vspace*{5mm} + +\section{Introduction} + +\subsection{Description} + +With this package you can create context menu, or terminal, or doc viewer, like in an OS. + +Global styles are mostly fixed, but some customizations are possible. + +\subsection{Loading} + +To load the package, simply use : + +\begin{quote} +\begin{verbatim} +\usepackage{sim-os-menus} +\end{verbatim} +\end{quote} + +The package loads the packages : + +\begin{itemize} + \item \MontreCode{tikz} (with \MontreCode{calc,positioning}), \MontreCode{pgf}, \MontreCode{pgffor} ; + \item \MontreCode{calc}, \MontreCode{fontawesome5} ; + \item \MontreCode{simplekv}, \MontreCode{xintexpr}, \MontreCode{listofitems}, \MontreCode{xstring} ; + \item \MontreCode{settobox}, \MontreCode{tabularray} ; + \item \MontreCode{tcolorbox} (with \MontreCode{breakable,fitting,skins,listings,listingsutf8,hooks}). +\end{itemize} + +\vfill + +\subsection{History} + +\begin{quote} +\begin{verbatim} +0.1.0 : Initial version +\end{verbatim} +\end{quote} + +\pagebreak + +\section{The macros} + +\subsection{Context menu} + +I order to create a context menu, the command is : + +\begin{quote} +\begin{verbatim} +%----contextual menu +\ContextMenu[keys]{list of items}<tikz options> +\end{verbatim} +\end{quote} + +Optional keys, between \MontreCode{[...]} are : + +\begin{itemize} + \item \MontreCode{ColBack} := background color ; + \item \MontreCode{ColHL} : = highlight color ; + \item \MontreCode{Rounded} := boolean for rounded corners (\MontreCode{true} by default) ; + \item \MontreCode{Font} := font for the items (\MontreCode{\textbackslash normalsize\textbackslash normalfont} by default) ; + \item \MontreCode{ColItems} := color(s) for the items (\MontreCode{black} by default) ; + \item \MontreCode{MarginV} := vertical margin of the lines (\MontreCode{6pt} by default) ; + \item \MontreCode{MarginH} := horizontal margin of the lines (\MontreCode{12pt} by default) ; + \item \MontreCode{Arrow} := character for the arrow (\MontreCode{\textbackslash faCaretRight} by default) ; + \item \MontreCode{ListSeps} := list for the possible sep lines (empty or for all the levels !) ; + \item \MontreCode{ListIcons} := list for the possible icons (empty or for all the levels/items !) ; + \item \MontreCode{ListOffsets} := list for the possible vertical offset of levels (from 2, \ldots !) (empty or for all the sub-levels !) ; + \item \MontreCode{Icons} := boolean for icons (\MontreCode{false} by default) ; + \item \MontreCode{Bar} := boolean for small vertical bar with icons (\MontreCode{true} by default) ; + \item \MontreCode{Space} := horizontal space between levels (\MontreCode{-0.125} by default). +\end{itemize} + +\medskip + +The mandatory argument, between \MontreCode{\{...\}}, is given as : + +\smallskip + +\hfill\MontreCode{item1A,item1B,... § item2A,itemp2B,... § ...}\hfill~ + +\begin{itemize} + \item if an item ends with \MontreCode{(*)}, this is the beginning of the next level (\underline{only one} by level !) ; + \item if an item ends with \MontreCode{(>)} (\underline{before} optional \MontreCode{(*)}), an arrow is written at the end of the line. +\end{itemize} + +A correct usage of the syntax is necessary for the code ! + +\vspace{5mm} + +A few tips, due to \MontreCode{ListIcons}, \MontreCode{ListOffsets} and \MontreCode{ListSeps} keys, which are \textit{sensitive} : + +\begin{itemize} + \item \MontreCode{ListIcons} must have the same number of elements than the number of levels/items (with possible empty items) ; + \item \MontreCode{ListSeps} must have the same number of elements than the number of levels (with possible empty items) ; + \item \MontreCode{ListOffsets} must have the same number of elements than the numbers of sub-levels (with 0 si no offset !). +\end{itemize} + +\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} +%default style +\ContextMenu{Item1A(>),Item1B,Item1C(>)(*),Item1D § Item2A(*),Item2B(>),Item2C} +\end{tcblisting} + +\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} +%custom style +\ContextMenu[Rounded=false,ColBack=yellow,ColHL=teal,% + ListSeps={1,3/2},ColItems={black/white},Icons,Space=0,% + ListIcons={\faCut,\faIcon[regular]{copy},\faCopy,\faPaste / \faNotEqual}] + {Item1A(>)(*),Item1B,Item1C(>),Item1D § Item2A(*),Item2B(>),Item2C} +\end{tcblisting} + +\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} +\ContextMenu[Font=\sffamily,ListSeps={1,3/1/4/1/},ListOffsets={1,2,1,0}]{% + Menu1(>),Menu2,Menu3(>)(*),Menu4 § + SubMenuA(>),SubMenuB(>)(*) § + SubSubMenu1,SubSubMenu2,SubSubMenu3(>)(*),SubSubMenu4,SubSubMenu5(>) § + SSSSMa,SSSSMa(>)(*),SSSSMc § + OK(*),KO +} +\end{tcblisting} + +\pagebreak + +\subsection{Terminal} + +In order to create a terminal (Win/UNiX/Mac), environments are : + +\begin{quote} +\begin{verbatim} +%----Windows like terminal +\begin{TermWin}[keys]{tcbox options} + ... +\end{TermWin} + +%----UNiX like terminal +\begin{TermUnix}[keys]{tcbox options} + ... +\end{TermUnix} + +%----OSX like terminal +\begin{TermMac}[keys]{tcbox options} + ... +\end{TermMac} +\end{verbatim} +\end{quote} + +Optional keys, between \MontreCode{[...]} are : + +\begin{itemize} + \item \MontreCode{Title} := title of the terminal (\MontreCode{Terminal Win/UNiX/Mac} by default) ; + \item \MontreCode{Align} := horizontal alignment of the box (\MontreCode{center} by default) ; + \item \MontreCode{Width} := width of the box (\MontreCode{\textbackslash linewidth} by default). +\end{itemize} + +\medskip + +The mandatory argument, between \MontreCode{\{...\}}, are options to give to the tcbox. + +\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} +\begin{TermWin}{} +Microsoft Windows [version 10.0.22000.493] +(c) Microsoft Corporation. Tous droits réservés. +C:\Users\test>ping ctan.org +Envoi d'une requête 'ping' sur ctan.org [5.35.249.60] avec 32 octets de données : +Réponse de 5.35.249.60 : octets=32 temps=35 ms TTL=51 +Réponse de 5.35.249.60 : octets=32 temps=37 ms TTL=51 +Réponse de 5.35.249.60 : octets=32 temps=35 ms TTL=51 +Réponse de 5.35.249.60 : octets=32 temps=39 ms TTL=51 +Statistiques Ping pour 5.35.249.60: +Paquets : envoyés = 4, reçus = 4, perdus = 0 (perte 0%), +Durée approximative des boucles en millisecondes : +Minimum = 35ms, Maximum = 39ms, Moyenne = 36ms +\end{TermWin} +\end{tcblisting} + +\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} +\begin{TermUnix}[Align=flush right]{hbox} +test@DESKTOP:~$ ping -c 2 ctan.org +PING ctan.org (5.35.249.60) 56(84) bytes of data. +\end{TermUnix} +\end{tcblisting} + +\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} +\begin{TermMac}[Width=14cm,Align=flush left]{} +[test@server]$ ping -c 2 ctan.org +PING ctan.org (5.35.249.60) 56(84) bytes of data. +\end{TermMac} +\end{tcblisting} + +\pagebreak + +\subsection{Viewers} + +In order to create a 'fake' viewer (for \textsf{pdf} or \textsf{img}), environments are : + +\begin{quote} +\begin{verbatim} +%----PDF Viewer like +\begin{PDFViewer}[keys]{tcbox options} + .... +\end{PDFViewer} + +%----Image Viewer like +\begin{IMGViewer}[keys]{tcbox options} + .... +\end{IMGViewer} +\end{verbatim} +\end{quote} + +Optional keys, between \MontreCode{[...]} are : + +\begin{itemize} + \item \MontreCode{Title} := title of the terminal (\MontreCode{Terminal Windows} by default) ; + \item \MontreCode{Align} := horizontal alignment of the box (\MontreCode{center} by default) ; + \item \MontreCode{Width} := width of the box (\MontreCode{\textbackslash linewidth} by default) ; + \item \MontreCode{Halign} := horizontal alignment fot the content (\MontreCode{left} by default) ; + \item \MontreCode{Icons} := boolean for the icons (\MontreCode{true} by default). +\end{itemize} + +\medskip + +The mandatory argument, between \MontreCode{\{...\}}, are options to give to the tcbox. + +\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} +\begin{PDFViewer}{hbox} +\fbox{\includegraphics[page=35,width=6cm]{ProfLycee-doc.pdf}}% +\fbox{\includegraphics[page=36,width=6cm]{ProfLycee-doc.pdf}} +\end{PDFViewer} +\end{tcblisting} + +\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} +\begin{PDFViewer}[Width=14cm,Icons=false]{} +\fbox{\includegraphics[page=65,width=4.75cm]{ProfLycee-doc.pdf}} +\end{PDFViewer} +\end{tcblisting} + +\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} +\begin{IMGViewer}[Icons=false]{hbox} +\includegraphics[width=5cm]{example-image-b} +\end{IMGViewer} +\end{tcblisting} + +\begin{tcblisting}{colframe=lightgray,colback=lightgray!5} +\begin{IMGViewer}[Width=12cm]{} +\includegraphics[width=3cm]{example-image} +\end{IMGViewer} +\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 new file mode 100644 index 00000000000..2271b338d03 --- /dev/null +++ b/Master/texmf-dist/tex/latex/sim-os-menus/sim-os-menus.sty @@ -0,0 +1,469 @@ +% Author : C. Pierquet +% licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txtf + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{sim-os-menus}[2023/11/13 0.1.0 Present 'context menu'/'terminal'/'windows', with TikZ or tcolorbox] +%0.1.0 Initial version + +%====PACKAGES +\RequirePackage{tikz,pgf,pgffor} +\usetikzlibrary{calc,positioning} +\RequirePackage{calc} +\RequirePackage{fontawesome5} +\RequirePackage{simplekv} +\RequirePackage{xintexpr} +\RequirePackage{listofitems} +\RequirePackage{xstring} +\RequirePackage{settobox} +\RequirePackage{tabularray} +\RequirePackage{tcolorbox} +\tcbuselibrary{breakable,fitting,skins,listings,listingsutf8,hooks} + +%****CONTEXTMENU**** +%====USEFULL +\definecolor{ColBackContextMenu}{HTML}{f0f0f0}% +\definecolor{ColHLContextMenu}{HTML}{90c8f6}% +\newlength{\ContMenOffsetIcon}\setlength{\ContMenOffsetIcon}{0pt} +\newlength{\ContMenOffsetArrow}\setlength{\ContMenOffsetArrow}{1em} +\newlength{\ContMenOffsetV}\setlength{\ContMenOffsetV}{6pt} +\newlength{\ContMenOffset}\setlength{\ContMenOffset}{12pt} +\newlength{\ContMenWdth}\newlength{\ContMenWdthTmp} +\newlength{\ContMenHgth}\newlength{\ContMenHgthTmp} +\newsavebox{\maboitemenucontext} +\newsavebox{\maboitelogomenucontext} + +%====KEYS +\defKV[ContextMenu]{% + ColBack=\def\ContMenColBack{#1},% + ColHL=\def\ContMenColHL{#1},% + Font=\def\ContMenuFonte{#1},% + MarginV=\setlength{\ContMenOffsetV}{#1},% + MarginH=\setlength{\ContMenOffset}{#1}, + Arrow=\def\ContMenArrow{#1},% + ListSeps=\xdef\ContMenSep{#1},% + ListIcons=\xdef\ContMenIcons{#1},% + Space=\def\ContMenSpace{#1},% + ColItems=\def\ContMenuColItems{#1},% + ListOffsets=\xdef\ContMenOffsets{#1} +} + +\setKVdefault[ContextMenu]{% + ColBack=ColBackContextMenu,% + ColHL=ColHLContextMenu,% + Rounded=true,% + Font=\normalsize\normalfont,% + MarginV=6pt,% + MarginH=12pt,% + Arrow=\faCaretRight,% + ListSeps={},% + ListIcons={},% + Icons=false,% + Bar=true,% + Space=-0.125,% + ColItems=black,% + ListOffsets={} +} + +%====MACRO +\NewDocumentCommand\ContextMenu{ O{} m D<>{} }{% + %clés + \useKVdefault[ContextMenu]% + \setKV[ContextMenu]{#1}% + \setsepchar{§/,}% + \readlist*\DonnesContMenu{#2}% + \IfEq{\ContMenSep}{}% + {}% + { + \setsepchar[.]{/.,}% + \readlist*\LstSepContMenu{\ContMenSep}% + }% + \IfEq{\ContMenIcons}{}% + {}% + { + \setsepchar[.]{/.,}% + \readlist*\LstIconsContMenu{\ContMenIcons}% + }% + \IfEq{\ContMenOffsets}{}% + {}% + { + \setsepchar{,}% + \readlist*\LstOffsetsContMenu{\ContMenOffsets}% + }% + %colors of items + \IfSubStr{\ContMenuColItems}{/}% + {% + \StrCut{\ContMenuColItems}{/}{\ContMenuColItemsE}{\ContMenuColItemsH}% + }% + {% + \xdef\ContMenuColItemsE{\ContMenuColItems}\xdef\ContMenuColItemsH{\ContMenuColItems} + }% + %height of lines + \sbox{\maboitemenucontext}{\ContMenuFonte qSÉ}% + \settoboxtotalheight{\ContMenHgthTmp}{\maboitemenucontext}% + \ifboolKV[ContextMenu]{Icons}% + {% + \sbox{\maboitelogomenucontext}{\ContMenuFonte\faCreditCard}% + \settoboxwidth{\ContMenOffsetIcon}{\maboitelogomenucontext}% + }% + {% + \setlength{\ContMenOffsetIcon}{0pt}% + }% + \setlength{\ContMenHgth}{\ContMenHgthTmp+2\ContMenOffsetV}% + %environment + \begin{tikzpicture}[#3] + \ifboolKV[ContextMenu]{Rounded}% + {\tikzset{contextborder/.style={rounded corners=4pt}}}% + {\tikzset{contextborder/.style={}}}% + %--first node + \coordinate (I-1-1) at (0,0) ;% + %--levels one by one-- + \foreach \niv in {1,...,\DonnesContMenulen}{% + \def\nivmun{\inteval{\niv-1}}% + \def\nivpun{\inteval{\niv+1}}% + \itemtomacro\DonnesContMenu[\niv]{\ContMenNivTmp}% + \setsepchar{,}\readlist*\ContMenLstItem{\ContMenNivTmp}% + %left nodes + \coordinate (I-\niv-2) at ($(I-\niv-1)+(0,{-\ContMenHgth})$) ;% + \xintifboolexpr{\ContMenLstItemlen >= 2}% + {% + \foreach \i in {2,...,\ContMenLstItemlen}{% + \xdef\j{\inteval{\i+1}}% + \coordinate (I-\niv-\j) at ($(I-\niv-\i)+(0,{-\ContMenHgth})$) ;% + } + }% + {}% + %width calculus + \itemtomacro\ContMenLstItem[1]{\itemtmp}% + \IfEndWith{\itemtmp}{(*)}{\StrGobbleRight{\itemtmp}{3}[\itemtmp]}{}% + \IfEndWith{\itemtmp}{(>)}{\StrGobbleRight{\itemtmp}{3}[\itemtmp]}{}% + \sbox{\maboitemenucontext}{\pgfinterruptpicture\ContMenuFonte\itemtmp\endpgfinterruptpicture}% + \settoboxwidth{\ContMenWdthTmp}{\maboitemenucontext}% + \xdef\tmplistwidth{\the\ContMenWdthTmp}% + \xintifboolexpr{\ContMenLstItemlen >= 2}%calul des autres si besoin + {% + \foreach \i in {2,...,\ContMenLstItemlen}{% + \itemtomacro\ContMenLstItem[\i]{\itemtmp}% + \IfEndWith{\itemtmp}{(*)}{\StrGobbleRight{\itemtmp}{3}[\itemtmp]}{}% + \IfEndWith{\itemtmp}{(>)}{\StrGobbleRight{\itemtmp}{3}[\itemtmp]}{}% + \sbox{\maboitemenucontext}{\pgfinterruptpicture\ContMenuFonte\itemtmp\endpgfinterruptpicture}% + \settoboxwidth{\ContMenWdthTmp}{\maboitemenucontext}% + \xdef\tmplistwidth{\tmplistwidth,\the\ContMenWdthTmp}% + }% + }% + {}% + \pgfmathsetlength{\ContMenWdth}{max(\tmplistwidth)}% + \setlength{\ContMenWdth}{\ContMenWdth+\ContMenOffsetIcon+2\ContMenOffset+\ContMenOffsetArrow}%calcul de la 1ère largeur + %boxes + \draw[contextborder,draw=none,fill=\ContMenColBack] (I-\niv-1) rectangle++ ({\ContMenWdth},{-\ContMenLstItemlen*\ContMenHgth}) ; + \ifboolKV[ContextMenu]{Icons}% + {% + \ifboolKV[ContextMenu]{Bar}{\draw[thick,white] ($(I-\niv-1)+({\ContMenOffset+\ContMenOffsetIcon-3pt},{-0.5\ContMenOffsetV})$) --++ (0,{-\ContMenLstItemlen*\ContMenHgth+\ContMenOffsetV}) ;}{}% + }% + {}% + %labels + \foreach \i in {1,...,\ContMenLstItemlen}{% + \itemtomacro\ContMenLstItem[\i]{\itemtmp}% + \IfEndWith{\itemtmp}{(*)}% + {% + \StrGobbleRight{\itemtmp}{3}[\itemtmp]% + %offset si delared ? + + \IfEq{\ContMenOffsets}{}% + {% + \coordinate (I-\nivpun-1) at ($(I-\niv-\i)+({\ContMenWdth+\ContMenSpace\ContMenOffset},{0})$) ; + }% + {% + \xintifboolexpr{\niv < \DonnesContMenulen}% + {% + \itemtomacro\LstOffsetsContMenu[\niv]{\offsettmp}% + \coordinate (I-\nivpun-1) at ($(I-\niv-\i)+({\ContMenWdth+\ContMenSpace\ContMenOffset},{\offsettmp*\ContMenHgth})$) ; + }% + {}% + }% + + \draw[contextborder,draw=none,fill=\ContMenColHL,fill opacity=0.65] ($(I-\niv-\i)+({0.25\ContMenOffset},{-0.5\ContMenOffsetV})$) rectangle++ ({\ContMenWdth-0.5\ContMenOffset},{-\ContMenHgth+\ContMenOffsetV}) ; + %test if char at the end + \IfEndWith{\itemtmp}{(>)}% + {% + \StrGobbleRight{\itemtmp}{3}[\itemtmp]% + \draw ($(I-\niv-\i)+(0,{-0.5*\ContMenHgth})$) node[inner sep=0pt,right={\ContMenOffset+\ContMenOffsetIcon},font=\ContMenuFonte,text=\ContMenuColItemsH] {\itemtmp} ; + \draw ($(I-\niv-\i)+({\ContMenWdth-0.5\ContMenOffset},{-0.5*\ContMenHgth})$) node[inner sep=0pt,left=0.25\ContMenOffset,font=\ContMenuFonte,text=\ContMenuColItemsH] {$\vcenter{\hbox{\ContMenArrow}}$} ; + }% + {% + \draw ($(I-\niv-\i)+(0,{-0.5*\ContMenHgth})$) node[inner sep=0pt,right={\ContMenOffset+\ContMenOffsetIcon},font=\ContMenuFonte,text=\ContMenuColItemsH] {\itemtmp} ; + }% + }% + {% + \IfEndWith{\itemtmp}{(>)}% + {% + \StrGobbleRight{\itemtmp}{3}[\itemtmp]% + \draw ($(I-\niv-\i)+(0,{-0.5*\ContMenHgth})$) node[inner sep=0pt,right={\ContMenOffset+\ContMenOffsetIcon},font=\ContMenuFonte] {\itemtmp} ; + \draw ($(I-\niv-\i)+({\ContMenWdth-0.5\ContMenOffset},{-0.5*\ContMenHgth})$) node[inner sep=0pt,left=0.25\ContMenOffset,font=\ContMenuFonte,text=\ContMenuColItemsE] {$\vcenter{\hbox{\ContMenArrow}}$} ; + }% + {% + \draw ($(I-\niv-\i)+(0,{-0.5*\ContMenHgth})$) node[inner sep=0pt,right={\ContMenOffset+\ContMenOffsetIcon},font=\ContMenuFonte,text=\ContMenuColItemsE] {\itemtmp} ; + }% + }% + }% + %border + \draw[contextborder,thick,\ContMenColBack!75!black] (I-\niv-1) rectangle++ ({\ContMenWdth},{-\ContMenLstItemlen*\ContMenHgth}) ; + %separators + \IfEq{\ContMenSep}{}% + {}% + {% + \itemtomacro\LstSepContMenu[\niv]{\lstsepniv}% + \IfEq{\lstsepniv}{}% + {}% + {% + \setsepchar{,}% + \readlist*\lstsepnivpos{\lstsepniv} + \foreachitem\sep\in\lstsepnivpos{\def\seppun{\inteval{\sep+1}}\draw[thick,\ContMenColBack!75!black] ($(I-\niv-\seppun)+({0.25\ContMenOffset},0)$) --++ ({\ContMenWdth-0.5\ContMenOffset},0) ;}% + }% + }% + %icons + \ifboolKV[ContextMenu]{Icons}% + {% + \IfEq{\ContMenIcons}{}% + {}% + {% + \itemtomacro\LstIconsContMenu[\niv]{\lsticonsniv}% + \IfEq{\lsticonsniv}{}% + {}% + {% + \setsepchar{,}% + \readlist*\lsticonsnivpos{\lsticonsniv}% + \foreach \i in {1,...,\lsticonsnivposlen}{% + \itemtomacro\lsticonsnivpos[\i]{\icontmp}% + \itemtomacro\DonnesContMenu[\niv,\i]{\itemtmp}% + \IfEndWith{\itemtmp}{(*)}% + {% + \draw ($(I-\niv-\i)+({0.25\ContMenOffset+0.75\ContMenOffsetIcon},{-0.5*\ContMenHgth})$) node[scale=0.9,inner sep=0pt,font=\ContMenuFonte,text=\ContMenuColItemsH] {$\vcenter{\hbox{\icontmp}}$} ; + }% + {% + \draw ($(I-\niv-\i)+({0.25\ContMenOffset+0.75\ContMenOffsetIcon},{-0.5*\ContMenHgth})$) node[scale=0.9,inner sep=0pt,font=\ContMenuFonte,text=\ContMenuColItemsE] {$\vcenter{\hbox{\icontmp}}$} ; + }% + }% + }% + }% + }% + {}% + }% + \end{tikzpicture} +} + +%****TERMINAL**** +%====COLORS +\definecolor{Termmpurple}{RGB}{48,10,36} +\definecolor{Termmgray}{RGB}{70,72,67} +\definecolor{Termogray}{RGB}{148,147,141} +\definecolor{Termoorange}{RGB}{233,101,56} +\definecolor{Termterminal}{RGB}{80,78,70} +\definecolor{Termlinux}{RGB}{0,39,51} +\definecolor{Termwinblue}{HTML}{1883D7} +\definecolor{Termosxgray}{HTML}{D8D6D9} +\definecolor{Termosxgreen}{HTML}{1F8B36} + +%====WINDOWS (OK) +\tcbset{StyleTermWindows/.style={% + enhanced,boxrule=1pt,arc=1pt,before skip=\baselineskip,after skip=\baselineskip,% + colframe=Termwinblue,colback=black,colbacktitle=white,colupper=white,coltitle=black,% + titlerule=0.4pt,left=2pt,top=2pt,bottom=2pt,right=2pt,middle=2pt,% + fonttitle=\bfseries\small\sffamily + } +} + +\setKVdefault[TERMwin]{Title={Terminal Win},Align={center},Width={\linewidth}} + +\newcommand\TermWinComm{% + \begin{tikzpicture}[thick,scale=0.66] + \draw (0,0.5em)--++(1em,0) ; \draw[rounded corners=0.05em] (2em,0) rectangle++ (0.8em,0.8em) ; \draw[rounded corners=0.05em] (2.2em,0.2em) rectangle++ (0.8em,0.8em) ; \draw (4em,1em)--(5em,0) (4em,0)--(5em,1em) ; + \end{tikzpicture}% +} + +\newcommand\TermWinTitle{% + \begin{tblr}{colsep=0pt,rowsep=0pt,width=\linewidth,colspec={X[l]r}} + {\footnotesize\faTerminal}~~\useKV[TERMwin]{Title} & \TermWinComm \\ % + \end{tblr} +} + +\NewDocumentEnvironment{TermWin}{ O{} m } +{% + \restoreKV[TERMwin]% + \setKV[TERMwin]{#1}% + \tcblisting{StyleTermWindows,{\useKV[TERMwin]{Align}},title={\TermWinTitle},listing only,listing engine=listings,listing options={style=tcblatex,language={},basicstyle=\footnotesize\ttfamily},width={\useKV[TERMwin]{Width}},#2} +}% +{% + \endtcblisting% +} + +%====LINUX (OK) +\newcommand{\TermUbuntuWhite}{% + \begin{tikzpicture}[thick,anchor=base,baseline] + \filldraw[Termmgray] (0,0.25em) circle[radius=0.5em] ; + \end{tikzpicture}% +} +\newcommand{\TermUbuntuMin}{% + \begin{tikzpicture}[thick,anchor=base,baseline] + \filldraw[color=Termogray!50!white] (0,0.25em) circle[radius=0.5em]; + \draw[Termterminal](-0.35em,0.25em)--(0.35em,0.25em); + \end{tikzpicture}% +} +\newcommand{\TermUbuntuClose}{% + \begin{tikzpicture}[thick,anchor=base,baseline] + \filldraw[color=Termoorange!70!white] (0,0.25em) circle[radius=0.5em]; + \draw[Termterminal] (-0.32em,-0.07em)--(0.32em,0.57em); + \draw[Termterminal] (-0.32em,0.57em)--(0.32em,-0.07em); + \end{tikzpicture}% +} +\newcommand{\TermUbuntuMax}{% + \begin{tikzpicture}[thick,anchor=base,baseline] + \filldraw[color=Termogray!50!white] (0,0.25em) circle[radius=0.5em]; + \draw[Termterminal] (-0.32em,0.5em) rectangle (0.32em,0); + \end{tikzpicture}% +} + +\tcbset{StyleTermUniX/.style={% + enhanced,boxrule=1pt,arc=4pt,before skip=\baselineskip,after skip=\baselineskip,% + colframe=Termmgray,colback=Termmpurple,colbacktitle=Termmgray,colupper=white,coltitle=white,% + titlerule=0.4pt,left=2pt,top=2pt,bottom=2pt,right=2pt,middle=2pt,% + fonttitle=\bfseries\small\sffamily + } +} + +\setKVdefault[TERMnux]{Title={Terminal UNiX},Align={center},Width={\linewidth}} + +\newcommand\TermNuxTitle{% + \begin{tblr}{colsep=0pt,rowsep=0pt,width=\linewidth,colspec={lX[c]r}} + \TermUbuntuWhite~~\TermUbuntuWhite~~\TermUbuntuWhite & \vphantom{p}\useKV[TERMnux]{Title} & \TermUbuntuMin~~\TermUbuntuMax~~\TermUbuntuClose \\ + \end{tblr} +} + +\NewDocumentEnvironment{TermUnix}{ O{} m } +{% + \restoreKV[TERMnux]% + \setKV[TERMnux]{#1}% + \tcblisting{StyleTermUniX,{\useKV[TERMnux]{Align}},title={\TermNuxTitle},listing only,listing engine=listings,listing options={style=tcblatex,language={},basicstyle=\footnotesize\ttfamily},width={\useKV[TERMnux]{Width}},#2} +}% +{% + \endtcblisting% +} + +%OSX (OK) +\tcbset{StyleTermOSX/.style={% + enhanced,boxrule=1pt,arc=6pt,before skip=\baselineskip,after skip=\baselineskip,% + colframe=Termosxgray,colback=lightgray!15,colbacktitle=Termosxgray,colupper=black,coltitle=black,% + titlerule=0.4pt,left=2pt,top=2pt,bottom=2pt,right=2pt,middle=2pt,% + fonttitle=\bfseries\small\sffamily + } +} + +\newcommand{\TermOSXRed}{% + \begin{tikzpicture}[thick,anchor=base,baseline] + \filldraw[red] (0,0.25em) circle[radius=0.45em] ; + \end{tikzpicture}% +} + +\newcommand{\TermOSXOrange}{% + \begin{tikzpicture}[thick,anchor=base,baseline] + \filldraw[orange] (0,0.25em) circle[radius=0.45em] ; + \end{tikzpicture}% +} + +\newcommand{\TermOSXgreen}{% + \begin{tikzpicture}[thick,anchor=base,baseline] + \filldraw[Termosxgreen] (0,0.25em) circle[radius=0.45em] ; + \end{tikzpicture}% +} + +\newcommand{\TermOSXLG}{% + \begin{tikzpicture}[thick,anchor=base,baseline] + \filldraw[Termosxgray] (0,0.25em) circle[radius=0.45em] ; + \end{tikzpicture}% +} + +\setKVdefault[TERMosx]{Title={Terminal Mac},Align={center},Width={\linewidth}} + +\newcommand\TermOSXTitle{% + \begin{tblr}{colsep=0pt,rowsep=0pt,width=\linewidth,colspec={lX[c]r}} + \TermOSXRed~\TermOSXOrange~\TermOSXgreen & \vphantom{p}\useKV[TERMosx]{Title} & \TermOSXLG~\TermOSXLG~\TermOSXLG \\ + \end{tblr} +} + +\NewDocumentEnvironment{TermMac}{ O{} m } +{% + \restoreKV[TERMosx]% + \setKV[TERMosx]{#1}% + \tcblisting{StyleTermOSX,{\useKV[TERMosx]{Align}},title={\TermOSXTitle},listing only,listing engine=listings,listing options={style=tcblatex,language={},basicstyle=\footnotesize\ttfamily},width={\useKV[TERMosx]{Width}},#2} +}% +{% + \endtcblisting% +} + +%****VIEWERS**** +%PDFVIEWER (OK) +\tcbset{StylePDFViewer/.style={% + enhanced,boxrule=1pt,arc=6pt,before skip=\baselineskip,after skip=\baselineskip,% + colframe=gray,colback=lightgray!5,colbacktitle=lightgray!15,colupper=black,coltitle=black,titlerule=0.4pt,left=2pt,top=2pt,bottom=2pt,right=2pt,middle=0pt,fonttitle=\bfseries\small\sffamily + } +} + +\setKVdefault[PDFViewer]{Title={PDF Viewer},Align={center},Width={\linewidth},Halign={center},Icons=true} + +\NewDocumentCommand\PDFVIewerTitle{ s }{% + \IfBooleanTF{#1}% + {% + \begin{tblr}{colsep=4pt,rowsep=0pt,width=\linewidth,colspec={l|[1pt]X[c]|[1pt]c},cells={font=\footnotesize}} + \vphantom{p}\useKV[PDFViewer]{Title} && \faIcon[regular]{file-pdf} \\ + \end{tblr} + }% + {% + \begin{tblr}{colsep=4pt,rowsep=0pt,width=\linewidth,colspec={l|[1pt]l|[1pt]l|[1pt]l|[1pt]X[c]|[1pt]c},cells={font=\footnotesize}} + \vphantom{p}\useKV[PDFViewer]{Title} & \faIcon[regular]{folder}~~\faPrint~~\faIcon{pencil-alt} & \faArrowLeft~~\faArrowRight & \faExpand~~\faIcon{expand-alt}~~\faIcon{expand-arrows-alt}&&\faIcon[regular]{file-pdf} \\ + \end{tblr} + }% +} + +\NewDocumentEnvironment{PDFViewer}{ O{} m } +{% + \restoreKV[PDFViewer]% + \setKV[PDFViewer]{#1}% + \tcolorbox[StylePDFViewer,{\useKV[PDFViewer]{Align}},title={\ifboolKV[PDFViewer]{Icons}{\PDFVIewerTitle}{\PDFVIewerTitle*}},width={\useKV[PDFViewer]{Width}},halign={\useKV[PDFViewer]{Halign}},#2] +}% +{% + \endtcolorbox% +} + +%IMGVIEWER (OK) +\tcbset{StyleIMGViewer/.style={% + enhanced,boxrule=1pt,arc=6pt,before skip=\baselineskip,after skip=\baselineskip,% + colframe=gray,colback=lightgray!5,colbacktitle=lightgray!15,colupper=black,coltitle=black,titlerule=0.4pt,left=2pt,top=2pt,bottom=2pt,right=2pt,middle=0pt,fonttitle=\bfseries\small\sffamily + } +} + +\setKVdefault[IMGViewer]{Title={Image Viewer},Align={center},Width={\linewidth},Halign={center},Icons=true} + +\NewDocumentCommand\IMGVIewerTitle{ s }{% + \IfBooleanTF{#1}% + {% + \begin{tblr}{colsep=4pt,rowsep=0pt,width=\linewidth,colspec={l|[1pt]X[c]|[1pt]c},cells={font=\footnotesize}} + \vphantom{p}\useKV[IMGViewer]{Title} && \faIcon[regular]{file-image} \\ + \end{tblr} + }% + {% + \begin{tblr}{colsep=4pt,rowsep=0pt,width=\linewidth,colspec={l|[1pt]l|[1pt]l|[1pt]l|[1pt]X[c]|[1pt]c},cells={font=\footnotesize}} + \vphantom{p}\useKV[IMGViewer]{Title} & \faIcon[regular]{folder}~~\faPrint~~\faPen~~\faFillDrip~~\faBorderNone& \faArrowLeft~~\faArrowRight & \faExpand~~\faIcon{expand-alt}~~\faIcon{expand-arrows-alt}&&\faIcon[regular]{file-image} \\ + \end{tblr} + }% +} + +\NewDocumentEnvironment{IMGViewer}{ O{} m } +{% + \restoreKV[IMGViewer]% + \setKV[IMGViewer]{#1}% + \tcolorbox[StyleIMGViewer,{\useKV[IMGViewer]{Align}},title={\ifboolKV[IMGViewer]{Icons}{\IMGVIewerTitle}{\IMGVIewerTitle*}},width={\useKV[IMGViewer]{Width}},halign={\useKV[IMGViewer]{Halign}},#2] +}% +{% + \endtcolorbox% +} + +\endinput
\ No newline at end of file diff --git a/Master/tlpkg/bin/tlpkg-ctan-check b/Master/tlpkg/bin/tlpkg-ctan-check index 7f5f5a863b4..a1b027116b2 100755 --- a/Master/tlpkg/bin/tlpkg-ctan-check +++ b/Master/tlpkg/bin/tlpkg-ctan-check @@ -758,7 +758,8 @@ my @TLP_working = qw( show2e showcharinbox showdim showexpl showhyphenation showkerning showlabels showtags shtthesis shuffle - sidecap sidenotes sidenotesplus sides signchart silence sillypage + sidecap sidenotes sidenotesplus sides signchart + silence sillypage sim-os-menus simple-resume-cv simple-thesis-dissertation simplebnf simplecd simplecv simpleicons simpleinvoice simplekv simplenodes simpleoptics simpler-wick simples-matrices simplewick diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds index 451a09178aa..0fc974d1e93 100755 --- a/Master/tlpkg/libexec/ctan2tds +++ b/Master/tlpkg/libexec/ctan2tds @@ -1843,6 +1843,7 @@ chomp (my $ctan_root = `tlpkginfo --ctan-root`); 'scontents' => '&POSTscontents', 'scrabble' => '&POST_onelevel', 'shipunov' => '&POSTshipunov', + 'sim-os-menus' => '&POST_onelevel', 'simple-resume-cv' => '&POST_simple_rmFonts', 'simple-thesis-dissertation' => '&POST_simple_rmFonts', 'splitindex' => '&POST_do_man', diff --git a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc index 12ddf1488e3..6823ca2ace2 100644 --- a/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc +++ b/Master/tlpkg/tlpsrc/collection-latexextra.tlpsrc @@ -1236,6 +1236,7 @@ depend sidenotes depend sidenotesplus depend silence depend sillypage +depend sim-os-menus depend simplecd depend simplecv depend simpleinvoice diff --git a/Master/tlpkg/tlpsrc/sim-os-menus.tlpsrc b/Master/tlpkg/tlpsrc/sim-os-menus.tlpsrc new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Master/tlpkg/tlpsrc/sim-os-menus.tlpsrc |