With Windows 10 you can install the Windows Subsystem for Linux (WSL). This is basically Ubuntu Linux (one of the most popular versions of Linux) integrated into Windows 10 in a way that command-line Linux programs can be executed easily. News and announcements can be fouund at https://msdn.microsoft.com/commandline/wsl/about (msdn.microsoft.com/commandline/wsl/about). Michael Doob reports on 2017-06-02 that this works quite well for the programs necessary to author with PreTeXt, and provides the following help.
be able to use the bash command from the PowerShell window,
have your own WSL userid (distinct from Windows),
have your own WSL password (distinct from Windows).
The default configuration of WSL does not have the software needed for creating documents with PreTeXt. There are a few commands to be run before you can get started.
The program git is used to download the PreTeXt software onto your local computer. It is installed with the command sudo apt-get install git.
The program xsltproc is used to create your readable documents. It is installed with the command sudo apt-get install xsltproc.
After these are installed, you are ready to set up PreTeXt.
Putting PreTeXt on your computer
Here are the steps necessary to get the PreTeXt software onto your computer:
Make a new directory mkdir mathbook
Make your own clone of the PreTeXt repository git clone https://github.com/rbeezer/mathbook.git
Move to the new directory cd mathbook
Initialize the new directory with git pull
This last command synchronizes your files with those in the official repository. You should run it frequently to keep your files up to date.
The simplest example
Here is a brief description of the use of WSL to create readable files. You, as the author, create the xml file. The system will contain an appropriate xsl file that translates your xml file to something readable.
Several editors come with WSL by default including nano, pico, vi, and vim. Here are the steps to follow:
Type the command cd to align yourself in your home directory.
Use one of the editors to create a file called hw.xml (you could use the command nano hw.xml), and add the following text:
Run the command xsltproc mathbook/xsl/mathbook-html.xsl hw.xml Upon completion, your should have a file called hw.html.
Now the tricky part: you want to view the hw.html file in a browser, but the usual Windows programs cannot see the files created within WSL. So we have to copy them to a place where they are visible. Fortunately, this is pretty easy to do. To put hw.html on your desktop, use the command cp hw.html /mnt/c/Users/username/Desktop (note that “username” must be replaced by your Windows user name). Once the file is on the desktop, a double click will open it in a browser.
The edit-xsltproc-view cycle just given may seem daunting at first blush. Some things that can help:
Pressing the up arrow when at the command line displays the previously executed commands. Hitting the enter key while such a command is displayed executes it. This saves a lot of retyping.
It is possible to define aliases to shorten commands. Your local Linux guru can show how this is done.
It is possible to define scripts to shorten multiple commands. Your local Linux guru can show how this is done.