0

I am totally new using Emacs. I want to generate a Pdf file using Org mode with LaTeX. I know how to use LaTeX but I dont know how to handle my situation in Org mode.

The problem is that the references do not appear after the compilation. They only have [?], and the list of references does not appear. I tried to install org-ref but wasn't successful, so I deiced to use the "default" package from Org and LaTeX.

org latex insert citation ?????????????????

I try C-c C-x [ and the minibuffer prompts for a keyword. Then I write Oliveira2017 (the keyword from my refs.bib file), and the program inserts \cite{Oliveira2017}.. Then I compile the code with C-c C-e l o, and the pdf appears. But the citations have only [?], and no references are printed.

This is my Org file.

#+latex_class: koma-article
#+latex_class_options: [captions=tableheading,a4paper, 11pt]

#+latex_header: \usepackage{graphicx}
#+lateX_header: \usepackage{natbib}

#+latex_header: \usepackage[colorlinks]{hyperref}
#+latex_header: \hypersetup{colorlinks, linkcolor=blue, urlcolor=bblue}

#+bibliography: /home/User/Projects/LatexDocuments/refs

#+title: test
#+author: Some authors
* First chapter
Testing the citations \cite{Oliveira2017}.

\bibliography{refs.bib}
\bibliographystyle{plain}

My refs.bib file is

@article{Oliveira2017,
abstract = {This work describes the development of a sustainable and low-cost sandwich composite structure made from aluminium skins and bonded to a tubular core with epoxy resin.},
annote = {DONE.},
author = {Oliveira, Pablo Resende and Bonaccorsi, Aline Maria Silva and Panzera, T{\'{u}}lio Hallak and Christoforo, Andr{\'{e}} Luis and Scarpa, Fabrizio},
doi = {10.1016/J.TWS.2017.08.013},
file = {:home/alberto/Downloads/a99339b8852ec079008ff92abd755a9f.pdf:pdf},
issn = {0263-8231},
journal = {Thin-Walled Structures},
keywords = {Analysis of variance,Bottle caps waste,Sandwich composites,Tubular honeycomb},
month = {nov},
pages = {38--45},
publisher = {Elsevier},
title = {{Sustainable sandwich composite structures made from aluminium sheets and disposed bottle caps}},
volume = {120},
year = {2017}
}

I got the bib file from Mendeley, also I am using linux. In my myInit.org file I set these things for latex:

#+begin_src emacs-lisp
    (require 'ox-latex)
    (unless (boundp 'org-latex-classes)
      (setq org-latex-classes nil))
    (add-to-list 'org-latex-classes
         '("koma-article"
           "\\documentclass{scrartcl}"
           ("\\section{%s}" . "\\section*{%s}")
           ("\\subsection{%s}" . "\\subsection*{%s}")
           ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
           ("\\paragraph{%s}" . "\\paragraph*{%s}")
           ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
  #+end_src

This last code I got from the Org manual.

Edit: i added the next code

  #+begin_src emacs-lisp
;;    (require 'ox-bibtex)
    (setq org-latex-pdf-process (list "latexmk -f -pdf %f")
  #+end_src

The code compiles without problems but still no references only [?]. Then, i uncommented the (require 'ox-bibtex) and the next error comes up File is missing: Cannot open load file, No such file or directory, ox-bibtex.

11
  • You probably need to add a run of bibtex to your org-pdf-latex-process pipeline (or better yet, use latexmk if you can). Please edit your question and add the value of the variable org-latex-pdf-process which you can see with C-h v org-latex-pdf-process.
    – NickD
    Jan 7 at 23:16
  • @NickD Thanks for your answer look, i used the next command (setq org-latex-pdf-process (list "latexmk -f -pdf %f") in the init.el and the code compiles without errors, then i compiled the org file and the problem persists (there are not references). Also i wrote (require 'ox-bibtex) and the next error appears File is missing: Cannot open load file, No such file or directory, ox-bibtex
    – alberto
    Jan 8 at 4:14
  • 1
    @NickD Thank you for your answer, i did what you mentioned before and now everything works, i think that my real problem came from counsel package (some how the package created some errors that in turn affected the compilation). Also i removed the packages you already mentioned. now everything works.
    – alberto
    Jan 8 at 17:58
  • 1
    Just as question, look when i compiled the .tex file from my terminal i used pdflatex name.tex and the next warning appears LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.. Then i run again the code and the warning is gone, but the next info appears No file OrgLatex.bbl.. I know that such file i can create it using bibtex name.tex, and then run again the pdflatex name.tex and everything goes quite nice. However, before i used Sublime text, and i just compiled my program with one single command and everything ran quite nice.
    – alberto
    Jan 8 at 18:04
  • 1
    You should add the solution as an answer to the question, and accept that solution. That causes the question to show up as solved automatically.
    – db48x
    Jan 8 at 23:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.