forked from JunoLab/Weave.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
julia_latex.texw
51 lines (37 loc) · 1.11 KB
/
julia_latex.texw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{textgreek}
\usepackage{graphicx}
\usepackage{fancyvrb}
\usepackage{hyperref}
\DefineVerbatimEnvironment{juliaout}{Verbatim}{}
\DefineVerbatimEnvironment{juliacode}{Verbatim}{fontshape=sl}
\DefineVerbatimEnvironment{juliaterm}{Verbatim}{}
\title{Introduction to Julia Weave}
\begin{document}
\maketitle
This a sample \href{http://julialang.org/}{Julia} latex document that can
be executed using Weave. Output from code chunks and Gadfly
plots will be included in the weaved document.
This documented can be turned into Latex document with captured
result from Julia prompt.
\section*{Terminal chunk}
<<term=true>>=
x = 1:10
d = {"Weave" => "testing"}
y = [2, 4 ,8]
@
\section*{Capturing figures}
The figures and code can be included in the output.
<<fig_cap="sin(x) function."; label="sin_fun"; fig_pos="ht">>=
using Gadfly
x = linspace(0, 2π, 200)
plot(x=x, y = sin(x), Geom.line)
@
<<echo=false; fig_cap="cos(x) function.">>=
plot(x=x, y = cos(x), Geom.line)
@
<<echo=false; label="cos2_fun">>=
plot(x=x, y = cos(2x), Geom.line)
@
\end{document}