jkitchin / org-ref

org-mode modules for citations, cross-references, bibliographies in org-mode and useful bibtex tools to go with it.
GNU General Public License v3.0
1.35k stars 242 forks source link

Issue with exporting to pdf with table citation #1076

Closed nigo81 closed 1 year ago

nigo81 commented 1 year ago

When i export org to pdf, the table citation display as question mark.

this is my org-file:

:PROPERTIES:
:ID:       fbe28bbc-c4d0-4c7e-b625-1c51718e6775
:mtime:    20230506113621
:ctime:    20230506111845
:END:
#+OPTIONS: prop:nil

#+title: test

* Introduction

This is an example of using org-ref v3 to manage citations, tables and figures in an org-mode document.

ref:example-table

* Methods

Here is an example table:

#+NAME: example-table
#+CAPTION: Example table
| Column 1 | Column 2 |
|----------+----------|
| A        | B        |
| C        | D        |

I use C-c C-e r p to export pdf: image the refer table info ref:example-table don't display.

How can i show table refer correctly? Thanks

jkitchin commented 1 year ago

I guess this is a latex problem where there is an error and it doesn't get to finish resolving cross-references. Most likely due to some package that requires -shell-escape to compile correctly (usually minted) that is included by default.

One solution is to use this for the process to solve it:

