在计算机教程里,通常需输入路径名,菜单路径以及键盘快捷键,前文中提到keystroke包来输入键盘快捷键。这里介绍一个新的宏包menukeys,不仅能够输入键盘快捷键,而且可以选择windows和macos风格的键盘,路径名,菜单序列都是如此,下面介绍几个例子。 例子一: Menukey-ex

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[os=mac, mackeys=symbols]{menukeys}

\begin{document}
\noindent For saving a file to the desktop, go to \menu[,]{File, Save As...} and 
navigate to \directory{Users/Username/Desktop}. Alternatively, use the following 
keyboard shortcuts: \keys{\cmd+\shift+S} and \keys{\cmd+D}.
\end{document}
例子二: Menukey-ex2
\documentclass{article}
\usepackage{menukeys}
\renewmenumacro{\directory}{pathswithfolder} % default: paths
\begin{document}
\directory{Item 1 / Item 2 / Item 3 / ...}
\end{document}
更多例子可以阅读宏包说明文件:http://mirrors.ctan.org/macros/latex/contrib/menukeys/menukeys.pdf 选自:http://texblog.org/2013/03/14/menukeys-typesetting-menu-sequences-directory-path-names-and-keyboard-shortcuts-in-latex/