Multibib cite not working on Latex-Overleaf - latex

I am trying to use Multibib to separate the references, one for the paper and another for the appendix. The new command is not working, it doesn't find the bib entries from the related bib file.
Here is the smallest version of the overleaf project.
I use two different bib files: one for referencing through the paper and another for the SLR appendix part.
Then I created the new command:
\usepackage{multibib}
\newcites{slr}{Appendix References}
I used this command like:
An example with cite~\cite{10.1145/130844.130856}, and here is the citeslr~\citeslr{Mora_Segura201679}
And, at the Appendix part I wrote:
'''
\bibliography{sn-bibliography}
\clearpage
\appendix
\continuouslabelsfalse
\section{Selected Studies}
\label{append:slr}
\bibliographyslr{SLR}
'''
Find attached the minimal example here:
https://www.overleaf.com/3393931684gxnfmjfnbdyf
Hope for your support.

I solved this by adding a bibliography 'plain' style
\bibliographystyleslr{plain}

Related

Rmarkdown with LaTex-document in appendix?

I need to create an Rmarkdown document in which I have some text and 3 appendices showing 3 different LaTex files. I found many resources showing how to append Rcode in an appenidx, but have been unsuccessful for other kinds of appendices. As a structure, I use a thesisdown-template. The template has several chapters that are all compiled together in the end. There is also an appendix-template but I haven't figured out how to include a LaTex file in there. But given that I can have LaTex code in a Markdown file, it should be possible?
I do not need to use thesis-down, it could also be similar to the following:
Any ideas are welcome!
If I understand correctly, then you are only interested in PDF output. You can embed raw LaTeX commands in R Markdown, so the following should do what you need:
\appendix
## Appendix 1
\input{/path/to/my/LaTeXfile.tex}
## Appendix 2
\input{/path/to/my/other/LaTeXfile.tex}

How to handle citations in Ipython Notebook?

