I want to put some Julia source code listings I have that use unicode characters. I have generated my initial version as a conversion from markdown to latex, then to texmacs. Inside the .tm
file the source code looks all right but inside texmacs and inside the exported HTML it has been mangled. For example, this is the original source code with some greeks letters here and there:
struct SGD{T <: AbstractFloat, N} <: Optimizer{T, N}
θ::Array{T, N}
ϵ::T
SGD(θ::Array{T}, ϵ::AbstractFloat) where {T <: AbstractFloat, N} =
new{T, N}(θ, convert(T, ϵ))
end
This is how it is represented inside the texmacs file inside a <\verbatim>
:
struct SGD{T \<less\>: AbstractFloat, N} \<less\>: Optimizer{T, N}
\ \ \ \ θ::Array{T, N}
\ \ \ \ ϵ::T
\ \ \ \ SGD(θ::Array{T}, ϵ::AbstractFloat) where {T \<less\>:
AbstractFloat, N} =
\ \ \ \ \ \ \ \ new{T, N}(θ, convert(T, ϵ))
end
\;
And this is what I get inside texmacs and inside the generated HTML:
struct SGD{T <: AbstractFloat, N} <: Optimizer{T, N}
Îÿ::Array{T, N}
Ïţ::T
SGD(Îÿ::Array{T}, Ïţ::AbstractFloat) where {T <: AbstractFloat, N} =
new{T, N}(Îÿ, convert(T, Ïţ))
end
Copy-pasting from the original source code inside texmacs also gives errors:
As I understand Texmacs doesn’t use Unicode for .tm
files. I wouldn’t mind making a script that converts my source code listings to whatever representation uses texmacs for unicode but I have not found any info inside the help system.
Cheers,
Pedro.