4

All,

I'm working on another calculator screen. This will produce what I have thus far. Note the line in red, with a single mu character in red. I need that line to read:

\mu:\ne\mu_0  <\mu_0  >\mu_0

I also need to select one of the three, put a black background and type the characters in white.

Any suggestions?

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}

\usepackage{booktabs}
\usepackage{xparse}
\newcommand\tsurd{\ensuremath{\sqrt{\phantom{i}}}}
\newcommand\txbar{\ensuremath{\overline{\text{x}}}}
\newcommand\sumx{\ensuremath{\Sigma{\text{x}}}}
\newcommand\sumxsq{\ensuremath{\Sigma{\text{x}}^2}}
\newcommand\sigmax{\ensuremath{\sigma{\text{x}}}}
\newcommand\muzero{\ensuremath{\mu_0}}
\newcommand\muzerone{\ensuremath{\ne\mu_0}}
\newcommand\mymu{\ensuremath{\color{red}{\mu}}}
\ExplSyntaxOn
\NewDocumentCommand{\calcinput}{m}
{
 \tl_map_inline:nn { #1 } { ##1 \hspace{0pt} }
}
\ExplSyntaxOff


\begin{document}

\def\ttest{\calcinput{T-Test}}
\def\inpt{\calcinput{\ Inpt:{\colorbox{black}{\textcolor{white}{Data}}\ Stats}}}
\def\mymuzero{\calcinput{\ \muzero:0}}
\def\mylist{\calcinput{\ List:L1}}
\def\myfreq{\calcinput{\ Freq:1}}
\def\myalt{\calcinput{\ \mymu:}}
\def\mycalc{\calcinput{\ {\colorbox{black}{\textcolor{white}{Calculate}}\ Draw}}}


\begin{center}
\begin{tikzpicture}[font=\large\ttfamily]
\draw (0,0) rectangle (5,-4);
\node[align=flush left,text width =5cm,
 anchor=north west,inner sep=1pt] (ttest) {\ttest};
\node[align=flush left,text width =5cm,
 anchor=north west,inner sep=1pt] (inpt) at (ttest.south west) {\inpt};
\node[align=flush left,text width =5cm,
 anchor=north west,inner sep=1pt] (mymuzero) at (inpt.south west) {\mymuzero};
\node[align=flush left,text width =5cm,
 anchor=north west,inner sep=1pt] (mylist) at (mymuzero.south west) {\mylist};
\node[align=flush left,text width =5cm,
 anchor=north west,inner sep=1pt] (myfreq) at (mylist.south west) {\myfreq};
\node[align=flush left,text width =5cm,
 anchor=north west,inner sep=1pt] (myalt) at (myfreq.south west) {\myalt};
\node[align=flush left,text width =5cm,
 anchor=north west,inner sep=1pt] (mycalc) at (myalt.south west) {\mycalc};
\end{tikzpicture}
\end{center}

\end{document}
0

1 Answer 1

3

Below are two of the options you are looking for. Here I have defined the \WhiteText macro which places the text within a black box. This also adjusts the horizontal separation of the black box so that it does not result in any shifting of the text.

enter image description here

Further Enhancements:

  • It may be preferable to define a single \mymumu macro that accepts a parameter (0,1,2,3) which defines which of the three terms are to use the \WhiteText macro.

Code:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}

\newcommand*{\WhiteText}[1]{%
    \colorbox{black}{\kern-\fboxsep\textcolor{white}{#1}\kern-\fboxsep}%
}%

\usepackage{booktabs}
\usepackage{xparse}
\newcommand\tsurd{\ensuremath{\sqrt{\phantom{i}}}}
\newcommand\txbar{\ensuremath{\overline{\text{x}}}}
\newcommand\sumx{\ensuremath{\Sigma{\text{x}}}}
\newcommand\sumxsq{\ensuremath{\Sigma{\text{x}}^2}}
\newcommand\sigmax{\ensuremath{\sigma{\text{x}}}}
\newcommand\muzero{\ensuremath{\mu_0}}
\newcommand\muzerone{\ensuremath{\ne\mu_0}}
\newcommand\mymu{\ensuremath{\color{red}{\mu}}}

\newcommand\mymumuA{\ensuremath{\color{red}\mu:\ne\mu_0 <\mu_0 >\mu_0}}
\newcommand\mymumuB{\ensuremath{\color{red}\mu:\ne\mu_0 < \WhiteText{$\mu_0$} >\mu_0}}

\ExplSyntaxOn
\NewDocumentCommand{\calcinput}{m}
{
 \tl_map_inline:nn { #1 } { ##1 \hspace{0pt} }
}
\ExplSyntaxOff


\begin{document}

\def\ttest{\calcinput{T-Test}}
\def\inpt{\calcinput{\ Inpt:{\colorbox{black}{\textcolor{white}{Data}}\ Stats}}}
\def\mymuzero{\calcinput{\ \muzero:0}}
\def\mylist{\calcinput{\ List:L1}}
\def\myfreq{\calcinput{\ Freq:1}}
\def\myaltA{\calcinput{\ \mymumuA:}}
\def\myaltB{\calcinput{\ \mymumuB:}}
\def\mycalc{\calcinput{\ {\colorbox{black}{\textcolor{white}{Calculate}}\ Draw}}}


\begin{center}
\begin{tikzpicture}[font=\large\ttfamily]
\draw (0,0) rectangle (5,-4);
\node[align=flush left,text width =5cm,
 anchor=north west,inner sep=1pt] (ttest) {\ttest};
\node[align=flush left,text width =5cm,
 anchor=north west,inner sep=1pt] (inpt) at (ttest.south west) {\inpt};
\node[align=flush left,text width =5cm,
 anchor=north west,inner sep=1pt] (mymuzero) at (inpt.south west) {\mymuzero};
\node[align=flush left,text width =5cm,
 anchor=north west,inner sep=1pt] (mylist) at (mymuzero.south west) {\mylist};
\node[align=flush left,text width =5cm,
 anchor=north west,inner sep=1pt] (myfreq) at (mylist.south west) {\myfreq};
\node[align=flush left,text width =5cm,
 anchor=north west,inner sep=1pt] (myaltA) at (myfreq.south west) {\myaltA};
\node[align=flush left,text width =5cm,
 anchor=north west,inner sep=1pt] (myaltB) at (myaltA.south west) {\myaltB};
\node[align=flush left,text width =5cm,
 anchor=north west,inner sep=1pt] (mycalc) at (myaltB.south west) {\mycalc};
\end{tikzpicture}
\end{center}

\end{document}
2
  • Peter, than you so much. That worked!
    – David
    Dec 6, 2012 at 6:18
  • @user16203: You're welcome. But please do have a look at cmhughes and Werner's comments to your question. You have been here for a while not but have not bothered to upvote any answer/questions you find useful, nor have you accepted any answers. Up voting helps to filter the better answers, and accepting ones that you feel are adequately answered the question allows those to be considered as answered. Dec 6, 2012 at 6:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .