LaTeX Question: Manually Formatting Citations

In summary, Zotero does not output the correct formatting for citations in a bibtex file. The issue is compounded by Latex not being able to properly compile the data.
  • #1
SamBam77
27
0
I am using Zotero to collect and organize all of my citations, which I then export in a bibtex format to use in my LaTeX document, using natbib to make my bibliography. The problem is that I have a couple 'odd' references that do not format correctly. I think this is due to a combination of Zotero not outputting correctly, and my bib style sheet not having the write guidelines for this format. In any case, it does not show the correct formatting (best case), or throws a bunch of errors when compiling (worst case).

Since I only have a couple of these instances, rather than tracking down the main problem(s) that cause it, I just wanted to manually format the citation myself. Is there a way to do this? I think I would just prefer to hard-code in the correct text, and then tell LaTeX to print that citation in the correct place (in the reference list at the end) when I reference that source. How can I do this?
 
Physics news on Phys.org
  • #2
I'm unfamiliar with Zotero, but I imagine that you use it to periodically generate a fresh .bib file, so it would be cumbersome to always cut and paste the odd references into the file. Since \bibliography{#1,#2,...} takes multiple arguments, if you can remove the odd references from Zotero, you can simply hand format them into a 2nd .bib file using the natbib specs.
 
  • #3
What fzero says.

I use JabRef to keep my .bib files up to date.

If you show us a few examples of bibtex entries where Zotero/Bibtex/Latex screws up we be able to give you hints on how to work aroiund the problem.
 
  • #4
Yes, you are right. Zotero is only the software that I use to download and organize my references in, and which I use to periodically generate my updated .bib reference list. It would be very easy for me to remove the odd references from Zotero and manage them separately, it is getting them into Latex afterward that I am having problems with.

I will show two examples of types of citations that are not showing correctly: a web page and a conference paper.

The output from Zotero when I write the .bib file is:
Code:
@misc{last_google_?,
	title = {Google Home Page},
	url = {[PLAIN]https://www.google.com/}[/PLAIN] ,[/PLAIN] 
	journal = {Google},
	author = {last, first},
	howpublished = {[PLAIN]https://www.google.com/}[/PLAIN] 
},

@inproceedings{soumetz_drug_2004,
	title = {Drug delivery for nerve tissue regeneration},
	doi = {10.1109/NANO.2004.1392310},
	author = {Soumetz, F. C. and Giacomini, M. and Pastorino, L. and Phillips, J. B. and Brown, R. A. and Ruggiero, C.},
	month = aug,
	year = {2004},
	pages = {239--241}
}
You can see that the web page was outputted as a “misc” item, and the conference paper was written as an “inproceedings” item.

I am using the standard file “achemso.bst” (from the American Chemical Society) to format my citations in Latex,
\bibliographystyle{achemso}
Inside this file there are no guidelines for how to format “misc” references, so compilation of my bibliography fails and I do not get anything if I want to cite a web page. There is a set of rules for formatting “inproceedings” references, but it is incorrect...at least as far as the ACS formatting standards go in their style guide (pg 37 of 55).

My latex code is:
Code:
\documentclass[english]{article}
\usepackage{babel}
\usepackage[super, comma, sort&compress]{natbib}

\begin{document}

blah blah blah \cite{soumetz_drug_2004}

\bibliography{Refs}
\bibliographystyle{achemso}

\end{document}

If, however, I generate the citation directly from zotero (as opposed to exporting it to a bib file), it is generated correctly, since I have added the appropriate style guidelines for zotero.

Instead of just hard coding in the few problem references that I have, another solution would be to just fix the achemso style guideline file, I suppose. I could follow the pattern I see for other reference types and build my own, but this does not solve everything, since part of the problem is zotero is outputting the data in an incomplete way for the style sheet to use (for example, the name of the conference (for the conference paper example), or the date last accessed (for the website example).
 
Last edited by a moderator:
  • #5
Your bibtex entries look ok to me, so I guess the fault is in the .bst file as you point out.

Hacking .bst files is possible but not completely trivial.

I suggest that you contact the editors (or contact persons listed for LaTex documents) and present your example entries. Point out the problem and ask for suggestions.

In the mean time the easiest workaround appears to use Zotero directly.
An alternative is to use a different item type and add the missing information as note.
 
  • #6
M Quack said:
In the mean time the easiest workaround appears to use Zotero directly.
If I do this, however, the citation that it generates is not in any way connected with latex...it would be something that I could copy-past into other editors. That is what I originally wanted to do, take this output (which is correct) and use it to hard-code in my latex citation. How else might I get the information in there?

How about the “notes2bib” package, that allows users to make author notes in the reference list? I could make the citation an author note, but make it look exactly like a citation. But I have never been able to get this package to work for me. I am not sure if it is my computer, or whether I am just using it wrong. Could someone provide a simplest working example for this package using natbib for references (as opposed to biblatex)?
 

FAQ: LaTeX Question: Manually Formatting Citations

What is LaTeX?

LaTeX is a typesetting language used for creating professional and high-quality documents, especially in the fields of mathematics, science, and engineering.

How do I manually format citations in LaTeX?

To manually format citations in LaTeX, you can use the \cite{} command followed by the key of the reference you want to cite. You can also specify the citation style by using the \bibliographystyle{} and \bibliography{} commands.

Can I customize the citation style in LaTeX?

Yes, you can customize the citation style in LaTeX by using a different bibliography style or by modifying an existing one. You can also add additional packages or use the natbib package for more options.

How do I include page numbers in my citations?

To include page numbers in your citations, you can use the \cite{} command followed by a comma and the page number(s) inside square brackets. For example, \cite[42]{key} will cite the reference with the key "key" and include the page number 42 in the citation.

How do I add multiple citations in one command?

To add multiple citations in one command, you can use the \cite{} command followed by a comma-separated list of keys inside curly braces. For example, \cite{key1, key2, key3} will cite three references with the keys "key1", "key2", and "key3" in one command.

Similar threads

Replies
1
Views
5K
Replies
11
Views
5K
Replies
8
Views
2K
Replies
5
Views
4K
Replies
2
Views
1K
Replies
4
Views
2K
Replies
7
Views
11K
Back
Top