Comments (12)
You should probably provide more detail on how you are exporting. If you are using C-c e l L then citet:&merker-2022-machin-learn
should export to \citet{merker-2022-machin-learn}
. If LaTeX is your goal, this is the preferred way to export.
If you use C-c e r l instead then you will get a full citeprocitem via CSL. There is not a one to one mapping with CSL to the LaTeX cite commands, or feature parity with this option.
from org-ref.
I am specifically exporting to pdf with C-c e r p. Is there a way to configure org-ref to the desired behaviour?
from org-ref.
C-c C-e l o should work out of the box to get a pdf via LaTeX.
from org-ref.
C-c C-e l o gives me undefined citations, as the bibliography file reference is not properly exported to latex (bibliography:bibliography.bib in the org file gets exported to /bibliography{bibliography} in the tex file).
How would I go modifying the behaviour of citeprocitem to properly show year when using citet:
?
from org-ref.
I assume you mean \bibliography{bibliography}
. That is probably correct. if you have undefined citations, it could mean you are missing some entries that are in another file, or there is some issue with the entries in the bib file. you should share a small example that shows the problem.
from org-ref.
Using the following in my org file:
#+title: Cite
[[citet:&zimmermannClimaticExtremesImprove2009]]
- References
bibliographystyle:chicago
bibliography:bibliography.bib
I get the following .tex output when exporting using C-c e r p
:
% Created 2022-11-30 Wed 16:37
% Intended LaTeX compiler: pdflatex
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\makeatletter
\newcommand{\citeprocitem}[2]{\hyper@linkstart{cite}{citeproc_bib_item_#1}#2\hyper@linkend}
\makeatother
\author{Ward Fonteyn}
\date{\today}
\title{Cite}
\hypersetup{
pdfauthor={Ward Fonteyn},
pdftitle={Cite},
pdfkeywords={},
pdfsubject={},
pdfcreator={Emacs 28.1 (Org mode 9.6)},
pdflang={English}}
\begin{document}\maketitle
\tableofcontentsZimmermann et al. \citeprocitem{1}{Zimmermann et al. 2009}
\section{References}
\label{sec:org72b5651}\bibliographystyle{chicago}
\hypertarget{citeproc_bib_item_1}{Zimmermann, Niklaus E., Nigel G. Yoccoz, Thomas C. Edwards, Eliane S. Meier, Wilfried Thuiller, Antoine Guisan, Dirk R. Schmatz, and Peter B. Pearman. 2009. โClimatic Extremes Improve Predictions of Spatial Patterns of Tree Species.โ \textit{Proceedings of the National Academy of Sciences} 106 (supplement\_2). Proceedings of the National Academy of Sciences: 19723โ28. doi:\href{https://doi.org/10.1073/pnas.0901643106}{10.1073/pnas.0901643106}.}
\end{document}
and get this in my pdf:
instead of the expected "Zimmermann et al. (2009)"
from org-ref.
can you share the bib file? or at least the entry in question? It does not make sense to go through CSL for export to PDF via Latex. It is certainly better to let latex do the work.
from org-ref.
This is the bib file contents:
@Article{zimmermannClimaticExtremesImprove2009,
title = {Climatic Extremes Improve Predictions of Spatial Patterns of Tree Species},
author = {Zimmermann, Niklaus E. and Yoccoz, Nigel G. and Edwards, Thomas C. and Meier, Eliane S. and Thuiller, Wilfried and Guisan, Antoine and Schmatz, Dirk R. and Pearman, Peter B.},
year = {2009},
month = nov,
journal = {Proceedings of the National Academy of Sciences},
volume = {106},
number = {supplement_2},
pages = {19723--19728},
publisher = {{Proceedings of the National Academy of Sciences}},
doi = {10.1073/pnas.0901643106},
file = {/home/wardfont/bibliography/bibtex-pdfs/zimmermannClimaticExtremesImprove2009.pdf}
}
@Article is not capitalised in the file, but here is formatted that way.
I appreciate your time helping me.
from org-ref.
Maybe the problem is citet is not a native cite command in latex, and you have to use the natbib package to get it defined.
You need to add the natbib package like this:
Then for this:
with (setq org-latex-pdf-process (list "latexmk -shell-escape -bibtex -f -pdf %f"))
#+title: Cite
#+latex_header: \usepackage{natbib}
#+options: toc:nil
See [[citet:&zimmermannClimaticExtremesImprove2009]]
bibliographystyle:chicago
bibliography:bibliography.bib
from org-ref.
Adding the natbib package does fix the export using "C-c e l o". The same issue is still present when using "C-c e l r" however.
I will be using the former option from now on. Thank you for your time and this wonderful package!
from org-ref.
The same issue is also present when exporting to html, odt or word format using "C-c e r"
from org-ref.
The issue is there are two exporters: latex and CSL, and they do not support all options of each other. Latex is the best imo for org-ref, as I wrote it to provide near complete support of latex for citation rendering.
CSL is a different approach to citation rendering, and it does not use the latex citation commands. That means you can only ever get close to what latex does, and somethings are not even possible right now when using csl. Adding natbib has no effect on CSL export because it does not use any of the latex capabilities, you have to rely on an incomplete mapping of CSL to the latex cite commands.
anyway, the short version is for latex, use the latex exporter commands and you will get what you want. For everything else, use the org-ref CSL exporter, but stick to simpler cite commands.
from org-ref.
Related Issues (20)
- org-ref-get-bibtex-key-under-cursor returns nil instead of a list of keys HOT 4
- Referencing equations added with align environment HOT 12
- A typo in org-ref-citation-links HOT 1
- Export PDF without reference citations on M1 MacOS sonoma HOT 4
- Applying #+ATTR_ODT attributes to bibliography link HOT 1
- citet: produces duplicate author name HOT 5
- Error (use-package): org-ref/:catch: Cannot open load file: No such file or directory, request HOT 2
- cannot require org-ref HOT 8
- Slow editing of sentences with acronym links HOT 4
- page numbers ignored HOT 3
- `arxiv-get-bibtex-entry-via-arxiv-api` fails for entries with inactive related doi HOT 1
- Warning with org-ref package related to openalex.el HOT 11
- Bibliography is not exported if the last included org file ends with ``:noexport:`` tagged section. HOT 3
- PDF download from arxiv stopped working HOT 1
- Could org-ref support open HTMl files with eww/Xwidget? HOT 1
- OpenAlex: [error] request-default-error-callback HOT 3
- Export to non-LaTeX formats does not honor labels set with #+name: HOT 6
- Error loading org-ref-latex HOT 10
- arxiv-get-pdf-add-bibtex-entry goes to doi.org for particular arxiv id HOT 1
- Org-ref seems to not find entries in my bib file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from org-ref.