看板 LaTeX 關於我們 聯絡資訊
: → Marsden: \cite 應該是可行的, 不過要重新定義 \@auxout 03/05 01:03 : → Marsden: \write\@auxout{\string\bibcite{#1}{\thepointnumber}} 03/05 01:17 就像上面推文中提到的,使用 \cite 的時候他的編號是從生成的 .aux 檔中去抓出來的,所以要更動一下。 大概這樣: \def\@bibitem#1{% \item \immediate\write\@auxout{\string\bibcite{#1}{\thepointnumber}}%} 不過放置的位置要喬一下,不然會一直跟最後的 num 差 1 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.35.232 ※ 文章網址: https://www.ptt.cc/bbs/LaTeX/M.1488648548.A.2C5.html
ballII: 抱歉 我不知道這種碼要放在tex檔的哪裡 才能通過編譯 03/05 01:33
Marsden: 放在\makeatletter 和 \makeatother 之間呀 03/05 01:35
ballII: dl.dropboxusercontent.com/u/5173388/latex/cv.tex 03/05 01:40
ballII: 通不過編譯吔 03/05 01:42
ballII: 謝謝!數字差1沒關係 我可以少跑一次 或有空時想其他方法 03/05 01:52
ballII: 原來前一個跑不成是因為尾巴括號落在%之後啦XD 03/05 01:56
ㄝ抖,上面的方法是根據原文中你額外定義的計數器來作用的 不過我們似乎可以直接使用 \bibitem 的 counter https://goo.gl/gDyb3J 這樣直接更動 counter 或許更直接 不用如您上面那般額外定義一個計數器 也較不會出錯 代碼如下: ---------------------------------- %Bibliographic references \begin{thebibliography}{99} \makeatletter \setcounter{\@listctr}{8} \def\@bibitem#1{% \item \if@filesw \immediate\write\@auxout{\string\bibcite{#1}{\csname the\@listctr\endcsname}}% \fi\ignorespaces \addtocounter{\@listctr}{-2}} \makeatother \bibitem{my2017paper} my 2017 paper \bibitem{my2016paper} my 2016 paper \bibitem{my2015paper} my 2015 paper \bibitem{my2014paper} my 2014 paper \bibitem{my2011paper} my 2011 paper \end{thebibliography} ---------------------------------
ballII: 但這結果是從8往上數,不會倒數吔 03/05 02:17
因為我忘記 bibitem 本身是讓 counter 加一了 xDDD 上面這樣應該就可以了,可是這樣好像就沒差多少了0.0 ※ 編輯: Marsden (140.112.35.232), 03/05/2017 02:37:52
ballII: 好棒喔!真是太謝謝你了~ 03/05 06:01
NTUEECS: 推 03/10 01:59