Workflow for Teaching Mathematics Online

One of the hardest jobs being a Mathematics teacher in todays push in online learning is finding resources that can help aide the efficient facilitation of student learning.

Currently, there are several tools which help math teachers write equations and this process either involves clicking an array of buttons, moving mouse cursors around the equation and typing expressions OR knowing some LaTeX code and typing it all into a LaTeX editor and rendering it. Either side has its advantages and disadvantages.

Like possibly many other math teachers I didn’t particularly want to have to learn another language, so I sought to take the path of least resistance and bought some magic software (e.g. MathType) or used Microsoft’s Equation Editor, which allowed me to click the buttons and type a few things to achieve the resulting equation. This looked great and worked well, but when you begin to show mathematical process and working out, clicking buttons becomes very tedious.

I then searched around for other alternatives and dove into the other pool and began learning LaTeX. I started with the wonderful MacTeX software, and it allowed me to type LaTeX code, generate an equation and embed this into practically any piece of software. Again though this didn’t help much when it came to showing mathematical process and working out. While I certainly began to fall in love with LaTeX’s complexity the software I was using was not ideal.

I then gave up on LaTeX and went to a hybrid software solution: Mathematica 8. Wow, and what a jump this was – I felt like I was sitting in a Ferrari! I had all this mathematical power under my belt, but I just couldn’t devote the time needed to learn all the functionality required. I persisted for a year using this wonderful piece of software and enjoyed the ways in which I could create documents that had both charts, normal text, LaTeX equations, however, the biggest hurdle I faced was trying to get the information I created online and into our school’s learning management system (LMS). There was no easy way.

So, when the school provided us with new MacBook Airs towards the end of this term I was faced with a dilemma: do I install Mathematica on my new Mac? I had used it much last year but found its use this year not as helpful. In fact, I found myself using Wolfram Alpha website more and the software less.

It was towards the end of this year, armed with a new MacBook Air that I tried to look for an alternative solution. And this time my focus was more dependent on finding a resource that I could use easily both online and offline.

I created my list:

  • Had to have LaTeX functionality
  • Had to have Markdown functionality (a terribly easy way to write HTML without actually writing HTML!)
  • Had to allow both within the same file (the software would differentiate between what was text, Markdown and LaTeX and would render accordingly)
  • Needed to work on a Mac
  • The resulting output had to work inside the school’s LMS (this was harder than I thought!)
  • No contracts please (I didn’t want to be locked in to any commitments or plans or expensive software)
  • Support available (or a community) should the software break

After a few days of searching I came across a solution that fit most of my requirements. It was a little involved to setup and required the downloading of several parts, however, so far I’m VERY happy with the solution.

So what is it?

My working environment now involves this setup:

Within RStudio IDE I then had to setup some additional material.

  • From the menu bar > Tools > Install Packages… > knitr
  • From the menu bar > RStudio > Preferences > Weave Rnw files using: > knitr
  • From the menu bar > Project > Create Project… > New Project… > Type in a name and select location > Create Project (you should now be within that new project directory)
  • From Console window enter file.edit("~/.Rpofile")
  • This will open up a global profile file that will be applied to all projects in your RStudio IDE, if you wanted to only create a profile specific to the project change the above to file.edit(".Rprofile"). From whichever file I then entered the following information:
options(rstudio.markdownToHTML =
function(inputFile, outputFile) {
system(paste("pandoc", shQuote(inputFile), "-s --webtex=http://chart.apis.google.com/chart?cht=tx\\&chf=bg,s,FFFFFF00\\&chl= --self-contained -o", shQuote(outputFile)))
}
)
print("Global (or Local) .Rprofile file has been loaded.") // change to Local if .Rprofile is stored in project
// there needs to be a blank file here
view raw .Rprofile hosted with ❤ by GitHub

Once this was all done I then went to the menu bar > Session > Restart R. Which would then show in the console:

[1] "Global (or Local) .Rprofile file has been loaded."

Finally, to get started on my content I would then select from the menu bar > File > New > R Markdown. I would then type away the content to be delivered to my students which would include LaTeX and Markdown and then upon finishing click the magical “Knit HTML” button.

RStudio would then output a screen showing my resulting output, which I would copy and then paste within my school’s LMS.

So far so good!