% -------------------------------------------
% latex generated by: booktolatex.cgi
% from source file : ../htdocs/books/linux-document/linux-document-book.txt
% on: 19 April 2024, 7:43am
% querystring: books/linux-document/linux-document-book.txt
% document-root: /var/www/html
% script-name: /cgi-bin/booktolatex.cgi
% Server-name: bumble.sourceforge.net
% Sed-script: booktolatex.sed
% -------------------------------------------
\documentclass[a4paper,12pt]{article}
\usepackage[margin=0.4cm,noheadfoot]{geometry}
\usepackage{color} %% to use colours, use "xcolor" for more
\usepackage{multicol} %% for multiple columns
\usepackage{keystroke} %% for keyboard key images
\usepackage[toc]{multitoc} %% for multi column table of contents
\usepackage{tocloft} %% to customize the table of contents
\setcounter{tocdepth}{2} %% only display 2 levels in the contents
\setlength{\cftbeforesecskip}{0cm} %% make the toc more compact
\usepackage{listings} %% for nice code listings
%\lstset{language={},
\lstset{language=bash,
%% define special comment delimiters '##(' and ')'
moredelim=[s][\color{grey}\itshape\footnotesize\ttfamily]{~(}{)},
basicstyle=\ttfamily, %% fixed pitch font
xleftmargin=1cm, %% margin on the left outside the frames
breaklines=true, %% break long code lines
breakatwhitespace=false, %% break long code lines anywhere
breakindent=10pt, %% reduce the indent from 20pt to 10
postbreak=\mbox{{\color{blue}\small$\Rightarrow$\space}}, %% mark with arrow
showstringspaces=false, %% dont show spaces within strings
framerule=5pt, %% thickness of the frames
rulecolor=\color{lightgrey}, frame=l} %% source code settings
\usepackage{graphicx} %% to include images
\usepackage{fancybox} %% boxes with rounded corners
\usepackage{wrapfig} %% flow text around tables, images
\usepackage{tabularx} %% change width of tables
\usepackage[table]{xcolor} %% alternate row colour tables
\usepackage{booktabs} %% for heavier rules in tables
\usepackage[small,compact]{titlesec} %% sections more compact, less space
\usepackage{enumitem} %% more compact and better lists
\setlist{noitemsep} %% reduce list item spacing
\usepackage{hyperref} %% make urls into hyperlinks
\hypersetup{ %% add "pdftex," if only pdf output is required
colorlinks=true, %% set up the colours for the hyperlinks
linkcolor=black, %% internal document links black
urlcolor=black, %% url links black
filecolor=red,
citecolor=red,
bookmarks=true, pdfpagemode=UseOutlines}
% define some colours to use
\definecolor{lightgrey}{gray}{0.70}
\definecolor{grey}{gray}{0.30}
\titleformat{\section}[frame] %% titlesec: create framed section headings
{\normalfont}
{\filleft \footnotesize \enspace Section \thesection\enspace\enspace}
{3pt} {\bfseries\itshape\filright}
\title{Writing and Publishing with Linux}
\author{}
\date{27 October 2011, 6:33pm}
\setlength{\parindent}{0pt}
% \setlength{\parskip}{1ex}
% label lists with stars
\renewcommand{\labelitemi}{$\star$}
\begin{document}
\centerline{\Large \bf Writing and Publishing with Linux} \medskip
\begin{center}
{\huge ``}\textit{}{\huge ''}
\textsc{}
\end{center}
% -----------------------------------
% the toc should be 2 columns because of the \multitoc package
\tableofcontents
\begin{multicols}{2}
\begin{lstlisting}
MARKDOWN
The markdown system uses a minimalist structured text format to produce
html. 'markdown' is both a 'text format' and also a perl script used to
turn that format into html. Using pandoc it is possible to convert
markdown formatted text into other formats, such as pdf. Markdown may fill
a gap between enscript and latex, where the user wants more control over
how the produced document looks than can be obtained with 'enscript', but
doesnt wish to become mired down in the complexities of 'latex'
@@ http://daringfireball.net/projects/markdown/
details about the format of the source document (text file).
@@ http://daringfireball.net/projects/markdown/dingus
a page to actually try out markdown text syntax
@@ http://six.pairlist.net/pipermail/markdown-discuss/
the markdown discussion list archives
CONVERTING TO HTML ....
The 'markdown' perl script can only create html but 'pandoc' can produce
other formats from the same markdown source text document. Markdown
only seems to produce a 'fragment' of html (without head and body tags)
* display a text document converted to html with markdown
>> markdown document.txt | less
* convert a document to html and save as 'doc.html'
>> markdown doc.txt > doc.html
* convert a document and add html and body tags to make a complete page
>> (echo '
';markdown doc.txt;echo '') > out.html
>> markdown doc.txt|sed '1s/^//;$s.$..' > out.html
>> pandoc -s -o out.html doc.txt ##(the same but better, using pandoc)
MARKDOWN SYNTAX ....
The great advantage of markdown syntax is that the source document can be kept
'clean' without distracting or ugly markup codes. Normal html can be inserted
anywhere in a markdown document. If there is anything which markdown
cannot do (such as tables) just use html tags instead.
DOCUMENT HEADINGS ....
* create a 1st-level document heading (underline the text with '=' equals)
\begin{lstlisting}
The Heading
===========
\end{lstlisting}
* create a markdown 2nd-level document heading
\begin{lstlisting}
A Second Level Heading
\begin{lstlisting}
\end{lstlisting}
* markup a 3rd level document heading 'Stone Fruit'
>> ### Stone Fruit
* create a vim command ',ll' which underlines the current line with '-' dashes
>> map ,ll yyp:s/[ ]*$// \| s/[ ]*$// \| s/[^ ]/-/g \| s/- /--/go
##(place in 'vimrc'. This mapping helps to write markdown 2nd level headings)
* create a vim command ',LL' which creates a markdown 1st level heading
>> map ,ll yyp:s/[ ]*$// \| s/[ ]*$// \| s/[^ ]/=/g \| s/= /==/go
##(This mapping command underlines the current line with '=' equals)
* create a 'blockquote', that is text more indented than surrounding paragraphs
>> > ##(blockquotes can contain headings and paragraphs
TEXT EMPHASIS ....
* make a word or phrase emphasised
>> the following is *emphasised text*
>> the following is _emphasised text_ ##(more or less the same)
* strongly emphasise words or phrases
>> the following is **strongly emphasised text**
>> the following is __strongly emphasised text__
LISTS ....
The list marker can also be a '+' or a '*'. There is no difference
between these types of lists
* create an unordered (bulleted) list
\begin{lstlisting}
- first item
- second item
- third and last
\end{lstlisting}
* create an nested unordered list
\begin{lstlisting}
- first item
* sublist item 1
* sublist item 2
- second item
- third and last
\end{lstlisting}
* create an ordered list with a nested unordered list
\begin{lstlisting}
1. First
2. Second:
- Fee
- Fie
- Foe
3. Third
\end{lstlisting}
* create an unordered list with links to other parts of the page
\begin{lstlisting}
- [Chapter One](#chap1)
- [Chapter Two](#chap2)
- [Chapter Three](#chap3)
...
...
\end{lstlisting}
##(notice how normal html is used to create the anchors)
* create an ordered list
\begin{lstlisting}
1. first
2. second
3. third
\end{lstlisting}
LINKS ....
* create link in a document with the display text 'example link'
>> This is an [example link](http://example.com/)
##(the html: this is an example link.)
* create link with a display text and also a 'title' (when the mouse hovers over)
>> [example link](http://example.com/ "With a Title")
* for pdf output the embedded code backtick may look best
>> `http://google.com` ##(displays the link in fixed pitch font in pdf)
* create and use a named link with display text 'Google'
\begin{lstlisting}
a search engine is [Google][1]
[1]: http://www.google.com "Google"
[2]: http://www.yahoo.com "Yahoo"
* create a reference link with a space in the name
\begin{lstlisting}
I start my morning with a cup of coffee and
[The New York Times][NY Times].
[ny times]: http://www.nytimes.com/
\end{lstlisting}
IMAGES ....
* embedd an image file in the document, with an optional title
![a tree](/path/to/img.jpg "Title") ##(if the image is not found show 'tree')
* embedd an image in the document using the 'reference' style syntax
\begin{lstlisting}
![alt text][id]
[id]: /path/to/img.jpg "Title"
\end{lstlisting}
EMBEDDED CODE ....
* use backticks '`' to show code with special characters in it
>> dont use the `