以逐字模式提升角色

以逐字模式提升角色

考虑以下代码(参见这里对于原始代码):

\documentclass[
  a4paper,
  11pt
]{article}

\usepackage[varg]{newpxmath}
\usepackage[
  hmargin = 2.4cm,
  vmargin = 3cm
]{geometry}

\usepackage[most]{tcolorbox}
  \colorlet{blackened}{black!90!white}
  \colorlet{blackish}{black!70!white}
  \colorlet{greyish}{black!60!white}
  \colorlet{lightgreyish}{black!10!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.15cm,
    beforeafter skip = 0pt,
    toptitle = 0mm,
    bottomtitle = 0mm,
    right = 3pt,
    left = 3pt,
    top = 3pt,
    bottom = 3pt,
    boxsep = 0pt,
    boxrule = 0mm,
    sharp corners,
    sidebyside,
    sidebyside gap = 6pt,
    lefthand ratio = 0.622,
    bicolor,
    colback = lightgreyish,
    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.15mm,
  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 = \footnotesize\sffamily,
  coltext = orangeish,
  before upper = \vrule width 0pt height 2ex depth 1ex\relax,
}

\newtcbox{\KN}{
  enhanced,
  on line,
  arc = 2pt, outer arc = 2pt,
  boxrule = 0pt,
  bottomrule = 0.15mm,
  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 = \footnotesize\sffamily,
  coltext = whiteish,
  before upper = \vrule width 0pt height 2ex depth 1ex\relax,
}

\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}
\usepackage{xfrac}

\begin{document}

\begin{calx}{}{}
  \KY{$(-)$}
  \KY{8}
  \KN{$+$}
  \KY{6}
  \KY{enter}
  \tcblower
  {\Large
   \textLCD[0]{19}|-8+6|
   \textLCD[0]{18}|                 -2|
  }
\end{calx}

\end{document}

输出

如何将绿色框中两行的减号都增加几号ex左右?

答案1

您可以使用以下方式定义一个凸起的减号

\DefineLCDchar{rm}{00000000001111100000000000000000000}

(将减号提高一个像素)并像这样使用它

\textLCD[0]{19}|{rm}8+6|

或者,如果你想要减号总是上升,你可以用以下方式重新定义它

\DefineLCDchar{-}{00000000001111100000000000000000000}

并正常使用它(\textLCD[0]{19}|-8+6|)。在这两种情况下,结果都是

在此处输入图片描述

代码:

\documentclass[
  a4paper,
  11pt
]{article}

%\usepackage[varg]{newpxmath}
\usepackage[
  hmargin = 2.4cm,
  vmargin = 3cm
]{geometry}

\usepackage[most]{tcolorbox}
  \colorlet{blackened}{black!90!white}
  \colorlet{blackish}{black!70!white}
  \colorlet{greyish}{black!60!white}
  \colorlet{lightgreyish}{black!10!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.15cm,
    beforeafter skip = 0pt,
    toptitle = 0mm,
    bottomtitle = 0mm,
    right = 3pt,
    left = 3pt,
    top = 3pt,
    bottom = 3pt,
    boxsep = 0pt,
    boxrule = 0mm,
    sharp corners,
    sidebyside,
    sidebyside gap = 6pt,
    lefthand ratio = 0.622,
    bicolor,
    colback = lightgreyish,
    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.15mm,
  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 = \footnotesize\sffamily,
  coltext = orangeish,
  before upper = \vrule width 0pt height 2ex depth 1ex\relax,
}

\newtcbox{\KN}{
  enhanced,
  on line,
  arc = 2pt, outer arc = 2pt,
  boxrule = 0pt,
  bottomrule = 0.15mm,
  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 = \footnotesize\sffamily,
  coltext = whiteish,
  before upper = \vrule width 0pt height 2ex depth 1ex\relax,
}

\usepackage{lcd}
  \LCDcolors{black}{greenish}
  \DefineLCDchar{sq}{11100001000100011100000000000000000}
  \DefineLCDchar{tm}{00000100010101000100010101000100000}
  \DefineLCDchar{dv}{00000001000000011111000000010000000}
  \DefineLCDchar{mu}{00011000011110100001000000000000000}
  \DefineLCDchar{sc}{11011010011001000000000000000000000}
  % raised minus
  \DefineLCDchar{rm}{00000000001111100000000000000000000}
  % alternative: redefine the minus sign
  %\DefineLCDchar{-}{00000000001111100000000000000000000}

\DeclareMathOperator{\ee}{\textrm{e}}

%\usepackage{MnSymbol}
\usepackage{xfrac}

\begin{document}

\begin{calx}{}{}
  \KY{$(-)$}
  \KY{8}
  \KN{$+$}
  \KY{6}
  \KY{enter}
  \tcblower
  {\Large
   \textLCD[0]{19}|{rm}8+6|
   \textLCD[0]{18}|                 {rm}2|
  }
\end{calx}

\end{document}

编辑:

设置\DefineLCDchar5x7 矩阵中的像素。A0表示“像素关闭”,a1表示“像素打开”。像素从左到右、从上到下排列。手册中的图片显示了这一点:

在此处输入图片描述

相关内容