tweh / menukeys

A LaTeX package to typeset menu sequences, key strokes, paths etc.
46 stars 4 forks source link

better visibility for backquote and caret #57

Closed zhyiyu closed 4 years ago

zhyiyu commented 4 years ago

It seems like the markup of backquote and caret is not very recognizable to people's eyes

menukey

when they are not like this huge, I have to magnify to recognize them, especially for the backquote. Here is the code

% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = xelatex
\documentclass{article}
\usepackage{listings}
\usepackage[os = mac]{menukeys}
\renewmenumacro{\keys}{shadowedroundedkeys}

\begin{document}

\Huge

\begin{center}
backquote is \keys{`}
\end{center}

\begin{center}
caret is \keys{\lstinline{^}}
\end{center}

\end{document}

thanks!

tweh commented 4 years ago

Actually this is not a problem of menukeys but of the font you use. Pleas also note that the character you typed as backquote renders as an actual single quote, while the key you type is an accent. An thus nothing that could (should) be done in menukeys. So you may choose a font rendering those clearer and you may show both symbols printed on theses keys:

Bildschirmfoto 2020-07-12 um 09 49 45

% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = xelatex
\documentclass{article}
\usepackage{listings}
\usepackage[os = mac]{menukeys}
\renewmenumacro{\keys}{shadowedroundedkeys}

\usepackage{fontspec}
\setmonofont{Fira Mono}

\newcommand{\acckey}{\texttt{\textasciiacute}}
\newcommand{\hatkey}{\texttt{\textasciicircum}}

\usepackage{stackengine}
\newcommand{\acckeyII}{\texttt{%
   \raisebox{-1.4ex}{%
      \stackon[-0.3ex]{\textasciiacute}{\textasciigrave}%
   }%
}}
\newcommand{\hatkeyII}{\texttt{%
   \raisebox{-1.4ex}{%
      \stackon[-0.3ex]{\textasciicircum}{\textdegree}%
   }%
}}

\begin{document}

\Huge

\begin{center}
backquote is \keys{\acckey}\\
caret is \keys{\hatkey}
\end{center}

\begin{center}
backquote is \keys{\acckeyII}\\
caret is \keys{\hatkeyII}
\end{center}

\end{document}