LaTeX Question: Manually Formatting Citations

  • Context: LaTeX 
  • Thread starter Thread starter SamBam77
  • Start date Start date
  • Tags Tags
    Citations Latex
Click For Summary

Discussion Overview

The discussion revolves around formatting citations in LaTeX documents using Zotero and natbib, particularly addressing issues with specific references that do not compile correctly. Participants explore potential solutions for manually formatting citations and the challenges associated with BibTeX entries.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes using Zotero to manage citations but encountering formatting issues with certain references when exporting to BibTeX.
  • Another suggests removing problematic references from Zotero and manually formatting them in a separate .bib file according to natbib specifications.
  • A participant using JabRef offers to help if examples of the problematic BibTeX entries are provided.
  • The original poster shares specific examples of incorrectly formatted citations, including a web page and a conference paper, and notes the limitations of the achemso.bst file in handling these types.
  • There is a suggestion to contact editors for advice on the .bst file issues and to consider using Zotero directly as a workaround.
  • Another participant mentions the possibility of using a different item type in BibTeX and adding missing information as a note.
  • The original poster expresses a desire to hard-code citations directly into LaTeX and inquires about using the “notes2bib” package, indicating difficulties in getting it to work.

Areas of Agreement / Disagreement

Participants generally agree that the issues stem from the .bst file and Zotero's output, but there is no consensus on the best approach to resolve the formatting problems. Multiple competing views on how to handle the citations remain present.

Contextual Notes

The discussion highlights limitations in the achemso.bst file regarding specific reference types and the incomplete data output from Zotero, which affects citation formatting.

SamBam77
Messages
25
Reaction score
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
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.
 
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.
 
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:
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.
 
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)?
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
8K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
7K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
15K