(setq org-latex-pdf-process '("latexmk -shell-escape -f -pdf -%latex -interaction=nonstopmode -output-directory=%o %f"))

another is to modify the default packages to remove minted.

nigo81 commented 1 year ago

I guess this is a latex problem where there is an error and it doesn't get to finish resolving cross-references. Most likely due to some package that requires -shell-escape to compile correctly (usually minted) that is included by default.

One solution is to use this for the process to solve it:

(setq org-latex-pdf-process '("latexmk -shell-escape -f -pdf -%latex -interaction=nonstopmode -output-directory=%o %f"))

another is to modify the default packages to remove minted.

I use your config ,but not work. Thanks very much for your help anyway. my org-ref config is

(use-package org-ref
  :ensure t
  :init
  (setq bibtex-autokey-year-length 4
    bibtex-autokey-name-year-separator "-"
    bibtex-autokey-year-title-separator "-"
    bibtex-autokey-titleword-separator "-"
    bibtex-autokey-titlewords 2
    bibtex-autokey-titlewords-stretch 1
    bibtex-autokey-titleword-length 5)
  (define-key org-mode-map (kbd "C-c n r") 'org-ref-cite-insert-helm)
  (setq org-latex-pdf-process '("latexmk -shell-escape -f -pdf -%latex -interaction=nonstopmode -output-directory=%o %f"))
)

(setq zot_bib '("~/Documents/books/zotero/reading.bib") ; Zotero .bib 文件
      zot_pdf "~/Documents/books/zoteropdf"; Zotero 同步文件夹
      org_notes "~/Documents/orgnotes/references" ) ; org-roam 文献笔记目录

(use-package helm-bibtex
  :after org-roam
  :custom
  (bibtex-completion-notes-path org_notes)
  (bibtex-completion-bibliography zot_bib)
  (bibtex-completion-library-path zot_pdf))

(use-package org-roam-bibtex
  :after org-roam
  :hook (org-roam-mode . org-roam-bibtex-mode)
  :bind
  (("C-c n R" . orb-insert-link))
  :custom
  (orb-insert-interface 'helm-bibtex)
  (orb-insert-link-description 'citekey)
  (orb-preformat-keywords
   '("citekey" "title" "url" "author-or-editor" "keywords" "file"))
  (orb-process-file-keyword t)
  (orb-attached-file-extensions '("pdf"))
  :config
  (require 'org-ref) ; optional: if using Org-ref v2 or v3 citation links
)
jkitchin commented 1 year ago

you should see what happens when you build the latex file manually, or check the contents of the buffer *Org PDF LaTeX Output*. Probably you have some error in latex that is not working, e.g. a missing package or something.

nigo81 commented 1 year ago

you should see what happens when you build the latex file manually, or check the contents of the buffer *Org PDF LaTeX Output*. Probably you have some error in latex that is not working, e.g. a missing package or something.

sorry, I'm not familiar with the process and latex.I check the Org PDF LaTeX Output shows that:

Rc files read:
  NONE
Latexmk: This is Latexmk, John Collins, 4 Apr. 2023. Version 4.80.
No existing .aux file, so I'll make a simple one, and require run of *latex.
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex':  Reasons for rerun
Category 'other':
  Rerun of 'pdflatex' forced or previously required

------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex  -shell-escape -interaction=nonstopmode -recorder  "20230506111845-test.tex"'
------------
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=pdflatex)
 \write18 enabled.
entering extended mode
(./20230506111845-test.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-04-20>
(/opt/texlive/2023/texmf-dist/tex/latex/base/article.cls
Document Class: article 2022/07/02 v1.4n Standard LaTeX document class
(/opt/texlive/2023/texmf-dist/tex/latex/base/size11.clo))
(/opt/texlive/2023/texmf-dist/tex/latex/base/inputenc.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/base/fontenc.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/graphics/graphicx.sty
(/opt/texlive/2023/texmf-dist/tex/latex/graphics/keyval.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/graphics/graphics.sty
(/opt/texlive/2023/texmf-dist/tex/latex/graphics/trig.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/opt/texlive/2023/texmf-dist/tex/latex/graphics-def/pdftex.def)))
(/opt/texlive/2023/texmf-dist/tex/latex/tools/longtable.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/wrapfig/wrapfig.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/graphics/rotating.sty
(/opt/texlive/2023/texmf-dist/tex/latex/base/ifthen.sty))
(/opt/texlive/2023/texmf-dist/tex/generic/ulem/ulem.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/opt/texlive/2023/texmf-dist/tex/latex/amsmath/amstext.sty
(/opt/texlive/2023/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/opt/texlive/2023/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/capt-of/capt-of.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/hyperref/hyperref.sty
(/opt/texlive/2023/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty)
(/opt/texlive/2023/texmf-dist/tex/generic/iftex/iftex.sty)
(/opt/texlive/2023/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
(/opt/texlive/2023/texmf-dist/tex/generic/infwarerr/infwarerr.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty)
(/opt/texlive/2023/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty)
(/opt/texlive/2023/texmf-dist/tex/generic/pdfescape/pdfescape.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/hycolor/hycolor.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/auxhook/auxhook.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/hyperref/nameref.sty
(/opt/texlive/2023/texmf-dist/tex/latex/refcount/refcount.sty)
(/opt/texlive/2023/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty
(/opt/texlive/2023/texmf-dist/tex/latex/kvoptions/kvoptions.sty)))
(/opt/texlive/2023/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/hyperref/pd1enc.def)
(/opt/texlive/2023/texmf-dist/tex/generic/intcalc/intcalc.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/hyperref/puenc.def)
(/opt/texlive/2023/texmf-dist/tex/latex/url/url.sty)
(/opt/texlive/2023/texmf-dist/tex/generic/bitset/bitset.sty
(/opt/texlive/2023/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/base/atbegshi-ltx.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/hyperref/hpdftex.def
(/opt/texlive/2023/texmf-dist/tex/latex/base/atveryend-ltx.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty
(/opt/texlive/2023/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty)))
(/opt/texlive/2023/texmf-dist/tex/latex/minted/minted.sty
(/opt/texlive/2023/texmf-dist/tex/latex/fvextra/fvextra.sty
(/opt/texlive/2023/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/upquote/upquote.sty
(/opt/texlive/2023/texmf-dist/tex/latex/base/textcomp.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/lineno/lineno.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/tools/calc.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/tools/shellesc.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/ifplatform/ifplatform.sty
(/opt/texlive/2023/texmf-dist/tex/generic/catchfile/catchfile.sty
(/opt/texlive/2023/texmf-dist/tex/generic/etexcmds/etexcmds.sty))
(/opt/texlive/2023/texmf-dist/tex/generic/iftex/ifluatex.sty)
(./20230506111845-test.w18))
(/opt/texlive/2023/texmf-dist/tex/generic/xstring/xstring.sty
(/opt/texlive/2023/texmf-dist/tex/generic/xstring/xstring.tex))
(/opt/texlive/2023/texmf-dist/tex/latex/framed/framed.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/float/float.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/xcolor/xcolor.sty
(/opt/texlive/2023/texmf-dist/tex/latex/graphics-cfg/color.cfg)
(/opt/texlive/2023/texmf-dist/tex/latex/graphics/mathcolor.ltx))/usr/bin/pygmentize

(/opt/texlive/2023/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
(./20230506111845-test.aux)
(/opt/texlive/2023/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/opt/texlive/2023/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
(/opt/texlive/2023/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
(/opt/texlive/2023/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/opt/texlive/2023/texmf-dist/tex/latex/amsfonts/umsb.fd)
No file 20230506111845-test.toc.

Overfull \hbox (17.07358pt too wide) in paragraph at lines 34--37
[]\T1/cmr/m/n/10.95 :ID: fbe28bbc-c4d0-4c7e-b625-1c51718e6775 :mtime: 202305071
60242 :ctime:

LaTeX Warning: Reference `example-table' on page 1 undefined on input line 43.

[1{/opt/texlive/2023/texmf-var/fonts/map/pdftex/updmap/pdftex.map}{/opt/texlive
/2023/texmf-dist/fonts/enc/dvips/cm-super/cm-super-t1.enc}
pdfTeX warning (ext4): destination with the same identifier (name{table.1}) has
 been already used, duplicate ignored
<argument> ...shipout:D \box_use:N \l_shipout_box 
                                                  \__shipout_drop_firstpage_...
l.61 \end{document}
                   ] (./20230506111845-test.aux)

LaTeX Warning: There were undefined references.

LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.

Package rerunfilecheck Warning: File `20230506111845-test.out' has changed.
(rerunfilecheck)                Rerun to get outlines right
(rerunfilecheck)                or use package `bookmark'.

 )
(see the transcript file for additional information)</opt/texlive/2023/texmf-di
st/fonts/type1/public/cm-super/sfbx1095.pfb></opt/texlive/2023/texmf-dist/fonts
/type1/public/cm-super/sfbx1440.pfb></opt/texlive/2023/texmf-dist/fonts/type1/p
ublic/cm-super/sfrm1095.pfb></opt/texlive/2023/texmf-dist/fonts/type1/public/cm
-super/sfrm1200.pfb></opt/texlive/2023/texmf-dist/fonts/type1/public/cm-super/s
frm1728.pfb>
Output written on 20230506111845-test.pdf (1 page, 68584 bytes).
Transcript written on 20230506111845-test.log.
Latexmk: Missing input file '20230506111845-test.toc' (or dependence on it) from following:
  No file 20230506111845-test.toc.
Latexmk: Getting log file '20230506111845-test.log'
Latexmk: Examining '20230506111845-test.fls'
Latexmk: Examining '20230506111845-test.log'
Latexmk: References changed.
Latexmk: References changed.
Latexmk: Log file says output to '20230506111845-test.pdf'
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex':  Reasons for rerun
Changed files or newly in use/created:
  20230506111845-test.aux
  20230506111845-test.out
  20230506111845-test.toc

------------
Run number 2 of rule 'pdflatex'
------------
------------
Running 'pdflatex  -shell-escape -interaction=nonstopmode -recorder  "20230506111845-test.tex"'
------------
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=pdflatex)
 \write18 enabled.
entering extended mode
(./20230506111845-test.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2023-04-20>
(/opt/texlive/2023/texmf-dist/tex/latex/base/article.cls
Document Class: article 2022/07/02 v1.4n Standard LaTeX document class
(/opt/texlive/2023/texmf-dist/tex/latex/base/size11.clo))
(/opt/texlive/2023/texmf-dist/tex/latex/base/inputenc.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/base/fontenc.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/graphics/graphicx.sty
(/opt/texlive/2023/texmf-dist/tex/latex/graphics/keyval.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/graphics/graphics.sty
(/opt/texlive/2023/texmf-dist/tex/latex/graphics/trig.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/opt/texlive/2023/texmf-dist/tex/latex/graphics-def/pdftex.def)))
(/opt/texlive/2023/texmf-dist/tex/latex/tools/longtable.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/wrapfig/wrapfig.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/graphics/rotating.sty
(/opt/texlive/2023/texmf-dist/tex/latex/base/ifthen.sty))
(/opt/texlive/2023/texmf-dist/tex/generic/ulem/ulem.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/opt/texlive/2023/texmf-dist/tex/latex/amsmath/amstext.sty
(/opt/texlive/2023/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/opt/texlive/2023/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/capt-of/capt-of.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/hyperref/hyperref.sty
(/opt/texlive/2023/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty)
(/opt/texlive/2023/texmf-dist/tex/generic/iftex/iftex.sty)
(/opt/texlive/2023/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
(/opt/texlive/2023/texmf-dist/tex/generic/infwarerr/infwarerr.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty)
(/opt/texlive/2023/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty)
(/opt/texlive/2023/texmf-dist/tex/generic/pdfescape/pdfescape.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/hycolor/hycolor.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/letltxmacro/letltxmacro.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/auxhook/auxhook.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/hyperref/nameref.sty
(/opt/texlive/2023/texmf-dist/tex/latex/refcount/refcount.sty)
(/opt/texlive/2023/texmf-dist/tex/generic/gettitlestring/gettitlestring.sty
(/opt/texlive/2023/texmf-dist/tex/latex/kvoptions/kvoptions.sty)))
(/opt/texlive/2023/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/hyperref/pd1enc.def)
(/opt/texlive/2023/texmf-dist/tex/generic/intcalc/intcalc.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/hyperref/puenc.def)
(/opt/texlive/2023/texmf-dist/tex/latex/url/url.sty)
(/opt/texlive/2023/texmf-dist/tex/generic/bitset/bitset.sty
(/opt/texlive/2023/texmf-dist/tex/generic/bigintcalc/bigintcalc.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/base/atbegshi-ltx.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/hyperref/hpdftex.def
(/opt/texlive/2023/texmf-dist/tex/latex/base/atveryend-ltx.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/rerunfilecheck/rerunfilecheck.sty
(/opt/texlive/2023/texmf-dist/tex/generic/uniquecounter/uniquecounter.sty)))
(/opt/texlive/2023/texmf-dist/tex/latex/minted/minted.sty
(/opt/texlive/2023/texmf-dist/tex/latex/fvextra/fvextra.sty
(/opt/texlive/2023/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/upquote/upquote.sty
(/opt/texlive/2023/texmf-dist/tex/latex/base/textcomp.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/lineno/lineno.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/tools/calc.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/tools/shellesc.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/ifplatform/ifplatform.sty
(/opt/texlive/2023/texmf-dist/tex/generic/catchfile/catchfile.sty
(/opt/texlive/2023/texmf-dist/tex/generic/etexcmds/etexcmds.sty))
(/opt/texlive/2023/texmf-dist/tex/generic/iftex/ifluatex.sty)
(./20230506111845-test.w18))
(/opt/texlive/2023/texmf-dist/tex/generic/xstring/xstring.sty
(/opt/texlive/2023/texmf-dist/tex/generic/xstring/xstring.tex))
(/opt/texlive/2023/texmf-dist/tex/latex/framed/framed.sty)
(/opt/texlive/2023/texmf-dist/tex/latex/float/float.sty))
(/opt/texlive/2023/texmf-dist/tex/latex/xcolor/xcolor.sty
(/opt/texlive/2023/texmf-dist/tex/latex/graphics-cfg/color.cfg)
(/opt/texlive/2023/texmf-dist/tex/latex/graphics/mathcolor.ltx))/usr/bin/pygmentize

(/opt/texlive/2023/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
(./20230506111845-test.aux)
(/opt/texlive/2023/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/opt/texlive/2023/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
(/opt/texlive/2023/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
(./20230506111845-test.out) (./20230506111845-test.out)
(/opt/texlive/2023/texmf-dist/tex/latex/amsfonts/umsa.fd)
(/opt/texlive/2023/texmf-dist/tex/latex/amsfonts/umsb.fd)
(./20230506111845-test.toc)
Overfull \hbox (17.07358pt too wide) in paragraph at lines 34--37
[]\T1/cmr/m/n/10.95 :ID: fbe28bbc-c4d0-4c7e-b625-1c51718e6775 :mtime: 202305071
60242 :ctime:

LaTeX Warning: Reference `example-table' on page 1 undefined on input line 43.

[1{/opt/texlive/2023/texmf-var/fonts/map/pdftex/updmap/pdftex.map}{/opt/texlive
/2023/texmf-dist/fonts/enc/dvips/cm-super/cm-super-t1.enc}
pdfTeX warning (ext4): destination with the same identifier (name{table.1}) has
 been already used, duplicate ignored
<argument> ...shipout:D \box_use:N \l_shipout_box 
                                                  \__shipout_drop_firstpage_...
l.61 \end{document}
                   ] (./20230506111845-test.aux)

LaTeX Warning: There were undefined references.

 )
(see the transcript file for additional information)</opt/texlive/2023/texmf-di
st/fonts/type1/public/cm-super/sfbx1095.pfb></opt/texlive/2023/texmf-dist/fonts
/type1/public/cm-super/sfbx1440.pfb></opt/texlive/2023/texmf-dist/fonts/type1/p
ublic/cm-super/sfrm1095.pfb></opt/texlive/2023/texmf-dist/fonts/type1/public/cm
-super/sfrm1200.pfb></opt/texlive/2023/texmf-dist/fonts/type1/public/cm-super/s
frm1728.pfb>
Output written on 20230506111845-test.pdf (1 page, 72758 bytes).
Transcript written on 20230506111845-test.log.
Latexmk: ====List of undefined refs and citations:
  Reference `example-table' on page 1 undefined on input line 43
Latexmk: Getting log file '20230506111845-test.log'
Latexmk: Examining '20230506111845-test.fls'
Latexmk: Examining '20230506111845-test.log'
Latexmk: Log file says output to '20230506111845-test.pdf'
Latexmk: Summary of warnings from last run of *latex:
  Latex failed to resolve 1 reference(s)
Latexmk: All targets () are up-to-date
jkitchin commented 1 year ago

Can you put the contents of your tex file here?

also, what is this:

<argument> ...shipout:D \box_use:N \l_shipout_box 
                                                  \__shipout_drop_firstpage_...
l.61 \end{document}
nigo81 commented 1 year ago

1.contents of your tex file here

when i export pdf,it generate tex file,but i can't open it. So i press C-c C-e r l to export org to tex is:

% Created 2023-05-08 Mon 10:06
% 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}
\usepackage{minted}
\makeatletter
\newcommand{\citeprocitem}[2]{\hyper@linkstart{cite}{citeproc_bib_item_#1}#2\hyper@linkend}
\makeatother
\author{tujiabing\textsubscript{cd}}
\date{\today}
\title{test}
\hypersetup{
 pdfauthor={tujiabing\textsubscript{cd}},
 pdftitle={test},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 29.0.60 (Org mode 9.6.1)}, 
 pdflang={English}}
\begin{document}

\maketitle
\tableofcontents

:ID:       fbe28bbc-c4d0-4c7e-b625-1c51718e6775
:mtime:    20230507161220
:ctime:    20230506111845

\section{Introduction}
\label{sec:orgd354c66}

This is an example of using org-ref v3 to manage citations, tables and figures in an org-mode document.

\ref{example-table}

\section{Methods}
\label{sec:org2c5e6ef}

Here is an example table:

\begin{table}[htbp]
\caption{\label{tab:org49e665f}Example table}
\centering
\begin{tabular}{ll}
Column 1 & Column 2\\[0pt]
\hline
A & B\\[0pt]
C & D\\[0pt]
\end{tabular}
\end{table}
\end{document}

I don't know if it is useful for you.

2. what is it in above quote

<argument> ...shipout:D \box_use:N \l_shipout_box 
                                                  \__shipout_drop_firstpage_...
l.61 \end{document}

what you mentions in the quote is full content in my * org latex output* file after i export org to pdf. I don't know what's in the ellipsis.

sorry for i'm not familiar with latex, could you let me know what other information i should provide for you or tell me how to do by detail?

jkitchin commented 1 year ago

I see the issue. You need to put this in your init file (setq org-latex-prefer-user-labels t). The problem is it defaults to nil so org-mode labels your table as:

\begin{table}[htbp]
\caption{\label{tab:org49e665f}Example table}

so the ref you use is not actually defined.

nigo81 commented 1 year ago

I see the issue. You need to put this in your init file (setq org-latex-prefer-user-labels t). The problem is it defaults to nil so org-mode labels your table as:

\begin{table}[htbp]
\caption{\label{tab:org49e665f}Example table}

so the ref you use is not actually defined.

It works! I am extremely grateful for your patience and willingness to help me resolve this issue. Thank you so much for your invaluable assistance!