login

Section 1 Preparation for Publishing

Open a terminal. On Windows, run Ubuntu app from the start menu installed on WSL.
Install a script
Download the file
mp
and make it executable.1 On Windows, you may need to open the Linux folder by the command explorer.exe .(don’t forget the last period). Then go to the folder containing the downloaded file, run the command
ls
to check the file mp. Finally run
    chmod 755 mp
and place it in a path that can be reachable from anywhere.
Register ssh key
To publish a book to MathPage, you have to register your ssh key. In terminal, go to
.ssh
folder under your home folder. If the folder does not exist, create it first.2 Note that a directory or a file whose name starts with a dot is not visible by the command
ls
.
Use the following command to create private key
mathpage
and public key
mathpage.pub
:
    ssh-keygen -f mathpage
Display the content of the public key by
    cat mathpage.pub
and copy and paste the content as your ssh key to the author menu “Author > Manage ssh key” in MathPage.
Prepare passfile
Use the following command to create
.mathpage
folder under the home folder
    cd ~
    mkdir .mathpage
Before proceeding, note that in
passfile
,
AUTHOR
is the login id of the author,
SHELF
is the path to the folder containing LaTeX source files,
KEY
is the path to the ssh public key prepared before, and
PUBLISHER
is fixed.
Now create
passfile
using the command
    cd .mathpage
    cat > passfile
and paste the following content
    PUBLISHER=mathpage@publisher.mathpage.dev
    AUTHOR=judy
    SHELF=~/shelf/
    KEY=~/.ssh/mathpage
into it and press
CTRL-D
to save it. To verify the content of
passfile
, run the command
    cat passfile
again.
Finally, make sure the folder
~/shelf
used in
SHELF
above actually exists. To create the folder, use the command
cd ~; mkdir shelf
.
Upload LaTeX source files
To upload files in
SHELF
, use the command
    mp publish
(or
./mp publish
in the folder in which the file
mp
is). Now the script uploads the files in
SHELF
to MathPage and starts publishing updated books.
If you changed the name or location of
passfile
, then use the command
    mp -p ~/.mathpage/passfile publish
with changed path to
passfile
.
1
Edge or Safari web browser may have renamed the downloaded file as mp.txt. In this case, change to the original name mp.
2
mkdir .ssh; cd .ssh