% Author : C. Pierquet % licence : Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{calculatoritems}[2025/01/25 0.1.1 Menus from classic calculators] %====HISTORIQUE % v 0.1.1 Sample keys + fonts config for LUA + shortcut with img pdf % v 0.1.0 Initial version %====OPTION \newif\if@xelua \@xeluafalse \newif\if@amssymb \@amssymbtrue \DeclareOption{xelua}{\@xeluatrue} \DeclareOption{noamssymb}{\@amssymbfalse} \DeclareOption*{} \ProcessOptions\relax %====SPECIAL FONTS \if@xelua \@ifpackageloaded{fontspec}{}{\RequirePackage{fontspec}} \newfontfamily\fontNWKS{SourceCodePro-Medium}[Scale=MatchLowercase] %numworks \newfontfamily\fontCASIOA{AnonymousPro}[Scale=MatchLowercase] %casio35 \newfontfamily\fontCASIOB{AlegreyaSans}[Scale=MatchLowercase] %casio90 \newfontfamily\fontTI{AnonymousPro}[Scale=MatchLowercase] %ti \newfontfamily\fontHP{AlegreyaSans}[Scale=MatchLowercase] %ti \newfontfamily\fontKEY{Inconsolatazi4}[Scale=MatchLowercase] %global keys \RequirePackage{xstring} \RequirePackage{listofitems} %===== following font files must be downloaded manually (https://packages.cpierquet.fr/packages/graphiques/calculatoritems/calculatoritems_fonts.zip) \defaultfontfeatures[numworks]{Extension=.ttf,UprightFont=numworks-keys-regular,BoldFont=numworks-keys-bold} \newfontfamily{\fontkeyNWKS}{numworks}[Scale=MatchLowercase] \defaultfontfeatures[casiofx]{Extension=.ttf,UprightFont=CFX06} \newfontfamily{\fontkeyCASIOfx}{casiofx}[Scale=MatchLowercase] \defaultfontfeatures[casiocw]{Extension=.ttf,UprightFont=CASIO ClassWiz CW02} \newfontfamily{\fontkeyCASIOcw}{casiocw}[Scale=MatchLowercase] \defaultfontfeatures[texasfr]{Extension=.ttf,UprightFont=TI83PremiumCEKeys} \newfontfamily{\fontkeyTIfr}{texasfr}[Scale=MatchLowercase] \defaultfontfeatures[texasen]{Extension=.ttf,UprightFont=TI84PlusCEKeys} \newfontfamily{\fontkeyTI}{texasen}[Scale=MatchLowercase] %===== end external files \else \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 \newcommand\fontTI{\fontencoding{T1}\fontfamily{AnonymousPro}\fontseries{sb}\selectfont} %ti \newcommand\fontHP{\fontencoding{T1}\fontfamily{AlegreyaSans-TLF}\fontseries{sb}\selectfont} %casio90 \newcommand\fontKEY{\fontencoding{T1}\fontfamily{SourceCodePro-TLF}\fontseries{sb}\selectfont} %global keys \fi %====BASE \if@amssymb \RequirePackage{amssymb} \newcommand\nwkstri{\footnotesize\textcolor{orange}{$\blacktriangleright$}} \fi \RequirePackage{xstring} \RequirePackage{calc} \RequirePackage{simplekv} \RequirePackage{tcolorbox} \RequirePackage{circledtext} \usetikzlibrary{calc} \tcbuselibrary{skins} %====DIMs & Useful \newlength\calcsimmenusfsep \setlength\calcsimmenusfsep{1pt} \newlength\calcsimmenusmenutc \newlength\calcsimmenusitemtc \newlength\calcsimmenusdepth \newcommand\tidots{\scalebox{0.44}[0.55]{...}} \newcommand\casiodots{\circledtext[resize=real,width=0.75em]{$\cdots$}} %====TCSTYLES \tcbset{casiotc/.style={% enhanced,fontupper=\calcsimmenusfont,nobeforeafter,% box align=base,boxsep=\calcsimmenusfsep,% boxrule=0.8pt,left=0pt,right=0pt,top=0pt,% bottom=\dimexpr1pt-\calcsimmenusdepth\relax,no borderline } } \tcbset{casiotcmenunoir/.style={% width=\calcsimmenusmenutc,colframe=black,colback=black,% colupper=white,sharp corners,rounded corners=southeast,% arc=3pt,arc is angular,add to width=1pt } } \tcbset{casiotcmenublanc/.style={% enhanced,frame hidden,width=\calcsimmenusmenutc,% colframe=black,colback=white,colupper=black,% sharp corners,add to width=1pt, borderline north={0.75pt}{0pt}{black}, borderline west={0.75pt}{0pt}{black} } } \tcbset{casiotcitemnoir/.style={% width=\calcsimmenusmenutc,colframe=black,% colback=black,colupper=white,sharp corners,add to width=1pt } } \tcbset{casiotcitemsel/.style={% width=\calcsimmenusitemtc,sharp corners,% colframe=black,colback=black,colupper=white } } \tcbset{casioqd/.style={% fontupper=\calcsimmenusfont,nobeforeafter,% box align=base,boxsep=\calcsimmenusfsep,% boxrule=0.8pt,left=0pt,right=0pt,top=0pt,% bottom=\dimexpr1pt-\calcsimmenusdepth\relax,% } } \tcbset{casioqdmenunoir/.style={% enhanced,width=\calcsimmenusmenutc,colframe=black,% colback=black,colupper=white,arc=1pt,add to width=2pt } } \tcbset{casioqdmenublanc/.style={% width=\calcsimmenusmenutc,colframe=black,colback=white,% colupper=black,rounded corners,arc=1pt,add to width=2pt } } \tcbset{casioqditemnoir/.style={% width=\calcsimmenusmenutc,colframe=black,colback=black,% colupper=white,sharp corners,add to width=2pt } } \tcbset{casioqditemsel/.style={% width=\calcsimmenusitemtc,sharp corners,colframe=black,% colback=black,colupper=white,sharp corners } } \tcbset{vignettemenunwks/.style={% top=\dimexpr0.45pt+0.5\calcsimmenusfsep\relax,bottom=\dimexpr1pt-\calcsimmenusdepth\relax,% left=2pt,right=2pt,fontupper=\calcsimmenusfont,nobeforeafter,% box align=base,boxrule=0.45pt,boxsep=0.5\calcsimmenusfsep,sharp corners=all } } \tcbset{vignettemenuti/.style={% size=tight,boxrule=0.45pt,fontupper=\calcsimmenusfont,% nobeforeafter,left=0.45pt,right=0.45pt,top=0.15pt,bottom=0.15pt,box align=base } } \tcbset{vignettemenuhp/.style={% enhanced,fontupper=\calcsimmenusfont,nobeforeafter,% box align=base,boxsep=\calcsimmenusfsep,% boxrule=0.8pt,left=0pt,right=0pt,top=0pt,% bottom=\dimexpr1pt-\calcsimmenusdepth\relax,% } } \tcbset{vignettemenuhpnorth/.style={% width=\calcsimmenusmenutc,colupper=white,colback=darkgray!90,colframe=darkgray,% sharp corners=north,add to width=2pt } } \tcbset{vignettemenuhpround/.style={% width=\calcsimmenusmenutc,colupper=white,colback=darkgray!90,colframe=darkgray,% rounded corners,arc=1pt,add to width=2pt } } \tcbset{vignettemenuhpitemsel/.style={% width=\calcsimmenusitemtc,sharp corners,colframe=cyan!15,% colback=cyan!15,colupper=black,sharp corners } } \tcbset{vignettemenuhpitem/.style={% sharp corners,colframe=cyan!15,colback=cyan!15,colupper=black,sharp corners } } %====KEYS \defKV[calcsimmenus]{% model=\def\calcsimmenusmodel{#1},% type=\def\calcsimmenustype{#1},% fsep=\setlength\calcsimmenusfsep{#1},% font=\def\calcsimmenusfont{#1},% len=\def\calcsimmenuslen{#1},% bg=\def\calcsimmenusbg{#1},% rightsymb=\def\calcsimmenusrsymb{#1},% colorfont=\def\calcsimmenuscolfont{#1} } \setKVdefault[calcsimmenus]{% model={},% type={},% fsep=0.5pt,% font={\bfseries\ttfamily},% len=auto,% bg=white,% rightsymb={},% colorfont=black } \NewDocumentCommand\CalcItemMenu{ O{} m }{% \restoreKV[calcsimmenus]% \setKV[calcsimmenus]{#1}% \IfEq{\calcsimmenusmodel}{}%gen model {% \IfEq{\calcsimmenustype}{}%white bg {% {\setlength{\fboxsep}{\calcsimmenusfsep}\fcolorbox{black}{white}{\vphantom{qH}\calcsimmenusfont#2}}% }% {}% \IfEq{\calcsimmenustype}{black}%black bg {% {\setlength{\fboxsep}{\calcsimmenusfsep}\fcolorbox{black}{black}{\vphantom{qH}\calcsimmenusfont\textcolor{white}{#2}}}% }% {}% {}% }% {}% \IfEq{\calcsimmenusmodel}{35+}% {% \settowidth{\calcsimmenusmenutc}{\hbox{\calcsimmenusfont MMMM}}% \addtolength{\calcsimmenusmenutc}{2pt}% \settowidth{\calcsimmenusitemtc}{\hbox{\calcsimmenusfont MMMMMMMMMMMMMMMMMMM}}% \settodepth{\calcsimmenusdepth}{\hbox{\calcsimmenusfont gH}}% \IfEq{\calcsimmenuslen}{auto}% {% \StrLen{#2}[\calcsimmenusnbchar]% \xdef\calcsimmenushscale{\fpeval{min(4/(\calcsimmenusnbchar),1)}}% \xdef\calcsimmenusvscale{\fpeval{0.95*\calcsimmenushscale}}% }% {% \xdef\calcsimmenushscale{\fpeval{min(4/(\calcsimmenuslen),1)}}% \xdef\calcsimmenusvscale{\fpeval{0.95*\calcsimmenushscale}}% }% \IfEq{\calcsimmenustype}{}%white menu {% {\tcbox[tcbox width=minimum center,casiotc,casiotcmenublanc]{\vphantom{qH}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{bmenu}%black menu {% {\tcbox[tcbox width=minimum center,casiotc,casiotcmenunoir]{\vphantom{qH}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{item}%item {% {\tcbox[tcbox width=minimum center,casiotc,casiotcitemnoir]{\vphantom{qH}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{itemsel}%item sel {% {\tcbox[tcbox width=minimum left,casiotc,casiotcitemsel]{\makebox[\calcsimmenusitemtc]{\vphantom{qH}{#2}\hfill{\calcsimmenusrsymb}}}}% }% {}% }% {}% \IfEq{\calcsimmenusmodel}{90+}% {% \settowidth{\calcsimmenusmenutc}{\hbox{\calcsimmenusfont MMMMM}}% \addtolength{\calcsimmenusmenutc}{2pt}% \settowidth{\calcsimmenusitemtc}{\hbox{\calcsimmenusfont MMMMMMMMMMMMMMMMMMMMMM}}% \settodepth{\calcsimmenusdepth}{\hbox{\calcsimmenusfont gH}}% \IfEq{\calcsimmenuslen}{auto}% {% \StrLen{#2}[\calcsimmenusnbchar]% \xdef\calcsimmenushscale{\fpeval{min(5/(\calcsimmenusnbchar),1)}}% \xdef\calcsimmenusvscale{\fpeval{0.95*\calcsimmenushscale}}% }% {% \xdef\calcsimmenushscale{\fpeval{min(5/(\calcsimmenuslen),1)}}% \xdef\calcsimmenusvscale{\fpeval{0.95*\calcsimmenushscale}}% }% \IfEq{\calcsimmenustype}{}%white menu {% {\tcbox[tcbox width=minimum center,casioqd,casioqdmenublanc]{\vphantom{qH}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{bmenu}%black menu {% {\tcbox[tcbox width=minimum center,casioqd,casioqdmenunoir,overlay={\path[fill=\calcsimmenusbg]($(frame.south east) + (0.1pt,-0.1pt)$) -- ++ (0pt,3.2pt) -- ++ (-3.2pt,-3.2pt) -- cycle;}]{\vphantom{qH}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{item}%item {% {\tcbox[tcbox width=minimum center,casioqd,casioqditemnoir]{\vphantom{qH}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{itemsel}%item {% {\tcbox[tcbox width=minimum left,casioqd,casioqditemsel]{\makebox[\calcsimmenusitemtc]{\vphantom{qH}{#2}\hfill{\calcsimmenusrsymb}}}}% }% {}% }% {}% \IfEq{\calcsimmenusmodel}{math+}% {% \settowidth{\calcsimmenusmenutc}{\hbox{\calcsimmenusfont MMMMM}}% \addtolength{\calcsimmenusmenutc}{2pt}% \settowidth{\calcsimmenusitemtc}{\hbox{\calcsimmenusfont MMMMMMMMMMMMMMMMMMMM}}% \settodepth{\calcsimmenusdepth}{\hbox{\calcsimmenusfont gH}}% \IfEq{\calcsimmenuslen}{auto}% {% \StrLen{#2}[\calcsimmenusnbchar]% \xdef\calcsimmenushscale{\fpeval{min(5/(\calcsimmenusnbchar),1)}}% \xdef\calcsimmenusvscale{\fpeval{0.95*\calcsimmenushscale}}% }% {% \xdef\calcsimmenushscale{\fpeval{min(5/(\calcsimmenuslen),1)}}% \xdef\calcsimmenusvscale{\fpeval{0.95*\calcsimmenushscale}}% }% \IfEq{\calcsimmenustype}{}%white menu {% {\tcbox[tcbox width=minimum left,casioqd,casioqditemnoir]{\makebox[\calcsimmenusitemtc]{\vphantom{qH}{#2}\hfill{\calcsimmenusrsymb}}}}% }% {}% }% {}% \IfEq{\calcsimmenusmodel}{nwks}% {% \setlength{\calcsimmenusdepth}{0.375pt}% \IfEq{\calcsimmenustype}{}%white menu {% {\tcbox[vignettemenunwks,colframe=gray,colupper=darkgray,colback=white]{\vphantom{qH}\scalebox{0.85}[0.95]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{gmenu}%gray menu {% {\tcbox[vignettemenunwks,colframe=lightgray!50,colupper=black,colback=lightgray!50]{\vphantom{qH}\scalebox{0.85}[0.95]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{bmenu}%dark menu {% \xdef\tmplengthmenunwks{}% \IfEq{\calcsimmenuslen}{auto}% {% \foreach \i in {1,...,22}{\xdef\tmplengthmenunwks{M\tmplengthmenunwks}}% }% {% \foreach \i in {1,...,\calcsimmenuslen}{\xdef\tmplengthmenunwks{M\tmplengthmenunwks}}% }% \settowidth{\calcsimmenusitemtc}{\hbox{\calcsimmenusfont\tmplengthmenunwks}}% {% \tcbox[width=\calcsimmenusitemtc,tcbox width=minimum left,vignettemenunwks,colframe=gray,colupper=black,colback=lightgray!75]% {\makebox[\calcsimmenusitemtc]{\vphantom{qH}\scalebox{0.85}[0.95]{#2}\hfill{\calcsimmenusrsymb}}}% }% }% {}% }% {}% \IfEq{\calcsimmenusmodel}{ti}% {% \IfEq{\calcsimmenustype}{}% black menu {% {\tcbox[vignettemenuti,colback=black,colframe=black,colupper=white]{\vphantom{qH}\scalebox{0.9}[1]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{menu}% menu sel {% {\tcbox[vignettemenuti,colback=white,colframe=black,colupper=black]{\vphantom{[A]/Fiy}\scalebox{0.9}[1]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{itemsel}%item sel {% \StrCut{#2}{§}{\calcsimmenusnb}{\calcsimmenuslab}% {% \tcbox[vignettemenuti,colback=black,colframe=black,colupper=white]{\vphantom{[A]/Fiy}\scalebox{0.9}[1]{\calcsimmenusnb:}}% \hspace*{-0.225pt}% \tcbox[vignettemenuti,colback=white,colframe=black,colupper=black]{\vphantom{[A]/Fiy}\scalebox{0.9}[1]{\calcsimmenuslab}}}% }% {}% }% {}% \IfEq{\calcsimmenusmodel}{hp}% {% \settowidth{\calcsimmenusmenutc}{\hbox{\calcsimmenusfont MMMMM}}% \addtolength{\calcsimmenusmenutc}{2pt}% \settowidth{\calcsimmenusitemtc}{\hbox{\calcsimmenusfont MMMMMMMMMMMMMMMMMMMMM}}% \settodepth{\calcsimmenusdepth}{\hbox{\calcsimmenusfont gH}}% \IfEq{\calcsimmenuslen}{auto}% {% \StrLen{#2}[\calcsimmenusnbchar]% \xdef\calcsimmenushscale{\fpeval{min(5/(\calcsimmenusnbchar),1)}}% \xdef\calcsimmenusvscale{\fpeval{0.95*\calcsimmenushscale}}% }% {% \xdef\calcsimmenushscale{\fpeval{min(5/(\calcsimmenuslen),1)}}% \xdef\calcsimmenusvscale{\fpeval{0.95*\calcsimmenushscale}}% }% \IfEq{\calcsimmenustype}{}%bottom rounded {% {\tcbox[tcbox width=minimum center,vignettemenuhp,vignettemenuhpnorth]{\vphantom{qH}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{ritem}%rounded item {% {\tcbox[tcbox width=minimum center,vignettemenuhp,vignettemenuhpround]{\vphantom{qH}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{item}%item {% \StrCut{#2}{§}{\calcsimmenusnb}{\calcsimmenuslab}% {% \tcbox[vignettemenuhp,vignettemenuhp,vignettemenuhpitem]% {\vphantom{qH}\raisebox{0.75\calcsimmenusdepth}{\scalebox{0.66}[0.66]{\calcsimmenusnb}}\,{\calcsimmenuslab}{\calcsimmenusrsymb}}% }% }% {}% \IfEq{\calcsimmenustype}{itemsel}%item {% \StrCut{#2}{§}{\calcsimmenusnb}{\calcsimmenuslab}% {% \tcbox[tcbox width=minimum left,vignettemenuhp,vignettemenuhpitemsel]{% \makebox[\calcsimmenusitemtc]{% \vphantom{qH}\raisebox{0.75\calcsimmenusdepth}{\scalebox{0.66}[0.66]{\calcsimmenusnb}}\,{\calcsimmenuslab}\hfill{\calcsimmenusrsymb}% }% }% }% }% {}% }% {}% } %TCSTYLES BUTONS & COLORS \definecolor{casiowhitekey}{HTML}{f5f4f4} \definecolor{casiobluekey}{HTML}{3f8ca6} \definecolor{casioblueqdkey}{HTML}{2f56c8} \definecolor{casiobluexe}{HTML}{2e5366} \definecolor{texasbluekey}{HTML}{2373c9} \definecolor{texasgreenkey}{HTML}{589b31} %==35+ \tcbset{casiotckey/.style={% enhanced,fontupper=\calcsimmenusfont,nobeforeafter,% tcbox width=minimum center, box align=base,boxsep=\calcsimmenusfsep,% boxrule=0.8pt,left=0pt,right=0pt,top=0pt,% bottom=\dimexpr1pt-\calcsimmenusdepth\relax,no borderline } } \tcbset{casiokeytcgray/.style={% width=\calcsimmenusmenutc,colframe=gray!75,colback=gray!75,% colupper=\calcsimmenuscolfont,rounded corners,arc=1pt,add to width=2pt } } \tcbset{casiokeytcwhite/.style={% width=\calcsimmenusmenutc,colframe=casiowhitekey,colback=casiowhitekey,% colupper=\calcsimmenuscolfont,rounded corners,arc=1pt,add to width=2pt } } \tcbset{casiokeytcblue/.style={% width=\calcsimmenusmenutc,colframe=casiobluekey,colback=casiobluekey,% colupper=white,rounded corners,arc=1pt,add to width=2pt } } %90+E \tcbset{casioqdkey/.style={% enhanced,fontupper=\calcsimmenusfont,nobeforeafter,% tcbox width=minimum center, box align=base,boxsep=\calcsimmenusfsep,% boxrule=0.8pt,left=0pt,right=0pt,top=0pt,% bottom=\dimexpr1pt-\calcsimmenusdepth\relax,no borderline } } \tcbset{casioqdkeygray/.style={% width=\calcsimmenusmenutc,colframe=lightgray,colback=lightgray,% colupper=\calcsimmenuscolfont,rounded corners,arc=1pt,add to width=2pt } } \tcbset{casioqdkeywhite/.style={% width=\calcsimmenusmenutc,colframe=casiowhitekey,colback=casiowhitekey,% colupper=\calcsimmenuscolfont,rounded corners,arc=1pt,add to width=2pt } } \tcbset{casioqdkeyblue/.style={% width=\calcsimmenusmenutc,colframe=casioblueqdkey,colback=casioblueqdkey,% colupper=white,rounded corners,arc=1pt,add to width=2pt } } \tcbset{casioqdkeysilver/.style={% width=\calcsimmenusmenutc,colframe=darkgray,colback=darkgray,% colupper=lightgray,rounded corners,arc={0.25\calcsimmenusmenutc} } } %83 \tcbset{texaskey/.style={% enhanced,fontupper=\calcsimmenusfont,nobeforeafter,% tcbox width=minimum center, box align=base,boxsep=\calcsimmenusfsep,% boxrule=0.8pt,left=0pt,right=0pt,top=0pt,% no borderline } } \tcbset{texaskeywhite/.style={% width=\calcsimmenusmenutc,colframe=casiowhitekey,colback=casiowhitekey,% colupper=black,rounded corners,arc=1pt,bottom=0pt %bottom=\dimexpr1pt-\calcsimmenusdepth\relax, } } \tcbset{texaskeyblue/.style={% width=\calcsimmenusmenutc,colframe=texasbluekey,colback=texasbluekey,% colupper=white,rounded corners,arc=1pt,bottom=0pt %bottom=\dimexpr1pt-\calcsimmenusdepth\relax, } } \tcbset{texaskeygreen/.style={% width=\calcsimmenusmenutc,colframe=texasgreenkey,colback=texasgreenkey,% colupper=white,rounded corners,arc=1pt,bottom=0pt %bottom=\dimexpr1pt-\calcsimmenusdepth\relax, } } \tcbset{texaskeylightgray/.style={% width=\calcsimmenusmenutc,colframe=lightgray!66,colback=lightgray!66,% colupper=black,rounded corners,arc=1pt,bottom=0pt %bottom=\dimexpr1pt-\calcsimmenusdepth\relax, } } \tcbset{texaskeygray/.style={% width=\calcsimmenusmenutc,colframe=gray,colback=gray,% colupper=black,rounded corners,% bottom=0pt,arc=1pt } } \NewDocumentCommand\intcalckeydim{ O{1pt} m m m m }{%shortcut for compute scaling \settowidth{\calcsimmenusmenutc}{\hbox{\calcsimmenusfont #2}}% \addtolength{\calcsimmenusmenutc}{#1}% \settodepth{\calcsimmenusdepth}{\hbox{\calcsimmenusfont #3}}% \IfEq{\calcsimmenuslen}{auto}% {% \StrLen{#5}[\calcsimmenusnbchar]% \xdef\calcsimmenushscale{\fpeval{min((#4)/(\calcsimmenusnbchar),1)}}% \xdef\calcsimmenusvscale{0.95}%{\fpeval{0.975*\calcsimmenushscale}}% }% {% \xdef\calcsimmenushscale{\fpeval{min((#4)/(\calcsimmenuslen),1)}}% \xdef\calcsimmenusvscale{0.95}%{\fpeval{0.975*\calcsimmenushscale}}% }% } %testing ?? %\newsavebox{\jamBox} %\newlength{\jamWidth} %\newcommand{\jamIfToBig}[2]{% % % #1: Size to check against, like \textwidth % % #2: The content, like a tabular % \savebox{\jamBox}{#2}% % \settowidth{\jamWidth}{\usebox{\jamBox}}% % %\the\jamWidth -- \the#1 % \ifthenelse{\jamWidth < #1}% % {\usebox{\jamBox}}% % {\resizebox{#1}{!}{\usebox{\jamBox}}% % }% %} \def\samplecharacterskeyx{azertyuiopqsdfghjklmwxcvbn123456789AZERTYUIOPQSDFGHJKLMWXCVBN} \NewDocumentCommand\CalcKey{ O{} m }{% \restoreKV[calcsimmenus]% \setKV[calcsimmenus]{#1}% \IfEq{\calcsimmenusmodel}{35+}% {% \IfEq{\calcsimmenustype}{sgray}%small gray F1... 2 chars {% \intcalckeydim[2pt]{MMM}{\samplecharacterskeyx}{3}{#2}% {\tcbox[casiotckey,casiokeytcgray]{\vphantom{\samplecharacterskeyx}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{gray}%gray bottom 3 chars {% \intcalckeydim[2pt]{MMM}{(\samplecharacterskeyx}{3}{#2}% {\tcbox[casiotckey,casiokeytcgray]{\vphantom{(\samplecharacterskeyx}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{white}%white middle {% \intcalckeydim[2pt]{MMMM}{(\samplecharacterskeyx}{4}{#2}% {\tcbox[casiotckey,casiokeytcwhite]{\vphantom{(\samplecharacterskeyx}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{blue}%blue DEL AC {% \intcalckeydim[2pt]{MMM}{(\samplecharacterskeyx}{3}{#2}% {\tcbox[casiotckey,casiokeytcblue]{\vphantom{(\samplecharacterskeyx}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% }% {}% \IfEq{\calcsimmenusmodel}{90+}% {% \IfEq{\calcsimmenustype}{gray}%gray key {% \intcalckeydim[2pt]{MMM}{(\samplecharacterskeyx}{3}{#2}% {\tcbox[casioqdkey,casioqdkeygray]{\vphantom{(\samplecharacterskeyx}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{silver}%Fn key {% \intcalckeydim[2pt]{MM}{(\samplecharacterskeyx}{2}{#2}% {\tcbox[casioqdkey,casioqdkeysilver]{\vphantom{(\samplecharacterskeyx}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{blue}%blue DEL AC {% \intcalckeydim[2pt]{MMM}{(\samplecharacterskeyx}{3}{#2}% {\tcbox[casioqdkey,casioqdkeyblue]{\vphantom{(\samplecharacterskeyx}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{white}%white middle {% \intcalckeydim[2pt]{MMMM}{(\samplecharacterskeyx}{4}{#2}% {\tcbox[casioqdkey,casioqdkeywhite]{\vphantom{(\samplecharacterskeyx}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% }% {}% \IfEq{\calcsimmenusmodel}{83}% {% \IfEq{\calcsimmenustype}{swhite}%black menu {% \intcalckeydim[0pt]{MM}{(\samplecharacterskeyx}{2}{#2}% {\tcbox[texaskey,texaskeywhite]{\vphantom{(\samplecharacterskeyx}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{white}%black menu {% \intcalckeydim[0pt]{MMMMM}{(\samplecharacterskeyx}{5}{#2}% {\tcbox[texaskey,texaskeywhite]{\vphantom{(\samplecharacterskeyx}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{blue}%item sel {% \intcalckeydim{MMMM}{(\samplecharacterskeyx}{4}{#2}% {\tcbox[texaskey,texaskeyblue]{\vphantom{(\samplecharacterskeyx}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{green}%item sel {% \intcalckeydim{MMMM}{(\samplecharacterskeyx}{4}{#2}% {\tcbox[texaskey,texaskeygreen]{\vphantom{(\samplecharacterskeyx}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{lightgray}%item sel {% \intcalckeydim[1pt]{MMMM}{(\samplecharacterskeyx}{4}{#2}% {\tcbox[texaskey,texaskeylightgray]{\vphantom{(\samplecharacterskeyx}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% \IfEq{\calcsimmenustype}{gray}%item sel {% \intcalckeydim{MM}{(\samplecharacterskeyx)}{2}{#2}% {\tcbox[texaskey,texaskeygray]{\vphantom{(\samplecharacterskeyx}\scalebox{\calcsimmenushscale}[\calcsimmenusvscale]{#2}}}% }% {}% }% {}% } %CALC KEYS, WITH LUA \if@xelua \NewDocumentCommand\CalcKeyNwks{ s m }{% \IfBooleanT{#1}{\bgroup\bfseries}% \setsepchar{+}% \readlist*\listkeysnwks{#2}% \foreachitem\lettre\in\listkeysnwks{% \IfStrEqCase{\lettre}{% {left}{{\fontkeyNWKS L}}% {right}{{\fontkeyNWKS R}}% {up}{{\fontkeyNWKS U}}% {down}{{\fontkeyNWKS D}}% {home}{{\fontkeyNWKS H}}% {power}{{\fontkeyNWKS P}}% {ok}{{\fontkeyNWKS O}}% {back}{{\fontkeyNWKS B}}% {shift}{{\fontkeyNWKS S}}% {alpha}{{\fontkeyNWKS A}}% {xnt}{{\fontkeyNWKS x}}% {var}{{\fontkeyNWKS V}}% {tools}{{\fontkeyNWKS T}}% {clear}{{\fontkeyNWKS d}}% {exp}{{\fontkeyNWKS e}}% {ln}{{\fontkeyNWKS l}}% {log}{{\fontkeyNWKS g}}% {i}{{\fontkeyNWKS i}}% {virg}{{\fontkeyNWKS ,}}% {comma}{{\fontkeyNWKS ,}}% {pow}{{\fontkeyNWKS p}}% {sin}{{\fontkeyNWKS s}}% {cos}{{\fontkeyNWKS c}}% {tan}{{\fontkeyNWKS t}}% {pi}{{\fontkeyNWKS n}}% {sqrt}{{\fontkeyNWKS r}}% {sqr}{{\fontkeyNWKS q}}% {0}{{\fontkeyNWKS 0}}% {1}{{\fontkeyNWKS 1}}% {2}{{\fontkeyNWKS 2}}% {3}{{\fontkeyNWKS 3}}% {4}{{\fontkeyNWKS 4}}% {5}{{\fontkeyNWKS 5}}% {6}{{\fontkeyNWKS 6}}% {7}{{\fontkeyNWKS 7}}% {8}{{\fontkeyNWKS 8}}% {9}{{\fontkeyNWKS 9}}% {dot}{{\fontkeyNWKS .}}% {plus}{{\fontkeyNWKS +}}% {x10p}{{\fontkeyNWKS E}}% {minus}{{\fontkeyNWKS -}}% {lp}{{\fontkeyNWKS (}}% {rp}{{\fontkeyNWKS )}}% {ans}{{\fontkeyNWKS a}}% {div}{{\fontkeyNWKS /}}% {exe}{{\fontkeyNWKS X}}% {times}{{\fontkeyNWKS *}}% }% }% \IfBooleanT{#1}{\egroup}% }% \NewDocumentCommand\CalcKeyCasioCW{ m }{% \setsepchar{+}% \readlist*\listkeyscasiocw{#1}% \foreachitem\lettre\in\listkeyscasiocw{% \IfStrEqCase{\lettre}{% {on}{{\fontkeyCASIOcw W}}% {home}{{\fontkeyCASIOcw w}}% {ok}{{\fontkeyCASIOcw |}}% {up}{{\fontkeyCASIOcw E}}% {down}{{\fontkeyCASIOcw R}}% {left}{{\fontkeyCASIOcw !}}% {right}{{\fontkeyCASIOcw \$}}% {pgup}{{\fontkeyCASIOcw \%}}% {pgdown}{{\fontkeyCASIOcw \&}}% {config}{{\fontkeyCASIOcw L}}% {back}{{\fontkeyCASIOcw `}}% %next {shift}{{\fontkeyCASIOcw q}}% {var}{{\fontkeyCASIOcw '}}% {fx}{{\fontkeyCASIOcw Q}}% {ctlg}{{\fontkeyCASIOcw T}}% {tools}{{\fontkeyCASIOcw I}}% %next {x}{{\fontkeyCASIOcw [}}% {frac}{{\fontkeyCASIOcw a}}% {sqrt}{{\fontkeyCASIOcw s}}% {pow}{{\fontkeyCASIOcw \char"005E}}% {sqr}{{\fontkeyCASIOcw d}}% {exp}{{\fontkeyCASIOcw H}}% {comma}{{\fontkeyCASIOcw \#}}% {virg}{{\fontkeyCASIOcw \#}}% {sin}{{\fontkeyCASIOcw j}}% {cos}{{\fontkeyCASIOcw k}}% {tan}{{\fontkeyCASIOcw l}}% {lp}{{\fontkeyCASIOcw (}}% {rp}{{\fontkeyCASIOcw )}}% %next {7}{{\fontkeyCASIOcw 7}}% {8}{{\fontkeyCASIOcw 8}}% {9}{{\fontkeyCASIOcw 9}}% {del}{{\fontkeyCASIOcw o}}% {ac}{{\fontkeyCASIOcw C}}% {4}{{\fontkeyCASIOcw 4}}% {5}{{\fontkeyCASIOcw 5}}% {6}{{\fontkeyCASIOcw 6}}% {times}{{\fontkeyCASIOcw O}}% {div}{{\fontkeyCASIOcw P}}% {1}{{\fontkeyCASIOcw 1}}% {2}{{\fontkeyCASIOcw 2}}% {3}{{\fontkeyCASIOcw 3}}% {plus}{{\fontkeyCASIOcw +}}% {minus}{{\fontkeyCASIOcw p}}% {0}{{\fontkeyCASIOcw 0}}% {dot}{{\fontkeyCASIOcw .}}% {x10p}{{\fontkeyCASIOcw K}}% {fmt}{{\fontkeyCASIOcw n}}% {exe}{{\fontkeyCASIOcw B}}% %next {semicol}{{\fontkeyCASIOcw f}}% {ptvirg}{{\fontkeyCASIOcw f}}% {ans}{{\fontkeyCASIOcw M}}% {rep}{{\fontkeyCASIOcw u}}% }% }% }% \NewDocumentCommand\CalcKeyCasioFX{ m }{% \setsepchar{+}% \readlist*\listkeyscasiofx{#1}% \foreachitem\lettre\in\listkeyscasiofx{% \IfStrEqCase{\lettre}{% {F1}{{\fontkeyCASIOfx q}}% {F2}{{\fontkeyCASIOfx w}}% {F3}{{\fontkeyCASIOfx e}}% {F4}{{\fontkeyCASIOfx r}}% {F5}{{\fontkeyCASIOfx y}}% {F6}{{\fontkeyCASIOfx u}}% {up}{{\fontkeyCASIOfx B}}% {down}{{\fontkeyCASIOfx N}}% {left}{{\fontkeyCASIOfx !}}% {right}{{\fontkeyCASIOfx \$}}% {shift}{{\fontkeyCASIOfx L}}% {optn}{{\fontkeyCASIOfx i}}% {vars}{{\fontkeyCASIOfx o}}% {menu}{{\fontkeyCASIOfx p}}% {alpha}{{\fontkeyCASIOfx a}}% {sqr}{{\fontkeyCASIOfx s}}% {pow}{{\fontkeyCASIOfx \char"005E}}% {exit}{{\fontkeyCASIOfx d}}% {xtt}{{\fontkeyCASIOfx f}}% {log}{{\fontkeyCASIOfx g}}% {ln}{{\fontkeyCASIOfx G}}% {sin}{{\fontkeyCASIOfx h}}% {cos}{{\fontkeyCASIOfx j}}% {tan}{{\fontkeyCASIOfx k}}% {frac}{{\fontkeyCASIOfx ;}}% {sd}{{\fontkeyCASIOfx v}}% {lp}{{\fontkeyCASIOfx (}}% {rp}{{\fontkeyCASIOfx )}}% {comma}{{\fontkeyCASIOfx ,}}% {virg}{{\fontkeyCASIOfx ,}}% {sto}{{\fontkeyCASIOfx b}}% {7}{{\fontkeyCASIOfx 7}}% {8}{{\fontkeyCASIOfx 8}}% {9}{{\fontkeyCASIOfx 9}}% {del}{{\fontkeyCASIOfx P}}% {acon}{{\fontkeyCASIOfx O}}% {4}{{\fontkeyCASIOfx 4}}% {5}{{\fontkeyCASIOfx 5}}% {6}{{\fontkeyCASIOfx 6}}% {times}{{\fontkeyCASIOfx m}}% {div}{{\fontkeyCASIOfx M}}% {1}{{\fontkeyCASIOfx 1}}% {2}{{\fontkeyCASIOfx 2}}% {3}{{\fontkeyCASIOfx 3}}% {plus}{{\fontkeyCASIOfx +}}% {minus}{{\fontkeyCASIOfx -}}% {0}{{\fontkeyCASIOfx 0}}% {dot}{{\fontkeyCASIOfx .}}% {x10p}{{\fontkeyCASIOfx :}}% {sminus}{{\fontkeyCASIOfx n}}% {exe}{{\fontkeyCASIOfx l}}% }% }% }% \NewDocumentCommand\CalcKeyTIfr{ m }{% \setsepchar{+}% \readlist*\listkeystiqt{#1}% \foreachitem\lettre\in\listkeystiqt{% \IfStrEqCase{\lettre}{% {fx}{{\fontkeyTIfr o}}% {fenetre}{{\fontkeyTIfr p}}% {zoom}{{\fontkeyTIfr q}}% {trace}{{\fontkeyTIfr r}}% {graphe}{{\fontkeyTIfr s}}% {2nde}{{\fontkeyTIfr y}}% {mode}{{\fontkeyTIfr z}}% {suppr}{{\fontkeyTIfr \char"007B}}% {up}{{\fontkeyTIfr \char"007D}}% {down}{{\fontkeyTIfr \char"2020}}% {left}{{\fontkeyTIfr \char"007C}}% {right}{{\fontkeyTIfr \char"007E}}% {alpha}{{\fontkeyTIfr \char"0192}}% {xttn}{{\fontkeyTIfr \char"201E}}% {stats}{{\fontkeyTIfr \char"2026}}% {math}{{\fontkeyTIfr \char"00BB}}% {matrice}{{\fontkeyTIfr \char"00BE}}% {prgm}{{\fontkeyTIfr \char"00BC}}% {var}{{\fontkeyTIfr \char"00BD}}% {annul}{{\fontkeyTIfr \char"2018}}% {fmt}{{\fontkeyTIfr \char"2014}}% {trig}{{\fontkeyTIfr \char"02DC}}% {resol}{{\fontkeyTIfr \char"2122}}% {frac}{{\fontkeyTIfr \char"0161}}% {pow}{{\fontkeyTIfr \char"203A}}% {sqr}{{\fontkeyTIfr \char"00A1}}% {virg}{{\fontkeyTIfr \char"00A2}}% {lp}{{\fontkeyTIfr \char"00A3}}% {rp}{{\fontkeyTIfr \char"00A4}}% {div}{{\fontkeyTIfr \char"00A5}}% {log}{{\fontkeyTIfr \char"00AB}}% {7}{{\fontkeyTIfr \char"00AC}}% {8}{{\fontkeyTIfr \char"00AA}}% {9}{{\fontkeyTIfr \char"00AE}}% {times}{{\fontkeyTIfr \char"00AF}}% {ln}{{\fontkeyTIfr \char"00B5}}% {4}{{\fontkeyTIfr \char"00B6}}% {5}{{\fontkeyTIfr \char"00B7}}% {6}{{\fontkeyTIfr \char"00B8}}% {minus}{{\fontkeyTIfr \char"00B9}}% {sto}{{\fontkeyTIfr \char"00BF}}% {1}{{\fontkeyTIfr \char"00C0}}% {2}{{\fontkeyTIfr \char"00C1}}% {3}{{\fontkeyTIfr \char"00C2}}% {plus}{{\fontkeyTIfr \char"00C3}}% {on}{{\fontkeyTIfr \char"00C9}}% {0}{{\fontkeyTIfr \char"00CA}}% {dot}{{\fontkeyTIfr \char"00CB}}% {sminus}{{\fontkeyTIfr \char"00CC}}% {entrer}{{\fontkeyTIfr \char"00CD}}% %next {apps}{{\fontkeyTI \char"0152}}% {inv}{{\fontkeyTI \char"2014}}% {sin}{{\fontkeyTI \char"02DC}}% {cos}{{\fontkeyTI \char"2122}}% {tan}{{\fontkeyTI \char"0161}}% }% }% }% \NewDocumentCommand\CalcKeyTI{ m }{% \setsepchar{+}% \readlist*\listkeystien{#1}% \foreachitem\lettre\in\listkeystien{% \IfStrEqCase{\lettre}{% {y}{{\fontkeyTI o}}% {window}{{\fontkeyTI p}}% {zoom}{{\fontkeyTI q}}% {trace}{{\fontkeyTI r}}% {graph}{{\fontkeyTI s}}% {2nd}{{\fontkeyTI y}}% {mode}{{\fontkeyTI z}}% {del}{{\fontkeyTI \char"007B}}% {up}{{\fontkeyTI \char"007D}}% {down}{{\fontkeyTI \char"2020}}% {left}{{\fontkeyTI \char"007C}}% {right}{{\fontkeyTI \char"007E}}% {alpha}{{\fontkeyTI \char"0192}}% {xttn}{{\fontkeyTI \char"201E}}% {stat}{{\fontkeyTI \char"2026}}% {math}{{\fontkeyTI \char"00BB}}% {apps}{{\fontkeyTI \char"0152}}% {prgm}{{\fontkeyTI \char"00BC}}% {vars}{{\fontkeyTI \char"00BD}}% {clear}{{\fontkeyTI \char"2018}}% {inv}{{\fontkeyTI \char"2014}}% {sin}{{\fontkeyTI \char"02DC}}% {cos}{{\fontkeyTI \char"2122}}% {tan}{{\fontkeyTI \char"0161}}% {pow}{{\fontkeyTI \char"203A}}% {sqr}{{\fontkeyTI \char"00A1}}% {comma}{{\fontkeyTI \char"00A2}}% {lp}{{\fontkeyTI \char"00A3}}% {rp}{{\fontkeyTI \char"00A4}}% {div}{{\fontkeyTI \char"00A5}}% {log}{{\fontkeyTI \char"00AB}}% {7}{{\fontkeyTI \char"00AC}}% {8}{{\fontkeyTI \char"00AA}}% {9}{{\fontkeyTI \char"00AE}}% {times}{{\fontkeyTI \char"00AF}}% {ln}{{\fontkeyTI \char"00B5}}% {4}{{\fontkeyTI \char"00B6}}% {5}{{\fontkeyTI \char"00B7}}% {6}{{\fontkeyTI \char"00B8}}% {minus}{{\fontkeyTI \char"00B9}}% {sto}{{\fontkeyTI \char"00BF}}% {1}{{\fontkeyTI \char"00C0}}% {2}{{\fontkeyTI \char"00C1}}% {3}{{\fontkeyTI \char"00C2}}% {plus}{{\fontkeyTI \char"00C3}}% {on}{{\fontkeyTI \char"00C9}}% {0}{{\fontkeyTI \char"00CA}}% {dot}{{\fontkeyTI \char"00CB}}% {sminus}{{\fontkeyTI \char"00CC}}% {enter}{{\fontkeyTI \char"00CD}}% }% }% }% \fi %SHORTCUTS (with pdf files, not included) \@ifpackageloaded{inlinegraphicx}{}{\RequirePackage{inlinegraphicx}} \NewDocumentCommand\inckeycalc{ s O{} m m }{% \IfFileExists{calcitems_#3_#4.pdf}% {% \IfBooleanTF{#1}{\includegraphics[#2]{calcitems_#3_#4.pdf}}{\inlinegraphics[#2]{calcitems_#3_#4.pdf}}% }% {% \IfBooleanTF{#1}{\includegraphics[#2]{example-image.pdf}}{\inlinegraphics[#2]{example-image.pdf}}% }% } \endinput