Skip to content

Latest commit

 

History

History
198 lines (157 loc) · 4.8 KB

config.md

File metadata and controls

198 lines (157 loc) · 4.8 KB

@def website_title = "terasakisatoshi's math-blog" @def website_descr = "terasakisatoshi's math-blog" @def website_url = "https://terasakisatoshi.github.io/MathWebiner.jl" @def hasplotly = false @def hasjsx = false @def author = "SatoshiTerasaki" @def prepath = "MathSeminar.jl" @def ignore = ["slideshow/tutorial/src/", "slideshow/juliatokai/src/", ".statements/"]

@def date_format = "Y年ud日 E" @def date_months = ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"] @def date_days = ["月曜日","火曜日","水曜日","木曜日", "金曜日","土曜日","日曜日"]

\newcommand{\R}{\mathbb R} \newcommand{\Q}{\mathbb Q} \newcommand{\Z}{\mathbb Z} \newcommand{\N}{\mathbb N} \newcommand{\space}{\ } \newcommand{\newline}{ \ }

\newcommand{\bra}{\left\langle} \newcommand{\ket}{\right\rangle} \newcommand{\norm}[1]{\left\lVert#1\right\rVert} \newcommand{\Mat}{\mathop{\mathrm{Mat}}} \newcommand{\diag}{\mathop{\mathrm{diag}}} \newcommand{\rank}{\mathop{\mathrm{rank}}} \newcommand{\Ker}{\mathop{\mathrm{Ker}}}

\newcommand{\style}[2]{~~~

~~~!#2~~~
~~~}

\newcommand{\chapter}[1]{

#1

\setlevel{chapter} \increment{} \setlevel{subsection} \resetcount{} \setlevel{section} \resetcount{} \setlevel{subsection} } \newcommand{\section}[1]{

#1

\setlevel{section} \increment{} \setlevel{subsection} \resetcount{} } \newcommand{\subsection}[1]{### #1}

\newcommand{\theoremcounter}[4]{ \increment{} \recordTheoremNumber{!#2} \generateLabel{!#2} @@colorblock #1 \getTheoremNumber{} \generateTheoremName{!#3} \ !#4 @@ }

\newcommand{\definition}[3]{\theoremcounter{\bold{Definition}}{#1}{#2}{#3}} \newcommand{\lemma}[3]{\theoremcounter{\bold{Lemma}}{#1}{#2}{#3}} \newcommand{\prop}[3]{\theoremcounter{\bold{Proposition}}{#1}{#2}{#3}} \newcommand{\theorem}[3]{\theoremcounter{\bold{Theorem}}{#1}{#2}{#3}} \newcommand{\example}[3]{\theoremcounter{\bold{Example}}{#1}{#2}{#3}} \newcommand{\remark}[3]{\theoremcounter{\bold{Remark}}{#1}{#2}{#3}} \newcommand{\proof}[1]{ @@proof \ !#1 @@ \ }

\newcommand{\pycode}[2]{

#hideall
using PyCall
lines = replace("""!#2""", r"(^|\n)([^\n]+)\n?$" => s"\1res = \2")
py"""
$$lines
"""
println(py"res")
#2

\codeoutput{!#1} }

\newcommand{\Ccode}[2]{

#hideall
using Markdown

mdC_code = Markdown.htmlesc(raw"""!#2""")
mdC_code = raw"""!#2"""


mdfile = joinpath(dirname(@OUTPUT), "!#1.md")
open(mdfile,"w") do f
    print(f, mdC_code)
end

C_code=raw"""
!#2
"""

exefile = tempname()

#=
This trick is taken from

https://discourse.julialang.org/t/how-to-make-a-c-function-compiled-by-myself-available-to-ccall/7972/26
=#

open(`gcc -Wall -O2 -march=native -xc -o $exefile -`, "w") do f
    print(f, C_code)
end

run(`$exefile`)

\input{c}{!#1.md} }

\newcommand{\Cexec}[2]{ \Ccode{!#1}{!#2}

\codeoutput{!#1}

}

\newcommand{\rustcode}[2]{

#hideall
using Markdown

mdrs_code = Markdown.htmlesc(raw"""!#2""")
mdrs_code = raw"""!#2"""



mdfile = joinpath(dirname(@OUTPUT), "!#1.md")
open(mdfile,"w") do f
    print(f, mdrs_code)
end

rs_code=raw"""
!#2
"""

exefile = tempname()

#=
This trick is taken from

https://discourse.julialang.org/t/how-to-make-a-c-function-compiled-by-myself-available-to-ccall/7972/26
=#

open(`rustc -o $exefile -`, "w") do f
    print(f, rs_code)
end

run(`$exefile`)

\input{rust}{!#1.md} }

\newcommand{\rustexec}[2]{ \rustcode{!#1}{!#2}

\codeoutput{!#1}

}