update
parent
17e0ef3e56
commit
7d609bf199
|
@ -28,9 +28,9 @@ my %texCommands = (
|
|||
"iff" => ['if and only if', '\leftrightarrow', '$A \leftrightarrow B$'],
|
||||
"if and only if" => ['if and only if', '\leftrightarrow', '$A \leftrightarrow B$'],
|
||||
"subset" => ['subset or subset equal', '\subset or \subseteq', '$A \subset B$'],
|
||||
"less than or equal" => ['logical less than or equal', '\leq', '$A \leq B$'],
|
||||
"less than or equal" => ['logical less than or equal', '\leq', '$A \leq B$'],
|
||||
"less than" => ['logical less than', '<' , '$A < B$'],
|
||||
"<=" => ['logical less than or equal', '\leq', '$A \leq B$'],
|
||||
"<=" => ['logical less than or equal', '\leq', '$A \leq B$'],
|
||||
"<" => ['logical less than', '<' , '$A < B$'],
|
||||
"greater than or equal" => ['logical greater than or equal', '\geq', '$A \geq B$'],
|
||||
"greater than" => ['logical greater than', '>' , '$A > B$'],
|
||||
|
@ -79,15 +79,15 @@ handle remainder => sub {
|
|||
my $command = $texCommands{$key}[1]; #get tex command from hash
|
||||
|
||||
if($command) { #check to see if the key was in the table
|
||||
my $heading = $texCommands{$key}[0];
|
||||
my $usage = $texCommands{$key}[2];
|
||||
my $heading = $texCommands{$key}[0];
|
||||
my $usage = $texCommands{$key}[2];
|
||||
my $text = "Command: $command\nExample Usage: $usage";
|
||||
|
||||
#build the html string to display
|
||||
my $html = build_html($command, $usage);
|
||||
#build the html string to display
|
||||
my $html = build_html($command, $usage);
|
||||
|
||||
return $text, html => $html, heading => "Latex command ($heading)";
|
||||
return $text, html => $html, heading => "Latex command ($heading)";
|
||||
}
|
||||
|
||||
return; #return if no key was found
|
||||
};
|
||||
|
||||
|
|
10
t/Latex.t
10
t/Latex.t
|
@ -6,16 +6,16 @@ use Test::More;
|
|||
use DDG::Test::Goodie;
|
||||
|
||||
zci answer_type => 'Latex';
|
||||
zci is_cached => 1;
|
||||
zci is_cached => 0;
|
||||
|
||||
ddg_goodie_test(
|
||||
[qw(
|
||||
DDG::Goodie::Latex
|
||||
)],
|
||||
'latex integral' => test_zci('<i>Command:</i> \sum_{lower}^{upper} <br> <i>Usage:</i> $\sum{i=0}^{10} x^{2}$'),
|
||||
"Latex integral" => test_zci('<i>Command:</i> \sum_{lower}^{upper} <br> <i>Usage:</i> $\sum{i=0}^{10} x^{2}$'),
|
||||
"tex integral" => test_zci('<i>Command:</i> \sum_{lower}^{upper} <br> <i>Usage:</i> $\sum{i=0}^{10} x^{2}$'),
|
||||
"latex integral" => test_zci('<i>Command:</i> \sum_{lower}^{upper} <br> <i>Usage:</i> $\sum{i=0}^{10} x^{2}$'),
|
||||
"latex integral" => test_zci(
|
||||
'Command: \int_lowerbound^upperbound Example Usage: $\int_a^b f(x)dx$',
|
||||
html => '<i>Command:</i> \int_lowerbound^upperbound <br> <i>Example Usage:</i> $\int_a^b f(x)dx$',
|
||||
heading => 'Latex command (integral)'),
|
||||
);
|
||||
|
||||
done_testing;
|
||||
|
|
Loading…
Reference in New Issue