{"action":"created","issue":{"url":"https://api.github.com/repos/rstudio/rmarkdown/issues/536","labels_url":"https://api.github.com/repos/rstudio/rmarkdown/issues/536/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/rmarkdown/issues/536/comments","events_url":"https://api.github.com/repos/rstudio/rmarkdown/issues/536/events","html_url":"https://github.com/rstudio/rmarkdown/pull/536","id":112677335,"number":536,"title":"Use natbib or biblatex to process citations when keep_tex = TRUE","user":{"login":"yihui","id":163582,"avatar_url":"https://avatars.githubusercontent.com/u/163582?v=3","gravatar_id":"","url":"https://api.github.com/users/yihui","html_url":"https://github.com/yihui","followers_url":"https://api.github.com/users/yihui/followers","following_url":"https://api.github.com/users/yihui/following{/other_user}","gists_url":"https://api.github.com/users/yihui/gists{/gist_id}","starred_url":"https://api.github.com/users/yihui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yihui/subscriptions","organizations_url":"https://api.github.com/users/yihui/orgs","repos_url":"https://api.github.com/users/yihui/repos","events_url":"https://api.github.com/users/yihui/events{/privacy}","received_events_url":"https://api.github.com/users/yihui/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-21T20:57:13Z","updated_at":"2015-10-23T20:04:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rstudio/rmarkdown/pulls/536","html_url":"https://github.com/rstudio/rmarkdown/pull/536","diff_url":"https://github.com/rstudio/rmarkdown/pull/536.diff","patch_url":"https://github.com/rstudio/rmarkdown/pull/536.patch"},"body":"This PR was motivated from https://github.com/hadley/ggplot2-book/issues/96. LaTeX has its own solid tools to process citations (e.g. `bibtex`), and `pandoc-citeproc` does not seem to be very reliable. When a user wants to generate the tex output, we use the `--natbib` or `--biblatex` option instead of `--filter pandoc-citeproc`. In this case, I didn't figure out how I can convert the tex document to PDF using Pandoc (it seems Pandoc always parses the tex document and creates a new tex document then tries to compile it to PDF, and I don't want it to do that), so I invented a helper function `latexmk()`. Let me figure out if Pandoc has a built-in way to convert LaTeX directly to PDF without going through the steps `tex -> tex -> PDF`. Please hold on for now."},"comment":{"url":"https://api.github.com/repos/rstudio/rmarkdown/issues/comments/150676519","html_url":"https://github.com/rstudio/rmarkdown/pull/536#issuecomment-150676519","issue_url":"https://api.github.com/repos/rstudio/rmarkdown/issues/536","id":150676519,"user":{"login":"jjallaire","id":104391,"avatar_url":"https://avatars.githubusercontent.com/u/104391?v=3","gravatar_id":"","url":"https://api.github.com/users/jjallaire","html_url":"https://github.com/jjallaire","followers_url":"https://api.github.com/users/jjallaire/followers","following_url":"https://api.github.com/users/jjallaire/following{/other_user}","gists_url":"https://api.github.com/users/jjallaire/gists{/gist_id}","starred_url":"https://api.github.com/users/jjallaire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jjallaire/subscriptions","organizations_url":"https://api.github.com/users/jjallaire/orgs","repos_url":"https://api.github.com/users/jjallaire/repos","events_url":"https://api.github.com/users/jjallaire/events{/privacy}","received_events_url":"https://api.github.com/users/jjallaire/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T20:04:00Z","updated_at":"2015-10-23T20:04:00Z","body":"Okay, is this good to merge from your standpoint?\n\nOn Fri, Oct 23, 2015 at 3:59 PM, Yihui Xie <notifications@github.com> wrote:\n\n> I have added a simple helper function show_latex_error() to find the\n> error messages (lines that start with !). I have tested this PR on OS\n> X/Ubuntu/Windows with/without latexmk, and it seems to be working well. We\n> can certainly improve the latexmk() and show_latex_error() functions in\n> the future if necessary.\n>\n> One small caveat is that the biblatex package does not really work by\n> default if a .bib database is used, because we need to\n> \\usepackage[backend=bibtex]{biblatex}, but this backend option was not\n> set in Pandoc's template. The default backend for biblatex is biber,\n> which is less widely known. We may change our LaTeX template, but I guess\n> it is not worth the hassle for now and natbib should be much more popular\n> among LaTeX users.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/rstudio/rmarkdown/pull/536#issuecomment-150675517>.\n>\n"}}