Re: [心得] 利用git, git-latexdiff 輔助latex

看板LaTeX作者 (sppmg)時間7年前 (2017/02/14 00:08), 7年前編輯推噓2(200)
留言2則, 2人參與, 最新討論串3/3 (看更多)
你要不要建一個簡單的測試檔來試試,也好把它提供出來給大家測試。 我剛剛測試一下,發現 latexpand 只會將子檔原文貼上,所以如果你用的分割檔案 方法是 standalone 這類型,就會產生巢狀\documentclass \begin{document} 所以編譯就會失敗。(直接用latexmk 因為沒經過 latexpand 展開,所以沒問題。) 不過我測試過程中,latexmk 一律是顯示 XeTeX $ git latexdiff --latexmk --latexopt "-xelatex" --main article2.tex -o out3.pdf fce9f2e .............. This is XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016/Debian) (preloaded format=xelatex) restricted \write18 enabled. entering extended mode .............. (另測試於 XeTeX, Version 3.1415926-2.4-0.9998 (TeX Live 2012/Debian) , 結果一樣) 所以我也不知道為何你的會變成"This is pdfTeX"。 只能建議弄測試檔,然後用最少參數 git latexdiff --latexmk --latexopt "-xelatex" 試試看是否是 git-latexdiff 沒有將 --latexopt 傳過去了。 或是用指定pdflatex=xelatex 的方式,請參考 latexmk 說明或 http://tex.stackexchange.com/a/27483/111676 附上我測試過的其中一個版本列表 $ git --version git version 2.11.0 $ git latexdiff --version v1.1.4-20-g2bd8931 $ latexdiff --version This is LATEXDIFF 1.1.1 (Algorithm::Diff 1.15 fast, Perl v5.24.1) $ latexpand --version latexpand version v1.3. $ latexmk --version Latexmk, John Collins, 1 January 2015. Version 4.41 $ xelatex --version XeTeX 3.14159265-2.6-0.99996 (TeX Live 2016/Debian) ※ 引述《cgjosephlee (JLee)》之銘言: : 大家好 : 最近在做論文最後的修飾,老闆要看不同版本的差別 : 所以找到了這個script,但一直不成功 : 我是用mac TexLive 2016, 用sublime text 3編輯與compile,用git管理 : git-latexdiff是用homebrew安裝的,v1.1.4 : ST3 compile的指令: : latexmk -xelatex -f -cd -interaction=nonstopmode thesis.tex : 是可以成功compile的 : 但用git-latexdiff時 : git-latexdiff --main thesis.tex --ignore-makefile --latexmk --latexopt "-xelatex -f -interaction=nonstopmode" -o thesis.diff.pdf db0f915 : 一直跑不出來 : Error code (partial): : This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex) : restricted \write18 enabled. : entering extended mode : Latexmk: Log file says no output from latex : Latexmk: For rule 'pdflatex', no output was made : Failure to make 'thesis.pdf' : Collected error summary (may duplicate other messages): : pdflatex: Command for 'pdflatex' gave return code 256 : No PDF file generated. : PDF file generated is empty. : Error during compilation. Please examine and cleanup if needed: : Directory: /tmp/git-latexdiff.69107/new/. : File: thesis.tex : 看起來好像不是用xelatex跑會是失敗的原因嗎? : 另外我的結構是由一個thesis.tex去include各個chapter的.tex : 會是git-latexdiff不支援這樣的結構嗎? : ※ 引述《sppmg (sppmg)》之銘言: : : 主要的內容整理到下面網址了。 : : http://www.slideshare.net/sppmg/latex-with-git : : 簡單的說就是利用下面一行指令 : : git latexdiff --latexmk --latexopt "-xelatex" : : --main main.tex master dev : : 就可以生成兩個版本的pdf差異檔。 : : 細節以及安裝請見投影片囉! : : (我用Debian,windows可能要試一下。 : : 除git,latex外的工具中,git-latexdiff 是bash script,其餘是perl) -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.32.188.151 ※ 文章網址: https://www.ptt.cc/bbs/LaTeX/M.1487002108.A.6A1.html ※ 編輯: sppmg (114.32.188.151), 02/14/2017 00:21:22

02/14 17:23, , 1F
先用土砲的方式處理了 晚點有空再測試看看
02/14 17:23, 1F

02/26 13:58, , 2F
我的latexmk也一直傳不過後面那個option
02/26 13:58, 2F
文章代碼(AID): #1OeTdyQX (LaTeX)
文章代碼(AID): #1OeTdyQX (LaTeX)