-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversion to slide not taking extensions into account #36
Comments
This is a good idea for improvement and should be easy.
AhAh. No. Not that easy. :-( If you are really in a hurry, you can (probably) convert to slides, and then add <!-- javascript from CDN for conversion -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.5/marked.js"></script>
<script type="text/x-mathjax-config">
// make sure that equations numbers are enabled
MathJax.Hub.Config({ TeX: { equationNumbers: {
autoNumber: "AMS", // All AMS equations are numbered
useLabelIds: true, // labels as ids
// format the equation number - uses an offset eqNumInitial (default 0)
formatNumber: function (n) {return String(Number(n)+Number(1)-1)}
} }
});
</script> and this at the end of the head (before <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<!-- stylesheet from CDN -->
<link rel="stylesheet" type="text/css" href="https://rawgit.com/jfbercher/jupyter_latex_envs/master/src/latex_envs/static/latex_envs.css">
<!-- Custom stylesheet, it must be in the same directory as the html file -->
<link rel="stylesheet" href="custom.css">
<!-- Load mathjax
<script src="https://rawgit.com/ipython-contrib/jupyter_contrib_nbextensions/master/src/jupyter_contrib_nbextensions/nbextensions/latex_envs/thmsInNb4.js"></script>
-->
<script type="text/javascript" src="https://rawgit.com/jfbercher/jupyter_latex_envs/master/src/latex_envs/static/thmsInNb4.js"> </script>
<script>
$( document ).ready(function(){
//Value of configuration variables, some taken from the notebook's metada.
eqNum = 0; // begins equation numbering at eqNum+1
eqLabelWithNumbers = "True"=="True" ? true : false; //if true, label equations with equation numbers;
//otherwise using the tag specified by \label
conversion_to_html = false;
current_cit=1;
cite_by='key'; //only number and key are supported
//var document={}
document.bibliography={};
// Read environment map config
initmap();
// Read user envs config, if specified
environmentMap = $.extend(true,{}, environmentInitialMap)
// fire the main function with these parameters
var html_to_analyse = $('body').html()
var html_converted = thmsInNbConv(marked,html_to_analyse);
html_converted = html_converted.replace(/%[\S\t ]*<\/p>/gm,"</p>")
$('body').html(html_converted)
// Show/hide anchors
var labels_anchors = "False"=="True" ? true : false;
$('.latex_label_anchor').toggle(labels_anchors)
// Number all environments
report_style_numbering = "False"=="True" ? true : false;
reset_counters();
renumberAllEnvs();
});
</script |
Export to slides using
is available in version 1.4.3 at Pypi of in this repo. Enjoy. |
Hello JFB
As stated, this works well. This yields a single HTML page with the correct equations, numberings, etc. Very useful !
However it does not work with reveal.js
jupyter nbconvert --to slides_with_lenvs Perceptron.ipynb --post serve
Yields (see screenshot).
[Math Processing Error] \newcommand{\M}[1]{\mathbf{#1}}
Any idea ?
Thanks again.
… On Feb 24, 2018, at 9:44 PM, Jean-François Bercher ***@***.***> wrote:
Export to slides using
jupyter nbconvert --to slides_with_lenvs FILE.ipynb
is available in version 1.4.3 at Pypi <https://pypi.python.org/pypi/jupyter_latex_envs/1.4.3> of in this repo. Enjoy.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#36 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABfDUBJ5pIv0H_S7pr2ZDfm28KtOSp2Rks5tYHTLgaJpZM4SMLr8>.
|
There is no screenshot. Anyway this is probably unrelated to |
OK it might indeed be a browser issue indeed because with the fixed HTML version (without the reveal.js script) I sometime get the error, sometime not.
… On Feb 27, 2018, at 11:49 AM, Jean-François Bercher ***@***.***> wrote:
There is no screenshot.
Anyway this is probably unrelated to latex_envs. It means that your mathjax processor fails somewhere; because of your browser, your internet connexion or of cache issues. Try to clear the cache (press shift while reloading; or use your browser preferences).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#36 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABfDUCTR0WmbpfSsAoRDR4D9j7LudLVmks5tY92mgaJpZM4SMLr8>.
|
It works well in Firefox & Chrome after restarting the browsers. Thanks !
… On Feb 27, 2018, at 12:01 PM, Hugues Talbot ***@***.*** ***@***.***>> wrote:
OK it might indeed be a browser issue indeed because with the fixed HTML version (without the reveal.js script) I sometime get the error, sometime not.
> On Feb 27, 2018, at 11:49 AM, Jean-François Bercher ***@***.*** ***@***.***>> wrote:
>
> There is no screenshot.
>
> Anyway this is probably unrelated to latex_envs. It means that your mathjax processor fails somewhere; because of your browser, your internet connexion or of cache issues. Try to clear the cache (press shift while reloading; or use your browser preferences).
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub <#36 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABfDUCTR0WmbpfSsAoRDR4D9j7LudLVmks5tY92mgaJpZM4SMLr8>.
>
|
😃 |
Hello,
I cannot make use of both reveal.js slides and latex notebook extensions. In the slides, I simply get the unconverted code (see screenshot).
In other words, a command like
jupyter nbconvert --to slides_with_lenvs
is mssing.
The text was updated successfully, but these errors were encountered: