Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The MIT License (MIT)
The HARVARD License (MIT)

Copyright (c) 2014 Daniel J. Hocking

Expand Down
4 changes: 2 additions & 2 deletions Markdown_for_Manuscripts_ms.doc
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
<body>
<h1 id="catchy-title-that-reviewers-will-love">Catchy Title that Reviewers will Love</h1>
<h3 id="daniel-j.-hocking-and-names-of-awesome-coauthors">Daniel J. Hocking and Names of Awesome Coauthors</h3>
<p>*Daniel J. Hocking (<script type="text/javascript">
<p><em>Daniel J. Hocking (<script type="text/javascript">
<!--
h='&#x75;&#x73;&#x67;&#x73;&#46;&#x67;&#x6f;&#118;';a='&#64;';n='&#100;&#104;&#x6f;&#x63;&#x6b;&#x69;&#110;&#x67;';e=n+a+h;
document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+e+'<\/'+'a'+'>');
// -->
</script><noscript>&#100;&#104;&#x6f;&#x63;&#x6b;&#x69;&#110;&#x67;&#32;&#x61;&#116;&#32;&#x75;&#x73;&#x67;&#x73;&#32;&#100;&#x6f;&#116;&#32;&#x67;&#x6f;&#118;</noscript>), US Geological Survey, Conte Anadromous Fish Research Center, Turners Falls, MA, USA</p>
</script><noscript>&#100;&#104;&#x6f;&#x63;&#x6b;&#x69;&#110;&#x67;&#32;&#x61;&#116;&#32;&#x75;&#x73;&#x67;&#x73;&#32;&#100;&#x6f;&#116;&#32;&#x67;&#x6f;&#118;</noscript>), US Geological Survey, Conte Anadromous Fish Research Center, Turners Falls, MA, USA</em></p>
<h2 id="abstract">Abstract</h2>
<p>Set up the problem. Explain how you solve it. Tell what you find. Explain why it's the best thing ever.</p>
<h2 id="introduction">Introduction</h2>
Expand Down
90 changes: 90 additions & 0 deletions Markdown_for_Manuscripts_ms.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
\usepackage[vmargin=1in,hmargin=1in]{geometry}
</head>
<body>
<h1 id="catchy-title-that-reviewers-will-love">Catchy Title that Reviewers will Love</h1>
<h3 id="daniel-j.-hocking-and-names-of-awesome-coauthors">Daniel J. Hocking and Names of Awesome Coauthors</h3>
<p><em>Daniel J. Hocking (<script type="text/javascript">
<!--
h='&#x75;&#x73;&#x67;&#x73;&#46;&#x67;&#x6f;&#118;';a='&#64;';n='&#100;&#104;&#x6f;&#x63;&#x6b;&#x69;&#110;&#x67;';e=n+a+h;
document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+e+'<\/'+'a'+'>');
// -->
</script><noscript>&#100;&#104;&#x6f;&#x63;&#x6b;&#x69;&#110;&#x67;&#32;&#x61;&#116;&#32;&#x75;&#x73;&#x67;&#x73;&#32;&#100;&#x6f;&#116;&#32;&#x67;&#x6f;&#118;</noscript>), US Geological Survey, Conte Anadromous Fish Research Center, Turners Falls, MA, USA</em></p>
<h2 id="abstract">Abstract</h2>
<p>Set up the problem. Explain how you solve it. Tell what you find. Explain why it's the best thing ever.</p>
<h2 id="introduction">Introduction</h2>
<p>Background and problem setup <span class="citation">(Hocking and Babbitt 2014a, 2014b)</span></p>
<p>Relevant literature <span class="citation">(Hocking 2013, Hocking et al. 2013)</span></p>
<p>Objectives/hypotheses</p>
<h2 id="methods">Methods</h2>
<p>Describe what you did so it can actually be repeated. I don't want to see everything in the supplementary materials. Here's an example of using LaTeX to add equations:</p>
<p><br /><span class="math">$$
T_s = \mu + \frac{\alpha - \mu}{1 + e^{\gamma(\beta - T_a)}}
$$</span><br /></p>
<h2 id="results">Results</h2>
<p>Explain what you found. Avoid blind <em>P-values</em> (or avoid <em>P-values</em> altogether)</p>
<h2 id="discussion">Discussion</h2>
<p>Give context to what you found. Relate it to previous work. Describe why it's the most important scientific finding of the decade, yet avoid hyperbole. Easy, right?</p>
<h2 id="acknowledgements">Acknowledgements</h2>
<p>Thanks to Ethan White, Karthik Ram, Carl Boettiger, Ben Morris, and <a href="http://software-carpentry.org/">Software Carpentry</a> for getting me started with the skills needed to <a href="http://inundata.org/2012/12/04/how-to-ditch-word/">ditch MS Word</a> and produce more reproducible research.</p>
<h2 id="tables">Tables</h2>
<p>Table 1: Example Markdown table</p>
<table>
<colgroup>
<col width="20%" />
<col width="11%" />
<col width="8%" />
<col width="13%" />
<col width="12%" />
<col width="18%" />
</colgroup>
<thead>
<tr class="header">
<th align="left">Name</th>
<th align="left">col2</th>
<th align="left">col3</th>
<th align="left">col4</th>
<th align="left">col5</th>
<th align="left">Comments</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="left"><p>Brook Trout</p></td>
<td align="left"><p>1</p></td>
<td align="left"><p>big</p></td>
<td align="left"><p>few</p></td>
<td align="left"><p>2.2</p></td>
<td align="left"><p>Ecology &amp; life history data associated with trout</p></td>
</tr>
<tr class="even">
<td align="left"><p><em>Desmognathus</em> <em>fuscus</em></p></td>
<td align="left"><p>100</p></td>
<td align="left"><p>small</p></td>
<td align="left"><p>many</p></td>
<td align="left"><p>0.3</p></td>
<td align="left"><p>Widespread salamander species</p></td>
</tr>
</tbody>
</table>
<h2 id="figures">Figures</h2>
<p>Figure 1. Example of adding a figure.</p>
<div class="figure">
<img src="Figures/MADEP_W2033_T1.png" alt="Figure1" /><p class="caption">Figure1</p>
</div>
<div class="references">
<h2>Literature Cited</h2>
<p>Hocking, D. J. 2013. Comparing the influence of ecology journals using citation-based indices: making sense of a multitude of metrics. Ideas in Ecology and Evolution 6:55–65.</p>
<p>Hocking, D. J., and K. J. Babbitt. 2014a. Amphibian contributions to ecosystem services. Herpetological Conservation and Biology 9:1–17.</p>
<p>Hocking, D. J., and K. J. Babbitt. 2014b. Effects of red-backed salamanders on ecosystem functions. PloS one 9:e86854.</p>
<p>Hocking, D. J., K. J. Babbitt, and M. Yamasaki. 2013. Comparison of silvicultural and natural disturbance effects on terrestrial salamanders in northern hardwood forests. Biological Conservation 167:194–202.</p>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion Markdown_for_Manuscripts_ms.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Catchy Title that Reviewers will Love

### Daniel J. Hocking and Names of Awesome Coauthors

*Daniel J. Hocking ([dhocking@usgs.gov](mailto:dhocking@usgs.gov)), US Geological Survey, Conte Anadromous Fish Research Center, Turners Falls, MA, USA
*Daniel J. Hocking ([dhocking@usgs.gov](mailto:dhocking@usgs.gov)), US Geological Survey, Conte Anadromous Fish Research Center, Turners Falls, MA, USA*

Abstract
--------
Expand Down
Binary file modified Markdown_for_Manuscripts_ms.pdf
Binary file not shown.
57 changes: 57 additions & 0 deletions Markdown_for_Manuscripts_post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
\usepackage[vmargin=1in,hmargin=1in]{geometry}
</head>
<body>
<h1 id="writing-scientific-papers-using-markdown">Writing Scientific Papers Using Markdown</h1>
<p>Markdown is a markup language that is very handy and easy to use. I won't say much more about it, but I've written about it before <a href="http://danieljhocking.wordpress.com/2013/09/25/knitting-beautiful-documents-in-rstudio/">here</a> and <a href="http://danieljhocking.wordpress.com/2014/04/07/electronic-lab-notebook-take-1/">here</a>. I've used it increasingly for writing blog posts, webpages, taking notes, with GitHub issue tracking, and with R code (R Markdown in RStudio is fantastic!). As a Mac OS user, I find Microsoft Office products to be annoying and temperamental. I read Karthik Ram's great post on how to <a href="http://inundata.org/2012/12/04/how-to-ditch-word/">ditch MS Word</a> a while back and since I've been using Markdown for so much lately, it seemed like a good time to write my first scientific paper with it. I'm going to use this post, written in Markdown, to outline my process. This will help me repeat the process in the future if I like it and hopefully help others interested in trying it.</p>
<h3 id="step-1-create-a-markdown-document">Step 1: Create a Markdown Document</h3>
<p>Obviously the first step is to create a Markdown document. You can do this with any text editor and just change the extension from <code>.txt</code> to <code>.md</code>. However, there are applications with handy Markdown features. I use <a href="http://25.io/mou/">Mou</a> because it has a nice live-rendering of your markdown code so you can see what it looks like.</p>
<p>For this example and for future use, I've created a template for a manuscript that you can find here.</p>
<h3 id="step-2-add-in-text-citations">Step 2: Add In-Text Citations</h3>
<p>To add references, I use Mendeley and create a folder for any publications I cite (or might cite) in the manuscript. Then while writing you can add in-text citations with <code>[@Hocking2013]</code>, which can be found under Citation Key in Mendeley. Then I export this folder as a BibTeX file to the folder that the manuscript will live in. This will be used later to render the literature cited section.</p>
<h3 id="step-3-install-or-update-pandoc">Step 3: Install or Update Pandoc</h3>
<p>Pandoc is an amazing program to convert between different file types. In our case we can create HTML, Word, and PDF files from our Markdown document. You can find the installation instructions at <a href="http://johnmacfarlane.net/pandoc/installing.html" class="uri">http://johnmacfarlane.net/pandoc/installing.html</a>. You will also need LaTeX installed if you want to output PDF documents. You can use <a href="https://tug.org/mactex/">MacTex</a> or <a href="http://www.tug.org/mactex/morepackages.html">BasicTeX</a> on a Mac or <a href="http://miktex.org/">MiKTeX</a> on a Windows machine (Linux users, you know what to do).</p>
<p>I was getting an error</p>
<pre><code>Error running filter pandoc-citeproc
Error 83</code></pre>
<p>So I decided to install <a href="https://www.haskell.org/platform/">Haskell</a> and run the following:</p>
<pre><code>cabal update
cabal install pandoc pandoc-citeproc</code></pre>
<p>Then this can just be run again in the Terminal app in the future to update pandoc.</p>
<h3 id="step-4-add-a-style-sheet">Step 4: Add a Style Sheet</h3>
<p>When creating a PDF there is a 1.5 inch left margin by default (good for binding I guess). Generally, I want 1 inch margins all around so I open a text file and paste</p>
<pre><code>\usepackage[vmargin=1in,hmargin=1in]{geometry}</code></pre>
<p>Then save it as <code>format.sty</code> in the folder with the manuscript. If you want line numbers and other formatting you can add these lines</p>
<pre><code>\usepackage{lineno}
\linenumbers
\usepackage{times}</code></pre>
<h3 id="step-5-add-a-journal-style-file">Step 5: Add a Journal Style File</h3>
<p>One of the benefits of writing in simple text is that you don't have to worry about formatting while writing. But now to add formatting for a specific journal, go <a href="https://github.com/citation-style-language/styles">here</a> to get a style <code>.csl</code> file that is an XML type document that defines the styles required for a journal. This includes in-text citation, literature cited, and heading styles. Copy the desired <code>.csl</code> file into the same folder as manuscript <code>.md</code> document.</p>
<h3 id="step-6-put-it-all-together">Step 6: Put it all Together</h3>
<p>Now is when we use pandoc to combine the styles and bibliographic information with the manuscript. In the Terminal you can simply run</p>
<pre><code>pandoc document.md -o document.pdf</code></pre>
<p>to convert the document from markdown to PDF. However, this won't have any of the desired formatting. To include the formatting, you just add some flags and arguments as such:</p>
<pre><code>pandoc document.md -o document.pdf --bibliography cite.bib --csl style.csl -H format.sty</code></pre>
<p>To automate this code and potentially output PDF, Word, and HTML documents all at once you can easily create a <code>make</code> file. To do this open a text editor and paste something like:</p>
<pre><code>all: document_ms.pdf document_ms.doc

document_ms.doc: document_ms.md document_refs.bib
pandoc -H format.sty -V fontsize=12pt --bibliography document_refs.bib --csl=ecology.csl document_ms.md -o document_ms.doc

document_ms.pdf: document_ms.md document_refs.bib
pandoc -H format.sty -V fontsize=12pt --bibliography document_refs.bib --csl=ecology.csl document_ms.md -o document_ms.pdf</code></pre>
<p>Then save the file as <code>makefile</code> with no extension (i.e. <code>.txt</code>). Then when you <code>cd</code> to that folder in Terminal you just have to type <code>make</code> and the documents will automatically be created. At this point you should have <code>.md</code>, <code>.doc</code>, and <code>.pdf</code> files (and <code>.html</code> if you want).</p>
<p>If you change anything in the markdown file or want to format for a different journal just add the new <code>.csl</code> file and make any other changes you want then run <code>make</code> again. Then submit the manuscript.</p>
<p>I am currently using <code>diff</code> in git or GitHub to replace track changes with co-authors early in the process when there are lots of changes but authors can also comment on Word or PDF versions as well. I'm also interested in potentially checking out <a href="https://www.authorea.com/">Authorea</a> for collaborative writing in Markdown. It seems pretty slick.</p>
<div class="references">

</div>
</body>
</html>
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Markdown-for-Manuscripts
========================

Description of how to use markdown for scientific manuscripts
Read me examples
=================
1. To be continued.
5 changes: 4 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
all: Markdown_for_Manuscripts_ms.pdf Markdown_for_Manuscripts_ms.doc
all: Markdown_for_Manuscripts_ms.pdf Markdown_for_Manuscripts_ms.doc Markdown_for_Manuscripts_ms.html

Markdown_for_Manuscripts_ms.doc: Markdown_for_Manuscripts_ms.md Markdown_for_Manuscripts_refs.bib Figures/
pandoc -H format.sty -V fontsize=12pt --bibliography Markdown_for_Manuscripts_refs.bib --csl=ecology.csl Markdown_for_Manuscripts_ms.md -o Markdown_for_Manuscripts_ms.doc

Markdown_for_Manuscripts_ms.pdf: Markdown_for_Manuscripts_ms.md Markdown_for_Manuscripts_refs.bib Figures/
pandoc -H format.sty -V fontsize=12pt --bibliography Markdown_for_Manuscripts_refs.bib --csl=ecology.csl Markdown_for_Manuscripts_ms.md -o Markdown_for_Manuscripts_ms.pdf

Markdown_for_Manuscripts_ms.html: Markdown_for_Manuscripts_ms.md Markdown_for_Manuscripts_refs.bib Figures/
pandoc -H format.sty --bibliography Markdown_for_Manuscripts_refs.bib --csl=ecology.csl Markdown_for_Manuscripts_ms.md -o Markdown_for_Manuscripts_ms.html