Mendeley-Overleaf Double Brace Issue - latex

I am not sure if this is the appropriate place for this post, please let me know if I should post this somewhere else.
So I am using Overleaf and Mendeley to write my paper. I am using the online version of Mendeley and I sync my references into Overleaf mostly without any issues. But some of the references generated have double an extra set of {}, an example of this is given below:
#incollection{Alberts2002TheProtein,
title = {{The shape and structure of protein}},
year = {2002},
booktitle = { Molecular Biology of the Cell},
author = {Alberts, Bruce and Johnson, Alexander and Lewis, Julian and Raff, Martin and Roberts, Keith and Walter, Peter},
edition = {4},
month = {3},
volume = {},
publisher = {Garland Science}}
As you can see in the title attribute an extra set of parentheses was added by Mendeley. Whenever this happens I get a warning from Overleaf stating BibTeX: "{Essential" isn't a brace-balanced string for entry Alberts2010EssentialBiology. This happens only for a few of my references.
Since I am syncing my references to Overleaf I can't edit the .bib file in Overleaf and remove the extra set of parenthesis. Is there any way to remove it directly on the Mendeley website? Or set a style or preference?
I know I can download my references and then add them to a file and upload that file to Overleaf, I am trying to find a better alternative. Thank you for reading this.
Edit: Reproducible Example, you can add the following details on Mendeley and then try to get the BibTex citation code:
Type: Book Section
Book Title: Molecular Biology of the Cell
Title: The shape and structure of protein
Authors: (Last name, First name)
1. Alberts, Bruce
2. Johnson, Alexander
3. Lewis, Julian
4. Raff, Martin
5. Roberts, Keith
6. Walter, Peter
Edition: 4
Month:3
Publisher: Garland Science
Year =2002
I get the code I have posted above with two parentheses around title.
Edit: Removing the extra Pair of parenthesis resolves the warning.

Related

Simple Wikipedia Text into Plain Text Parser?

I'm searching for a simple parser that translates a String with wiki markup code to readable plain text, e.g.
A lot of these sources can also be used to add to other parts of the article, like the plot section. <font color="silver">[[User:Silver seren|Silver]]</font><font color="blue">[[User talk:Silver seren|seren]]</font><sup>[[Special:Contributions/Silver seren|C]]</sup> 05:34, 22 March 2012 (UTC)
to
A lot of these sources can also be used to add to other parts of the article, like the plot section. SilverserenC 05:34, 22 March 2012 (UTC)
I tried it with DKPro JWPL (where also the above example comes from) but this framework plain text output doesn't parse wiki talk pages (discussions) in the right way. It simply deletes lines that start with a number of ":" characters which are crucial for the talk pages.
Okay, I found out that the old wikipedia parser from JWPL is working: "de.tudarmstadt.ukp.wikipedia.parser"
link
You can use it like:
MediaWikiParserFactory pf = new MediaWikiParserFactory(Language.english);
MediaWikiParser parser = pf.createParser();
ParsedPage pp = parser.parse("some wiki code with markups");
System.out.println(pp.getText());

Extracting text from APA citation

