使用以下代码,我可以很好地模拟计算器屏幕。但是,我正在寻找一种方法来使求和符号更小。有什么建议吗?
\documentclass{article}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{xparse}
\newcommand\tsurd{\ensuremath{\sqrt{\phantom{i}}}}
\newcommand\txbar{\ensuremath{\overline{\text{x}}}}
\newcommand\sumx{\ensuremath{\sum{\text{x}}}}
\newcommand\sumxsq{\ensuremath{\sum{\text{x}}^2}}
\newcommand\sigmax{\ensuremath{\sigma{\text{x}}}}
\ExplSyntaxOn
\NewDocumentCommand{\calcinput}{m}
{
\tl_map_inline:nn { #1 } { ##1 \hspace{0pt} }
}
\ExplSyntaxOff
\begin{document}
\def\onevarstats{\calcinput{1-Var\ Stats}}
\def\xbar{\calcinput{\ \txbar:1.23}}
\def\mysumx{\calcinput{\ \sumx:12}}
\def\mysumxsq{\calcinput{\ \sumxsq:140}}
\def\s{\calcinput{\ Sx:3.2}}
\def\mysigmax{\calcinput{\ \sigmax:2.2}}
\def\n{\calcinput{\ n:7}}
\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] (onevarstats) {\onevarstats};
\node[align=flush left,text width =5cm,
anchor=north west,inner sep=1pt] (xbar) at (onevarstats.south west) {\xbar};
\node[align=flush left,text width =5cm,
anchor=north west,inner sep=1pt] (mysumx) at (xbar.south west) {\mysumx};
\node[align=flush left,text width =5cm,
anchor=north west,inner sep=1pt] (mysumxsq) at (mysumx.south west) {\mysumxsq};
\node[align=flush left,text width =5cm,
anchor=north west,inner sep=1pt] (s) at (mysumxsq.south west) {\s};
\node[align=flush left,text width =5cm,
anchor=north west,inner sep=1pt] (mysigmax) at (s.south west) {\mysigmax};
\node[align=flush left,text width =5cm,
anchor=north west,inner sep=1pt] (n) at (mysigmax.south west) {\n};
\end{tikzpicture}
\end{center}
\end{document}
答案1
或者您也可以使用以下命令:
$\textstyle \sum$
答案2
\Sigma
直接用代替怎么样\sum
?
\documentclass{article}
\usepackage{tikz}
\usepackage{amsmath}
\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}}}}
\ExplSyntaxOn
\NewDocumentCommand{\calcinput}{m}
{
\tl_map_inline:nn { #1 } { ##1 \hspace{0pt} }
}
\ExplSyntaxOff
\pagestyle{empty}
\begin{document}
\def\onevarstats{\calcinput{1-Var\ Stats}}
\def\xbar{\calcinput{\ \txbar:1.23}}
\def\mysumx{\calcinput{\ \sumx:12}}
\def\mysumxsq{\calcinput{\ \sumxsq:140}}
\def\s{\calcinput{\ Sx:3.2}}
\def\mysigmax{\calcinput{\ \sigmax:2.2}}
\def\n{\calcinput{\ n:7}}
\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] (onevarstats) {\onevarstats};
\node[align=flush left,text width =5cm,
anchor=north west,inner sep=1pt] (xbar) at (onevarstats.south west) {\xbar};
\node[align=flush left,text width =5cm,
anchor=north west,inner sep=1pt] (mysumx) at (xbar.south west) {\mysumx};
\node[align=flush left,text width =5cm,
anchor=north west,inner sep=1pt] (mysumxsq) at (mysumx.south west) {\mysumxsq};
\node[align=flush left,text width =5cm,
anchor=north west,inner sep=1pt] (s) at (mysumxsq.south west) {\s};
\node[align=flush left,text width =5cm,
anchor=north west,inner sep=1pt] (mysigmax) at (s.south west) {\mysigmax};
\node[align=flush left,text width =5cm,
anchor=north west,inner sep=1pt] (n) at (mysigmax.south west) {\n};
\end{tikzpicture}
\end{center}
\end{document}
或者,您也可以写\scriptstyle\sum
来代替\sum
。