August 8, 2022 (05:48:29 PM)
To compile those notes, you need
Then, clone the repository at https://rocketgit.com/user/caubert/CSCI_3410, and refer to the example file for a gentle test and guide on the syntax and tool of this document. Change the current folder to notes
, and execute make example
. You can have a look at notes/Makefile
to understand what is happening in the example
rule.
The Generating Documents (Basic) Using Markdown User Manual outlines the objectives, requirements, and needs to be addressed when training users on how to generate a PDF, HTML, or ODT document using markdown file. The plan presents the activities needed to support file development.
Markdown is a fast and easy way to take notes, create content for a website, and produce print-ready documents. It’s a lightweight markup language with plain text formatting syntax. Markdown is designed to be converted to many different output formats such as PDF, Word, ODT, HTML, and many more. It is both portable and platform independent, more intuitive to read and write, and can be used for websites, documents, notes, books, etc., but is often used to format readme files and in online discussion forums.
Markdown text is written and stored in plaintext file with a markdown extension (e.g. .md). Using a separate markdown application capable of processing markdown (we will be using Pandoc), it takes the markdown formatted text and converts it to HTML. The HTML file can then be viewable in a web browser or then converted to another file format, like PDF.
Helpful Skills:
For a fully functioning environment and step by step guide on installation instructions follow the instructions below:
NOTE: All the following steps must be installed on a Linux operating system.
apt update
then type: apt install git
NOTE: Upon opening your terminal, you may see username@hostname:~$. You want your terminal to run as root@hostname. To do this, upon opening your terminal, type: su --
Then enter your password. You should see something like this:
Install Make In your terminal, type (as root): apt-get update
then type: apt-get install build-essential
Install LaTex
I
dpkg -i pandoc-2.9.2.1-amd64.deb
cabal update
apt-get install haskell-platform
cabal update
NOTE: To run terminal as a normal user, type: su - username
where “username” is your username. You should see something like this:
cabal install pandoc-types
cabal configure
cabal install
Install pandoc-numbering filter Type (as normal user): pip3 install pandoc-numbering
Install latexmk fully automated latex document generation
NOTE: You may need to expose hidden files while in “Home”. To do this press Ctrl + H.
Install pdf2svg In your terminal type (as root): apt-get install pdf2svg
Install librsvg2-bin In your terminal type (as root): apt-get install librsvg2-bin
Install texlive-xetex In your terminal type (as root): apt-get install texlive-xetex
Install linuxlibertine font and freefont
apt-get install fonts-linuxlibertine
apt-get install fonts-freefont-ttf
Clone this basic folder structure (as a normal user) Type: git clone https://github.com/poonamveeral/GeneralRepo
Testing Pandoc
pandoc test_pandoc.md -o test_pandoc.html
<p>I’m a test for pandoc.</p>
pandoc test_pandoc-numbering.md --filter pandoc-numbering -o test_pandoc-numbering.html
export PATH=$PATH:/home/username/.local/bin
<p><span id="exercise:1" class="pandoc-numbering-text exercise"><strong>Exercise 1</strong> <em>(The first exercise)</em></span></p>
<p><span id="exercise:2" class="pandoc-numbering-text exercise"><strong>Exercise 2</strong> <em>(The second exercise)</em></span></p>
pandoc --citeproc test_pandoc-citeproc.md -o test_pandoc-citeproc.html
<p><span class="citation" data-cites="item1">(Doe 2005)</span></p>
<h1 class="unnumbered" id="references" class="unnumbered">References</h1>
<div id="refs" class="references hanging-indent" role="doc-bibliography">
<div id="ref-item1" role="doc-biblioentry">
<p>Doe, John. 2005. <em>First Book</em>.</p>
</div>
</div>
pandoc -F pandoc-include-code test_pandoc-include-code.md -o test_pandoc-include-code.html
<p>Here is some code:</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode md"><code class="sourceCode markdown"><span id="cb1-1"><a href="#cb1-1"></a>I'm a test for pandoc. </span></code></pre></div>
If you’re receiving “Could not find executable pandoc-include-code”
export PATH=$PATH:/home/username/.cabal/bin
Follow these steps to learn how to create a simple markdown document utilizing bibliographies, images/figures, and code blocks.
To start off, you’re going to need a folder structure set up like this:
If you completed number 13 from 2.2 Software Requirements skip step 2. If not, continue on.
You want each folder to contain:
.
├── install/ -- How to install requirements to compile the document.
│ └── .md files -- To test Pandoc
├── bib/ -- References (including reference to the document).
│ └── .bib files -- To store citations.
├── code/ -- Source code included in the document.
│ └── code files -- (E.g. .java, .xml, .sql)
├── fig/ -- Source code for various figures used in the document.
├── img/ -- Various image files itegrated in the document.
├── latex/ -- Latex configuration file.
├── style/ -- CSS style used for the web page.
├── Makefile -- Directives to generate example.md document.
├── README.md -- The present file.
└── example.md -- Sample file to test.
An example of a basic template of a markdown file can be found at “example.md” in the generic repo from step 13 from above.
Follow these steps to learn how to compile and convert a markdown file to PDF, ODT, and HTML. Other possible conversion formats can be found here: https://pandoc.org/
Open up a terminal, inside of it, change your directory to where your markdown file is located. In this example, navigate to your “Course” folder. To do this, simply type: cd Course
where “Course” is the name of your Course folder.
Next, type: make fig
“make fig” compiles all the latex code in order to produce the figures from the figures folder.
Then type: make fig_svg
“make fig_svg” compiles all the latex code in order to produce the figures from the figures folder.
To produce a PDF document common format is:
pandoc <filters> inputfile.md -o outputfile.ext
or
pandoc <filters> -o outputfile.ext inputfile.md
For our example, in your terminal, while in the directory of where your markdown file is located, which should be your “Course” folder, type:
make pdf
or
pandoc --toc --filter pandoc-numbering --citeproc --filter pandoc-include-code \
--top-level-division=chapter -M date="$(LANG=en_us_88591 date '+%B %e, %Y (%r)')" \
--pdf-engine=xelatex --pdf-engine-opt=-shell-escape -V links-as-notes \
--default-image-extension=pdf -o example.pdf example.md
To check if the results worked, from your desktop, navigate to your “Course” folder. You should see a new file called “example.pdf”.
For our example, in your terminal, while in the directory of where your markdown file is located, which should be your “Course” folder, type:
make odt
or
pandoc --toc --filter pandoc-numbering --citeproc --filter pandoc-include-code \
--top-level-division=chapter -M date="$(LANG=en_us_88591 date '+%B %e, %Y (%r)')" \
--default-image-extension=svg -o example.odt example.md
To check if the results worked, from your desktop, navigate to your “Course” folder. You should see a new file called “example.odt”.
For our example, in your terminal, while in the directory of where your markdown file is located, which should be your “Course” folder, type:
make html
or
pandoc --toc --filter pandoc-numbering --citeproc --filter pandoc-include-code \
--top-level-division=chapter -M date="$(LANG=en_us_88591 date '+%B %e, %Y (%r)')" \
--css=style/style.css --toc-depth=1 --self-contained --default-image-extension=svg \
-o example.html example.md
where “style.css” is the name of your css file.
To check if the results worked, from your desktop, navigate to your “Course” folder. You should see a new file called “example.html”.