Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Turns the LaTeX expression `expr` into an image encoded as a stream. You can tw

* `dpi`: Dots-per-inch determines the resolution of resulting image. Default: 300
* `format`: Resulting image format. Default `png`
* `displaystyle`: (boolean) Use display style for forulae, defaults to `false` (inline)
* `packages`: A list of extra LaTeX packages to include. Default `["amsmath"]`
* `macros`: A list of LaTeX preprocessor macros. Default `""`
* `pdflatex_path`: A path the `pdflatex` executable. Default: `pdflatex`
Expand Down
5 changes: 3 additions & 2 deletions mathmode.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = function(expr, options) {
}
var format = options.format || "png";
var size = options.dpi || 300;
var ds = options.displaystyle ? '\\displaystyle' : '';

var package_list = options.packages || [ "amsmath" ];
var packages = [];
Expand All @@ -35,7 +36,7 @@ module.exports = function(expr, options) {
"\\usepackage{transparent}",
options.macros || "",
"\\begin{document}",
"\\begin{preview} $",
"\\begin{preview} $"+ds,
sanitize(expr),
"$ \\end{preview}",
"\\end{document}"
Expand All @@ -60,4 +61,4 @@ module.exports = function(expr, options) {
tex_stream.pipe(convert.stdin);

return result;
}
}
3 changes: 3 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require('./mathmode')('{\\Sigma = \\{0,\\dots, M\\}}', {
displaystyle: true
}).pipe(process.stdout);