mirror of
https://github.com/wassname/jupyter_contrib_nbextensions.git
synced 2026-09-11 12:20:19 +08:00
more removal of latex_envs:
- templates - fix conda env import tests
This commit is contained in:
@@ -42,7 +42,6 @@ test:
|
||||
- jupyter_contrib_nbextensions.migrate
|
||||
- jupyter_contrib_nbextensions.nbconvert_support
|
||||
- jupyter_contrib_nbextensions.nbconvert_support.embedhtml
|
||||
- jupyter_contrib_nbextensions.nbconvert_support.latex_envs
|
||||
- jupyter_contrib_nbextensions.nbconvert_support.pp_highlighter
|
||||
- jupyter_contrib_nbextensions.nbconvert_support.pre_codefolding
|
||||
- jupyter_contrib_nbextensions.nbconvert_support.pre_collapsible_headings
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
{%- extends 'full.tpl' -%}
|
||||
|
||||
|
||||
{%- block html_head -%}
|
||||
|
||||
<meta charset="utf-8"/>
|
||||
|
||||
<!-- javascript from CDN for conversion -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.5/marked.js"></script>
|
||||
|
||||
|
||||
|
||||
{% if nb['metadata']['latex_envs']['eqLabelWithNumbers'] == True %}
|
||||
<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({{nb['metadata']['latex_envs']['eqNumInitial']}} ))}
|
||||
} }
|
||||
});
|
||||
</script>
|
||||
{% else %}
|
||||
<script type="text/x-mathjax-config">
|
||||
// make sure that equations numbers are enabled
|
||||
MathJax.Hub.Config({ TeX: { equationNumbers: {
|
||||
autoNumber: "none", // All AMS equations are numbered
|
||||
useLabelIds: true, // labels as ids
|
||||
} }
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
|
||||
{{ super() }}
|
||||
|
||||
|
||||
|
||||
<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/ipython-contrib/jupyter_contrib_nbextensions/master/src/jupyter_contrib_nbextensions/nbextensions/latex_envs/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_contrib_nbextensions/latex_envs/src/jupyter_contrib_nbextensions/nbextensions/latex_envs/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 = "{{nb['metadata']['latex_envs']['eqLabelWithNumbers']}}"=="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={};
|
||||
|
||||
|
||||
// fire the main function with these parameters
|
||||
var html_to_analyse = $('body').html()
|
||||
var html_converted = thmsInNbConv(marked,html_to_analyse);
|
||||
$('body').html(html_converted)
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
{%- endblock html_head -%}
|
||||
|
||||
{% block body %}
|
||||
|
||||
|
||||
{{ super() }}
|
||||
|
||||
|
||||
|
||||
{%- endblock body %}
|
||||
|
||||
{% block footer %}
|
||||
</html>
|
||||
{% endblock footer %}
|
||||
@@ -1,170 +0,0 @@
|
||||
((*- extends 'article.tplx' -*))
|
||||
|
||||
((* block h1 -*))\section((* endblock h1 -*))
|
||||
((* block h2 -*))\subsection((* endblock h2 -*))
|
||||
((* block h3 -*))\subsubsection((* endblock h3 -*))
|
||||
((* block h4 -*))\paragraph((* endblock h4 -*))
|
||||
((* block h5 -*))\subparagraph((* endblock h5 -*))
|
||||
|
||||
|
||||
((* block abstract *))
|
||||
\tableofcontents
|
||||
%~\par
|
||||
%\newpage
|
||||
((* endblock abstract *))
|
||||
|
||||
%or?
|
||||
%((* block toc *))\tableofcontents((* endblock toc *))
|
||||
|
||||
|
||||
%===============================================================================
|
||||
% My custom output style
|
||||
%===============================================================================
|
||||
% A custom cell style that places code in a simple verbatim and prints "Input #"
|
||||
% and "Output #" cell prompts.
|
||||
|
||||
((*- block in_prompt -*))
|
||||
% No prompt!
|
||||
%\textbf{Input \#{}(((cell.prompt_number)))}
|
||||
|
||||
((*- endblock in_prompt -*))
|
||||
|
||||
((*- block input -*))
|
||||
%
|
||||
\begin{lstlisting}
|
||||
((( cell.source )))
|
||||
\end{lstlisting}
|
||||
((*- endblock input -*))
|
||||
|
||||
% ok
|
||||
|
||||
%but may be this?
|
||||
|
||||
%((*- block output_prompt -*))
|
||||
% No prompt!
|
||||
%\textbf{Output \#{}(((cell.prompt_number)))}
|
||||
%((*- endblock output_prompt -*))
|
||||
|
||||
|
||||
((* block author *))
|
||||
\author{J.-F. Bercher}
|
||||
((* endblock author *))
|
||||
|
||||
((* block title *))
|
||||
\title{ }
|
||||
((* endblock title *))
|
||||
|
||||
((* block packages *))
|
||||
((( super() )))
|
||||
\usepackage{listings}
|
||||
((* endblock packages *))
|
||||
|
||||
%or -- both work
|
||||
((* block header *))
|
||||
((( super() )))
|
||||
%\usepackage{foo}
|
||||
((* endblock *))
|
||||
|
||||
|
||||
((* block commands *))
|
||||
% Prevent overflowing lines due to hard-to-break entities
|
||||
\sloppy
|
||||
% Setup hyperref package
|
||||
\hypersetup{
|
||||
breaklinks=true, % so long urls are correctly broken across lines
|
||||
pdftitle={\@title},
|
||||
pdfauthor={\@author},
|
||||
colorlinks=true, %colorise les liens
|
||||
breaklinks=true, %permet le retour à la ligne dans les liens trop longs
|
||||
urlcolor= blue, %couleur des hyperliens
|
||||
linkcolor= blue, %couleur des liens internes
|
||||
citecolor=blue, %couleur des liens de citations
|
||||
bookmarksopen=false,
|
||||
pdftoolbar=false,
|
||||
pdfmenubar=false,
|
||||
% hidelinks
|
||||
}
|
||||
% Slightly bigger margins than the latex defaults
|
||||
\geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}
|
||||
%listings configuration
|
||||
|
||||
\definecolor{mygreen}{rgb}{0,0.6,0}
|
||||
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
|
||||
\definecolor{mymauve}{rgb}{0.58,0,0.82}
|
||||
\lstset{
|
||||
language=Python,
|
||||
commentstyle=\color{mygreen},
|
||||
keywordstyle=\color{blue},
|
||||
stringstyle=\color{mymauve},
|
||||
xleftmargin= 1cm,
|
||||
xrightmargin= 1cm,
|
||||
showstringspaces=false,
|
||||
breaklines=true,
|
||||
texcl=false,
|
||||
% basicstyle=\ttfamily,
|
||||
frame=single,
|
||||
frameround=tttt,
|
||||
framesep=10pt,
|
||||
%framexleftmargin=10pt,
|
||||
%framexrightmargin =10pt,
|
||||
%frameshape={RYRYNYYYY}{yny}{yny}{RYRYNYYYY}
|
||||
inputencoding=utf8,
|
||||
extendedchars=true,
|
||||
literate=%
|
||||
{é}{{\'{e}}}1
|
||||
{è}{{\`{e}}}1
|
||||
{ê}{{\^{e}}}1
|
||||
{ë}{{\¨{e}}}1
|
||||
{É}{{\'{E}}}1
|
||||
{Ê}{{\^{E}}}1
|
||||
{û}{{\^{u}}}1
|
||||
{ù}{{\`{u}}}1
|
||||
{à}{{\`{a}}}1
|
||||
{ç}{{\c{c}}}1
|
||||
{Ç}{{\c{C}}}1
|
||||
{î}{{\^{i}}}1
|
||||
{Î}{{\^{I}}}1
|
||||
}
|
||||
((* endblock commands *))
|
||||
|
||||
|
||||
% Display latex
|
||||
|
||||
((* block data_latex -*))
|
||||
((*- if output.latex.startswith('$'): -*))
|
||||
((= Replace $ symbols with more explicit, equation block. =))
|
||||
\begin{equation}
|
||||
((( output.latex | strip_dollars )))
|
||||
\end{equation}
|
||||
((*- else -*))
|
||||
((( output.latex )))
|
||||
((*- endif *))
|
||||
((* endblock data_latex *))
|
||||
|
||||
|
||||
|
||||
((* block bibliography *))
|
||||
%\bibliographystyle{ieetran}
|
||||
%\bibliography{Thesis}
|
||||
((* endblock bibliography *))
|
||||
|
||||
% Draw a figure using the graphicx package.
|
||||
((* macro draw_figure(filename) -*))
|
||||
((* set filename = filename | posix_path *))
|
||||
((*- block figure scoped -*))
|
||||
\begin{center}
|
||||
\adjustimage{max size={0.6\linewidth}{0.6\paperheight}}{((( filename )))}
|
||||
\end{center}
|
||||
% { \hspace*{\fill} \\}
|
||||
((*- endblock figure -*))
|
||||
((*- endmacro *))
|
||||
|
||||
|
||||
%============================================================
|
||||
((= This line selects the cell style. =))
|
||||
%((* set cell_style = 'style_bw_python.tplx' *))
|
||||
((* set cell_style = 'style_python.tplx' *))
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,171 +0,0 @@
|
||||
((*- extends 'report.tplx' -*))
|
||||
|
||||
((* block h1 -*))\chapter((* endblock h1 -*))
|
||||
((* block h2 -*))\section((* endblock h2 -*))
|
||||
((* block h3 -*))\subsection((* endblock h3 -*))
|
||||
((* block h4 -*))\subsubsection((* endblock h4 -*))
|
||||
((* block h5 -*))\paragraph((* endblock h5 -*))
|
||||
|
||||
|
||||
((* block abstract *))
|
||||
\tableofcontents
|
||||
%~\par
|
||||
%\newpage
|
||||
((* endblock abstract *))
|
||||
|
||||
%or?
|
||||
%((* block toc *))\tableofcontents((* endblock toc *))
|
||||
|
||||
|
||||
%===============================================================================
|
||||
% My custom output style
|
||||
%===============================================================================
|
||||
% A custom cell style that places code in a simple verbatim and prints "Input #"
|
||||
% and "Output #" cell prompts.
|
||||
|
||||
((*- block in_prompt -*))
|
||||
% No prompt!
|
||||
%\textbf{Input \#{}(((cell.prompt_number)))}
|
||||
|
||||
((*- endblock in_prompt -*))
|
||||
|
||||
((*- block input -*))
|
||||
%
|
||||
\begin{lstlisting}
|
||||
((( cell.source )))
|
||||
\end{lstlisting}
|
||||
((*- endblock input -*))
|
||||
|
||||
% ok
|
||||
|
||||
%but may be this?
|
||||
|
||||
%((*- block output_prompt -*))
|
||||
% No prompt!
|
||||
%\textbf{Output \#{}(((cell.prompt_number)))}
|
||||
%((*- endblock output_prompt -*))
|
||||
|
||||
|
||||
((* block author *))
|
||||
\author{J.-F. Bercher}
|
||||
((* endblock author *))
|
||||
|
||||
((* block title *))
|
||||
\title{ }
|
||||
((* endblock title *))
|
||||
|
||||
((* block packages *))
|
||||
((( super() )))
|
||||
\usepackage{listings}
|
||||
\usepackage{float}
|
||||
((* endblock packages *))
|
||||
|
||||
%or -- both work
|
||||
((* block header *))
|
||||
((( super() )))
|
||||
%\usepackage{foo}
|
||||
((* endblock *))
|
||||
|
||||
|
||||
((* block commands *))
|
||||
% Prevent overflowing lines due to hard-to-break entities
|
||||
\sloppy
|
||||
% Setup hyperref package
|
||||
\hypersetup{
|
||||
breaklinks=true, % so long urls are correctly broken across lines
|
||||
pdftitle={\@title},
|
||||
pdfauthor={\@author},
|
||||
colorlinks=true, %colorise les liens
|
||||
breaklinks=true, %permet le retour à la ligne dans les liens trop longs
|
||||
urlcolor= blue, %couleur des hyperliens
|
||||
linkcolor= blue, %couleur des liens internes
|
||||
citecolor=blue, %couleur des liens de citations
|
||||
bookmarksopen=false,
|
||||
pdftoolbar=false,
|
||||
pdfmenubar=false,
|
||||
% hidelinks
|
||||
}
|
||||
% Slightly bigger margins than the latex defaults
|
||||
\geometry{verbose,tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in}
|
||||
%listings configuration
|
||||
|
||||
\definecolor{mygreen}{rgb}{0,0.6,0}
|
||||
\definecolor{mygray}{rgb}{0.5,0.5,0.5}
|
||||
\definecolor{mymauve}{rgb}{0.58,0,0.82}
|
||||
\lstset{
|
||||
language=Python,
|
||||
commentstyle=\color{mygreen},
|
||||
keywordstyle=\color{blue},
|
||||
stringstyle=\color{mymauve},
|
||||
xleftmargin= 1cm,
|
||||
xrightmargin= 1cm,
|
||||
showstringspaces=false,
|
||||
breaklines=true,
|
||||
texcl=false,
|
||||
% basicstyle=\ttfamily,
|
||||
frame=single,
|
||||
frameround=tttt,
|
||||
framesep=10pt,
|
||||
%framexleftmargin=10pt,
|
||||
%framexrightmargin =10pt,
|
||||
%frameshape={RYRYNYYYY}{yny}{yny}{RYRYNYYYY}
|
||||
inputencoding=utf8,
|
||||
extendedchars=true,
|
||||
literate=%
|
||||
{é}{{\'{e}}}1
|
||||
{è}{{\`{e}}}1
|
||||
{ê}{{\^{e}}}1
|
||||
{ë}{{\¨{e}}}1
|
||||
{É}{{\'{E}}}1
|
||||
{Ê}{{\^{E}}}1
|
||||
{û}{{\^{u}}}1
|
||||
{ù}{{\`{u}}}1
|
||||
{à}{{\`{a}}}1
|
||||
{ç}{{\c{c}}}1
|
||||
{Ç}{{\c{C}}}1
|
||||
{î}{{\^{i}}}1
|
||||
{Î}{{\^{I}}}1
|
||||
}
|
||||
((* endblock commands *))
|
||||
|
||||
|
||||
% Display latex
|
||||
|
||||
((* block data_latex -*))
|
||||
((*- if output.latex.startswith('$'): -*))
|
||||
((= Replace $ symbols with more explicit, equation block. =))
|
||||
\begin{equation}
|
||||
((( output.latex | strip_dollars )))
|
||||
\end{equation}
|
||||
((*- else -*))
|
||||
((( output.latex )))
|
||||
((*- endif *))
|
||||
((* endblock data_latex *))
|
||||
|
||||
|
||||
|
||||
((* block bibliography *))
|
||||
%\bibliographystyle{ieetran}
|
||||
%\bibliography{Thesis}
|
||||
((* endblock bibliography *))
|
||||
|
||||
% Draw a figure using the graphicx package.
|
||||
((* macro draw_figure(filename) -*))
|
||||
((* set filename = filename | posix_path *))
|
||||
((*- block figure scoped -*))
|
||||
\begin{center}
|
||||
\adjustimage{max size={0.6\linewidth}{0.6\paperheight}}{((( filename )))}
|
||||
\end{center}
|
||||
% { \hspace*{\fill} \\}
|
||||
((*- endblock figure -*))
|
||||
((*- endmacro *))
|
||||
|
||||
|
||||
%============================================================
|
||||
((= This line selects the cell style. =))
|
||||
%((* set cell_style = 'style_bw_python.tplx' *))
|
||||
((* set cell_style = 'style_python.tplx' *))
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user