Skip to content

Instantly share code, notes, and snippets.

@raydsameshima
Created November 10, 2018 15:19
Show Gist options
  • Save raydsameshima/3f197e209a2863d67e7390dfdf03abd3 to your computer and use it in GitHub Desktop.
Save raydsameshima/3f197e209a2863d67e7390dfdf03abd3 to your computer and use it in GitHub Desktop.
typewriter.sty usage
% !TeX program = lualatex
\documentclass{article}
\usepackage{amsmath}
\usepackage{typewriter}
\begin{document}
\title{Some math symbols}
\author{Ray D. Sameshima}
\maketitle
\section{Some equations}
\begin{equation}
E = mc^2
\end{equation}
\subsection{a text}
The quick brown fox jumps over the lazy dog.
\subsubsection{another test}
Unfortunately some mathematical symbols can not be used e.g., let me write
\begin{equation}
\verb|\forall n \in \mathbb{N}|
\end{equation}
in equation:
\begin{equation}
\forall n \in \mathbb{N}.
\end{equation}
\verb|\pi| becomes \pi, but \verb|\sum, \prod| do not appear: $\sum, \prod$.
\end{document}
@davidcarlisle
Copy link

It was really aiming to emulate a typewriter and most (pre-electronic) typewriters would never have had those symbols... If you use the github version of the package, it's easier to change fonts: I used Lucida Console which has \sum and \prod and added a couple more definitions to get

image

Just changed the preamble to

\documentclass{article}
\usepackage{amsmath}

\newcommand\ttbasefont{lucon.ttf}
\usepackage{typewriter}
\def\forall{V\llap-}
\def\mathbb#1{\ifx N#1IN\else#1\fi}
\def\in{~in~}

\begin{document}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment