Skip to content

Instantly share code, notes, and snippets.

@jchassoul
Forked from max-mapper/bibtex.png
Created May 16, 2018 02:04

Revisions

  1. @maxogden maxogden revised this gist May 5, 2017. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion paper.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ Pizza (@pizza2000identification) is an understudied yet widely utilized implemen

    # Diagram

    ![It's Pizza](pizza.png)
    ![It's Pizza](https://gist.github.com/maxogden/97190db73ac19fc6c1d9beee1a6e4fc8/raw/adaaa9b5c19460d3be42021ef0c1b8e11a8d38fe/pizza.png)

    # Algorithm

    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -30,7 +30,7 @@ The `pandoc-citeproc` filter will automatically generate a references section fo

    First you can grab some Bibtex references from Google Scholar and throw them in a `paper.bib` file:

    ![](bibtex.png)
    ![](https://gist.github.com/maxogden/97190db73ac19fc6c1d9beee1a6e4fc8/raw/adaaa9b5c19460d3be42021ef0c1b8e11a8d38fe/bibtex.png)

    Then when you render the paper references will get converted automatically if you cite them using the identifier from the bibtex in Markdown like this:

  2. @max-mapper max-mapper revised this gist May 5, 2017. 6 changed files with 138 additions and 4 deletions.
    Binary file added bibtex.png
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
    13 changes: 10 additions & 3 deletions paper.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,19 @@
    ---
    title: "Pizza - A Carbohydrate Based Substrate For Tomato Emulsion Delivery"
    title: "Pizza - A Carbohydrate Based Substrate For Tomato Delivery"
    date: "May 2017"
    author: "Maxwell Ogden"
    author: "Maxwell Ogden, Pizza Enthusiasts Institute"
    ---


    # Abstract

    Pizza (@pizza2000identification) is an understudied yet widely utilized implement for delivering in-vivo *Solanum lycopersicum* based liquid mediums in a variety of next-generation mastications studies. Here we describe a de novo approach for large scale *T. aestivum* assemblies based on protein folding that drastically reduces the generation time of the mutation rate.

    # Diagram

    ![It's Pizza](pizza.png)

    # Algorithm

    $$f(x)=pizza^2$$

    # References
    Binary file added paper.pdf
    Binary file not shown.
    105 changes: 105 additions & 0 deletions paper.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,105 @@
    \documentclass[a4paperpaper,twocolumn]{article}
    \usepackage{lmodern}
    \usepackage{amssymb,amsmath}
    \usepackage{ifxetex,ifluatex}
    \usepackage{fixltx2e} % provides \textsubscript
    \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
    \usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}
    \else % if luatex or xelatex
    \ifxetex
    \usepackage{mathspec}
    \else
    \usepackage{fontspec}
    \fi
    \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
    \fi
    % use upquote if available, for straight quotes in verbatim environments
    \IfFileExists{upquote.sty}{\usepackage{upquote}}{}
    % use microtype if available
    \IfFileExists{microtype.sty}{%
    \usepackage{microtype}
    \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
    }{}
    \usepackage[unicode=true]{hyperref}
    \hypersetup{
    pdftitle={Pizza - A Carbohydrate Based Substrate For Tomato Delivery},
    pdfauthor={Maxwell Ogden, Pizza Enthusiasts Institute},
    pdfborder={0 0 0},
    breaklinks=true}
    \urlstyle{same} % don't use monospace font for urls
    \usepackage{graphicx,grffile}
    \makeatletter
    \def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
    \def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
    \makeatother
    % Scale images if necessary, so that they will not overflow the page
    % margins by default, and it is still possible to overwrite the defaults
    % using explicit options in \includegraphics[width, height, ...]{}
    \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
    \IfFileExists{parskip.sty}{%
    \usepackage{parskip}
    }{% else
    \setlength{\parindent}{0pt}
    \setlength{\parskip}{6pt plus 2pt minus 1pt}
    }
    \setlength{\emergencystretch}{3em} % prevent overfull lines
    \providecommand{\tightlist}{%
    \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
    \setcounter{secnumdepth}{0}
    % Redefines (sub)paragraphs to behave more like sections
    \ifx\paragraph\undefined\else
    \let\oldparagraph\paragraph
    \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
    \fi
    \ifx\subparagraph\undefined\else
    \let\oldsubparagraph\subparagraph
    \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
    \fi

    % set default figure placement to htbp
    \makeatletter
    \def\fps@figure{htbp}
    \makeatother


    \title{Pizza - A Carbohydrate Based Substrate For Tomato Delivery}
    \author{Maxwell Ogden, Pizza Enthusiasts Institute}
    \date{May 2017}

    \begin{document}
    \maketitle

    \section{Abstract}\label{abstract}

    Pizza (Pizza et al. (2000)) is an understudied yet widely utilized
    implement for delivering in-vivo \emph{Solanum lycopersicum} based
    liquid mediums in a variety of next-generation mastications studies.
    Here we describe a de novo approach for large scale \emph{T. aestivum}
    assemblies based on protein folding that drastically reduces the
    generation time of the mutation rate.

    \section{Diagram}\label{diagram}

    \begin{figure}
    \centering
    \includegraphics{pizza.png}
    \caption{It's Pizza}
    \end{figure}

    \section{Algorithm}\label{algorithm}

    \[f(x)=pizza^2\]

    \section*{References}\label{references}
    \addcontentsline{toc}{section}{References}

    \hypertarget{refs}{}
    \hypertarget{ref-pizza2000identification}{}
    Pizza, Mariagrazia, Vincenzo Scarlato, Vega Masignani, Marzia Monica
    Giuliani, Beatrice Arico, Maurizio Comanducci, Gary T Jennings, et al.
    2000. ``Identification of Vaccine Candidates Against Serogroup B
    Meningococcus by Whole-Genome Sequencing.'' \emph{Science} 287 (5459).
    American Association for the Advancement of Science: 1816--20.

    \end{document}
    Binary file added pizza.png
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
    24 changes: 23 additions & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,8 @@ Markdown is the most common format for writing on GitHub, and is what I use for

    ![markdown example](https://gist.githubusercontent.com/maxogden/97190db73ac19fc6c1d9beee1a6e4fc8/raw/c127b99eddbd3491114aefaaa60a124e566d77a5/markdown.png)

    The above example is from the [Dat Paper](https://github.com/datproject/docs/tree/master/papers).

    ### 1. Install Pandoc

    [Pandoc](https://en.wikipedia.org/wiki/Pandoc) is a great tool for converting between different print formats. In this case pandoc will handle these conversions for us, all in one command:
    @@ -30,6 +32,26 @@ First you can grab some Bibtex references from Google Scholar and throw them in

    ![](bibtex.png)

    Then when you render the paper references will get converted like this:
    Then when you render the paper references will get converted automatically if you cite them using the identifier from the bibtex in Markdown like this:

    ```
    The seminal work [@pizza2000identification]
    ```

    ### 4. Render it

    Once you have `.md` and `.bib` files you can generate a PDF like this:

    ```
    pandoc --filter pandoc-citeproc --bibliography=paper.bib --variable classoption=twocolumn --variable papersize=a4paper -s paper.md -o paper.pdf
    ```

    Or generate the intermediate Latex source like this:

    ```
    pandoc --filter pandoc-citeproc --bibliography=paper.bib --variable classoption=twocolumn --variable papersize=a4paper -s paper.md -t latex -o paper.txt
    ```

    ### 5. Upload it

    Now you're ready to post the `.txt`, `.bib`, `.pdf` and `.md` files on a pre-print server, ideally with a CC0 public domain dedication license for maximum openness, and upload it to GitHub so others can access and re-use your research!
  3. @maxogden maxogden revised this gist May 5, 2017. 3 changed files with 54 additions and 2 deletions.
    10 changes: 10 additions & 0 deletions paper.bib
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    @article{pizza2000identification,
    title={Identification of vaccine candidates against serogroup B meningococcus by whole-genome sequencing},
    author={Pizza, Mariagrazia and Scarlato, Vincenzo and Masignani, Vega and Giuliani, Marzia Monica and Arico, Beatrice and Comanducci, Maurizio and Jennings, Gary T and Baldi, Lucia and Bartolini, Erika and Capecchi, Barbara and others},
    journal={Science},
    volume={287},
    number={5459},
    pages={1816--1820},
    year={2000},
    publisher={American Association for the Advancement of Science}
    }
    12 changes: 12 additions & 0 deletions paper.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    ---
    title: "Pizza - A Carbohydrate Based Substrate For Tomato Emulsion Delivery"
    date: "May 2017"
    author: "Maxwell Ogden"
    ---


    # Abstract

    Pizza (@pizza2000identification) is an understudied yet widely utilized implement for delivering in-vivo *Solanum lycopersicum* based liquid mediums in a variety of next-generation mastications studies. Here we describe a de novo approach for large scale *T. aestivum* assemblies based on protein folding that drastically reduces the generation time of the mutation rate.

    # References
    34 changes: 32 additions & 2 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,35 @@
    ## How to make a scientific looking PDF from markdown (with bibliography)

    Markdown is the most common format for writing on GitHub, and is what I use for all of my own documentation. It also exports to HTML and other convenient formats for reading on mobile devices. However, sometimes you want to export it as a PDF so that you can author scientific papers and export the formats that pre-print servers want.
    Markdown is the most common format for writing on GitHub, and is what I use for all of my own documentation. It also exports to HTML and other convenient formats for reading on mobile devices. However, sometimes you want to export it as a PDF so that you can author scientific papers and export the formats that pre-print servers like [arxiv.org](https://arxiv.org/) will accept.

    ![markdown example](https://gist.githubusercontent.com/maxogden/97190db73ac19fc6c1d9beee1a6e4fc8/raw/c127b99eddbd3491114aefaaa60a124e566d77a5/markdown.png)

    ### 1. Install Pandoc

    [Pandoc](https://en.wikipedia.org/wiki/Pandoc) is a great tool for converting between different print formats. In this case pandoc will handle these conversions for us, all in one command:

    ```
    Markdown -> Latex -> Latex Citeproc Bibliography Filter -> PDF
    ```

    To install it on Mac OS using homebrew:

    ```
    brew install pandoc pandoc-citeproc
    ```

    ### 2. Author your paper

    See `paper.md` for an example. You can use YAML frontmatter to specify variables that Pandoc will use as the variables in it's Latex template. To see the Latex template you can run `pandoc -D latex`.

    ### 3. Create a bibliography

    The `pandoc-citeproc` filter will automatically generate a references section for you at the end of your document, and also replace all Markdown references an academic citation style.

    First you can grab some Bibtex references from Google Scholar and throw them in a `paper.bib` file:

    ![](bibtex.png)

    Then when you render the paper references will get converted like this:


    ![markdown example](https://gist.githubusercontent.com/maxogden/97190db73ac19fc6c1d9beee1a6e4fc8/raw/c127b99eddbd3491114aefaaa60a124e566d77a5/markdown.png)
  4. @maxogden maxogden revised this gist May 5, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,4 @@

    Markdown is the most common format for writing on GitHub, and is what I use for all of my own documentation. It also exports to HTML and other convenient formats for reading on mobile devices. However, sometimes you want to export it as a PDF so that you can author scientific papers and export the formats that pre-print servers want.

    ![markdown example](https://gist.github.com/maxogden/97190db73ac19fc6c1d9beee1a6e4fc8/raw/3a813fa7d80ebeff65c13be5f9678eb5ef461120/markdown.png)
    ![markdown example](https://gist.githubusercontent.com/maxogden/97190db73ac19fc6c1d9beee1a6e4fc8/raw/c127b99eddbd3491114aefaaa60a124e566d77a5/markdown.png)
  5. @max-mapper max-mapper revised this gist May 5, 2017. 1 changed file with 0 additions and 0 deletions.
    Binary file modified markdown.png
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
  6. @maxogden maxogden revised this gist May 5, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,4 @@

    Markdown is the most common format for writing on GitHub, and is what I use for all of my own documentation. It also exports to HTML and other convenient formats for reading on mobile devices. However, sometimes you want to export it as a PDF so that you can author scientific papers and export the formats that pre-print servers want.

    ![markdown example](markdown.png)
    ![markdown example](https://gist.github.com/maxogden/97190db73ac19fc6c1d9beee1a6e4fc8/raw/3a813fa7d80ebeff65c13be5f9678eb5ef461120/markdown.png)
  7. @max-mapper max-mapper revised this gist May 5, 2017. 1 changed file with 0 additions and 0 deletions.
    Binary file added markdown.png
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
  8. @maxogden maxogden created this gist May 5, 2017.
    5 changes: 5 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    ## How to make a scientific looking PDF from markdown (with bibliography)

    Markdown is the most common format for writing on GitHub, and is what I use for all of my own documentation. It also exports to HTML and other convenient formats for reading on mobile devices. However, sometimes you want to export it as a PDF so that you can author scientific papers and export the formats that pre-print servers want.

    ![markdown example](markdown.png)