I have a spreadsheet containing APA citation style text and I want to split them into author(s), date, and title.
An example of a citation would be:
Parikka, J. (2010). Insect Media: An Archaeology of Animals and Technology. Minneapolis: Univ Of Minnesota Press.
Given this string is in field I2 I managed to do the following:
Name: =LEFT(I2, FIND("(", I2)-1) yields Parikka, J.
Date: =MID(I2,FIND("(",I2)+1,FIND(")",I2)-FIND("(",I2)-1) yields 2010
However, I am stuck at extracting the name of the title Insect Media: An Archaeology of Animals and Technology.
My current formula =MID(I2,FIND(").",I2)+2,FIND(").",I2)-FIND(".",I2)) only returns the title partially - the output should show every character between ).and the following ..
I tried =REGEXEXTRACT(I2, "\)\.\s(.*[^\.])\.\s" ) and this generally works but does not stop at the first ". " - Like with this example:
Sanders, E. B.-N., Brandt, E., & Binder, T. (2010). A framework for organizing the tools and techniques of participatory design. In Proceedings of the 11th biennial participatory design conference (pp. 195–198). ACM. Retrieved from http://dl.acm.org/citation.cfm?id=1900476
Where is the mistake?
The title can be found (in the two examples you've given, at least) with this:
=MID(I2,find("). ",I2)+3,find(". ",I2,find("). ",I2)+3)-(find("). ",I2)+3)+1)
In English: Get the substring starting after the first occurrence of )., up to and including the first occurrence of . following.
If you wish to use REGEXEXTRACT, then this works (on your two examples). (You can also see a Regex101 demo.):
=REGEXEXTRACT(I3,"(?:.*\(\d{4}\)\.\s)([^.]*\.)(?: .*)")
Where is the mistake?
In your expression, you were capturing (.*[^\.]), which greedily includes any number of characters followed by a character in the character class not (backslash or dot), which means that multiple sentences can be captured. The expression finished with \.\s, which wasn't captured, so the capture group would end before a period-then-space, rather than including it.
Try:
=split(SUBSTITUTE(SUBSTITUTE(I2, "(",""), ")", ""),".")
If you don't replace the parentheses around 2010, it thinks it is a negative number -2010.
For your Title try adding index split to your existing formula:
=index(split(REGEXEXTRACT(A5, "\)\.\s(.*[^\.])\.\s" ),"."),0,1)&"."

In Pandoc, how do I add a newline between authors through the YAML metablock without modifying the template?

I am trying to add a a couple of authors to a report I am writing. Preferably, the second author would appear on a new line after the first. I know I can modify the template to add a new field or the multiple author example given in the Pandoc readme. However, I wonder if there is any character I can use to insert a new line between authors directly in the metablock. So far I have tried \newline, \\, | with newline and space, <br>, <div></div>, and making the author list a string with newline or double spaces between author names, but nothing has worked. My desired output is pdf.
The problem isn't in the YAML metadata formatting (for which there are numerous ways to have multiline strings), but that the LaTeX \author command strips the newlines. But for PDF output (with LaTeX) you can do:
---
title: mytitle
author: '\protect\parbox{\textwidth}{\protect\centering Author: 1\\ Author: 2\\ Author 3}'
---
body text
You can go with a simple list to achieve this.
---
title: 'Any title comes here'
author:
- Author One
- Author Two
---
Another way is to rely on the title block that has a slightly different syntax.
% Any title comes here
% author(s) (separated by semicolons)
% date
Find additional variants in the metadata-block section of the pandoc manual.

how to rename sections in latex

How can i give another name to the main sections of a scientific paper in Latex? So instead of 'References' i wanna write a different title, instead of 'Abstract' another, and so on.
Regards
Redefine any of the following commands:
Abstract: \abstractname
Appendix: \appendixname
Bibliography: \bibname
Chapter: \chaptername
Contents: \contentsname
Index: \indexname
List of Figures: \listfigurename
List of Tables: \listtablename
Part: \partname
References: \refname
So, for example,
\renewcommand\refname{My References}
The list comes from The LaTeX Companion, 2nd edition, page 34.
For references \bibname is defined in the book class, but not in the article class. The latter is using \refname.
thanks! helped me a lot.
Just to help other fellas, it did not work for me before \begin{document}
I did it just before \part as below:
\renewcommand\partname{Capítulo}
\part{\textit{Conjuntura regulatória}}
\chapter{\large MATRIZ ENERGÉTICA BRASILEIRA}
worked as a charm.

How to order citations by appearance using BibTeX?

