-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a98e642
commit 9261a0d
Showing
5 changed files
with
84 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
use std::{fs::File, path::Path}; | ||
|
||
use common::{html_template, tabled, OUTPUT_DIR}; | ||
|
||
mod common; | ||
|
||
fn main() { | ||
let concl = common::test(); | ||
if std::env::var("RENDER").as_deref() != Ok("true") { | ||
concl.exit() | ||
} | ||
|
||
let mut file = File::create(Path::new(OUTPUT_DIR).join("environments.html")).unwrap(); | ||
html_template(&mut file, "Mathematical Environments Tests", None, tabled).unwrap(); | ||
|
||
concl.exit(); | ||
} | ||
|
||
macro_rules! round_trip_display { | ||
($name:ident, $($input:literal),+ $(,)?) => { | ||
$crate::round_trip!( | ||
$name, | ||
$($input),+, | ||
display_mode = pulldown_latex::config::DisplayMode::Block | ||
); | ||
}; | ||
(should_panic, $name:ident, $($input:literal),+ $(,)?) => { | ||
$crate::round_trip!( | ||
should_panic, | ||
$name, | ||
$($input),+ | ||
); | ||
} | ||
} | ||
|
||
round_trip_display!(arrays, | ||
r#"\begin{array}{||c|r|l||} | ||
a + b \\[2em] | ||
a + b & c & d \\[2em] \hline | ||
a + b | ||
\end{array}"#, | ||
r#"\begin{array}{c:c:c} | ||
a & b & c \\ \hline | ||
d & e & f \\ | ||
\hdashline | ||
g & h & i | ||
\end{array}"#, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Mathematical Environments Tests</title> | ||
<link rel="stylesheet" type="text/css" href="/Users/charles/Code/rust/pulldown-latex/styles.css"> | ||
<meta charset="UTF-8"> | ||
</head> | ||
<body> | ||
<table style="max-width: 60vw; margin: auto;"><tr><th colspan="2">Arrays</th></tr><tr><td>\begin{array}{||c|r|l||} | ||
a + b \\[2em] | ||
a + b & c & d \\[2em] \hline | ||
a + b | ||
\end{array}</td><td style="position: relative"><math display="block"><mtable class="menv-arraylike"><mtr><mtd class="menv-left-solid menv-border-only"></mtd><mtd class="menv-left-solid menv-right-solid"><mi>a</mi><mo>+</mo><mi>b</mi></mtd></mtr><mtr style="height: 2em"><mtd class="menv-left-solid menv-border-only"></mtd><mtd class="menv-left-solid menv-right-solid"></mtd></mtr><mtr><mtd class="menv-left-solid menv-border-only"></mtd><mtd class="menv-left-solid menv-right-solid"><mi>a</mi><mo>+</mo><mi>b</mi></mtd><mtd class="cell-right menv-right-solid"><mi>c</mi></mtd><mtd class="cell-left menv-right-solid"><mi>d</mi></mtd><mtd class="menv-right-solid menv-border-only"></mtd></mtr><mtr style="height: 2em"><mtd class="menv-left-solid menv-border-only"></mtd><mtd class="menv-left-solid menv-right-solid"></mtd><mtd class="cell-right menv-right-solid"></mtd><mtd class="cell-left menv-right-solid"></mtd><mtd class="menv-right-solid menv-border-only"></mtd></mtr><mtr class="menv-hline"><mtd class="menv-left-solid menv-border-only"></mtd><mtd class="menv-left-solid menv-right-solid"><mi>a</mi><mo>+</mo><mi>b</mi></mtd></mtr></mtable></math></td></tr><tr><td>\begin{array}{c:c:c} | ||
a & b & c \\ \hline | ||
d & e & f \\ | ||
\hdashline | ||
g & h & i | ||
\end{array}</td><td style="position: relative"><math display="block"><mtable class="menv-arraylike"><mtr><mtd class="menv-right-dashed"><mi>a</mi></mtd><mtd class="menv-right-dashed"><mi>b</mi></mtd><mtd><mi>c</mi></mtd></mtr><mtr class="menv-hline"><mtd class="menv-right-dashed"><mi>d</mi></mtd><mtd class="menv-right-dashed"><mi>e</mi></mtd><mtd><mi>f</mi></mtd></mtr><mtr class="menv-hdashline"><mtd class="menv-right-dashed"><mi>g</mi></mtd><mtd class="menv-right-dashed"><mi>h</mi></mtd><mtd><mi>i</mi></mtd></mtr></mtable></math></td></tr></table></body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.