mirror of https://github.com/mpastell/Weave.jl
commit
589e1ce3d1
|
@ -1,18 +0,0 @@
|
|||
using Weave
|
||||
using Test
|
||||
|
||||
cleanup = true
|
||||
|
||||
#Test hold and term options
|
||||
weave("documents/test_hold.mdw", doctype="pandoc", plotlib="Gadfly")
|
||||
result = read("documents/test_hold.md", String)
|
||||
ref = read("documents/test_hold_ref.md", String)
|
||||
@test result == ref
|
||||
cleanup && rm("documents/test_hold.md")
|
||||
|
||||
#Test setting and restoring chunk options
|
||||
Weave.weave("documents/default_opts.noweb", doctype = "tex")
|
||||
result = read("documents/default_opts.tex", String)
|
||||
ref = read("documents/default_opts_ref.tex", String)
|
||||
@test result == ref
|
||||
cleanup && rm("documents/default_opts.tex")
|
|
@ -1,30 +0,0 @@
|
|||
|
||||
|
||||
<<>>=
|
||||
using Gadfly
|
||||
print(1:10)
|
||||
plot(x = 1:10)
|
||||
@
|
||||
|
||||
<<>>=
|
||||
import Weave
|
||||
Weave.set_chunk_defaults(Dict{Symbol, Any}(
|
||||
:out_width => "\\0.5linewidth",
|
||||
:results => "tex"
|
||||
))
|
||||
@
|
||||
|
||||
<<>>=
|
||||
print(1:10)
|
||||
plot(x = 1:10)
|
||||
@
|
||||
|
||||
|
||||
<<echo = false>>=
|
||||
Weave.restore_chunk_defaults()
|
||||
@
|
||||
|
||||
<<>>=
|
||||
print(1:10)
|
||||
plot(x = 1:10)
|
||||
@
|
|
@ -1,43 +0,0 @@
|
|||
\begin{juliacode}
|
||||
using Gadfly
|
||||
print(1:10)
|
||||
\end{juliacode}
|
||||
\begin{juliaout}
|
||||
1:10
|
||||
\end{juliaout}
|
||||
|
||||
\begin{juliacode}
|
||||
plot(x = 1:10)
|
||||
\end{juliacode}
|
||||
\includegraphics[width=\linewidth]{figures/default_opts_1_1.pdf}
|
||||
|
||||
\begin{juliacode}
|
||||
import Weave
|
||||
Weave.set_chunk_defaults(Dict{Symbol, Any}(
|
||||
:out_width => "\\0.5linewidth",
|
||||
:results => "tex"
|
||||
))
|
||||
\end{juliacode}
|
||||
|
||||
\begin{juliacode}
|
||||
print(1:10)
|
||||
\end{juliacode}
|
||||
1:10
|
||||
|
||||
\begin{juliacode}
|
||||
plot(x = 1:10)
|
||||
\end{juliacode}
|
||||
\includegraphics[width=\0.5linewidth]{figures/default_opts_3_1.pdf}
|
||||
|
||||
|
||||
\begin{juliacode}
|
||||
print(1:10)
|
||||
\end{juliacode}
|
||||
\begin{juliaout}
|
||||
1:10
|
||||
\end{juliaout}
|
||||
|
||||
\begin{juliacode}
|
||||
plot(x = 1:10)
|
||||
\end{juliacode}
|
||||
\includegraphics[width=\linewidth]{figures/default_opts_5_1.pdf}
|
|
@ -1,67 +0,0 @@
|
|||
|
||||
# Default
|
||||
|
||||
<<>>=
|
||||
using Gadfly
|
||||
x = 1:10
|
||||
plot(x = x, y = x)
|
||||
print(x)
|
||||
plot(x = x, y = x)
|
||||
display(x)
|
||||
@
|
||||
|
||||
# Terminal
|
||||
|
||||
<<term=true>>=
|
||||
using Gadfly
|
||||
x = 1:10
|
||||
plot(x = x, y = x)
|
||||
print(x)
|
||||
plot(x = x, y = x)
|
||||
display(x)
|
||||
@
|
||||
|
||||
# Prompt
|
||||
|
||||
<<term=true; prompt="\njulietta> ">>=
|
||||
using Gadfly
|
||||
x = 1:10
|
||||
plot(x = x, y = x)
|
||||
print(x)
|
||||
plot(x = x, y = x)
|
||||
display(x)
|
||||
@
|
||||
|
||||
# Display
|
||||
|
||||
<<display=true>>=
|
||||
using Gadfly
|
||||
x = 1:10
|
||||
plot(x = x, y = x)
|
||||
print(x)
|
||||
plot(x = x, y = x)
|
||||
display(x)
|
||||
@
|
||||
|
||||
# Both display and term
|
||||
|
||||
<<display=true;term=true>>=
|
||||
using Gadfly
|
||||
x = 1:10
|
||||
plot(x = x, y = x)
|
||||
print(x)
|
||||
plot(x = x, y = x)
|
||||
display(x)
|
||||
@
|
||||
|
||||
|
||||
# Hold results
|
||||
|
||||
<<hold=true>>=
|
||||
using Gadfly
|
||||
x = 1:10
|
||||
plot(x = x, y = x)
|
||||
print(x)
|
||||
plot(x = x, y = x)
|
||||
display(x)
|
||||
@
|
|
@ -1,232 +0,0 @@
|
|||
|
||||
# Default
|
||||
|
||||
~~~~{.julia}
|
||||
using Gadfly
|
||||
x = 1:10
|
||||
plot(x = x, y = x)
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
![](figures/test_hold_1_1.png)\
|
||||
|
||||
|
||||
~~~~{.julia}
|
||||
print(x)
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
~~~~
|
||||
1:10
|
||||
~~~~
|
||||
|
||||
|
||||
|
||||
~~~~{.julia}
|
||||
plot(x = x, y = x)
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
![](figures/test_hold_1_2.png)\
|
||||
|
||||
|
||||
~~~~{.julia}
|
||||
display(x)
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
~~~~
|
||||
1:10
|
||||
~~~~
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Terminal
|
||||
|
||||
~~~~{.julia}
|
||||
julia> using Gadfly
|
||||
|
||||
julia> x = 1:10
|
||||
1:10
|
||||
|
||||
julia> plot(x = x, y = x)
|
||||
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
![](figures/test_hold_2_1.png)\
|
||||
|
||||
|
||||
~~~~{.julia}
|
||||
julia> print(x)
|
||||
1:10
|
||||
julia> plot(x = x, y = x)
|
||||
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
![](figures/test_hold_2_2.png)\
|
||||
|
||||
|
||||
~~~~{.julia}
|
||||
julia> display(x)
|
||||
1:10
|
||||
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Prompt
|
||||
|
||||
~~~~{.julia}
|
||||
julietta> using Gadfly
|
||||
|
||||
julietta> x = 1:10
|
||||
1:10
|
||||
|
||||
julietta> plot(x = x, y = x)
|
||||
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
![](figures/test_hold_3_1.png)\
|
||||
|
||||
|
||||
~~~~{.julia}
|
||||
julietta> print(x)
|
||||
1:10
|
||||
julietta> plot(x = x, y = x)
|
||||
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
![](figures/test_hold_3_2.png)\
|
||||
|
||||
|
||||
~~~~{.julia}
|
||||
julietta> display(x)
|
||||
1:10
|
||||
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Display
|
||||
|
||||
~~~~{.julia}
|
||||
using Gadfly
|
||||
x = 1:10
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
~~~~
|
||||
1:10
|
||||
~~~~
|
||||
|
||||
|
||||
|
||||
~~~~{.julia}
|
||||
plot(x = x, y = x)
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
![](figures/test_hold_4_1.png)\
|
||||
|
||||
|
||||
~~~~{.julia}
|
||||
print(x)
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
~~~~
|
||||
1:10
|
||||
~~~~
|
||||
|
||||
|
||||
|
||||
~~~~{.julia}
|
||||
plot(x = x, y = x)
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
![](figures/test_hold_4_2.png)\
|
||||
|
||||
|
||||
~~~~{.julia}
|
||||
display(x)
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
~~~~
|
||||
1:10
|
||||
~~~~
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Both display and term
|
||||
|
||||
~~~~{.julia}
|
||||
julia> using Gadfly
|
||||
|
||||
julia> x = 1:10
|
||||
1:10
|
||||
|
||||
julia> plot(x = x, y = x)
|
||||
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
![](figures/test_hold_5_1.png)\
|
||||
|
||||
|
||||
~~~~{.julia}
|
||||
julia> print(x)
|
||||
1:10
|
||||
julia> plot(x = x, y = x)
|
||||
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
![](figures/test_hold_5_2.png)\
|
||||
|
||||
|
||||
~~~~{.julia}
|
||||
julia> display(x)
|
||||
1:10
|
||||
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Hold results
|
||||
|
||||
~~~~{.julia}
|
||||
using Gadfly
|
||||
x = 1:10
|
||||
plot(x = x, y = x)
|
||||
print(x)
|
||||
plot(x = x, y = x)
|
||||
display(x)
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
|
||||
~~~~
|
||||
1:101:10
|
||||
~~~~
|
||||
|
||||
|
||||
![](figures/test_hold_6_1.png)\
|
||||
|
||||
![](figures/test_hold_6_2.png)\
|
||||
|
Loading…
Reference in New Issue