Write book in markdown
-
Upload
larry-cai -
Category
Technology
-
view
7.945 -
download
5
description
Transcript of Write book in markdown
Larry cai <[email protected]>
AgendaEnvironmentExercise 1: generate bookExercise 2: add your own into the books (workflow)
Exercise 3: add more things using markdownExercise 4: Hello World in LatexExercise 5: Change color for header/footer Exercise 6: Table in MultiMarkdownReference
Learn MultiMarkdown to Book2
Environment @ Windows
Learn MultiMarkdown to Book3
Git Bash (unix env) http://git-scm.com
Editor MarkdownPad http://markdownpad.com/
MultiMarkdown http://fletcherpenney.net/multimarkdown
Latex MiKTex: http://www.miktex.org/portable
Exercise 1 – Generate Book PDF mmdtex-2.9.5105.tar.gz (120M) is provided for multimarkdown+MiKTex environment $ tar –zxvf mmdtex-2.9.5105.tar.gz –C /c # extract to c:
In Windows Explorer, run C:\mmdtex\MiKTex\miktex-portable.cmd
Right click miktex icon-> Options -> Refresh FNDB
Generate book $ source /c/mmdtex/env.sh$ git clone [email protected]:larrycai/sdcamp.git$ cd sdcamp$ ./mmd2bok
Open sdcamp.pdf
Learn MultiMarkdown to Book4
HOWTO: mmdtex-2.9.5105.tar.gz Download MultiMarkdown portable version
http://fletcherpenney.net/multimarkdown/download/
c:\mmdtex\MultiMarkdown
Download MiKTex Windows Portable version 2.9.5105http://www.miktex.org/portable c:\mmdtex\MiKTex
Add c:\mmdtex\env.sh$ cat env.shMMDTEX_BASE=/c/mmdtexexport PATH=${MMDTEX_BASE}/MiKTex/miktex/bin:${MMDTEX_BASE}/MultiMarkdown:$PATH
Run Exercise 1 to get latex package automatically Then
$ tar –zcvf mmdtex-2.9.5105.tar.gz mmdtexLearn MultiMarkdown to Book5
Workflow
Learn MultiMarkdown to Book6
Markdown
Book content
Latex
Latex Template
PDFmultimarkdown xelatex
Take a look at the script mmd2bok
Exercise 2: add one chapter Edit sdcamp/contents/*.markdown Change contexts in
Preface/Chapters/Appendix and build again
Learn MultiMarkdown to Book7
MarkdownPad is the best markdown editor in Windows – Simple, Clean
Learn markdown Markdown is a text-to-HTML conversion tool
for web writers. Markdown allows you to write using an easy-
to-read, easy-to-write plain text format, then convert it to structurally valid XHTML
Others: rST (reStructuredText) , asciidoc are similar to markdown
Learn MultiMarkdown to Book8
Markdown syntax
http://packetlife.net/media/library/16/Markdown.pdf
Book structureFront-cover & Back-coverPreface/Forward/AcknowledgementContents Main chaptersAppendix/Glossary/Bibliography
Learn MultiMarkdown to Book10
Exercise 3: Markdown
Learn MultiMarkdown to Book11
Add code sectionAdd extra subsectionAdd bulletAdd image
![敏捷宣言 ](../img/xxx)Build again
LaTeX in short
Learn MultiMarkdown to Book12
Exercise 4: Latex hello World
Learn MultiMarkdown to Book13
Open TeXworksCreate file hello.tex
Or $ xelatex hello.texSee template template/template-win.texSee other latex latex/chapters.tex
\documentclass[11pt,a4paper]{article}\usepackage{fontspec}\setmainfont{Microsoft YaHei}\begin{document}世界 ,你好 !\end{document}
Latex Fonts
Learn MultiMarkdown to Book14
Fonts \textrm{...} roman \textsf{...} sans serif \textbf{...} bold face \textnormal{...} document font
Size \tiny tiny font \footnotesize quite small font \small , \normalsize normal font
中文楷体,宋体,黑体 $ fc-list :lang=zh-cn
Exercise 5: Update template
Learn MultiMarkdown to Book15
Footer/header – to change color and position
\fancyhf{}\fancyhead[LE]{\color{colorheader}\quad\small\textbf\thepage\quad\quad\small\leftmark}\fancyhead[RO]{\color{colorheader}\small\rightmark\quad\quad\small\textbf\thepage\quad}%\fancyhead[RE,LO]{\color{colorheader}\small{\savedtitle}} % book title %\fancyfoot[LE,RO]{\small\textbf\thepage} % page number%\renewcommand{\headrulewidth}{0.4pt} % add one line\pagestyle{fancy}
L: Left, E: Even
MultiMarkdown MultiMarkdown, or MMD, is a tool to help turn
minimally marked-up plain text into well formatted documents, including HTML, PDF (by way ofLaTeX) …
MMD is a superset of the Markdown syntax, Table/Footnote/Image control … Code ..
Learn MultiMarkdown to Book16
http://fletcherpenney.net/multimarkdown
Exercise 6: Add table Add table
| First Header | Second Header | Third Header | | :----------- | :-----------: | -------------------: | | First row | Data | Very long data entry | | Second row | **Cell** | *Cell* | [simple_table]
Learn MultiMarkdown to Book17
https://rawgithub.com/fletcher/human-markdown-reference/master/index.html
ReferenceMarkdown
Standard markdown: http://daringfireball.net/projects/markdown/
Github flavored markdown: http://github.github.com/github-flavored-markdown/
Multimarkdown: http://fletcherpenney.net/multimarkdown
MarkdownPad: http://markdownpad.com/Latex: http://www.latex-project.org/intro.html
MiKTex: http://www.miktex.org/portable My projects
https://github.com/larrycai/sdcamphttps://github.com/larrycai/latex-support
Learn MultiMarkdown to Book18
Other platform: Ubuntu/MacOS (TBD) https://github.com/larrycai/sdcamp/blob/
master/BUILD.md
Learn MultiMarkdown to Book19