How do i append a paper in appendix in latex? - latex

In my Master thesis i want to append a paper as an appendix to the thesis. I am writing in LateX in the "report" style. At the end of the thesis there are some code in Appendix A, and in Appendix B i want to add a paper, written in latex. How do i append the paper at the end, as a standalone paper, with its own bibliography etc?

And the cleaner option consists of using pdfpages. That way rebuilding your document doesn't require appending it again :). The other options aren't really necessary in your case I believe: they mainly concern selecting specific pages and changing the page layout to multiple pages per sheet.

Note very clean, but you could just compile the two files as PDF and the concatenate the them.

Related

How can I use org-mode to write LaTeX for scientific journals?

I write most text using org-mode nowadays, and I often use it to generate PDF via LaTeX (xelatex, specifcally). But now I want to use it to write scientific articles, and journals often want me to use a specific style. This includes a .cls-file, which is easy enough using org-latex-classes, but quite often, they require a specific setup following \begin{document} (i.e. a specific abstract section, funky author and affiliation, etc, and I don't see how to do that. That is, I now do this within a #+begin/end_latex section - but this needs to be completely rewritten if I switch style.
I realize I probably need to fiddle with the LaTeX code at some point, but I'd like to minimize this fiddling as far as possible, and I'd like to be able to switch from one journal to another with a minimum of fuss, and keeping my org-mode source as intact as possible.
See item 3 at http://kitchingroup.cheme.cmu.edu/blog/2014/08/08/What-we-are-using-org-mode-for/
There is a list of papers there we have written in org-mode and exported to LaTeX. We have probably 8 more since that post.
In the SI you can find the org-source embedded in the PDF, and here: Spencer D. Miller, Vladimir V. Pushkarev, Andrew J. Gellman and John R. Kitchin, Simulating Temperature Programmed Desorption of Oxygen on Pt(111) Using DFT Derived Coverage Dependent Desorption Barriers, Topics In Catalysis, 57(1), 106-117 (2013). http://link.springer.com/article/10.1007%2Fs11244-013-0166-3 you can even find our manuscript embedded.
You may also want to checkout https://github.com/jkitchin/org-ref for citation management and https://github.com/jkitchin/jmax/blob/master/ox-manuscript.el for how we do our exports.
Depending on the amount of latex polishing you need to do, you may find it simpler to just add some things to your org file, and use a little bit of babel directly. Here is a snippet of how the start of one my files might look. Some of things are in there, because I will also have the R code for the statistical analyses in the org file in order to be able to have a more reproducible work flow:
# -*- mode: org; org-export-babel-evaluate: nil -*-
#+Title: This is my title
#+Author: An Author, Another Author, and Last Author
#+Options: toc:nil ':t *:nil -:nil ::nil <:nil ^:t author:t d:t H:5 |:t
#+Property: header-args:R :session *myarticlessection* :results output :exports both :cache yes
#+Latex_Class: article
#+Latex_Class_Options: [12pt]
#+Latex_Header: \usepackage{amsmath}
#+Latex_Header: \usepackage[T1]{fontenc}
#+Latex_Header: \usepackage{mathptmx}
#+Latex_Header_Extra: \linespread{1.5}
#+LATEX_HEADER: \usepackage[citestyle=authoryear-icomp,bibstyle=authoryear, hyperref=true,backref=true,maxcitenames=3,url=true,backend=biber,natbib=true] {biblatex}
#+Latex_header: \addbibresource{myarticles.bib}
#+BEGIN_SRC latex :results output
\begin{abstract}
Here is where I put the abstract.
\end{abstract}
#+END_SRC
#+RESULTS:
#+BEGIN_LaTeX
\begin{abstract}
And this is where it ended up after evaluating the babel block.
\end{abstract}
#+END_LaTeX
I used org-mode to write several papers, including my PhD thesis. It helped me greatly to keep track of open problems, priorities, annotations etc.
I use a small custom converter that reads the .org file and exports parts of it to a .tex file. Note that "normal" org-mode text (including headings, text, priorities, keywords etc.) is not exported, just the stuff between #BEGIN_LaTeX and #END_LaTeX tags. This way, you can make annotations as you see fit, which won't appear in the published text.

LaTeX and Text Statistics

with LaTeX is there the possibility to generate a table with some statistics about the text written?
For exemple, one table with the number of nouns, phrases, paragraph, and some index about the variability or frequency of the words used.
Anyway, if there is not a package like this, how can I build one? I am very interested about this.
Thank you in advance
Noone has ever implemented a natural language processing toolkit (NLTK) for LaTeX. In principle, this is possible, but TeX as a programming language isn't particularly well suited for this task.
So I suggest looking for one of the existing NLTKs (e.g., python-nltk) and do the statistics with it and feed back the result to LaTeX.
LaTeX code is just plain text with control sequences.
You can use detex to remove all comments and control sequences, leaving you with plain text which you could feed through any NLTK you like.
The result of that can be formatted as a table and \input into the document.

R --markdown to latex - tables do not show up

I am using Knitr in Rstudio, to generate markdown files. I display the tables via xtable package and it shows up nicely in html file. However, when I converd .md to latex via pandoc - the latex file does not contain the tables as it is supposed to be, but only the values in table without any command.
Markdown - Knitr input
In order to give a better idea, the following table provides a sample of
data rows:
```{r table, results='asis', echo=FALSE}
r = read.table("C:/aR_files/data.txt",sep=",", header=TRUE,as.is=TRUE)
r$X = NULL;
print(xtable(r), type='html')
```
Latex
In order to give a better idea, the following table provides a sample of
data rows:
Row1
Row2
Val1
Val1
I thought I may be missing a latex package, so I downloaded ctable.sty, but still I get the same output. Any ideas appreciated, thanks!
I use a very similar workflow to yours and your best bet is to abandon the often clunky xtable package and use the pander package to print your tables. You can wrap any object that you might want to display as a table in the generic pander() function. This is a wrapper for the pandoc.table() function which has several options. If you specify the option style = "XXX" you can achieve what you are asking about here. There are 4 different styles you can choose from; "multiline" (the default), "grid", "simple", or "rmarkdown". I frequently knit rmarkdown documents from within Rstudio and then convert them to Word documents using the pander package:
library(pander)
Pandoc.convert("C:/Users/BlahBlahBlah/Document.md", format="docx")
All of the 4 table styles get turned into table objects upon conversion to .docx format, but only one table style looks right in the .docx document and the .html file that results from the initial "knit". That style is "rmarkdown". You can implement this 2 ways. One would be:
```{r table, results='asis'}
pandoc.table(myTable, style = "rmarkdown")
```
I prefer to set the table style globally at the beginning of my document however, ensuring that all my tables have the same formatting and also allowing me to use the more succinct pander(x) instead of the more verbose pandoc.table(x, style = "someStyle"):
```{r table, results='asis'}
panderOptions("table.style", "rmarkdown")
pander(myTable)
```
There are some side effects of using the rmarkdown style however. Mainly, it does not support newline characters within cells, so buyer beware. I experimented with the different styles and eventually decided that I liked the default style of "multiline" because of it's flexibility with line breaks within cells, even though the .html files I generate look silly. This doesn't bother me though, as I really only use the .docx files that I convert from the .md files. I wrote a blog post about making nice tables that you might find useful. It weighs the pros and cons of several methods including xtable() and several pander() scenarios.

MLA-style bibliography with BibLaTeX: How to organise by section?

I'm using the MLA authoring style. I would like to print out a bibliography subdivided into different sections. I also want annotations on each source. Is this possible with BibLaTeX? Should I just do it manually?
Yes, I think you can do that with Biblatex, but I think you should still just do it manually.
Note, though, that you are probably wanting to craft your notes differently for each citation from one paper to the next, which leads to the question: why use Bibtex at all? You can generate a Bibtex file the usual way, until all the references are there, then cut&paste the .bbl file into place in your Latex file, and annotate and reformat away to your heart's content.
So I think that Bibtex makes sense as a standard repository of the basic facts about citations you might make again and again: in particular you can get it error-free; my experience as a scientific editor is that most authors are sure that their bibliographies are error-free, most have between 10% and 60% of entries having errors in them. Latex users tend to be better that Word users in this respect, and I think that it is because of Bibtex.
Caveat: you will need to mess about with the thebibliography environment to do this. But that is another question... Also, if there are errors in your Bibtex file, you will need to correct them in two places.
Why I don't like Biblatex: the Bibtex prepresentation is a standard, and is accepted by all kinds of other document processors. You shouldn't put special Latex formatting into your bibliographic database: that will reduce the utility of that database. For m in particular, I use both Latex and Context: both use Bibtex, but only Latex uses Biblatex.
I managed to write a quite nice MLA-style bibliography with bibtex and the style provided by the Reed College (which is based on Natbib), and BibUnits to subdivide the entries in sections (as discussed here)
(let me know if you have any tips with MLA styles, my paper is not finished yet)
EDIT: my answer was for standard bibtex, not biblatex, sorry
yes, you can do it easily with biblatexwith the headings:
For instance:
\defbibheading{general}{\section*{General Architecture}}
\defbibheading{european}{\section*{European Architecture}}
\printbibliography[heading=general,keyword=general]
\printbibliography[heading=european,keyword=european]
and add the relevant keywords={architecture} keywords={general} in your *.bib files
Here is a biblatex MLA-style, if you need biblatex-mla (and a related question, you may also face this problem)

Parts in pdflatex Table of Contents

I have a thesis in which I want to group some chapters together, using the \part command.
What I would like is to have the following:
Chapter 1
Part I
Chapter 2
Chapter 3
Part II
Chapter 4
Chapter 5
Chapter 6
So the last chapter should again be on the same level as the parts. In the table of contents of the text you can't really detect it, because Parts are on the same level anyway.
The problem is that in the PDF, the chapter 6 is added under Part II.
Does anyone know of a way to change that?
The bookmark package can do this quite nicely, among other things. It also only uses a single pass to embed PDF bookmarks into the document.
\part{...}
\chapter{...}
\bookmarksetup{startatroot}
\chapter{...}
The fact that LaTeX does it wrong probably means that something is wrong with the structure of your document: \part is not meant to group chapters, but to devide the document in parts. The difference is that every chapter should be in a part.
Try 'introduction' or 'preliminaries' as a name for the part containing chapter 1.
It might be possible to work around, but you'd have to redefine command throughout the document. It might be worthwhile to use \chapter* for chapters not in a pat, step the chapter-counter manually, and manually call \addcontentsline with the right argument. However, this is IMHO bad use of LaTeX: for well-structured documents, the standard LaTeX commands should suffice.

Resources