Update for itex2MML 1.38
Add support, in the LaTeX export, for blackboard bold digits and lowercase latin letters. If these are present, LaTeX will \usepackage{mathbbol} N.B.: this uses the stmaryrd font for blackboard bold letters, instead of the msbm font. Tests included. (Yes, you need to update itex2MML as well.)
This commit is contained in:
parent
e2ccdfd812
commit
c85ce458ce
|
@ -4,6 +4,9 @@
|
||||||
\usepackage{amsfonts}
|
\usepackage{amsfonts}
|
||||||
\usepackage{amssymb}
|
\usepackage{amssymb}
|
||||||
\usepackage{amsthm}
|
\usepackage{amsthm}
|
||||||
|
<%- if @tex_content =~ /\\mathbb\{[^}]*[a-z0-9]+[^}]*\}/ -%>
|
||||||
|
\usepackage{mathbbol}
|
||||||
|
<% end -%>
|
||||||
\usepackage{graphicx}
|
\usepackage{graphicx}
|
||||||
\usepackage{color}
|
\usepackage{color}
|
||||||
\usepackage{ucs}
|
\usepackage{ucs}
|
||||||
|
|
|
@ -31,6 +31,7 @@ class WikiControllerTest < ActionController::TestCase
|
||||||
@oak = pages(:oak)
|
@oak = pages(:oak)
|
||||||
@elephant = pages(:elephant)
|
@elephant = pages(:elephant)
|
||||||
@eternity = Regexp.new('author=.*; path=/; expires=' + Time.utc(2030).strftime("%a, %d-%b-%Y %H:%M:%S GMT"))
|
@eternity = Regexp.new('author=.*; path=/; expires=' + Time.utc(2030).strftime("%a, %d-%b-%Y %H:%M:%S GMT"))
|
||||||
|
set_tex_header
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_authenticate
|
def test_authenticate
|
||||||
|
@ -849,17 +850,15 @@ class WikiControllerTest < ActionController::TestCase
|
||||||
assert_response :missing
|
assert_response :missing
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_tex
|
def set_tex_header
|
||||||
r = process('tex', 'web' => 'wiki1', 'id' => 'HomePage')
|
@tex_header1 = %q!\documentclass[12pt,titlepage]{article}
|
||||||
assert_response(:success)
|
|
||||||
|
|
||||||
assert_equal %q!\documentclass[12pt,titlepage]{article}
|
|
||||||
|
|
||||||
\usepackage{amsmath}
|
\usepackage{amsmath}
|
||||||
\usepackage{amsfonts}
|
\usepackage{amsfonts}
|
||||||
\usepackage{amssymb}
|
\usepackage{amssymb}
|
||||||
\usepackage{amsthm}
|
\usepackage{amsthm}
|
||||||
\usepackage{graphicx}
|
!
|
||||||
|
@tex_header2 = %q!\usepackage{graphicx}
|
||||||
\usepackage{color}
|
\usepackage{color}
|
||||||
\usepackage{ucs}
|
\usepackage{ucs}
|
||||||
\usepackage[utf8x]{inputenc}
|
\usepackage[utf8x]{inputenc}
|
||||||
|
@ -1084,7 +1083,14 @@ class WikiControllerTest < ActionController::TestCase
|
||||||
|
|
||||||
%-------------------------------------------------------------------
|
%-------------------------------------------------------------------
|
||||||
|
|
||||||
\section*{HomePage}
|
!
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_tex
|
||||||
|
r = process('tex', 'web' => 'wiki1', 'id' => 'HomePage')
|
||||||
|
assert_response(:success)
|
||||||
|
|
||||||
|
assert_equal @tex_header1 + @tex_header2 + %q!\section*{HomePage}
|
||||||
|
|
||||||
HisWay would be MyWay $\sin(x) \includegraphics[width=3em]{foo}$ in kinda ThatWay in HisWay though MyWay $\backslash$OverThere --{} see SmartEngine in that SmartEngineGUI
|
HisWay would be MyWay $\sin(x) \includegraphics[width=3em]{foo}$ in kinda ThatWay in HisWay though MyWay $\backslash$OverThere --{} see SmartEngine in that SmartEngineGUI
|
||||||
|
|
||||||
|
@ -1094,6 +1100,22 @@ HisWay would be MyWay $\sin(x) \includegraphics[width=3em]{foo}$ in kinda ThatWa
|
||||||
!, r.body
|
!, r.body
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_tex_with_blackboard_digits
|
||||||
|
@wiki.write_page('wiki1', 'Page2',
|
||||||
|
"Page2 contents $\\mathbb{01234}$.\n",
|
||||||
|
Time.now, Author.new('AnotherAuthor', '127.0.0.2'), test_renderer)
|
||||||
|
r = process('tex', 'web' => 'wiki1', 'id' => 'Page2')
|
||||||
|
assert_response(:success)
|
||||||
|
|
||||||
|
assert_equal @tex_header1 + "\\usepackage{mathbbol}\n" + @tex_header2 + %q!\section*{Page2}
|
||||||
|
|
||||||
|
Page2 contents $\mathbb{01234}$.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\end{document}
|
||||||
|
!, r.body
|
||||||
|
end
|
||||||
|
|
||||||
def test_web_list
|
def test_web_list
|
||||||
another_wiki = @wiki.create_web('Another Wiki', 'another_wiki')
|
another_wiki = @wiki.create_web('Another Wiki', 'another_wiki')
|
||||||
|
|
|
@ -213,6 +213,12 @@ END_THM
|
||||||
%{display='inline' xmlns='http://www.w3.org/1998/Math/MathML'>} +
|
%{display='inline' xmlns='http://www.w3.org/1998/Math/MathML'>} +
|
||||||
%{<mi>A</mi><mo>\342\205\213</mo><mi>B</mi></math></p>},
|
%{<mi>A</mi><mo>\342\205\213</mo><mi>B</mi></math></p>},
|
||||||
"equation $A \\invamp B$")
|
"equation $A \\invamp B$")
|
||||||
|
|
||||||
|
assert_markup_parsed_as(
|
||||||
|
%{<p>blackboard digits: <math class='maruku-mathml' display='} +
|
||||||
|
%{inline' xmlns='http://www.w3.org/1998/Math/MathML'><mi>math} +
|
||||||
|
%{bb</mi><mn>123 </mn></math></p>},
|
||||||
|
"blackboard digits: $\mathbb{123}$")
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_blahtex
|
def test_blahtex
|
||||||
|
|
Loading…
Reference in a new issue