Chapter 2 Author
In this chapter, we explain how to publish books written by an author on her personal computer to MathPage. We assume she can run commands in a Linux terminal.
Section 1 Preparation for Publishing
Open a terminal. On Windows, run Ubuntu app from the start menu installed on WSL.
Download the file
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
and place it in a path that can be reachable from anywhere.
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
:
Display the content of the public key by
and copy and paste the content as your ssh key to the author menu “Author > Manage ssh key” in MathPage.
Use the following command to create
.mathpage
folder under the home folder
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
again.
Finally, make sure the folder
~/shelf
used in
SHELF
above actually exists. To create the folder, use the command
cd ~; mkdir shelf
.
To upload files in
SHELF
, use the command
(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
.
Section 2 Author Menu
“First name” and “Last name” are used to display the copyright owner of the books published in MathPage. On the other hand, “Nickname” is the pen name of the author. “Language” is the language which is used, for instance, in emails to the author.
Here paste into the text area the content of the ssh key generated in the publishing preparation step. Whenever the ssh key changes, the field should be updated with the content of the new ssh key.
Add a new book by filling “Title“, “Cover”, “Slug” and choosing the main LaTeX source file in the “Source” field. For “Title”, an image file can be uploaded. If there is no image file ready, then this field can be left empty. “Slug” is a short character string used in the url of the book, and hence comprised of English characters from a to z, numerals from 0 to 9, an hyphen or a dash. For example, for a linear algebra book, you can use the acronym “la” for slug. For “Language”, English or Korean can be chosen as the language of the book. If the book is comprised of several files “
\included
” to the main file, then in “Source”, choose the main file.
In the bookshelf, the books published in MathPage are displayed. This page is only visible to the author.
The author with the copyright of a book published in MathPage can request sale of the book in the MathPage bookstore. Use “Request for Sale” button in the author menu.
Section 3 Publishing Tutorial
Create a new folder
my_book
in the shelf folder. Then download to the folder the file
Typeset this file by the LaTeX system on the personal computer. If typeset successfully, then open and check the generated
my_book.pdf
file.
Now open the terminal, and run the command
mp publish
to upload the files to MathPage. Then in the author menu, add a new book
My Book
, and check the published book in MathPage.
A book in Korean can be typeset by XeLaTeX engine. Create a new folder
my_book_ko
in the shelf folder. Into the new foler, download one of the following files for your platform
Typeset this file using XeLaTeX engine (in the LaTeX system). After typesetting, check the generated
my_book_ko.pdf
.
Now use the command
mp publish
to publish to MathPage. In the author menu, create a new book
My Korean Book
. Choose Korean as the language of the book. Finally check the new book in MathPage.
If you look into the book
my_book_ko.pdf
carefully, you would find English expressions such as “Chapter” or “Section” unfit in the book in Korean language. This is because of the document class file
book.cls
, which is designed for English books. Hence for books in Korean, download the following file to the folder containing the book source files
and change the first line of
my_book_ko.tex
as follows:
Now typeset the book with XeLaTeX again, and check
my_book_ko.pdf
in natural Korean style.
A large subset of LaTeX is supported by MathPage. On the other hand, MathPage extends LaTeX to support media and interactive contents. Refer to Chapter
5 for further information.