13

How can you typeset keys to get the impression of a Calculator?

Remark: This question is a split-of Keyboard Font for LaTeX

17

There are packages for it:

tipfr

Example from the doc:

enter image description here

A small example:

\documentclass[11pt,english]{scrartcl} 
\usepackage{babel} 
\usepackage{tipfr} 

\begin{document}

Push 
\Touche[style=number, principal=1]
\Touche[style=operation, principal=+]
\Touche[style=number, principal=2]
\Touche[style=function,principal={=},]
and you get the result 3.

\end{document}

enter image description here

Some examples for the \Touche-macro: enter image description here

graph35 - Casio calculators

Actually (2018-03-24) one model is available: graph35+.

  • I like it! But why not give a MWE for people to copy and paste the code? The documentation had just snippets of code. – DJP Jan 2 '15 at 3:19
  • I downloaded the files from CTAN, put the style file in with the tex file but it wouldn't compile. The error message was: "newtxtt.sty not found". I googled and found a copy on the internet. Put that in the same file and again it wouldn't compile: "I do not know the /tcb/color key and I'm going to ignore it". The problem is line 14. Any idea how to continue? – DJP Jan 2 '15 at 3:31
  • @DJP newtxtt can be found on CTAN at ctan.org/pkg/newtxtt. With version 1.03 and 1.051 (the actual one) I get no error. I look for a MWE - actually I found a bug (?) in tipfr.sty with babel and \shorthandon{;} (line 422 + 494) - I kep you informed. – knut Jan 2 '15 at 19:53
  • @DJP have you updated LaTeX on your computer? For example, newtxtt is a fairly new addition. – A.Ellett Jan 2 '15 at 22:06
  • @knut I do have the updated newtxtt.sty file but I still can't compile your MWE. I get "./tipfr.sty:422: Package babel Error: I cannot switch `;' on or off--not a shorthand." and later: "l.422 \shorthandon{;}". This sounds like the bug(?) you mention above. – DJP Jan 2 '15 at 22:33
3

\shorthandon{} and \shorthandoff{} do not make sense for French with LuaTeX or XeTeX as high punctuation characters (:;!?) are no longer made active with these engines.

I would suggest dropping the two commands \shorthandon{;} and \shorthandoff{;} in tipfr.sty and adding babel to the options of \usetikzlibrary{...} on line 10, this should take care of ; characters when they happen to be active (in French with TeX or pdfTeX engines).

  • I made those changes and it's working for me! This will be a useful package to have. Thanks! +1. – DJP Jan 5 '15 at 18:42
  • 1
    This should be a comment rather than an answer. – Werner Jan 5 '15 at 18:53
  • 1
    +1 - although it should be a comment - but it really solve the problem. – knut Jan 5 '15 at 19:56
2

I can't write a comment because I haven't enough reputation so I use the answer box. You can draw calculator's keys with the tipfr package. There is a update (see http://www.ctan.org/pkg/tipfr) : with the help of the previous answer, the problem you met is fixed.

The "principal" option can now be called with the "enter" style. For example : \Touche[style=enter,principal={=}] or \Touche[style=enter,principal={EXE}]

I added a starred version to \Calculatrice to draw a small calculator (see an example at the end of documentation)

  • 1
    Welcome to TeX.SX! If you elaborate on your answer it's more than a comment ;-) – user31729 Jan 8 '15 at 11:48
  • +1 for the package and the quick solution of the problem. And for the info, why it's an answer and no comment ;) – knut Jan 8 '15 at 13:30
2

Now it exists a new package to draw keys of a scientific calculator. I used that calculator when I teached at Junior High School.

ticollege.sty : https://www.ctan.org/pkg/ticollege

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.