What is the best way to take care of citations in Ipython Notebook? Ideally, I would like to have a bibtex file, and then, as in latex, have a list of shorthands in Ipython markdown cells, with the full references at the end of the notebook.
The relevant material I found is this: http://nbviewer.ipython.org/github/ipython/nbconvert-examples/blob/master/citations/Tutorial.ipynb
But I couldn't follow the documentation very well. Can anyone explain it? Thanks so much!!
Summary
This solution is largely based on Sylvain Deville's excellent blog post. It allows you to simply write [#citation_key] in markdown cells. The references will be formatted after document conversion. The only requirements are LaTeX and pandoc, which are both widely supported. While there is never a guarantee, this approach should therefore still work in many years time.
Step-by-Step Guide
In addition to a working installation of jupyter you need:
LaTeX (installation guide).
Pandoc (installation guide).
A citation style language. Download a citation style, e.g., APA. Save the .csl file (e.g., apa.csl) into the same folder as your jupyter notebook (or specify the path to the .csl file later).
A .bib file with your references. I am using a sample bib file list.bib. Save to the same folder as your jupyter notebook (or specify the path to the .bib file later).
Once you completed these steps, the rest is easy:
Use markdown syntax for references in markdown cells in your jupyter notebook. E.g., [#Sh:1] where the syntax works like this: ([#citationkey_in_bib_file]). I much prefer this syntax over other solutions because it is so fast to type [#something].
At the end of your ipython notebook, create a code cell with the following syntax to automatically convert your document (note that this is R code, use an equivalent command to system() for python):
#automatic document conversion to markdown and then to word
#first convert the ipython notebook paper.ipynb to markdown
system("jupyter nbconvert --to markdown paper.ipynb")
#next convert markdown to ms word
conversion <- paste0("pandoc -s paper.md -t docx -o paper.docx",
" --filter pandoc-citeproc",
" --bibliography="listb.bib",
" --csl="apa.csl")
system(conversion)
Run this cell (or simply run all cells). Note that the 2nd system call is simply pandoc -s paper.md -t docx -o paper.docx --filter pandoc-citeproc --bibliography=listb.bib --csl=apa.csl. I merely used paste0() to be able to spread this over multiple lines and make it nicer to read.
The output is a word document. If you prefer another document, check out this guide for alternative syntax.
#Extras
If you do not like that your converted document includes the syntax for the document conversion, insert a markdown cell above and below the code cell with the syntax for the conversion. In the cell above, enter <!-- and in the cell below enter -->. This is a regular HTML command for a comment, so the syntax will in between these two cells will be evaluated but not printed.
You can also include a yaml header in your first cell. E.g.,
---
title: This is a great title.
author: Author Name
abstract: This is a great abstract
---
You can use the Document Tools of the Calico suite, which can be installed separately with:
sudo ipython install-nbextension https://bitbucket.org/ipre/calico/downloads/calico-document-tools-1.0.zip
Read the tutorial and watch the YouTube video for more details.
Warning: only the cited references are processed. Therefore, if you fail to cite an article, it won't appear in the References section. As a little working example, copy the following in a Markdown cell and press the "book" icon.
<!--bibtex
#Article{PER-GRA:2007,
Author = {P\'erez, Fernando and Granger, Brian E.},
Title = {{IP}ython: a System for Interactive Scientific Computing},
Journal = {Computing in Science and Engineering},
Volume = {9},
Number = {3},
Pages = {21--29},
month = may,
year = 2007,
url = "http://ipython.org",
ISSN = "1521-9615",
doi = {10.1109/MCSE.2007.53},
publisher = {IEEE Computer Society},
}
#article{Papa2007,
author = {Papa, David A. and Markov, Igor L.},
journal = {Approximation algorithms and metaheuristics},
pages = {1--38},
title = {{Hypergraph partitioning and clustering}},
url = {http://www.podload.org/pubs/book/part\_survey.pdf},
year = {2007}
}
-->
Examples of citations: [CITE](#cite-PER-GRA:2007) or [CITE](#cite-Papa2007).
This should result in the following added Markdown cell:
References
^ Pérez, Fernando and Granger, Brian E.. 2007. IPython: a System for Interactive Scientific Computing. URL
^ Papa, David A. and Markov, Igor L.. 2007. Hypergraph partitioning and clustering. URL
I was able to run it with the following approach:
Insert the html citation as in the tutorial you mentioned.
Create ipython.bib in the "standard" bibtex format. It goes into the same file as your *.ipynb notebook file.
Create the template file as in the tutorial, also in the same directory or else in the (distribution dependent) directory with the other templates. On my system, that's /usr/local/lib/python2.7/dist-packages/IPython/nbconvert/templates/latex.
The tutorial has the template extend latex_article.tplx. On my distribution, it's article.tplx (without latex_).
Run nbconvert with --to latex; that generates an .aux file among other things. Latex will complain about missing references.
Run bibtex yournotebook.aux; this generates yournotebook.bbl. You only need to re-run this if you change references.
Re-run nbconvert either with --to latex or with --to pdf. This generates a .tex file, or else runs all the way to a .pdf.
If you want html output, you can use pandoc to assemble the references into a tidy citation page. This may require some hand-editing to make an html page you can reference from your main document.
If you know that you will be converting your notebook to latex anyway, consider simply adding a "Raw" cell (Ctrl+M R) to the end of the document, containing the bibliography just as you would put it in pure LaTeX.
For example, when I need to reference a couple of external links, I would not even care to do a proper BibTeX thing and simply have a "Raw" cell at the end of the notebook like that:
\begin{thebibliography}{1}
\bibitem{post1}
Holography in Simple Terms. K.Tretyakov (blog post), 2015.\\
\url{http://fouryears.eu/2015/07/24/holography-in-simple-terms/}
\bibtem{book1}
The Importance of Citations. J. Smith. 2010.
\end{thebibliography}
The items can be cited in other Markdown cells using the usual <cite data-cite="post1">(KT, 2015)</cite>
Of course, you can also use proper BibTeX as well. Just add the corresponding Raw cell, e.g:
\bibliographystyle{unsrt}
\bibliography{papers}
This way you do not have to bother editing a separate template file (at the price of cluttering the notebook's HTML export with raw Latex, though).
You should have a look at the latex_envs extension in https://github.com/ipython-contrib/IPython-notebook-extensions (install from this repo, it is the most recent version). This extension contains a way to integrate bibliography using bibtex files and standard latex notation, and generates a bibliography section at the end of the notebook. Style of citations can be (to some extent) customized. Some documentation here https://rawgit.com/jfbercher/latex_envs/master/doc/latex_env_doc.html

Including doxygen's LaTeX output as an appendix to a larger document

I have a "project book" which uses LaTeX's \documentclass{report} ("report" is like a more compact version of \documentclass{book}). I would like to include into this book an appendix with the Doxygen-generated API documentation for the software in the project.
I have achieved this by setting Doxygen's config options LATEX_HEADER and LATEX_FOOTER to an empty file. This makes the resulting latex/refman.tex have top level commands like: \section{\-Namespace \-Index}, at which point I can wrap this with a top level document like:
\documentclass{report}
\usepackage{doxygen.sty}
% the "import" package helps to find Doxygen files in the latex/ subdirectory
\usepackage{import}
% [...] title page and the rest of the book
\appendix
\chapter{API reference (generated by Doxygen)
subimport{latex/}{refman.tex}
% [...] final stuff
\end{document}
This works reasonably well and I get doxygen.sty with this special doxygen invocation:
doxygen -w latex /dev/null /dev/null doxygen.sty
One problem is that this puts an "autogenerated" header on the entire document (not just on the doxygen appendix). I can get rid of this by editing doxygen.sty (I also rename it for my inclusion, actually) and commenting out the block that starts with % Setup fancy headings.
At this point I have something I can live with, but I would like to go one step further: the "doxygen" style modifies a lot of other aspects of the LaTeX document style, and I like it less.
So my question is (in two levels of excellence):
What would be a minimal set of LaTeX commands to put in a doxygen.sty file that would nicely render the doxygen appendix but not interfere with the rest of the LaTeX document?
Even better, has someone come up with a way of doing
\usepackage{doxygen_standalone}
% [... until you need doxygen]
\begin{doxygen}
% the stuff you need to insert your auto-generated doxygen API docs,
% for example the \subimport{latex/}{refman.tex} that I showed above
\end{doxygen}
This last approach is one I would consider very clean.
I'm hoping there is a really simple answer, such as "this already exists in doxygen.sty as an option, and you missed it!"
rename doxygen.sty to mydoxygen.sty, then modify it by inserting
\newenvironment{doxygen}{... most of doxygen.sty goes here ...}{}

How do I cite the title of an article in LaTeX?

I'm using LaTeX and BibTeX for an article, and I want to able to cite the title of an article I reference. What is the command to do this?
I'm using \bibliographystyle{chicago} and it does not appear to be \citeT{}, \citetitle{} or \citeTitle{}
#Norman, and the various commenters, are correct in that it would be difficult to do this with bibtex and other tools. But, there is an alternative. Biblatex does allow this through the command \citetitle. Also, if you really want to, the formatting drivers in biblatex are easily readable and modifiable, but only if you feel the need. Unfortunately, it is not part of any distribution, yet, so it has to be downloaded and installed.
Just type in the title. Even natbib, the most powerful widespread BibTeX package, is not powerful enough to do what you want out of the box. Trying to get BibTeX to extract the title for you, by means of a LateX command, is possible, but it would require that you
Design a new format for bibliography items that is incompatible with existing formats.
Write your own custom .bst file, using the very strange postfix language that is used only by BibTeX, to be compatible with your new format.
Write a new LaTeX command to pull the title information out of the new format.
Speaking as someone who has written several custom bst files as well as a replacement for BibTeX, it's just not worth fooling with. After all, if you are citing the paper, you probably know the title anyway.
EDIT: If you have to do this with multiple papers, I would try to cheat. Extend the bst file so that it writes into the bbl file a command that writes into the aux file the title associated with each bibkey. You can model the bbl command on \label and the actual title-citing command on \ref.
This is how I solve the title issue for cited papers:
In the preamble
include Natbib:
\usepackage[sort&compress]{natbib}
If you want to cite a TITLE instead of an author in the text you define the title like this in the preamble:
\defcitealias{Weiser1996designingcalm}{Designing Calm Technology}
Note:
You need to have a bibtex item (for the title ''Designing Calm Technology'') with the key {Weiser1996designingcalm}.
In the paper where you want to write the cited paper's title
\citetalias{Weiser1996designingcalm}
this results in => Designing Calm Technology (i.e. the text you specified with the \defcitealias command above)
or
\citepalias{Weiser1996designingcalm}
that results in => (Designing Calm Technology) (i.e. title with parenthesis)
This question is old and maybe \citefield was not around back in the days, but now it works like charm for this kind of problems:
\documentclass[varwidth]{standalone}
\usepackage{biblatex}
\begin{filecontents}{\jobname.bib}
#article{example,
title = {NAME OF PAPER},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\citefield{example}{title}
\end{document}
Got it from this question.
Thanks to Anders for the hint. \defcitealias seems to be the way to go.
Bibtex produces a .bbl file which contains the bibliography entries. something like that
\bibitem[\protect\citeauthoryear{Andrienko
{\itshape{et~al.}}}{2003}]{Andrienko2003}
Andrienko, G., Andrienko, N., and Voss, H., 2003. {GIS for Everyone: The
CommonGIS Project and Beyond}. {\itshape {In}}: {\itshape {Maps and the
Internet}}., 131--146 Elsevier.
I use Eclipse, which is free and that you may already have to apply regular expressions in this file when needed. '\R' acts as platform independent line delimiter. Here is an example of multi-line search:
search:
\\bibitem.*(\R.*)?\R?\{([^{]*)\}\R^[^\\].*\d\d\d\d\.\s([^\.]*\R?[^\.]*)\R?.*\R?.*
and replace:
\\defcitealias{$2}{$3}
(For myself I use \\bibitem.*(\R.*)?\R?\{([^{]*)\}$\R^([^\\].*[^\}]$\R.*$\R.*) to get all the item text)
Et produces a series of \defcitealias that can be copypasted elsewhere:
\defcitealias{Andrienko2003}{{GIS for Everyone: The
CommonGIS Project and Beyond}}
Finally, this can be used to build a custom command such as:
\newcommand{\MyCite}[1]{\citet*{#1}. \citetalias{#1}.}
Used as \MyCite{Andrienko2003} and producing: Andrienko et al. (2003). GIS for Everyone: The CommonGIS Project and Beyond.

Force the end of a LaTeX command in MultiMarkDown

I'm using MultiMarkdown to generate a LaTeX file of an academic paper I'm working on. I'm using biblatex for the bibliography, which allows for commands like autocite and autocites:
This is a true statement.\autocite{source:2007}
When autocites is used, each braced entry is considered a citation source, which works great when there are multiple sources for the citation:
This is another statement.\autocites{othersource}{yetanothersource}
However, when the text following the autocites command is another bracketed LaTeX command, biblatex treats it as another source, spacing:
This is another statement.\autocites{othersource}{yetanothersource} {\itshape The New York Times}…
results in a footnote that looks like this:
Bib data for othersource; bib data for yetanothersource; \itshape The New York Times
That's a problem. One obvious way around it is to use a different command for italics, like \emph{The New York Times}, but unfortunately MultiMarkdown uses itshape instead of \emph, and I'd rather not muck around in MMD's source code.
Is there a LaTeX sequence or code that will force a break between the two sequences of braced commands? Forcing a line break with \\ kind of works ({yetanothersource}\\{\itshape), but it creates a new paragraph after the first command. Is there something similar to \\ that will tell the LaTex engine to begin parsing the {itshape} as a new command rather than as part of autocite{}?
This is a hopeless guess, but have you tried \relax?
Something like:
This is another statement.\autocites{othersource}{yetanothersource}\relax {\itshape The New York Times}…

Resources