A simpler way is maybe to just use Literate to create a .ipynb notebook; open the notebook with Jupyter and click “save as”
It worked fine, then I tried to put the pdf in my Dropbox and everything went wrong. I reinstalled Atom, and now it’s working.
I did what I thought I did before, but now It’s not working.
weave("C:/Users/brett/OneDrive/Documents/", out_path=C:/Users/brett/OneDrive/Documents/ECON214Assignment3.pdf, doctype="md2pdf")
I forget how to do this. This is what I have
I’m not sure whether you’re asking a question or stating something? Note that in your quote:
- your path specification seems odd, afaik on windows you need reverse
\but I don’t use windows so I don’t know
- the second kwarg will definitely not work, you need
- are you giving the entire
weaveto process ?
Btw I think at this point it might make more sense if you open an issue directly on Weave with your problems, it might encourage them to improve the docs for windows users maybe (and/or you could suggest such improvements)
Although ‘\’ is the standard path separator for Windows, almost all software will accept ‘/’ as path separator. This particular point is unlikely to be the problem here.
I actually went in by hand and changed every one of those, the Windows way shows up red in the editor, and always gives an error message. Same in R.
Did you type ‘\\’? Don’t forget that ‘\’ is an escape character, so you need two backslashes in order for the string to be interpreted with a single backslash.
It feels like there should be some kind of function to do this automatically.
I guess you can just do
julia> filename = "hello/there" "hello/there" julia> replace(filename, "/" => "\\") "hello\\there"
raw"This\is\fine\on\Windows" which I find convenient.
As I indicated above
/ is almost always correctly interpreted as a path separator in Windows programming. The only context I know where ‘\’ is required is on the DOS/PowerShell command line or in
The suggestions above (using
\\) should work, but are almost certainly irrelevant to the OP. It seems likely that some of the reputed problems are a result of syntax errors, not of the function call itself. This also applies to the replies to Problem with Weave Code, also started by @brett_knoss
It would be useful if @brett_knoss could provide not only the code used, but also the context (what is expected to happen here, what actually happens, what are the relevant input files) as well as the error messages that result.
The second and third points suggested by @tlienart are probably the relevant ones to address.
A simpler way could be to just copy/paste to one of the many online sythax highliter that support Julia…
Should we generate a package/interface containing a Path type which can produce the correct path depending on the operating system? It could also be extended to cover different schemes(URL, Tree locations, …)
Also joinpath and splitpath could be easier to write.
The expected outcome is to write a pdf file with the .jl file in it.
/ = not a unary operator
//= not a unary operator
\ = invalid escape sequence
You need to copy and paste exactly what you are writing in Julia and exactly what Julia “replies”. Put everything inside triple backticks at the beginning and end.
Yes, we (I and the others who are trying to help you) got that. The title you provided for the topic was a good one, and makes it clear what you want to achieve. But you haven’t explained enough for us to understand why it isn’t working for you.
I think one of the problems is that you haven’t learned to quote code. If you wrap code, and Julia output in sets of triple backticks, like this:
``` This text won't be formatted, and is displayed exactly the way I type it. ```
we will get a better picture of what you tried and what the result was.
So lets take a look at what I think isn’t working for you:
Based on this, I think you need to read the Weave.jl documentation more carefully.
- The first argument to
weaveshould be a string that represents the source file not a directory.
out_pathargument should be a string that represents a directory, not a file. The directory must exist before you run
weave. Note that you can also use the special symbol
:docfor this argument, so that the output lands in the same directory as the input.
What you should have used is
weave("C:/Users/brett/OneDrive/Documents/ECON214Assignment3.jl", out_path="C:/Users/brett/OneDrive/Documents", doctype="md2pdf")
I hope this helps.
weave("C:/Users/brett/OneDrive/Documents/", ECON214Assignment3.jl, out_path=C:/Users/brett/OneDrive/Documents/ECON214Assignment3.pdf, doctype="md2pdf")
the file I’m trying to weave is Econ214Assignment3.jl
the pdf I want is to be called Econ214Assignment3.pdf
It would be much more helpful if you could post error messages more. But more importantly, you it would be best for you to read the error messages. For instance, in your
out_path, above, you haven’t quoted your strings, which is probably going to give you an error.