By default (using the plain style) BibTeX orders citations alphabetically.
How to order the citations by order of appearance in the document?
There are three good answers to this question.
Use the unsrt bibliography style, if you're happy with its formatting otherwise
Use the makebst (link) tool to design your own bibliography style
And my personal recommendation:
Use the biblatex package (link). It's the most complete and flexible bibliography tool in the LaTeX world.
Using biblatex, you'd write something like
\documentclass[12pt]{article}
\usepackage[sorting=none]{biblatex}
\bibliography{journals,phd-references} % Where journals.bib and phd-references.bib are BibTeX databases
\begin{document}
\cite{robertson2007}
\cite{earnshaw1842}
\printbibliography
\end{document}
Change
\bibliographystyle{plain}
to
\bibliographystyle{ieeetr}
Then rebuild it a few times to replace the .aux and .bbl files that were made when you used the plain style.
Or simply delete the .aux and .bbl files and rebuild.
If you use MiKTeX you shouldn't need to download anything extra.
The best I came up with is using the unsrt style, which seems to be a tweaked plain style. i.e.
\bibliographystyle{unsrt}
\bibliography{bibliography}
However what if my style is not the default?
Just a brief note - I'm using a modified version of plain.bst sitting in the directory with my Latex files; it turns out having sorting by order of appearance is a relatively easy change; just find the piece of code:
...
ITERATE {presort}
SORT
...
... and comment it - I turned it to:
...
%% % avoid sort:
%% ITERATE {presort}
%%
%% SORT
...
... and then, after running bibtex, pdflatex, pdflatex - the citations will be sorted by order of appearance (that is, they will be unsorted :) ).
Cheers!
EDIT: just realized that what I wrote is actually in the comment by #ChrisN: "can you edit it to remove the SORT command" ;)
You answered your own question---unsrt is to be used when you want references to ne listed in the order of appeareance.
But you might also want to have a look at natbib, an extremely flexible citation package. I can not imagine living without it.
I'm a bit new to Bibtex (and to Latex in general) and I'd like to revive this old post since I found it came up in many of my Google search inquiries about the ordering of a bibliography in Latex.
I'm providing a more verbose answer to this question in the hope that it might help some novices out there facing the same difficulties as me.
Here is an example of the main .tex file in which the bibliography is called:
\documentclass{article}
\begin{document}
So basically this is where the body of your document goes.
``FreeBSD is easy to install,'' said no one ever \cite{drugtrafficker88}.
``Yeah well at least I've got chicken,'' said Leeroy Jenkins \cite{goodenough04}.
\newpage
\bibliographystyle{ieeetr} % Use ieeetr to list refs in the order they're cited
\bibliography{references} % Or whatever your .bib file is called
\end{document}
...and an example of the .bib file itself:
#ARTICLE{ goodenough04,
AUTHOR = "G. D. Goodenough and others",
TITLE = "What it's like to have a sick-nasty last name",
JOURNAL = "IEEE Trans. Geosci. Rem. Sens.",
YEAR = "xxxx",
volume = "xx",
number = "xx",
pages = "xx--xx"
}
#BOOK{ drugtrafficker88,
AUTHOR = "G. Drugtrafficker",
TITLE = "What it's Like to Have a Misleading Last Name",
YEAR = "xxxx",
PUBLISHER = "Harcourt Brace Jovanovich, Inc."
ADDRESS = "The Florida Alps, FL, USA"
}
Note the references in the .bib file are listed in reverse order but the references are listed in the order they are cited in the paper.
More information on the formatting of your .bib file can be found here: http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management
I often use the bibliography style natbib because it supplies quite complete set of formats as well as tags for us.
Add this if you want the number of citations to appear in order in the document
they will only be unsorted in the reference page:
\bibliographystyle{unsrt}
I used the following in overleaf and become in ascending order:
\usepackage{cite}
\bibliographystyle{unsrt}
with unsrt the problem is the format. use \bibliographystyle{ieeetr} to get refences in order of citation in document.
If you happen to be using amsrefs they will override all the above - so comment out:
\usepackage{amsrefs}
The datatool package offers a nice way to sort bibliography by an arbitrary criterion, by converting it first into some database format.
Short example, taken from here and posted for the record:
\documentclass{article}
\usepackage{databib}
\begin{document}
% First argument is the name of new datatool database
% Second argument is list of .bib files
\DTLloadbbl{mybibdata}{acmtr}
% Sort database in order of year starting from most recent
\DTLsort{Year=descending}{mybibdata}
% Add citations
\nocite{*}
% Display bibliography
\DTLbibliography{mybibdata}
\end{document}
I use natbib in combination with bibliographystyle{apa}. Eg:
\begin{document}
The body of the document goes here...
\newpage
\bibliography{bibliography} % Or whatever you decided to call your .bib file
\usepackage[round, comma, sort&compress ]{natbib}
bibliographystyle{apa}
\end{document}

Resources