Comments (2)
Hi, this is an issue due to how Windows represents directories paths.
While Operating Systems based on Unix (such as Linux and Max OS) uses the slash (/
) to separate the parts of a path, Windows uses the backslash (\
).
So, the file you want to open, in a Unix based OS is represented as docs/_main.pdf
, while in Windows it is represented as docs\_main.pdf
.
Given that in R \
is used as an escape character (for representing special characters like \n
or \t
), you have to write your path as docs\\_main.pdf
. This way, \\
is used to represent the single backslash in the path.
I fixed this issue modifying the Makefile
replacing Rscript -e 'browseURL("docs/_main.pdf")'
at line 4 with Rscript -e 'browseURL(ifelse(.Platform[["OS.type"]] == "windows", "docs\\_main.pdf", "docs/_main.pdf"))'
On R, .Platform[["OS.type"]]
will return "windows"
if R is running on Windows and "unix"
if R is running on Linux or Mac OS.
This is the whole Makefile
with the fix on pdf, gitbook and word:
pdf:
Rscript -e 'options(bookdown.render.file_scope = FALSE); bookdown::render_book("index.Rmd", output_format = "bookdown::pdf_book")'
rm -f *.log *.mtc* *.maf *.aux *.bcf *.lof *.lot *.out *.toc front-and-back-matter/abbreviations.aux
Rscript -e 'browseURL(ifelse(.Platform[["OS.type"]] == "windows", "docs\\_main.pdf", "docs/_main.pdf"))'
gitbook:
Rscript -e 'options(bookdown.render.file_scope = FALSE); bookdown::render_book("index.Rmd", output_format = "bookdown::gitbook")'
Rscript -e 'browseURL(ifelse(.Platform[["OS.type"]] == "windows", "docs\\index.html", "docs/index.html"))'
word:
Rscript -e 'options(bookdown.render.file_scope = FALSE); bookdown::render_book("index.Rmd", output_format = "bookdown::word_document2")'
Rscript -e 'browseURL(ifelse(.Platform[["OS.type"]] == "windows", "docs\\_main.docx", "docs/_main.docx"))'
clean:
rm -f *.log *.mtc* *.maf *.aux *.bbl *.blg *.xml
clean-knits:
rm -f *.docx *.html *.pdf *.log *.maf *.mtc* *.tex *.toc *.out *.lof *.lot *.bcf *.aux
rm -R *_files
rm -R *_cache
from oxforddown.
Thanks for flagging this issue!
I've just pushed a fix - the Makefile now uses the here
package to build the filepath, which should ensure cross-platform compatibility (I tested it on Mac OS and Windows 10).
Can you try downloading the latest version from GitHub and checking it it works?
from oxforddown.
Related Issues (20)
- "Render" output HOT 2
- Problem with number of authors and the et al. abbreviation HOT 1
- Figure caption placement HOT 2
- package โxelatexโ is not available for this version of R HOT 1
- Linespacing varies amongst pages HOT 8
- Table of contents preventing the LaTeX from compiling for PDF output HOT 5
- if show-abstract-in-toc: true, Abstract TOC hyperlink is to Acknowledgements HOT 1
- Cannot find font information and ways to change it HOT 1
- remove the page breaks for each chapter HOT 1
- Issues with pandoc-citeproc in oxforddown HOT 2
- Compilation problems HOT 4
- Adapting headings to local language
- Cannot Knit
- how create numbered examples HOT 1
- Note below figure in graphic environment
- Minitocs shift pages through the space they take up but don't adjust for this
- Missing Book Title in Bibliography Citations (citing book section)
- How to change font style
- cleaning auxiliary files when knitting single chapter HOT 2
- fresh downloaded oxforddown not building HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oxforddown.