PHP code example of samwilson / commonmark-latex
1. Go to this page and download the library: Download samwilson/commonmark-latex library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
samwilson / commonmark-latex example snippets
$environment = new \League\CommonMark\Environment\Environment();
// Add the core extension.
$environment->addExtension(new \League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension\CommonMarkCoreExtension());
// Add the LaTeX extension.
$environment->addExtension(new \Samwilson\CommonMarkLatex\LatexRendererExtension());
$converter = new \League\CommonMark\MarkdownConverter($environment);
$latex = $converter->convert('*Markdown* content goes here!')->getContent());