\documentclass[a4paper,12pt]{article}

\usepackage[iso,english]{isodate}
\usepackage[margin=1in]{geometry}
\usepackage[english]{babel}
\usepackage{hyperref}
\usepackage{parskip}

\usepackage{amsmath}
\usepackage[color]{tiscreen}
\usepackage{multicol}
\usepackage{array}
\usepackage{longtable}
\usepackage{fancyvrb-ex}
\fvset{
	frame=single,
	label=\fbox{Source},
	framesep=4mm,
	numbers=left,
	fontsize=\footnotesize,
}

\newcommand{\LCDsymb}[1]{\large \textLCD{1}|{#1}~|}

\title{TI calculator screen (and buttons)\\{\small TI-82 STATS, TI-84}}
\author{Mustafa Ibrahim, Caleb Bibb}
\date{2021-12-31}

\begin{document}

\maketitle

\begin{center}
	\begin{tabular}{cc}
		\tiscreen
		|10^6*(4^7+1){rarrow}X  |
		|       1.6385E10|
		|{sqrt}(X)*X/10!      |
		|     577971782.1|
		|cos{ar}(cos(Ans))  |
		|        62.11246|
		|{fcur}               |
		|                |
		&
		\tibtnextramatrix
	\end{tabular}

	\dotfill

	\begin{tabular}{ccccc}
		\tibtnsecond & \tibtnmode   & \tibtndel       &                  &             \\
		\tibtnalpha  & \tibtnxton   & \tibtnstat      &                  &             \\
		\tibtnmath   & \tibtnmatrix & \tibtnprgm      & \tibtnvars       & \tibtnclear \\
		\tibtnxnone  & \tibtnsin    & \tibtncos       & \tibtntan        & \tibtnpower \\
		\tibtnxtwo   & \tibtncomma  & \tibtnleftparen & \tibtnrightparen & \tibtndiv   \\
		\tibtnlog    & \tibtnseven  & \tibtneight     & \tibtnnine       & \tibtntimes \\
		\tibtnln     & \tibtnfour   & \tibtnfive      & \tibtnsix        & \tibtnminus \\
		\tibtnsto    & \tibtnone    & \tibtntwo       & \tibtnthree      & \tibtnplus  \\
		\tibtnon     & \tibtnzero   & \tibtndot       & \tibtnneg        & \tibtnenter \\
	\end{tabular}
\end{center}

\newpage\tableofcontents\newpage

\section{Quickstart}

\begin{SideBySideExample}[xrightmargin=5.5cm]
%\usepackage[color]{tiscreen}

\tiscreen
|4+1             |
|               5|
|Ans{sq}         |
|              25|
|{fcur}          |
|                |
|                |
|                |

Lorem \tibtnmath{} ipsum

\tibtnextramath
\end{SideBySideExample}

\section{Package option(s)}

\subsection{Color} \label{sec:color}

Using the \texttt{color} option will change the colors used by the \verb|\LCD|
command for printing the screen using \verb|\tiscreen|. The colors are defined
as \texttt{tiscreenfg} (foreground, i.e. font color) and \texttt{tiscreenbg}
(background) and redefined like this:

\begin{Verbatim}
% Add this to your preamble
\definecolor{tiscreenbg}{HTML}{5d9345}
\definecolor{tiscreenfg}{HTML}{FFFFFF}
\end{Verbatim}

\subsection{Defined colors} \label{sec:colordef}

\begin{tabular}{lcl}
	Name            & Color                                                              & Usage        \\ \hline
	tiscreenfg      & {\ttfamily \color{tiscreenfg}{000000}}                             & LCD commands \\
	tiscreenbg      & {\ttfamily \color{tiscreenbg}{5d9345}}                             & LCD commands \\
	tibtngray       & {\ttfamily \color{tibtngray}{494F54}}                              & Buttons      \\
	tibtnyellow     & {\ttfamily \colorbox{tibtncaseblack}{\color{tibtnyellow}{F1E78B}}} & Buttons      \\
	tibtngreen      & {\ttfamily \colorbox{tibtncaseblack}{\color{tibtngreen}{D5DE93}}}  & Buttons      \\
	tibtnwhite      & {\ttfamily \colorbox{tibtncaseblack}{\color{tibtnwhite}{E2E2E2}}}  & Buttons      \\
	tibtnblue       & {\ttfamily \colorbox{tibtncaseblack}{\color{tibtnblue}{CDE2E9}}}   & Buttons      \\
	tibtncaseblack  & {\ttfamily \color{tibtncaseblack}{232A32}}                         & Buttons      \\
\end{tabular}

\clearpage\part{Screen}

\section{LCD size}

The default LCD size is $8 \times 16$ (the size of the TI-82 STATS). It can be
changed by redefining the variables used to determine the size of the display
or by using the original \verb|\LCD| command.

\begin{Verbatim}
% First method (For entire document)
\def\tiscreenX{16}
\def\tiscreenY{8}

% Second method (Only once)
\LCD{5}{11}
|ANOTHER  |
|EXAMPLE  |
|WITH A   |
|DIFFERENT|
|SIZE     |
\end{Verbatim}

\section{(Re)defined characters} \LCDcolors{black}{white}

\begin{center}
	\begin{longtable}{|l|l|l|}
		\multicolumn{3}{c}{\textbf{Added characters}} \\
		\hline
		Name             & Symbol              & \verb|\LCD| \textnormal{Code} \\
		\hline
		E                & \LCDsymb{sciE}      & \verb|{sciE}| \\
		$\sigma$         & \LCDsymb{sigma}     & \verb|{sigma}| \\
		$\Sigma$         & \LCDsymb{Sigma}     & \verb|{Sigma}| \\
		$x^2$            & \LCDsymb{sq}        & \verb|{sq}| \\
		$x^{-1}$         & \LCDsymb{ar}        & \verb|{ar}| \\
		$x^3$            & \LCDsymb{c3}        & \verb|{c3}| \\
		$y^x$            & \LCDsymb{cx}        & \verb|{cx}| \\
		$x_1$            & \LCDsymb{sub1}      & \verb|{sub1}| \\
		$x_2$            & \LCDsymb{sub2}      & \verb|{sub2}| \\
		$x_3$            & \LCDsymb{sub3}      & \verb|{sub3}| \\
		$x_4$            & \LCDsymb{sub4}      & \verb|{sub4}| \\
		$x_5$            & \LCDsymb{sub5}      & \verb|{sub5}| \\
		$x_6$            & \LCDsymb{sub6}      & \verb|{sub6}| \\
		$x_{10}$         & \LCDsymb{sub10}     & \verb|{sub10}| \\
		$\bar x$         & \LCDsymb{barx}      & \verb|{barx}| \\
		$\bar y$         & \LCDsymb{bary}      & \verb|{bary}| \\
		$-x$             & \LCDsymb{dash}      & \verb|{dash}| \\
		$\rightarrow$    & \LCDsymb{sto}       & \verb|{sto}| \\
		$\theta$         & \LCDsymb{theta}     & \verb|{theta}| \\
		$\pi$            & \LCDsymb{pi}        & \verb|{pi}| \\
		$\eta$           & \LCDsymb{eta}       & \verb|{eta}| \\
		$+$              & \LCDsymb{tick}      & \verb|{tick}| \\
		$^\circ$         & \LCDsymb{degree}    & \verb|{degree}| \\
		                 & \LCDsymb{square}    & \verb|{square}| \\
		                 & \LCDsymb{alpha}     & \verb|{alpha}| \\
		$\uparrow$       & \LCDsymb{2nd}       & \verb|{2nd}| \\
		$\geq$           & \LCDsymb{geq}       & \verb|{geq}| \\
		$\leq$           & \LCDsymb{leq}       & \verb|{leq}| \\
		$\neq$           & \LCDsymb{neq}       & \verb|{neq}| \\
		$x^3$            & \LCDsymb{c3}        & \verb|{c3}| \\
		$A^T$            & \LCDsymb{transpose} & \verb|{transpose}| \\
		$A^r$            & \LCDsymb{upr}       & \verb|{upr}| \\
		$chi$            & \LCDsymb{chi}       & \verb|{chi}| \\
		$\triangleright$ & \LCDsymb{fwedge}    & \verb|{fwedge}| \\
		$\triangleleft$  & \LCDsymb{bwedge}    & \verb|{bwedge}| \\
		$\mathbf{N}$     & \LCDsymb{bbN}       & \verb|{bbN}| \\
		$\mathbf{/}$     & \LCDsymb{bb/}       & \verb|{bb/}| \\
		\hline
		\multicolumn{3}{c}{\textbf{Redefined characters}} \\
		\hline
		!                & \LCDsymb{!}         & \{!\} \\
		\{               & \LCDsymb{lb}        & \{lb\} \\
		\}               & \LCDsymb{rb}        & \{rb\} \\
		$[$              & \LCDsymb{[}         & \{[\} \\
		$]$              & \LCDsymb{]}         & \{]\} \\
		$\sqrt{x}$       & \LCDsymb{sqrt}      & \{sqrt\} \\
		e                & \LCDsymb{e}         & \{e\} \\
		i                & \LCDsymb{i}         & \{i\} \\
		v                & \LCDsymb{v}         & \{v\} \\
		w                & \LCDsymb{w}         & \{w\} \\
		Ellipses         & \LCDsymb{ell}       & \{ell\} \\
		Apostrophe       & \LCDsymb{'}         & \{'\} \\
		List             & \LCDsymb{L}         & \{L\} \\
		Underscore       & \LCDsymb{_}         & \{\_\} \\
		\hline
	\end{longtable}
\end{center}

\clearpage\part{Buttons}

\section{Usage}

The \verb|\tibtn<...>| commands only prints the button and are useful when
displaying buttons inline. The \verb|\tibtnextra<...>| commands shows the extra
functionality of the button (accessed by the \tibtnsecond{} and \tibtnalpha{}
buttons). See secion \ref{sec:button} for defined buttons and section
\ref{sec:buttonscustom} for how to define custom buttons.

\section{Defined buttons} \label{sec:button}

\begin{center}
	\begin{longtable}{lrlr}
		\verb|\tibtnsecond|     & \tibtnsecond     & \tibtnextrasecond     & \verb|\tibtnextrasecond|     \\
		\verb|\tibtnmode|       & \tibtnmode       & \tibtnextramode       & \verb|\tibtnextramode|       \\
		\verb|\tibtndel|        & \tibtndel        & \tibtnextradel        & \verb|\tibtnextradel|        \\
		\verb|\tibtnalpha|      & \tibtnalpha      & \tibtnextraalpha      & \verb|\tibtnextraalpha|      \\
		\verb|\tibtnxton|       & \tibtnxton       & \tibtnextraxton       & \verb|\tibtnextraxton|       \\
		\verb|\tibtnstat|       & \tibtnstat       & \tibtnextrastat       & \verb|\tibtnextrastat|       \\
		\verb|\tibtnmath|       & \tibtnmath       & \tibtnextramath       & \verb|\tibtnextramath|       \\
		\verb|\tibtnmatrix|     & \tibtnmatrix     & \tibtnextramatrix     & \verb|\tibtnextramatrix|     \\
		\verb|\tibtnprgm|       & \tibtnprgm       & \tibtnextraprgm       & \verb|\tibtnextraprgm|       \\
		\verb|\tibtnvars|       & \tibtnvars       & \tibtnextravars       & \verb|\tibtnextravars|       \\
		\verb|\tibtnclear|      & \tibtnclear      & \tibtnextraclear      & \verb|\tibtnextraclear|      \\
		\verb|\tibtnxnone|      & \tibtnxnone      & \tibtnextraxnone      & \verb|\tibtnextraxnone|      \\
		\verb|\tibtnsin|        & \tibtnsin        & \tibtnextrasin        & \verb|\tibtnextrasin|        \\
		\verb|\tibtncos|        & \tibtncos        & \tibtnextracos        & \verb|\tibtnextracos|        \\
		\verb|\tibtntan|        & \tibtntan        & \tibtnextratan        & \verb|\tibtnextratan|        \\
		\verb|\tibtnpower|      & \tibtnpower      & \tibtnextrapower      & \verb|\tibtnextrapower|      \\
		\verb|\tibtnxtwo|       & \tibtnxtwo       & \tibtnextraxtwo       & \verb|\tibtnextraxtwo|       \\
		\verb|\tibtncomma|      & \tibtncomma      & \tibtnextracomma      & \verb|\tibtnextracomma|      \\
		\verb|\tibtnleftparen|  & \tibtnleftparen  & \tibtnextraleftparen  & \verb|\tibtnextraleftparen|  \\
		\verb|\tibtnrightparen| & \tibtnrightparen & \tibtnextrarightparen & \verb|\tibtnextrarightparen| \\
		\verb|\tibtndiv|        & \tibtndiv        & \tibtnextradiv        & \verb|\tibtnextradiv|        \\
		\verb|\tibtnlog|        & \tibtnlog        & \tibtnextralog        & \verb|\tibtnextralog|        \\
		\verb|\tibtnseven|      & \tibtnseven      & \tibtnextraseven      & \verb|\tibtnextraseven|      \\
		\verb|\tibtneight|      & \tibtneight      & \tibtnextraeight      & \verb|\tibtnextraeight|      \\
		\verb|\tibtnnine|       & \tibtnnine       & \tibtnextranine       & \verb|\tibtnextranine|       \\
		\verb|\tibtntimes|      & \tibtntimes      & \tibtnextratimes      & \verb|\tibtnextratimes|      \\
		\verb|\tibtnln|         & \tibtnln         & \tibtnextraln         & \verb|\tibtnextraln|         \\
		\verb|\tibtnfour|       & \tibtnfour       & \tibtnextrafour       & \verb|\tibtnextrafour|       \\
		\verb|\tibtnfive|       & \tibtnfive       & \tibtnextrafive       & \verb|\tibtnextrafive|       \\
		\verb|\tibtnsix|        & \tibtnsix        & \tibtnextrasix        & \verb|\tibtnextrasix|        \\
		\verb|\tibtnminus|      & \tibtnminus      & \tibtnextraminus      & \verb|\tibtnextraminus|      \\
		\verb|\tibtnsto|        & \tibtnsto        & \tibtnextrasto        & \verb|\tibtnextrasto|        \\
		\verb|\tibtnone|        & \tibtnone        & \tibtnextraone        & \verb|\tibtnextraone|        \\
		\verb|\tibtntwo|        & \tibtntwo        & \tibtnextratwo        & \verb|\tibtnextratwo|        \\
		\verb|\tibtnthree|      & \tibtnthree      & \tibtnextrathree      & \verb|\tibtnextrathree|      \\
		\verb|\tibtnplus|       & \tibtnplus       & \tibtnextraplus       & \verb|\tibtnextraplus|       \\
		\verb|\tibtnon|         & \tibtnon         & \tibtnextraon         & \verb|\tibtnextraon|         \\
		\verb|\tibtnzero|       & \tibtnzero       & \tibtnextrazero       & \verb|\tibtnextrazero|       \\
		\verb|\tibtndot|        & \tibtndot        & \tibtnextradot        & \verb|\tibtnextradot|        \\
		\verb|\tibtnneg|        & \tibtnneg        & \tibtnextraneg        & \verb|\tibtnextraneg|        \\
		\verb|\tibtnenter|      & \tibtnenter      & \tibtnextraenter      & \verb|\tibtnextraenter|      \\
	\end{longtable}
\end{center}

\section{Custom buttons} \label{sec:buttonscustom}

Buttons are defined using the \verb|\tibtn| and \verb|\tibtnextra|. It's often
convenient to define a \verb|\tibtn| command then use it inside
\verb|\tibtnextra| (See example below). See section \ref{sec:colordef} for a
list of defined colors.

\verb|\tibtn[<text color>]{<button color>}{<text>}|

\verb|\tibtnextra{<middle>}{<top left>}{<top right>}|

\begin{SideBySideExample}[xrightmargin=5.5cm]
\def\tibtnfoo{\tibtn[black]{tibtnblue}{FOO}}
\tibtnfoo{}

\def\tibtnextrafoo{\tibtnextra{\tibtnfoo}{BAR}{BAZ}}
\tibtnextrafoo
\end{SideBySideExample}

\end{document}
