
我有一個類似的問題這個帖子。
我正在嘗試將 a 添加.jpg
到.Rnw
文件中(使用 RSweave 和knitr 編譯 LaTex)。我嘗試了以下方法但沒有成功:
<<IMAG0387.jpg,fig=TRUE>>=
library(knitr)
f <- 'M:/QW Monitoring Team/GLRI toxics/Phase II/Wastewater Intensive/Sniffer/Leaf_Experiments/photos/IMAG0387.jpg'
@
\includegraphics{f}
我收到錯誤:
You can now run (pdf)latex on 'Sam_Report_Actual.tex'
Warning message:
file stem 'Sam_Report_Actual-IMAG0387.jpg' is not portable
Running pdflatex.exe on Sam_Report_Actual.tex...failed
請注意,這Sam_Report_Actual
是文件的名稱.Rnw
。我檢查了C:\Program Files (x86)\MiKTeX 2.9\miktex\bin
我的計算機,發現有 pdflatex.exe,所以我不確定發生了什麼。建議?
答案1
嘆息,既然您已經閱讀了鏈接到的帖子,為什麼您仍然寫\includegraphics{f}
(根據該帖子的答案,這顯然是錯誤的)?
請發布完整的錯誤訊息(大概在 中Sam_Report_Actual.log
),並避免使用絕對路徑(如果可能,請始終使用相對路徑)和檔案路徑中的空格(使用_
or-
代替)。