How to reference a specific chapter in a book in Bookdown? - latex

I know it is possible to include references to specific sections/chapters of citations in Latex, but am wondering if there is a way to do this within the R Bookdown environment. Searches show lots of ways to reference other sections of the book I am writing in bookdown. For context, including a bookdown citation such as [#Gelman2014] produces the following reference in the pdf output: (Gelman 2014). I am looking for a way to get something along the lines of (Gelman 2014 Sec 2.1). Thanks in advance!

Welcome to SO, #lcaruso!
You could try something like this:
[#Gelman2014 \text{Sec} 2.1]

Related

How to remove page number locations being added to bibliography entries

I am writing my thesis in Overleaf, using the IEEE reference style and the BibTeX package for the bibliography. The bibliography entries generated have additional text at the end, it would appear it is including which page(s) the particular citation comes from. Any help removing them would be greatly appreciated, and I have included an image of my PDF to show what this looks like. Thank you.
EDIT: The problem has been solved. My includes.tex files uses two packages, backref and pagebackref, which were responsible for adding the "pages" and their numbers for each citation entry. Include these if you want these pages labels, remove them if you do not. Thank you all for your help.
The easiest method is to just edit the .bib file, and remove all lines with "pages = ... ". If the bib file doesn't specify them, then bibtex won't create entries for it.
E.g., in
#article{dubey2014survey,
title={A survey of high level frameworks in block-structured adaptive mesh refinement packages},
author={Dubey, Anshu and Almgren, Ann and Bell, John and Berzins, Martin and Brandt, Steve and Bryan, Greg and Colella, Phillip and Graves, Daniel and Lijewski, Michael and L{\"o}ffler, Frank and others},
journal={Journal of Parallel and Distributed Computing},
volume={74},
number={12},
pages={3217--3227},
year={2014},
publisher={Elsevier}
}
just remove the 'pages' line.
If you want to do it programmatically you'd have to edit the .bst file (IEEEtran.bst if i remember correctly), but that's not for the faint of heart, so I'd recommend the easier method.

Remove citation from Latex

I am trying to edit a a paper in Latex. But it make some problems in Reference section. I deleted three citation from reference file and remove citation name Like, \cite{X...} from the paper content. But still the citation are showed in the original pdf file. I need a suggestion, what would be solution or better way to do this.
Check the *.log files: you should understand better what's going on. However, citations handling has several steps (simplified version):
latex file.tex outputs a file.aux with the citations
bibtex file.tex outputs a file.bbl with the references
one more (or even more) latex file.tex is needed to get the article with both references and citations
The complete flow (taken from Goosens, Mittelbach, and Samarin (1994) The LaTeX Companion, Figure 12.1, p. 375) is: []
I encountered the same issue and I resolved it by deleting all the build generated files, i.e. *.aux, *.log etc, and rebuilding the .tex file.

Showing labels in BibTex [LaTeX]

I'm currently using the apalike style for my bibliography, using natbib for author-year, however when I generate the bibliography I lose the labels that normally precede the reference,
i.e. [S. Rostami, 2010] Shahin Rostami (2010) https://stackoverflow.com/questions/ask etc etc..
I read apalike.bst and it seems this is intended, my quesiton is, how do I get them back? Something I can include in the preamble? Otherwise is there a similar style that shows labels?
Also, I'm doing this all in Lyx.
OK, a real answer!
Advice: don't use homebrew citation styles in scientific articles. If your university recommends a specific style (e.g., APA, Chicago), use the existing matching style. Otherwise, you can get a feel for what is the dominant citation/reflist style by looking at what styles used by the articles you cite.
If you really do want to create such a homebrew cite/reflist style, then the easy option is to copy the .bbl file into your article and edit that: with luck, you can devise a regex that will create all or most of the labels you want. But rerunning Bibtex will not respect the changes you have made. The "right" thing is to clone apalike.bst and change the way it generates the author/date sentence to include the label information as well. BST hacking is a bit of a black art —time-consuming, fiddly, and poorly documented— but the language is not essentially difficult. Look at btxhak, Designing Bibtex styles and Nicolas Markey's tutorial to get started. Alternatively, there are some bst-hackery-avoiding suggestions in this SO Q&A.

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