LaTeX, Minitab/SPSS Output, and Monospaced Sections

I’m in year four of six of my Open University Computing & IT (Computer Science) with Statistics undergraduate degree. As I can no longer write by hand for extended assignments, I have begun using LaTeX to submit my statistics coursework. One of the issues I encountered is how annoying it is to put SPSS or Minitab console output in the assignment.

My requirements are that it should be monospaced font, the monospaced font must support single character math symbols (e.g. \mu, \neq), and that multiple spaces need to be printed. First I tried \texttt, but that didn’t give me much control. Next I tried \verbatim, but then I lost \mu

Yay I have a new problem.gif

Turns out I needed something different. I successfully cobbled together a solution using \usepackage{mdframed} and a find\replace on the lowly space to a tilde.

First I created a style in the document header, \mdfdefinestyle{monosec}{font=\footnotesize\ttfamily, align=left}, then added the section.

\begin{mdframed}[style=monosec]
Test of $\mu = 0.26$ vs $\mu \neq 0.26$\\
The assumed standard deviation = 0.2685\\ \linebreak
Variable~~~N~~~~Mean~~~StDev~~SE~Mean~~~~~~~95\%~CI~~~~~~~~~~Z~~~~~~P~\\
Strength~~30~~0.3659~~0.2685~~~0.0490~~(0.2698,~0.4619)~~2.16~~0.031
\end{mdframed}

Success!
Screenshot 2019-04-11 at 09.57.36.png

I hope this helps someone else out there.
[Optimizing……]

 
0
Kudos
 
0
Kudos

Now read this

The Station Wagon Down the Freeway Problem

Growing up, one of the maxims my dad said to me was to never underestimate the transfer speed of a station wagon loaded with tape going down the freeway. Back then (the 1990s) it was a considerable transfer speed, but I wanted to see how... Continue →