#StackBounty: #fonts #color #packages #tcolorbox A small display of a scientific calculator

Bounty: 100

Starting from LCD package (one page) of documentation, looking in particular this question where there is the long code of @Thomas F. Sturm (here):,

documentclass[openany,10pt]{book}

usepackage{newpxtext}

usepackage[varg]{newpxmath} %font package

usepackage[letterpaper,margin=0.75in,bindingoffset=0.5in]{geometry}

usepackage[most]{tcolorbox}
    colorlet{blackened}{black!90!white}
    colorlet{blackish}{black!70!white}
    colorlet{greyish}{black!60!white}
    colorlet{whiteish}{white}
    colorlet{orangeish}{yellow!90!red}
    colorlet{greenish}{green!16!gray}
    colorlet{redish}{red!80!black}

tcbset{calbackground/.style={
    enhanced,
    leftright skip=0.25cm,beforeafter skip=0pt,
    toptitle=0mm,bottomtitle=0mm,
    right=2mm,left=2mm,
    top=1pt,
    bottom=0.25cm,
    boxsep=0pt,
    boxrule=0mm,
    sharp corners,
    sidebyside,
    sidebyside gap=2mm,
    lefthand ratio=0.6,
    bicolor,
    colback=black!10!white,
    colbacklower=greenish,
    colframe=white,
    autoparskip,
    }}

newtcbtheorem[no counter]{calx}{Calculator}{calbackground}{cax}

newtcbox{KY}[1][]{
    enhanced,
    on line,
    arc=2pt,outer arc=2pt,
    boxrule=0pt,bottomrule=0.25mm,rightrule=0.2mm,
    boxsep=0pt,left=0pt,right=0pt,top=1pt,bottom=1pt,
    interior style={top color=blackish,bottom color=blackened},
    colframe=greyish,
    width=2.5em,
    tcbox width=forced center,
    equal height group=K,
    valign=center,
    fontupper=footnotesizesffamily,
    coltext=orangeish,
    before upper=vrule width 0pt height 2ex depth 1exrelax,
    }

newtcbox{KYm}[1][]{
    enhanced,
    on line,
    arc=2pt,outer arc=2pt,
    boxrule=0pt,bottomrule=0.25mm,rightrule=0.2mm,
    boxsep=0pt,left=0pt,right=0pt,top=1pt,bottom=1pt,
    interior style={top color=blackish,bottom color=blackened},
    colframe=greyish,
    width=2.5em,
    tcbox width=forced center,
    equal height group=K,
    valign=center,
    fontupper=footnotesizesffamily,
    coltext=orangeish,
    before upper=vrule width 0pt height 2ex depth 1exrelax$,
    after upper=$,
    }

newtcbox{KN}{
    enhanced,
    on line,
    arc=2pt,outer arc=2pt,
    boxrule=0pt,bottomrule=0.25mm,rightrule=0.2mm,
    boxsep=0pt,left=0pt,right=0pt,top=1pt,bottom=1pt,
    interior style={top color=blackish,bottom color=blackened},
    colframe=greyish,
    width=1.5em,
    tcbox width=forced center,
    equal height group=K,
    valign=center,
    fontupper=footnotesizesffamily,
    coltext=whiteish,
    before upper=vrule width 0pt height 2ex depth 1exrelax,
    }

usepackage{lcd}
    LCDcolors{black}{greenish}
    DefineLCDchar{sq}{11100001000100011100000000000000000}
    DefineLCDchar{tm}{00000100010101000100010101000100000}
    DefineLCDchar{dv}{00000001000000011111000000010000000}
    DefineLCDchar{mu}{00011000011110100001000000000000000}
    DefineLCDchar{sc}{11011010011001000000000000000000000}

DeclareMathOperator{ee}{textrm{e}}

usepackage{MnSymbol} %boxes
usepackage{xfrac} %sfrac
usepackage{lipsum} %for textwidth comparison
    setlipsumdefault{1-2}

begin{document}

begin{calx}{}{}
KY{$($}KN{3}KY{$x^2$}KN{-}KN{4}KY{$x^2$}KN{-}KN{6}KY{$x^2$}KY{$)$}KN{$=$}
tcblower
{LargetextLCD[0]{20}|(3{sq}-4{sq}-6{sq})|}
{LARGEtextLCD[0]{16}|             -43|}
end{calx}
%
begin{calx}{}{}
KN{$div$}KY{$($}KY{$(-)$}KN{2}KN{$times$}KN{4}KN{$times$}KN{6}KY{$)$}KN{$=$}
tcblower
{LargetextLCD[0]{20}|ANS{dv}(-2{tm}4{tm}6)|}
{LARGEtextLCD[0]{16}|    0.8958333333|}
end{calx}
%
begin{calx}{}{}
KY{$cos^{-1}$}KY{ANS}KN{$=$}
tcblower
{LargetextLCD[0]{20}|cos{mu}(ANS|}
{LARGEtextLCD[0]{16}|     26.38432975|}
end{calx}
%
begin{calx}{}{}
KY{$circ,prime,primeprime$}
tcblower
{LargetextLCD[0]{20}|cos{mu}(ANS|}
{LARGEtextLCD[0]{16}|     26°23'3.59{sc} |}
end{calx}

lipsum

KYm{x^2}%
KYm{x^3}%
KYm{x^{-1}}%
KYm{x^{filledsquare}}%
KYm{sqrt{filledmedsquare}}%
KYm{sqrt[3]{filledmedsquare}}%
KYm{sqrt[filledsquare]{medsquare}}\

KY{$ln$}%
KY{$log$}%
KY{$log_{filledsquare}medsquare$}%
KY{$10^{filledsquare}$}%
KY{$ee^{filledsquare}$}\

KY{$(-)$}%
KY{$frac{filledmedsquare}{medsquare}$}%
KY{$sfrac{filledmedsquare}{medsquare}$}%
KY{$tfrac{filledmedsquare}{medsquare}$}\

KY{$circ,prime,primeprime$}%
KY{$sin$}%
KY{$sin^{-1}$}%
KY{$cos$}%
KY{$cos^{-1}$}%
KY{$tan$}%
KY{$tan^{-1}$}\

KY{$($}%
KY{$)$}%
KN{$times$}%
KN{$div$}%
KN{$+$}%
KN{$-$}%
KN{$=$}\

KN{$1$}%
KN{$2$}%
KN{$3$}%
KN{$4$}%
KN{$5$}%
KN{$6$}%
KN{$7$}%
KN{$8$}%
KN{$9$}%
KN{$0$}\

KN{1}%
KN{2}%
KN{3}%
KN{4}%
KN{5}%
KN{6}%
KN{7}%
KN{8}%
KN{9}%
KN{0}\

end{document}

how can I reduce the MWE adding only the words DEG or RAD in character LCD, increasing the dimension of the rectangle (height and lenght)?

Thank you very much for all users.

enter image description here


Related question for the symbols of the calculator: Easiest way to create TeX macro/code to access symbols from particular font?


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.