\documentclass{article}
\usepackage{iftex}
\usepackage{cochineal}
\ifpdftex
  \usepackage[T1]{fontenc}
\fi

\usepackage{morse-simple}

\usepackage[margin=1.15in]{geometry}

\usepackage{amsmath}
\usepackage{mflogo}
\usepackage{ragged2e}
\usepackage{array}
\newcommand\TikZ{Ti\/\emph{k}Z}

\makeatletter
\newcommand{\verbatimfont}[1]{\renewcommand{\verbatim@font}{\ttfamily#1}}
\makeatother

% Remove section numbers
\setcounter{secnumdepth}{0}

\title{The morse-simple package}
\author{Jim Hef{}feron}
\date{v~1.0, 2026-July-04}

\pagestyle{empty}
\begin{document}
\maketitle\thispagestyle{empty}

This package is for including small bits of morse code as strings, not sounds,
in \LaTeX{} documents.
Here is a minimal working example.
\verbatimfont{\small}% 
\begin{quote}
\begin{verbatim}
\documentclass{article}
\usepackage{morse-simple}
\begin{document}
Morse for FN34 is \cwWord{FN34}.
\end{document}
\end{verbatim}
\end{quote}
and there is a sample morse code cheat card included in this package.

These are the most useful commands.
\begin{center}\small
  \begin{tabular}{l|l}
    \multicolumn{1}{c}{\textit{Input}}
      &\multicolumn{1}{c}{\textit{Output}}        \\
    \hline \rule{0pt}{10pt}% 
    \verb|\cwWord{Vermont}|      &\cwWord{Vermont}  \\
    \verb|\cwMessage{ur 599}|    &\cwMessage{ur 599}  \\
    \verb|\morse{tu 73}|          &\morse{tu 73}  \\
  \end{tabular}
\end{center}
If you like, you can just use the second one.  
It just calls the first after breaking the input along the
spaces.

A note about the names:~what you may know as `dots' and `dashes' 
are best called `dits' and `dahs'.
You can get a single dit or dah with \verb|\cwDit| and 
\verb|\cwDah|. 






\section{Package options}
The main package option is that the default for dits is a short 
dash~`\cwDitDash{}'
but you can instead choose a filled-in circle~`\cwDitDot{}' by calling the 
package as \verb|\usepackage[ditdot]{morse-simple}|, giving 
\begingroup\renewcommand\cwDit{\cwDitDot}\cwWord{Paris}\endgroup\ 
for \verb|\cwWord{Paris}|.
 
\begin{center}\small
  \begin{tabular}{l | l l | >{\RaggedRight}p{2.5in}}
    \multicolumn{1}{c}{\textit{Option}} 
      &\multicolumn{1}{c}{\textit{Type}} 
      &\multicolumn{1}{c}{\textit{Default}} 
      &\multicolumn{1}{c}{\textit{Affects}}   \\
    \hline \rule{0pt}{10pt}%
    \verb|thickness=...| &Dimension &\verb|0.35ex|  
       &Thickness (vertical) of a dash.  \\
    \verb|height=...|    &Dimension &Same as math $-$
       &Distance of the middle of a dash above the baseline. \\
    \verb|ditwidth=...|  &Dimension &\verb|0.20em|
       &Width (horizontal) of a dit. \\
    \verb|dahwidth=...|  &Dimension &$3\cdot\text{ditwidth}$
      &Width (horizontal) of a dah. \\
    \verb|intracharfactor=...|  &Number &\verb|1|
      &Multiply this by the ditwidth to get the space between dits and dahs inside of a character. \\
    \verb|intercharfactor=...|  &Number &\verb|3| 
      &Multiply this by the ditwidth to get the space between characters. \\
    \verb|interwordfactor=...|  &Number &\verb|7|
      &Multiply this by the ditwidth to get the space between words. \\
    \verb|grayshade=...|  &Number in [0\ldots 1] &\verb|0.5|
      &Darkness of gray for \verb|\morse{..}| (larger numbers are lighter). \\
    \verb|ditdot|         &Toggle on  &Off 
      &Make dah's be circles, not small dashes.  \\
    \verb|dotscale=...|  &Number &\verb|1.5|
      &Factor by which periods are rescaled to make dot circles.  \\
    \verb|dotraise=...|  &Dimension &\verb|1.70pt|
      &Height of rescaled dot.  \\
  \end{tabular}
\end{center}

Justifications for the defaults:~the standard for sounds is that dahs are 
three times as long as dits.
Similarly, the intracharacter 
space, that between a character's dits and dahs, is the same length as a dit,
the intercharacter space is three times as long a dit, and
the interword space is seven dits long.
Visually, those all looked OK to me so I used them.
(I have made these spacings be dimensions, not skips.
In particular, I judged that no one would want to put several lines of morse
where for the interword space they would wish to add some stretch or 
shrink.
If I guessed wrong then sorry about that;~instead you should use a 
ragged right environment or something similar.)

Most of the options are for fiddling with placements and sizes, perhaps to 
better suit your document's font.
Because some of the option defaults involve font characteristics, 
you want to load this package after you do any font loading.

To help fiddle, there are commands to enlarge the dits and
dahs.
Here are the results of \verb|\cwEnlargeDit| and 
\verb|\cwEnlargeDah|
(these take an optional magnification factor argument, with default~15),
where the \verb|ditdot| package option is not invoked.
The middle one temporarily changes the dah to \verb|\cwDitDot|,
just to show what enlargement of that looks like.
The green boxes run from the baseline to a height of 1\,ex.
The red line is at the height of a math minus sign.
Here the dit and dah are at that height, which is the 
default.
\begin{center}
  \cwEnlargeDit
  \quad
  \begingroup\renewcommand\cwDit{\cwDitDot}
    \cwEnlargeDit
  \endgroup
  \quad
  \cwEnlargeDah  
\end{center}





\section{This package}
This package is not named `morse' because there is already a package by that 
name.  

The justification for a new package is that the existing one does things
in a way that is different from how most \LaTeX-ers work today:~it
uses a \MF{} font.
Some more recent approaches propose \TikZ{}, which is a big solution to
a small problem.
Instead this package uses rules
(with circles for dits, if desired, that are scaled-up periods). 

This is the first time I've done \texttt{expl3} programming.
Bug reports welcome.
\end{document}
%
% These lines tell gnu-emacs to typeset with the luatex engine
% which requires Unicode encoding only (utf-8)
% ^c^t^s for toggling synctex. 
% ^-Shift-Click to move from pdf to source, Command-Shift-Click on OSX
%%% Local Variables:
%%% mode: latex
%%% TeX-engine: luatex
%%% TeX-source-correlate-method-active: synctex
%%% coding: utf-8
%%% End:
