% !TeX TXS-program:compile = txs:///arara % arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} % arara: pdflatex: {shell: no, synctex: no, interaction: batchmode} \documentclass[11pt,a4paper]{ltxdoc} \usepackage{bera} \usepackage{inconsolata} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[scale=0.875]{cabin} \usepackage{calculatoritems} \usepackage{fancyvrb} \usepackage{fancyhdr} \usepackage{tabularray} \usepackage{fontawesome5} \fancyhf{} \renewcommand{\headrulewidth}{0pt} \lfoot{\sffamily\small [calculatoritems]} \cfoot{\sffamily\small - \thepage{} -} \rfoot{\hyperlink{matoc}{\small\faArrowAltCircleUp[regular]}} \usepackage{hologo} \providecommand\tikzlogo{Ti\textit{k}Z} \providecommand\TeXLive{\TeX{}Live\xspace} \let\TikZ\tikzlogo \usepackage{hyperref} \urlstyle{same} \hypersetup{pdfborder=0 0 0} \usepackage[margin=2cm]{geometry} \setlength{\parindent}{0pt} \def\TPversion{0.1.0} \def\TPdate{11/11/2024} \usepackage{enumitem} \usepackage{tcolorbox} \usepackage{pgffor} \tcbuselibrary{breakable,skins,hooks,listingsutf8} \lstdefinestyle{packagestyle} { language=[LaTeX]TeX,% columns=fullflexible,% extendedchars=true,% basicstyle=\small\ttfamily,% keywordstyle={\color{black}},% classoffset=0,% keywords={},% alsoletter={-},% keywordstyle={\color{blue}},% classoffset=1,% alsoletter={-},% morekeywords={},% keywordstyle={\color{violet}},% classoffset=2,% alsoletter={-},% morekeywords={calculatoritems,\CalcItemMenu,nwkstri,tidots,casiodots},% keywordstyle={\color{green!50!black}},% classoffset=3,% morekeywords={xelua,noamssymb,model,type,fsep,font,len,bg,rightsymb},% keywordstyle={\color{orange}},% inputencoding=utf8/latin1 } \lstset{ % language=[LaTeX]TeX,% basicstyle=\small\ttfamily,% keywordstyle={},% % classoffset=0,% % keywords={},% % alsoletter={-},% % keywordstyle={\color{blue}},% % classoffset=1,% % alsoletter={-},% % morekeywords={},% % keywordstyle={\color{violet}},% % classoffset=2,% % alsoletter={-},% % morekeywords={calculatoritems,\CalcItemMenu,nwkstri,tidots,casiodots},% % keywordstyle={\color{green!50!black}},% % classoffset=3,% % morekeywords={xelua,noamssymb,model,type,fsep,font,len,bg,rightsymb},% % keywordstyle={\color{orange}} } \newtcblisting{DemoCode}[1]{% enhanced,width=\linewidth,% bicolor,size=title,% colback=cyan!10!white,% colbacklower=cyan!5!white,% colframe=cyan!75!black,% listing options={% breaklines=true,% breakatwhitespace=true,% style=packagestyle,% basicstyle=\footnotesize\ttfamily,% tabsize=4,% commentstyle={\itshape\color{gray}}, keywordstyle={\color{blue}},% classoffset=0,% keywords={\newfontfamily},% alsoletter={-},% keywordstyle={\color{blue}},% classoffset=1,% alsoletter={-},% morekeywords={\CalcItemMenu,\nwkstri,\tidots,\casiodots},% keywordstyle={\color{violet}},% classoffset=2,% alsoletter={-},% morekeywords={calculatoritems,\CalcItemMenu,nwkstri,tidots,casiodots},% keywordstyle={\color{green!50!black}},% classoffset=3,% morekeywords={xelua,noamssymb,model,type,fsep,font,len,bg,rightsymb},% keywordstyle={\color{orange}} },% #1 } \newtcbinputlisting\DemoCodeFile[1]{% enhanced,width=\linewidth,% bicolor,size=title,% colback=lightgray!10!white,% colbacklower=lightgray!5!white,% colframe=lightgray!75!black,% listing options={% breaklines=true,% breakatwhitespace=true,% style=tcblatex, extendedchars=true,% basicstyle=\tiny\ttfamily,% keywordstyle={},% tabsize=2,% commentstyle={\itshape\color{gray}},% inputencoding=utf8/latin1 },% breakable, listing only,% listing file={#1} } \NewDocumentCommand\ShowCode{ m }{% \colorbox{lightgray!50}{\lstinline!#1!}% } \begin{document} \thispagestyle{empty} \begin{center} \begin{minipage}{0.88\linewidth} \begin{tcolorbox}[colframe=yellow,colback=yellow!15] \begin{center} \renewcommand{\arraystretch}{1.25}% \begin{tabular}{c} {\Huge \texttt{calculatoritems}}\\ \\ {\LARGE Insert items of} \\ {\LARGE classic calculators.} \\ \\ {\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/calculatoritems}} \\ \end{tabular} \end{center} \hrule \vfill \begin{tcblisting}{colframe=lightgray,colback=lightgray!5,listing only} Classic calculators items or menus : 35+E : \CalcItemMenu[model=35+,font=\fontCASIOA]{GRAPH} 90+E: \CalcItemMenu[model=90+,type=bmenu,font=\fontCASIOB]{MAT} MATH+ : \CalcItemMenu[model=math+,font=\fontCASIOB,rightsymb=>]{arithmetic} NWKS : \CalcItemMenu[model=nwks,type=bmenu,rightsymb=\nwkstri,len=12,font\fontNWKS]{X predict} TI : \CalcItemMenu[model=ti,type=itemsel,font=\small\fontTI]{6§{fmin(}} HP Prime : \CalcItemMenu[model=hp,type=itemsel,font=\small\fontHP,rightsymb=>]{4§Quadratic Explorer} \end{tcblisting} \begin{tcolorbox}[colframe=lightgray,colback=lightgray!5] Classic calulators items or menus : \begin{itemize} \item \texttt{35+E~} : \CalcItemMenu[model=35+,font=\fontCASIOA]{GRAPH} \item \texttt{90+E~} : \CalcItemMenu[model=90+,type=bmenu,font=\fontCASIOB,bg=lightgray!5]{MAT} \item \texttt{MATH+} : \CalcItemMenu[model=math+,font=\fontCASIOB,rightsymb=>]{arithmetic} \item \texttt{NWKS~} : \CalcItemMenu[model=nwks,type=bmenu,rightsymb=\nwkstri,len=14, font=\fontNWKS]{X predict} \item \texttt{TI~~~} : \CalcItemMenu[model=ti,type=itemsel,font=\fontTI]{6§{fmin(}} \item \texttt{HP~~~} : \CalcItemMenu[model=hp,type=itemsel,font=\fontHP,rightsymb=>]{4§Quadratic Explorer} \end{itemize} \end{tcolorbox} \vfill~ %\hrule % %\medskip %\emph{% % The \textsf{luarandom} package do the same things, but with the obligation to compile with \hologo{LuaLaTeX}. %} % %\medskip \hrule \vspace*{5mm} \pagebreak \phantomsection \hypertarget{matoc}{} \tableofcontents \vspace*{5mm} \vfill \section{History \& Future} \texttt{0.1.0: Initial version} \texttt{todo~: usage of nodepthtext package ?} \vspace*{5mm} %\hrule \pagebreak \section{Introduction} \subsection{Loading, useful packages} In order to load \ShowCode{calculatoritems}, simply use: \begin{DemoCode}{listing only} \usepackage{calculatoritems} \end{DemoCode} Loaded packages are \ShowCode{xstring}, \ShowCode{calc}, \ShowCode{simplekv}, \ShowCode{tcolorbox} and \ShowCode{circledtext}. Loaded libraries are \ShowCode{calc} and \ShowCode{skins}. \smallskip If \ShowCode{ammsymb} doen't need to be loaded (useful for int. macro), just add \ShowCode{[noamssymb]} to the loading. \begin{DemoCode}{listing only} %w/o amssymb loading \usepackage[noamssymb]{calculatoritems} \end{DemoCode} \subsection{Fonts} The package define shortcuts for fonts, depending on the engine, an option \ShowCode{[xelua]} can be used. \begin{DemoCode}{listing only} %normal loading, for classic engines (pdflatex/latex) \usepackage{calculatoritems} \end{DemoCode} \begin{DemoCode}{listing only} %special loading, for recent engines (xelatex/lualatex) \usepackage[xelua]{calculatoritems} \end{DemoCode} Available fonts are given by followings macros (best fonts are \texttt{teletype}). \begin{DemoCode}{listing only} %normal loading, for classic engines (pdflatex/latex) \newcommand\fontNWKS{% \fontencoding{T1}\fontfamily{SourceCodePro-TLF}\selectfont %nwks } \newcommand\fontCASIOA{% \fontencoding{T1}\fontfamily{AnonymousPro}\fontseries{sb}\selectfont %casio35 } \newcommand\fontCASIOB{% \fontencoding{T1}\fontfamily{AlegreyaSans-TLF}\fontseries{sb}\selectfont %casio90 & math+ } \newcommand\fontTI{% \fontencoding{T1}\fontfamily{AnonymousPro}\fontseries{sb}\selectfont %ti } \newcommand\fontHP{% \fontencoding{T1}\fontfamily{AlegreyaSans-TLF}\fontseries{sb}\selectfont %hp } \end{DemoCode} \begin{DemoCode}{listing only} %special loading, for recent engines (xelatex/lualatex) with fontspec \newfontfamily\fontNWKS{SourceCodePro-Medium} %numworks \newfontfamily\fontCASIOA{AnonymousPro} %casio35 \newfontfamily\fontCASIOB{AlegreyaSans} %casio90 & math+ \newfontfamily\fontTI{AnonymousPro} %ti \newfontfamily\fontHP{AlegreyaSans} %casio90 & math+ \end{DemoCode} \subsection{Special macros} Special macros are available, to match with some custom \textit{symbols}. \begin{DemoCode}{} \nwkstri \qquad \tidots \qquad \casiodots \end{DemoCode} \section{Usage} \subsection{Global usage} The purpose of the main macro is to insert, \textit{inline}, a small \texttt{tcbox} to display \textit{items} as for classic calculators. Size and aspect are fixed, in order to \textit{match} the original rendering. \subsection{The macro} The main macro is \ShowCode{\\CalcItemMenu}. \begin{DemoCode}{listing only} \CalcItemMenu[keys]{content} \end{DemoCode} Available keys are : \begin{itemize}[leftmargin=*] \item \ShowCode{model} : specify the model (\texttt{empty} by default) ; \item \ShowCode{type} : type of item, according to the specified model (\texttt{empty} by default) ; \item \ShowCode{fsep} : length for modifying the sep between rules and content (\texttt{1pt} by default) ; \item \ShowCode{font} : font for the content (\texttt{\textbackslash bfseries\textbackslash ttfamily} by default) ; \item \ShowCode{len} : internal key for modifying length of content, for same models/types (\texttt{auto} by default) ; \item \ShowCode{bg} : bg color or the \textit{external background}, if necessary (\texttt{white} by default) ; \item \ShowCode{rightsymb} : right symbol, if necessary (\texttt{empty} by default). \end{itemize} \section{Samples} \subsection{Generic model} This is the default rendering. Available items are : \begin{itemize}[leftmargin=*] \item \ShowCode{[type=\{\}]} := white menu (default value)\hfill\CalcItemMenu{MyItem} \item \ShowCode{[type=black]} := black menu\hfill\CalcItemMenu[type=black]{MyItem} \end{itemize} \begin{DemoCode}{listing only}% \CalcItemMenu{MyItem} \CalcItemMenu[type=black]{MyItem} \end{DemoCode} \subsection{CASIO 35+ or fx-9860GIII} For this model, the key is \ShowCode{[model=35+]}, and font \ShowCode{[font=\\fontCASIOA]} can be used. By default, there's 4 \textit{characters} in the box, so if there's more, a \textit{h-stretch} is applied. Available items are : \begin{itemize}[leftmargin=*] \item \ShowCode{[type=\{\}]} := white menu (default value) \hfill\CalcItemMenu[model=35+,font=\small\fontCASIOA]{GRPH} \item \ShowCode{[type=bmenu]} := dark menu \hfill\CalcItemMenu[model=35+,type=bmenu,font=\small\fontCASIOA]{GRPH} \item \ShowCode{[type=item]} := item menu \hfill\CalcItemMenu[model=35+,type=item,font=\small\fontCASIOA]{GRPH} \item \ShowCode{[type=itemsel]} := item selected (19 chars) with optional right symbol\hfill\CalcItemMenu[model=35+,type=itemsel,font=\small\fontCASIOA]{TEST LONG ITEM} \end{itemize} \begin{DemoCode}{listing only} \CalcItemMenu[model=35+,font=\small\fontCASIOA]{GRPH} \CalcItemMenu[model=35+,type=bmenu,font=\small\fontCASIOA]{GRPH} \CalcItemMenu[model=35+,type=item,font=\small\fontCASIOA]{GRPH} \CalcItemMenu[model=35+,type=itemsel,font=\small\fontCASIOA]{TEST LONG ITEM} \end{DemoCode} \subsection{CASIO 90+ or fx-CG50} For this model, the key is \ShowCode{[model=90+]}, and font \ShowCode{[font=\\fontCASIOB]} can be used. By default, there's 5 \textit{characters} in the box, so if there's more, a \textit{h-stretch} is applied. Available items are : \begin{itemize}[leftmargin=*] \item \ShowCode{[type=\{\}]} := white menu (default value) \hfill\CalcItemMenu[model=90+,font=\small\fontCASIOB]{GRAPH} \item \ShowCode{[type=bmenu]} := black menu \hfill\CalcItemMenu[model=90+,type=bmenu,font=\small\fontCASIOB]{GRAPH} \item \ShowCode{[type=item]} := item menu \hfill\CalcItemMenu[model=90+,type=item,font=\small\fontCASIOB]{GRAPH} \item \ShowCode{[type=itemsel]} := item selected (22 chars) with optional right symbol \hfill\CalcItemMenu[model=90+,type=itemsel,font=\small\fontCASIOB]{TEST LONG ITEM} \end{itemize} \begin{DemoCode}{listing only} \CalcItemMenu[model=90+,font=\small\fontCASIOB]{GRAPH} \CalcItemMenu[model=90+,type=bmenu,font=\small\fontCASIOB]{GRAPH} \CalcItemMenu[model=90+,type=item,font=\small\fontCASIOB]{GRAPH} \CalcItemMenu[model=90+,type=itemsel,font=\small\fontCASIOB]{TEST LONG ITEM} \end{DemoCode} \subsection{CASIO MATH+} For this model, the key is \ShowCode{[model=math+]} (20 chars), and font \ShowCode{[font=\\fontCASIOB]} can be used. Only one item is available, due to \textit{new global usage}, but \texttt{rightsymb} can be used. \begin{itemize}[leftmargin=*] \item \ShowCode{[rightsymb=\{\}]} (default)\hfill\CalcItemMenu[model=math+,font=\small\fontCASIOB]{MyItem} \item \ShowCode{[rightsymb=>]}\hfill\CalcItemMenu[model=math+,font=\small\fontCASIOB,rightsymb=>]{MyItem} \item \ShowCode{[rightsymb=\\casiodots]}\hfill\CalcItemMenu[model=math+,font=\small\fontCASIOB,rightsymb=\casiodots]{MyItem} \end{itemize} \begin{DemoCode}{listing only} \CalcItemMenu[model=math+,font=\small\fontCASIOB]{MyItem} \CalcItemMenu[model=math+,font=\small\fontCASIOB,rightsymb=>]{MyItem} \CalcItemMenu[model=math+,font=\small\fontCASIOB,rightsymb=\casiodots]{MyItem} \end{DemoCode} \subsection{NUMWORKS} For this model, the key is \ShowCode{[model=nwks]}, and font \ShowCode{[font=\\fontNWKS]} can be used. Available items are : \begin{itemize}[leftmargin=*] \item \ShowCode{[type=\{\}]} := white menu (default)\hfill\CalcItemMenu[model=nwks,font=\small\fontNWKS]{MyItem} \item \ShowCode{[type=gmenu]} := gray menu\hfill\CalcItemMenu[model=nwks,type=gmenu,font=\small\fontNWKS]{MyItem} \item \ShowCode{[type=bmenu]} := black menu (22 chars, with \texttt{rightsymb})\hfill\CalcItemMenu[model=nwks,type=bmenu,font=\small\fontNWKS,rightsymb=\nwkstri]{MyItem} \end{itemize} \begin{DemoCode}{listing only} \CalcItemMenu[model=nwks,font=\small\fontNWKS]{MyItem} \CalcItemMenu[model=nwks,type=gmenu,font=\small\fontNWKS]{MyItem} \CalcItemMenu[model=nwks,type=bmenu,font=\small\fontNWKS,rightsymb=\nwkstri]{MyItem} \end{DemoCode} \subsection{TI} For this model, the key is \ShowCode{[model=ti]}, and font \ShowCode{[font=\\fontTI]} can be used. Available items are : \begin{itemize}[leftmargin=*] \item \ShowCode{[type=\{\}]} := black menu (default)\hfill\CalcItemMenu[model=ti,font=\small\fontTI]{MyItem} \item \ShowCode{[type=menu]} := default menu\hfill\CalcItemMenu[model=ti,type=menu,font=\small\fontTI]{MyItem} \item \ShowCode{[type=itemsel]} := selected itemn, with number\hfill\CalcItemMenu[model=ti,type=itemsel,font=\small\fontTI]{1§{MyItem\tidots}} \end{itemize} \begin{DemoCode}{listing only} \CalcItemMenu[model=ti,font=\small\fontTI]{MyItem} \CalcItemMenu[model=ti,type=menu,font=\small\fontTI]{MyItem} \CalcItemMenu[model=ti,type=itemsel,font=\small\fontTI]{1§{MyItem\tidots}} \end{DemoCode} \subsection{HP Prime} For this model, the key is \ShowCode{[model=hp]}, and font \ShowCode{[font=\\fontHP]} can be used. By default, there's 5 \textit{characters} in the box, so if there's more, a \textit{h-stretch} is applied. Available items are : \begin{itemize}[leftmargin=*] \item \ShowCode{[type=\{\}]} := semi-rounded (default value) \hfill\CalcItemMenu[model=hp,font=\small\fontHP]{Catlg} \item \ShowCode{[type=ritem]} := rounded \hfill\CalcItemMenu[model=hp,type=ritem,font=\small\fontHP]{OK} \item \ShowCode{[type=item]} := item with optional right symbol\hfill\CalcItemMenu[model=hp,type=item,font=\small\fontHP,rightsymb={~>}]{1§Extremum} \item \ShowCode{[type=itemsel]} := item selected (21 chars) with optional right symbol \hfill\CalcItemMenu[model=hp,type=itemsel,font=\small\fontHP,rightsymb=>]{4§Quadratic Explorer} \end{itemize} \begin{DemoCode}{listing only} \CalcItemMenu[model=hp,font=\small\fontHP]{Catlg} \CalcItemMenu[model=hp,type=ritem,font=\small\fontHP]{OK} \CalcItemMenu[model=hp,type=item,font=\small\fontHP,rightsymb={~>}]{1§Extremum} \CalcItemMenu[model=hp,type=itemsel,font=\small\fontHP,rightsymb=>]{4§Quadratic Explorer} \end{DemoCode} \pagebreak \section{The code} \DemoCodeFile{calculatoritems.sty} \end{document}