diff --git a/testing/latex_envs/conversion/documentation.pdf b/testing/latex_envs/conversion/documentation.pdf deleted file mode 100644 index 6b88038..0000000 Binary files a/testing/latex_envs/conversion/documentation.pdf and /dev/null differ diff --git a/testing/latex_envs/conversion/documentation.tex b/testing/latex_envs/conversion/documentation.tex deleted file mode 100644 index 0b56264..0000000 --- a/testing/latex_envs/conversion/documentation.tex +++ /dev/null @@ -1,129 +0,0 @@ - - -\input{header.tex} - -\usepackage{amsthm} % theorems -\usepackage{lettrine} -\usepackage{lastpage} -\usepackage{url} -\usepackage{mdframed} -\usepackage[T1]{fontenc} -%\usepackage[francais]{babel} - - - -\DeclareUnicodeCharacter{00A0}{~} %get rid of "unicode char u8 not set up for use with latex" - -\makeatletter -\renewcommand{\@evenfoot}% - {\hfil \upshape Page {\thepage}/\pageref{LastPage}} -\renewcommand{\@oddfoot}{\@evenfoot} -\makeatother - -%%% Further colors and hyperref configuration -% Colors -\definecolor{webgreen}{rgb}{0,.5,0} -\definecolor{webbrown}{rgb}{.6,0,0} -\definecolor{webyellow}{rgb}{0.98,0.92,0.73} -\definecolor{webgray}{rgb}{.753,.753,.753} -\definecolor{webblue}{rgb}{0,0,.8} - - -\usepackage{hyperref} -\hypersetup{bookmarks,bookmarksnumbered,%bookmarksopen, -colorlinks,linkcolor=webbrown,filecolor=webgreen,citecolor=webgreen, -breaklinks=true, -hyperindex=true -urlcolor=webbrown,pagebackref,pdfpagemode=None,pdfstartview=Fit} -%%%---------------------------------------- -%For redefinition of quote env -\usepackage[strict]{changepage} -\usepackage{framed} - -%% for a listing environment -\usepackage{verbatim} - -\begin{document} -\title{(some) \LaTeX{} environments in Jupyter notebook } -%\begin{abstract} -%Abstract -%\end{abstract} - -\maketitle - -\thispagestyle{empty} % Removes page numbers - -% - -\definecolor{lightred}{rgb}{1,0.1,0} -\def\myeqbox#1#2{{\fcolorbox{#1}{light#1}{$\textcolor{#1}{ #2}$}}} -\def\eqbox#1#2#3#4{{\fcolorbox{#1}{#2}{$\textcolor{#3}{ #4}$}}} -% border|background|text -\def\eqboxa#1{{\boxed{#1}}} -\def\eqboxb#1{{\eqbox{green}{white}{green}{#1}}} -\def\eqboxc#1{{\eqbox{blue}{white}{blue}{#1}}} -\def\eqboxd#1{{\eqbox{blue}{lightblue}{blue}{#1}}} - -\def\textem#1{\emph{#1}} -\def\url#1{\href{#1}{#1}} - -\newtheorem{theorem}{Theorem} -\newtheorem{exercise}{Exercise} -\newtheorem{example}{Example} -\newtheorem{prop}{Property} -\newtheorem{remark}{Remark} -\newtheorem{proposition}{Proposition} -\newtheorem{property}{Property} -\newtheorem{definition}{Definition} -\newtheorem{lemma}{Lemma} -\newtheorem{problem}{Problem} - -\newenvironment{textboxa} -{ \begin{mdframed}[backgroundcolor=yellow]} -{ \end{mdframed} } - - -% ----------------------------------------------------- -% The environment for listing is defined here. It is simply derived -% from lstlisting -\definecolor{mylatexlstbkg}{rgb}{0.898,1.0,0.898} -\definecolor{mylatexlstbkg}{rgb}{0.9176,1.0,0.9176} - -\lstnewenvironment{listing} -{\lstset{language=[LaTeX]TeX, -backgroundcolor=\color{mylatexlstbkg}}} -{} - -%% ---------------------------------------------------- -% redefinition environnement quote -% from: http://www.jevon.org/wiki/Fancy_Quotation_Boxes_in_Latex -% for adjustwidth environment - -\definecolor{darkblue}{rgb}{0.0, 0.0, 0.55} -\definecolor{formalshade}{rgb}{0.95,0.95,1} - -\renewenvironment{quote}{% - \def\FrameCommand{% - \hspace{1pt}% - {\color{darkblue}\vrule width 2pt}% - {\color{formalshade}\vrule width 4pt}% - \colorbox{formalshade}% - }% - \MakeFramed{\advance\hsize-\width\FrameRestore}% - \noindent\hspace{-4.55pt}% disable indenting first paragraph - \begin{adjustwidth}{}{7pt}% - \vspace{2pt}\vspace{2pt}% -} -{% - \vspace{2pt}\end{adjustwidth}\endMakeFramed% -} -%% ------------------- - - -\tableofcontents -%\newpage - -\input{latex_env_doc.tex} - - -\end{document} diff --git a/testing/latex_envs/conversion/example.png b/testing/latex_envs/conversion/example.png deleted file mode 100644 index 2433079..0000000 Binary files a/testing/latex_envs/conversion/example.png and /dev/null differ diff --git a/testing/latex_envs/conversion/header.tex b/testing/latex_envs/conversion/header.tex deleted file mode 100644 index d26b0cd..0000000 --- a/testing/latex_envs/conversion/header.tex +++ /dev/null @@ -1,273 +0,0 @@ - -% Default to the notebook output style - - -% Inherit from the specified cell style. - - - - - - -\documentclass[11pt]{article} - - - - - \usepackage{graphicx} % Used to insert images - \usepackage{adjustbox} % Used to constrain images to a maximum size - \usepackage{color} % Allow colors to be defined - \usepackage{enumerate} % Needed for markdown enumerations to work - \usepackage{geometry} % Used to adjust the document margins - \usepackage{amsmath} % Equations - \usepackage{amssymb} % Equations - \usepackage[mathletters]{ucs} % Extended unicode (utf-8) support - %\usepackage[utf8]{inputenc} % Allow utf-8 characters in the tex document - %\usepackage[utf8x]{inputenc} % Allow utf-8 characters in the tex document - \usepackage{fancyvrb} % verbatim replacement that allows latex - \usepackage{grffile} % extends the file name processing of package graphics - % to support a larger range - % The hyperref package gives us a pdf with properly built - % internal navigation ('pdf bookmarks' for the table of contents, - % internal cross-reference links, web links for URLs, etc.) - \usepackage{hyperref} - \usepackage{longtable} % longtable support required by pandoc >1.10 - \usepackage{booktabs} % table support for pandoc > 1.12.2 - -\usepackage{listings} -\usepackage{float} - - - - - \definecolor{orange}{cmyk}{0,0.4,0.8,0.2} - \definecolor{darkorange}{rgb}{.71,0.21,0.01} - \definecolor{darkgreen}{rgb}{.12,.54,.11} - \definecolor{myteal}{rgb}{.26, .44, .56} - \definecolor{gray}{gray}{0.45} - \definecolor{lightgray}{gray}{.95} - \definecolor{mediumgray}{gray}{.8} - \definecolor{inputbackground}{rgb}{.95, .95, .85} - \definecolor{outputbackground}{rgb}{.95, .95, .95} - \definecolor{traceback}{rgb}{1, .95, .95} - % ansi colors - \definecolor{red}{rgb}{.6,0,0} - \definecolor{green}{rgb}{0,.65,0} - \definecolor{brown}{rgb}{0.6,0.6,0} - \definecolor{blue}{rgb}{0,.145,.698} - \definecolor{purple}{rgb}{.698,.145,.698} - \definecolor{cyan}{rgb}{0,.698,.698} - \definecolor{lightgray}{gray}{0.5} - - % bright ansi colors - \definecolor{darkgray}{gray}{0.25} - \definecolor{lightred}{rgb}{1.0,0.39,0.28} - \definecolor{lightgreen}{rgb}{0.48,0.99,0.0} - \definecolor{lightblue}{rgb}{0.53,0.81,0.92} - \definecolor{lightpurple}{rgb}{0.87,0.63,0.87} - \definecolor{lightcyan}{rgb}{0.5,1.0,0.83} - - % commands and environments needed by pandoc snippets - % extracted from the output of `pandoc -s` - \DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}} - % Add ',fontsize=\small' for more characters per line - \newenvironment{Shaded}{}{} - \newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}} - \newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}} - \newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} - \newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} - \newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}} - \newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} - \newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}} - \newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{{#1}}}} - \newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}} - \newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}} - \newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}} - \newcommand{\RegionMarkerTok}[1]{{#1}} - \newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}} - \newcommand{\NormalTok}[1]{{#1}} - - % Define a nice break command that doesn't care if a line doesn't already - % exist. - \def\br{\hspace*{\fill} \\* } - % Math Jax compatability definitions - \def\gt{>} - \def\lt{<} - % Document parameters - -\title{ } - - - -\author{J.-F. Bercher} - - - - % Pygments definitions - -\makeatletter -\def\PY@reset{\let\PY@it=\relax \let\PY@bf=\relax% - \let\PY@ul=\relax \let\PY@tc=\relax% - \let\PY@bc=\relax \let\PY@ff=\relax} -\def\PY@tok#1{\csname PY@tok@#1\endcsname} -\def\PY@toks#1+{\ifx\relax#1\empty\else% - \PY@tok{#1}\expandafter\PY@toks\fi} -\def\PY@do#1{\PY@bc{\PY@tc{\PY@ul{% - \PY@it{\PY@bf{\PY@ff{#1}}}}}}} -\def\PY#1#2{\PY@reset\PY@toks#1+\relax+\PY@do{#2}} - -\expandafter\def\csname PY@tok@vc\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} -\expandafter\def\csname PY@tok@nt\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} -\expandafter\def\csname PY@tok@gt\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}} -\expandafter\def\csname PY@tok@go\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.53,0.53,0.53}{##1}}} -\expandafter\def\csname PY@tok@kc\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} -\expandafter\def\csname PY@tok@nc\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}} -\expandafter\def\csname PY@tok@kn\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} -\expandafter\def\csname PY@tok@nv\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} -\expandafter\def\csname PY@tok@c1\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}} -\expandafter\def\csname PY@tok@sr\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.53}{##1}}} -\expandafter\def\csname PY@tok@mo\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} -\expandafter\def\csname PY@tok@se\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.13}{##1}}} -\expandafter\def\csname PY@tok@nf\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}} -\expandafter\def\csname PY@tok@o\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} -\expandafter\def\csname PY@tok@sh\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} -\expandafter\def\csname PY@tok@k\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} -\expandafter\def\csname PY@tok@ge\endcsname{\let\PY@it=\textit} -\expandafter\def\csname PY@tok@s\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} -\expandafter\def\csname PY@tok@sc\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} -\expandafter\def\csname PY@tok@gu\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}} -\expandafter\def\csname PY@tok@sb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} -\expandafter\def\csname PY@tok@ss\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} -\expandafter\def\csname PY@tok@mf\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} -\expandafter\def\csname PY@tok@c\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}} -\expandafter\def\csname PY@tok@il\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} -\expandafter\def\csname PY@tok@gi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.63,0.00}{##1}}} -\expandafter\def\csname PY@tok@ne\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.82,0.25,0.23}{##1}}} -\expandafter\def\csname PY@tok@kp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} -\expandafter\def\csname PY@tok@bp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} -\expandafter\def\csname PY@tok@vi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} -\expandafter\def\csname PY@tok@ow\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}} -\expandafter\def\csname PY@tok@gr\endcsname{\def\PY@tc##1{\textcolor[rgb]{1.00,0.00,0.00}{##1}}} -\expandafter\def\csname PY@tok@sx\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} -\expandafter\def\csname PY@tok@w\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}} -\expandafter\def\csname PY@tok@na\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.49,0.56,0.16}{##1}}} -\expandafter\def\csname PY@tok@gh\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}} -\expandafter\def\csname PY@tok@s2\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} -\expandafter\def\csname PY@tok@gd\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}} -\expandafter\def\csname PY@tok@kt\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.69,0.00,0.25}{##1}}} -\expandafter\def\csname PY@tok@cs\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}} -\expandafter\def\csname PY@tok@gp\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}} -\expandafter\def\csname PY@tok@cm\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.25,0.50,0.50}{##1}}} -\expandafter\def\csname PY@tok@nb\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} -\expandafter\def\csname PY@tok@s1\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} -\expandafter\def\csname PY@tok@nd\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}} -\expandafter\def\csname PY@tok@no\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.53,0.00,0.00}{##1}}} -\expandafter\def\csname PY@tok@si\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.73,0.40,0.53}{##1}}} -\expandafter\def\csname PY@tok@m\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} -\expandafter\def\csname PY@tok@kr\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} -\expandafter\def\csname PY@tok@err\endcsname{\def\PY@bc##1{\setlength{\fboxsep}{0pt}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}} -\expandafter\def\csname PY@tok@ni\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.60,0.60,0.60}{##1}}} -\expandafter\def\csname PY@tok@nn\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}} -\expandafter\def\csname PY@tok@gs\endcsname{\let\PY@bf=\textbf} -\expandafter\def\csname PY@tok@mh\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} -\expandafter\def\csname PY@tok@mi\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}} -\expandafter\def\csname PY@tok@cp\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.74,0.48,0.00}{##1}}} -\expandafter\def\csname PY@tok@kd\endcsname{\let\PY@bf=\textbf\def\PY@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}} -\expandafter\def\csname PY@tok@vg\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}} -\expandafter\def\csname PY@tok@sd\endcsname{\let\PY@it=\textit\def\PY@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}} -\expandafter\def\csname PY@tok@nl\endcsname{\def\PY@tc##1{\textcolor[rgb]{0.63,0.63,0.00}{##1}}} - -\def\PYZbs{\char`\\} -\def\PYZus{\char`\_} -\def\PYZob{\char`\{} -\def\PYZcb{\char`\}} -\def\PYZca{\char`\^} -\def\PYZam{\char`\&} -\def\PYZlt{\char`\<} -\def\PYZgt{\char`\>} -\def\PYZsh{\char`\#} -\def\PYZpc{\char`\%} -\def\PYZdl{\char`\$} -\def\PYZhy{\char`\-} -\def\PYZsq{\char`\'} -\def\PYZdq{\char`\"} -\def\PYZti{\char`\~} -% for compatibility with earlier versions -\def\PYZat{@} -\def\PYZlb{[} -\def\PYZrb{]} -\makeatother - - - - - % Prevent overflowing lines due to hard-to-break entities - \sloppy - % Setup hyperref package -% \hypersetup{ -% breaklinks=true, % so long urls are correctly broken across lines -% hidelinks -% } -%%% Further colors and hyperref configuration -% Colors -\definecolor{webgreen}{rgb}{0,.5,0} -\definecolor{webbrown}{rgb}{.6,0,0} -\definecolor{webyellow}{rgb}{0.98,0.92,0.73} -\definecolor{webgray}{rgb}{.753,.753,.753} -\definecolor{webblue}{rgb}{0,0,.8} - -\hypersetup{bookmarks,bookmarksnumbered,%bookmarksopen, -colorlinks,linkcolor=webbrown,filecolor=webgreen,citecolor=webgreen, -breaklinks=true, -hyperindex=true -urlcolor=webbrown,pagebackref,pdfpagemode=None,pdfstartview=Fit} - % 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} - -%\usepackage{xcolor} -\definecolor{mylstbkg}{rgb}{1,0.899,0.8} - - \lstset{ -language=Python, -commentstyle=\color{mygreen}, -keywordstyle=\color{blue}, -stringstyle=\color{mymauve}, -xleftmargin= 1cm, -xrightmargin= 1cm, -showstringspaces=false, - breaklines=true, - texcl=false, -% basicstyle=\ttfamily, -basicstyle=\footnotesize, -frame=none, %was single -%frameround=tttt, %was not% -framesep=10pt, -backgroundcolor=\color{mylstbkg}, -%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 -} - - -%\usepackage{foo} diff --git a/testing/latex_envs/conversion/ipynb_thms_to_html b/testing/latex_envs/conversion/ipynb_thms_to_html deleted file mode 100755 index 87fa74c..0000000 --- a/testing/latex_envs/conversion/ipynb_thms_to_html +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -#This is to convert to html the notebooks with embedded LaTex structures -#as used in the latex_envs extension -#required: nodejs, perl - -listOfFiles=$* -#from http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in -SDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) - -if [ ! -f ./thmsInNb.tpl ] -then - cp -n $SDIR/thmsInNb.tpl . # for conversion, the template file must be in the same directory (or in templates/html dir) - thmsInNbCopied=true -fi - - -for f in $listOfFiles -do - echo [Translating... $f ] - cp $f temp.ipynb - perl -pi -e s/'\\\\\['/'\$\$'/ temp.ipynb - perl -pi -e s/'\\\\\]'/'\$\$'/ temp.ipynb - ipython3 nbconvert --template=thmsInNb --to html temp --output temp - echo [Post Html processing] - nodejs $SDIR/post_html_thms.js < temp.html > ${f%.ipynb}.html - #echo [Updating links] - #perl -pi -e s/.ipynb/.html/g ${f%.ipynb}.html - echo Done -done -cp -n ~/.ipython/nbextensions/latex_envs.css . # copy the css file in the same directory as the html -if $thmsInNbCopied - then rm thmsInNb.tpl #cleaning -fi - - diff --git a/testing/latex_envs/conversion/ipynb_thms_to_latex b/testing/latex_envs/conversion/ipynb_thms_to_latex deleted file mode 100755 index be9cf45..0000000 --- a/testing/latex_envs/conversion/ipynb_thms_to_latex +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -# example: ./ipynb_thms_to_latex Lect*.ipynb - - -listOfFiles=$* -#from http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in -SDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -echo $SDIR - -cp -n $SDIR/thmsInNb_article.tplx . # for conversion, the template file must be in the same directory (or in templates/html dir) -#cp -n $SDIR/thmsInNb_book.tplx . # for conversion, the template file must be in the same directory (or in templates/html dir) -for f in $listOfFiles -do - temp=${f%.ipynb}_tmp.ipynb - cp $f $temp - # corrections in some markdown cells - perl -pi -e s/'\\\\\['/'\$\$'/ $temp - perl -pi -e s/'\\\\\]'/'\$\$'/ $temp - # convert ipynb to latex - ipython3 nbconvert --to latex --template thmsInNb_article $temp - #ipython nbconvert --to latex --template thmsInNb_book $temp - - ## postprocessing - python3 $SDIR/thmInNb_tolatex.py ${temp%.ipynb}.tex ${f%.ipynb}.tex #conversion of remaining environments - python3 $SDIR/texheaders_rm.py ${f%.ipynb}.tex #remove headers and footers (optional -- can be commented) - #python3 $SDIR/toc_and_cln.py ${f%.ipynb}.tex - # want to number everything - perl -pi -e s/'\\\['/'\\begin{equation}'/ ${f%.ipynb}.tex - perl -pi -e s/'\\\]'/'\\end{equation}'/ ${f%.ipynb}.tex -done -echo Cleaning... -rm *_tmp.* -#rm thmsInNb_article.tplx - diff --git a/testing/latex_envs/conversion/latex_env_doc.ipynb b/testing/latex_envs/conversion/latex_env_doc.ipynb deleted file mode 100644 index 9bf2fdd..0000000 --- a/testing/latex_envs/conversion/latex_env_doc.ipynb +++ /dev/null @@ -1,705 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "application/javascript": [ - "IPython.load_extensions('calico-document-tools');" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "%%javascript \n", - "IPython.load_extensions('calico-document-tools');" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "application/javascript": [ - "IPython.load_extensions('latex_envs');" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "%%javascript \n", - "IPython.load_extensions('latex_envs');" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "%%html\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Goal" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Initial goal" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The initial goal was only to add an environment `theorem` in my workflow. That is to be able to type something like\n", - "\\begin{listing}\n", - "\\begin{theorem} \n", - "Let $u$ and $v$ be two vectors of $\\mathbb{R}^n$. The dot product can be expressed as\n", - "$$u^Tv = |u||v| \\cos \\theta,$$ \n", - "where $\\theta$ is the angle between $u$ and $v$ ...\n", - "\\end{theorem}\n", - "\\end{listing}\n", - "in a markdown cell and have it rendered, like\n", - "\n", - "\\begin{theorem}\n", - "Let $u$ and $v$ be two vectors of $\\mathbb{R}^n$. The dot product can be expressed as $$u^Tv = |u||v| \\cos \\theta,$$ where $\\theta$ is the angle between $u$ and $v$ ...\n", - "\\end{theorem}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Features" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The initial project has evolved to account for more environments and introduce some other features." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Support for simple LaTeX commands" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We also added some LaTeX commands (e.g. `\\textit`, `\\textbf`, `\\underline`) -- this is useful in the case of copy-paste from a LaTeX document. Labels and references are supported, including for equations." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Available environments" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "- **theorems-like environments**: *property, theorem, lemma, corollary, proposition, definition,remark, problem, exercise, example*,\n", - "- **lists**: *enumerate, itemize*, \n", - "- limited support for a *figure* environment,\n", - "- an environment *listing*,\n", - "- *textboxa*, wich is a `textbox` environment defined as a demonstration (see below).\n", - "\n", - "More environments can be added easily in the javascript source file `thmsInNb.js`. The rendering is done according to the stylesheet `latex_env.css`, which can be customized." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Automatic numerotation" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Counters for numbering are implemented: one for theorems-like environments, a second for exercises-like environments and a third one for numbering figures. \n", - "Mathjax-equations with a label are also numbered document-wide (in contrast with standard notebook/mathjax numbering where the scope of numbering is limited to cells). \n", - "An anchor is created for any label which enables to links things in the document: `\\label` and `\\ref` are both supported. A limitation is that numbering is updated (incremented) each time a cell is rendered. A toolbar button is provided to reset the counters and refresh the rendering of the whole document." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Other features" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "- It is possible to mix LaTeX and markdown markup in environments \n", - "- Environments can be nested. However, this is not always perfect..." - ] - }, - { - "cell_type": "markdown", - "metadata": { - "collapsed": true - }, - "source": [ - "# Usage and examples" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Installation" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The extension consists in two javascript scripts: `latex_envs.js`, `thmsInNb.js` together with a stylesheet `latex_envs.css`. \n", - "Follow the instructions in the [wiki](https://github.com/ipython-contrib/IPython-notebook-extensions/wiki) to install the extension. You can simply copy these files in the notebook extension directory (usually ~/.ipython/nbextensions) and load the extension in the notebook by \n", - "\n", - " %%javascript \n", - " IPython.load_extensions('latex_envs');" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## A first example" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This example shows another example of environment, featuring automatic numerotation, and the use of labels and references. Also note that standard markdown can be present in the environment and is interpreted. \n", - "*The rendering is done according to the stylesheet `latex_env.css`, which of course, can be tailored to specific uses and tastes*. " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\\begin{listing}\n", - "\\begin{definition} \\label{def:FT}\n", - "Let $x[n]$ be a sequence of length $N$. Then, its **Fourier transform** is given by\n", - "\\begin{equation}\n", - "\\label{eq:FT}\n", - "X[k]= \\frac{1}{N} \\sum_{n=0}^{N-1} x[n] e^{-j2\\pi \\frac{kn}{N}}\n", - "\\end{equation}\n", - "\\end{definition}\n", - "\\end{listing}\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "\\begin{definition} \\label{def:FT}\n", - "Let $x[n]$ be a sequence of length $N$. Then, its **Fourier transform** is given by\n", - "\\begin{equation}\n", - "\\label{eq:FT2}\n", - "X[k]= \\frac{1}{N} \\sum_{n=0}^{N-1} x[n] e^{-j2\\pi \\frac{kn}{N}}\n", - "\\end{equation}\n", - "\\end{definition}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This is an extremely important tool in signal processing. We put this in evidence using the `textboxa` environment -- which is defined here in the css, and that one should define in the LaTeX counterpart:\n", - "\\begin{listing}\n", - "\\begin{textboxa}\n", - "The Fourier transform is an extremely useful tool to have in your toolbox!\n", - "\\end{textboxa}\n", - "\\end{listing}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\\begin{textboxa}\n", - "The Fourier transform is an extremely useful tool to have in your toolbox!\n", - "\\end{textboxa}\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "As an example, consider the Fourier transform (\\ref{eq:FT2}) of a pure cosine wave given by\n", - "$$\n", - "x[n]= \\cos(2\\pi k_0 n/N),\n", - "$$\n", - "where $k_0$ is an integer. Its Fourier transform is given by \n", - "$$\n", - "X[k] = \\frac{1}{2} \\left( \\delta[k-k_0] + \\delta[k-k_0] \\right), \n", - "$$\n", - "modulo $N$. This is illustrated in the following simple script:" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAEZCAYAAACKF66QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGkVJREFUeJzt3Xu8XGV97/HPV8KdCEbaEJGbYsQqIlbRqj1svHCAo0hb\nRbHFeMOengq8PN6gVkk9VdS2pyhWX1URo1IQLUSwKEROIuANgSAiIKIGUMkGFDTIRYTv+WM9m0yG\nmdkze8/O7Gfn+3699ivr+qzfrD35zrOfNbNGtomIiHo9YtQFRETE9CTIIyIqlyCPiKhcgjwionIJ\n8oiIyiXIIyIqlyAPACR9TNLfj7qOYZC0UNJFkn4j6Z9GXU8rSVtLOlfSnZI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BfDolvY+CVwDXKHm29s/xvqecad3dtxPM4Z9chluOZ/Sw7d9\nBfBrug+rtLbZrf32x3Bpy+q/BF5fjns1cKikRwMnAm+w/SOaLyfv9BbHS1j/QjZxfGwfS3NN4v1l\n+b7At7rUH5ug3MY2RkrSCcBdtjfK14NJegyw0vYTJ914IysXZVfafuYk270P+K7ts3ttF5uO9Mhj\nNtgovQlJrwa+DfzdxjjeoMpF2ZWSDui2TRlWeR75RqNokR55RETl0iOPiKhcgjwionIJ8oiIyiXI\nIyIqlyCPiKhcgjwionL/H9EXA/71Eb4cAAAAAElFTkSuQmCC\n", - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "%matplotlib inline\n", - "import numpy as np\n", - "import matplotlib.pyplot as plt \n", - "from numpy.fft import fft\n", - "k0=4; N=128; n=np.arange(N); k=np.arange(N)\n", - "x=np.sin(2*np.pi*k0*n/N)\n", - "X=fft(x)\n", - "plt.stem(k,np.abs(X))\n", - "plt.xlim([0, 20])\n", - "plt.title(\"Fourier transform of a cosine\")\n", - "_=plt.xlabel(\"Frequency index (k)\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Second example" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This example shows a series of environments, with different facets; **links, references, markdown or/and LaTeX formatting within environments**. Again, the rendering is done according to the stylesheet `latex_env.css`, which can be tailored. The listing of environments below is typed using the environment *listing*..." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\\begin{listing}\n", - "\\begin{definition} \\label{def:diffeq}\n", - "We call \\textbf{difference equation} an equation of the form\n", - "$$\n", - "\\label{eq:diffeq}\n", - "y[n]= \\sum_{k=1}^{p} a_k y[n-k] + \\sum_{i=0}^q b_i x[n-i]\n", - "$$\n", - "\\end{definition}\n", - "\n", - "\\begin{property}\n", - "If all the $a_k$ in equation (\\ref{eq:diffeq}) of definition \\ref{def:diffeq} are zero, then the filter has a **finite impulse response**. \n", - "\\end{property}\n", - "\n", - "\\begin{proof}\n", - "Let $\\delta[n]$ denote the Dirac impulse. Take $x[n]=\\delta[n]$ in (\\ref{eq:diffeq}). This yields, by definition, the impulse response:\n", - "$$\n", - "\\label{eq:fir}\n", - "h[n]= \\sum_{i=0}^q b_i \\delta[n-i],\n", - "$$\n", - "which has finite support. \n", - "\\end{proof}\n", - "\n", - "\\begin{theorem}\n", - "The poles of a causal stable filter are located within the unit circle in the complex plane.\n", - "\\end{theorem}\n", - "\n", - "\\begin{example} \\label{ex:IIR1}\n", - "Consider $y[n]= a y[n-1] + x[n]$. The pole of the transfer function is $z=a$. The impulse response $h[n]=a^n$ has infinite support.\n", - "\\end{example}\n", - "\n", - "In the following exercise, you will check that the filter is stable iff $a$<1.\n", - "\n", - "\\begin{exercise}\\label{ex:exofilter}\n", - "Consider the filter defined in Example \\ref{ex:IIR1}. Using the **function** `lfilter` of scipy, compute and plot the impulse response for several values of $a$.\n", - "\\end{exercise}\n", - "\n", - "\\end{listing}\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The lines above are rendered as follows (of course everything can be tailored in the stylesheet):\n", - "\n", - "\\begin{definition} \\label{def:diffeq}\n", - "We call \\textbf{difference equation} an equation of the form\n", - "\\begin{equation}\n", - "\\label{eq:diffeq}\n", - "y[n]= \\sum_{k=1}^{p} a_k y[n-k] + \\sum_{i=0}^q b_i x[n-i]\n", - "\\end{equation}\n", - "\\end{definition}\n", - "Properties of the filter are linked to the coefficients of the difference equation. For instance, an immediate property is \n", - "\n", - "\\begin{property}\n", - "If all the $a_k$ in equation (\\ref{eq:diffeq}) of definition \\ref{def:diffeq} are zero, then the filter has a **finite impulse response**. \n", - "\\end{property}\n", - "\n", - "\\begin{proof}\n", - "Let $\\delta[n]$ denote the Dirac impulse. Take $x[n]=\\delta[n]$ in (\\ref{eq:diffeq}). This yields, by definition, the impulse response:\n", - "\\begin{equation}\n", - "\\label{eq:fir}\n", - "h[n]= \\sum_{i=0}^q b_i \\delta[n-i],\n", - "\\end{equation}\n", - "which has finite support. \n", - "\\end{proof}\n", - "\n", - "\n", - "\\begin{theorem}\n", - "The poles of a causal stable filter are located within the unit circle in the complex plane.\n", - "\\end{theorem}\n", - "\n", - "\n", - "\\begin{example} \\label{ex:IIR1}\n", - "Consider $y[n]= a y[n-1] + x[n]$. The pole of the transfer function is $z=a$. The impulse response $h[n]=a^n$ has infinite support.\n", - "\\end{example}\n", - "\n", - "In the following exercise, you will check that the filter is stable iff $a$<1.\n", - "\n", - "\\begin{exercise}\\label{ex:exofilter}\n", - "Consider the filter defined in Example \\ref{ex:IIR1}. Using the **function** `lfilter` of scipy, compute and plot the impulse response for several values of $a$.\n", - "\\end{exercise}\n", - "\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\\begin{listing}\n", - "The solution of exercise \\ref{ex:exofilter}, which uses a difference equation as in Definition \\ref{def:diffeq}:\n", - "\\end{listing}\n", - "The solution of exercise \\ref{ex:exofilter}, which uses a difference equation as in Definition \\ref{def:diffeq}:" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAEKCAYAAAAYd05sAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsnXeYlNX1xz8HBJQmRQRFUAGJFEGiQSnqtaCAQbFEg4A1\nUbEk/tSIGnXYKBE1RmNBsaFEsEUsCLHvVRHsigKiIkFBpQhI75zfH/edZXZ3dsruzLwzy/08z31m\n5i33Pe+wfN875557jqgqHo/H46l+1AjbAI/H4/FkBy/wHo/HU03xAu/xeDzVFC/wHo/HU03xAu/x\neDzVFC/wHo/HU03ZKVcXEhEfj+nxeDyVQFWlMuflTOCh8kZWN0RkhKqOCNuOsBChJnAZcA2c+BG8\ncLwqW8O2K2x29L+LWPx3sZ2qDI69i8aTU0ToCLwLDAAOhRff8+L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8ifwHbj+5UnGiK7Eg/zd7kNy53TPkhqIjjx3YU3LpAXJH\nkCt+fjR0CiGElhp7Q6cQQghrIxJ8CCG0VCT4EEJoqUjwIYTQUpHgQwihpSLBhxBCS0WCD60j6TWl\nS+J9kv4habaUj0q6ca33L4TVEs/Bh1aT9FXgqO1vrfW+hLDa4go+dIEAJF0+NNDIDZJ+Iul3kv4m\n6SOSviHpL5LuLl3XIukdkh6Q9JCkXzV9hIRwNogEH7psK/Bucv/bPyUPsvBW4EXg/aWjuO8BH7V9\nEXlwhq+t1c6GcLpWHHQ7hBYzcLftgaRHgMr2PWXdfnL3tduANwP35X6wqMn9hoRwVogEH7rsBIDt\nJGluaHkinxsCHrV96VrsXAivVNyiCV217KAjSzwBvFbSTsh9+5dxMUM4K0SCD13goelyZTh5ZBw7\njyP8MeDrkpouny8Z546G8P8Uj0mGEEJLxRV8CCG0VCT4EEJoqUjwIYTQUpHgQwihpSLBhxBCS0WC\nDyGElooEH0IILRUJPoQQWup/lAtzMWJ4g58AAAAASUVORK5CYII=\n", - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "%matplotlib inline\n", - "import numpy as np\n", - "import matplotlib.pyplot as plt \n", - "from scipy.signal import lfilter\n", - "d=np.zeros(100); d[0]=1 #dirac impulse\n", - "alist=[0.2, 0.8, 0.9, 0.95, 0.99, 0.999, 1.001, 1.01]\n", - "for a in alist:\n", - " h=lfilter([1], [1, -a],d)\n", - " _=plt.plot(h, label=\"a={}\".format(a))\n", - "plt.ylim([0,1.5])\n", - "plt.xlabel('Time')\n", - "_=plt.legend()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Finally, it is sometimes useful to integrate a figure within a markdown cell. The standard markdown markup for that is `![link](image)`, but a limitation is that the image can not be resized, can not be referenced and is not numbered. Furthermore it can be useful to re-use existing code. Threfore we have added a limited support for the `figure` environment. This enables to do something like\n", - "\\begin{listing}\n", - "\\begin{figure}[H]\n", - "\\centerline{\\includegraphics[width=10cm]{example.png}}\n", - "\\caption{\\label{fig:example} This is an example of figure included using LaTeX commands.}\n", - "\\end{figure}\n", - "\\end{listing}\n", - "which renders as\n", - "\\begin{figure}[H]\n", - "\\centerline{\\includegraphics[width=10cm]{example.png}}\n", - "\\caption{\\label{fig:example} This is an example of figure included using LaTeX commands.}\n", - "\\end{figure}\n", - "Of course, this Figure can now be referenced: \n", - "\\begin{listing}\n", - "Figure \\ref{fig:example} shows a second filter with input $X_2$, output $Y_2$ and an impulse response denoted as $h_2(n)$\n", - "\\end{listing}\n", - "Figure \\ref{fig:example} shows a second filter with input $X_2$, output $Y_2$ and an impulse response denoted as $h_2(n)$" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Third example:" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This example shows that environments like itemize or enumerate are also available. As already indicated, this is useful for copying text from a TeX file. Following the same idea, text formating commands `\\textit`, `\\textbf`, `\\underline`, etc are also available." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\\begin{listing}\n", - "The following \\textit{environments} are available:\n", - "\\begin{itemize}\n", - " \\item \\textbf{Theorems and likes}\n", - " \\begin{enumerate}\n", - " \\item theorem,\n", - " \\item lemma,\n", - " \\item corollary\n", - " \\item ...\n", - " \\end{enumerate}\n", - " \\item \\textbf{exercises}\n", - " \\begin{enumerate}\n", - " \\item problem,\n", - " \\item example,\n", - " \\item exercise\n", - " \\end{enumerate}\n", - "\\end{itemize}\n", - "\\end{listing}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "which gives... \n", - "\n", - "The following \\textit{environments} are available:\n", - "\\begin{itemize}\n", - "\\item \\textbf{Theorems and likes}\n", - "\\begin{enumerate}\n", - "\\item theorem,\n", - "\\item lemma,\n", - "\\item corollary\n", - "\\item ...\n", - "\\end{enumerate}\n", - "\\item \\textbf{exercises}\n", - "\\begin{enumerate}\n", - "\\item problem,\n", - "\\item example,\n", - "\\item exercise\n", - "\\end{enumerate}\n", - "\\end{itemize}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# (post)-Converters" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The extension works in the live-notebook. Since it relies on a bunch of javascript, the notebook does not render as is in very nice services such as `nbviewer` or `github` viewer. Similarly, `nbconvert` does not know of the LaTeX constructs which are used and therefore do not fully convert notebooks making use of this extension. Therefore, it is necessary to add a post conversion step to conversions provided by `nbconvert`. Though an interface exists for adding post-converters to nbconvert, this (first) author was too lazy and not enough strong to implement the post conversion along these lines. What has be done are simple `bash` and `python` scripts that perform this conversion." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Installation" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copy the scripts files to a directory in your search path, or launch the scripts with the complete path. The two main scripts are `ipynb_thms_to_html` (conversion to html, of course:) and `ipynb_thms_to_latex` (conversion to LaTeX!)." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Conversion to html" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Requirements**: You will need `perl`, `nodejs`, and `ipython3` (the script calls `ipython3`; if your interpreter is `ipython`, edit the script and replace the different occurences).\n", - "\n", - "The conversion to html is done by something like \n", - "\n", - " [path/]ipynb_thms_to_html filename\n", - "or a list of files such as\n", - "\n", - " [path/]ipynb_thms_to_html *.ipynb\n", - "In turn, this script makes somes substitutions using `perl`, and then uses the `nodesj` javascript interpreter to make the very same substitutions that are done in the live notebook.\n", - "The conversion uses the template `thmsInNb.tpl` (located in the script directory). It also copies the css `latex_env.css` in the directory of the output html file (it must be copied with html files in the case of web upload)." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Conversion to LaTeX" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Requirements**: You will need `perl` and `ipython3`. \n", - "\n", - "The conversion to LaTeX is done by something like \n", - "\n", - " [path/]ipynb_thms_to_latex filename\n", - "or a list of files such as\n", - "\n", - " [path/]ipynb_thms_to_latex *.ipynb\n", - " \n", - "The script makes some substitutions and cleaning in arkdown cells, then calls the legacy `nbconvert`. Afterward, it runs through the LaTeX environments and converts their contents (which can contain markdown markup) to LaTeX. Note that the script contains a list of the LaTeX environments to process. In the case of the addition of an environment in the main javascript (`thmsInNb.js`), this list must also be updated. \n", - "\n", - "Finally, the script removes the header and footer in the LaTeX file. This is a personnal choice, and the corresponding line can be safely commented. \n", - "\n", - "\\begin{example}\n", - "As for an example, the present document has been converted using\n", - " \n", - " ipynb_thms_to_latex latex_env_doc.ipynb\n", - " \n", - "Then the resulting file (without header/footer) has been included in the main file `documentation.tex`, where some LaTeX definitions of environments are done (namely listings, colors, etc) and compiled using \n", - " \n", - " xelatex documentation\n", - " \n", - "The output can be consulted [here](documentation.pdf). \n", - "\\end{example}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Disclaimer, sources and thanks" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This is a not-quick but certainly dirty hack. I am a complete beginner in javascript and of course there are obviously a large amount of possible improvements of the code, in cleaning, factorizing, etc! Language also needs improvement. \n", - "\n", - "**Contributions will be welcome and deeply appreciated.** \n", - "\n", - "Originally, I used a piece of code from the nice online markdown editor `stackedit` [https://github.com/benweet/stackedit/issues/187](https://github.com/benweet/stackedit/issues/187), where the authors also considered the problem of incorporating LaTeX markup in their markdown. I also used examples and code from [https://github.com/ipython-contrib/IPython-notebook-extensions](https://github.com/ipython-contrib/IPython-notebook-extensions). \n" - ] - }, - { - "cell_type": "code", - "execution_count": 101, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "application/javascript": [ - "IPython.load_extensions('latex_envs');" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "%%javascript \n", - "IPython.load_extensions('latex_envs');" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.4.3+" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/testing/latex_envs/conversion/latex_env_doc.tex b/testing/latex_envs/conversion/latex_env_doc.tex deleted file mode 100644 index 40cddae..0000000 --- a/testing/latex_envs/conversion/latex_env_doc.tex +++ /dev/null @@ -1,570 +0,0 @@ - - - - - - -%~\par -%\newpage - - - - % No prompt! -%\textbf{Input \#{}}% -\begin{lstlisting} -%%javascript -IPython.load_extensions('calico-document-tools'); -\end{lstlisting}% No prompt! -%\textbf{Output \#{}} -% - - \begin{verbatim} - - \end{verbatim} - - % No prompt! -%\textbf{Input \#{}}% -\begin{lstlisting} -%%javascript -IPython.load_extensions('latex_envs'); -\end{lstlisting}% No prompt! -%\textbf{Output \#{}} -% - - \begin{verbatim} - - \end{verbatim} - - % No prompt! -%\textbf{Input \#{}}% -\begin{lstlisting} -%%html - -\end{lstlisting} - \section{Goal}\label{goal} - - \subsection{Initial goal}\label{initial-goal} - - The initial goal was only to add an environment \texttt{theorem} in my -workflow. That is to be able to type something like - -\begin{listing} -\begin{theorem} -Let $u$ and $v$ be two vectors of $\mathbb{R}^n$. The dot product can be -expressed as \begin{equation}u^Tv = |u||v| \cos \theta,\end{equation} where $\theta$ is the angle -between $u$ and $v$ \ldots{} -\end{theorem} -\end{listing} - -in a markdown cell and have it rendered, like - -\begin{theorem} -Let $u$ and $v$ be two vectors of $\mathbb{R}^n$. The dot product can be -expressed as \begin{equation}u^Tv = |u||v| \cos \theta,\end{equation} where $\theta$ is the angle -between $u$ and $v$ \ldots{} -\end{theorem} - - \subsection{Features}\label{features} - - The initial project has evolved to account for more environments and -introduce some other features. - - \subsubsection{Support for simple LaTeX -commands}\label{support-for-simple-latex-commands} - - We also added some LaTeX commands (e.g. \texttt{\textbackslash{}textit}, -\texttt{\textbackslash{}textbf}, \texttt{\textbackslash{}underline}) -- -this is useful in the case of copy-paste from a LaTeX document. Labels -and references are supported, including for equations. - - \subsubsection{Available environments}\label{available-environments} - - \begin{itemize} -\itemsep1pt\parskip0pt\parsep0pt -\item - \textbf{theorems-like environments}: \emph{property, theorem, lemma, - corollary, proposition, definition,remark, problem, exercise, - example}, -\item - \textbf{lists}: \emph{enumerate, itemize},\\ -\item - limited support for a \emph{figure} environment, -\item - an environment \emph{listing}, -\item - \emph{textboxa}, wich is a \texttt{textbox} environment defined as a - demonstration (see below). -\end{itemize} - -More environments can be added easily in the javascript source file -\texttt{thmsInNb.js}. The rendering is done according to the stylesheet -\texttt{latex\_env.css}, which can be customized. - - \subsubsection{Automatic numerotation}\label{automatic-numerotation} - - Counters for numbering are implemented: one for theorems-like -environments, a second for exercises-like environments and a third one -for numbering figures.\\Mathjax-equations with a label are also numbered -document-wide (in contrast with standard notebook/mathjax numbering -where the scope of numbering is limited to cells). An anchor is created -for any label which enables to links things in the document: -\texttt{\textbackslash{}label} and \texttt{\textbackslash{}ref} are both -supported. A limitation is that numbering is updated (incremented) each -time a cell is rendered. A toolbar button is provided to reset the -counters and refresh the rendering of the whole document. - - \subsubsection{Other features}\label{other-features} - - \begin{itemize} -\itemsep1pt\parskip0pt\parsep0pt -\item - It is possible to mix LaTeX and markdown markup in environments\\ -\item - Environments can be nested. However, this is not always - perfect\ldots{} -\end{itemize} - - \section{Usage and examples}\label{usage-and-examples} - - \subsection{Installation}\label{installation} - - The extension consists in two javascript scripts: -\texttt{latex\_envs.js}, \texttt{thmsInNb.js} together with a stylesheet -\texttt{latex\_envs.css}. Follow the instructions in the -\href{https://github.com/ipython-contrib/IPython-notebook-extensions/wiki}{wiki} -to install the extension. You can simply copy these files in the -notebook extension directory (usually -\textasciitilde{}/.ipython/nbextensions) and load the extension in the -notebook by - -\begin{verbatim} -%%javascript -IPython.load_extensions('latex_envs'); -\end{verbatim} - - \subsection{A first example}\label{a-first-example} - - This example shows another example of environment, featuring automatic -numerotation, and the use of labels and references. Also note that -standard markdown can be present in the environment and is interpreted. -\emph{The rendering is done according to the stylesheet -\texttt{latex\_env.css}, which of course, can be tailored to specific -uses and tastes}. - - \begin{listing} -\begin{definition} -\label{def:FT} Let $x[n]$ be a sequence of length $N$. Then, its -\textbf{Fourier transform} is given by - -\begin{equation} -\label{eq:FT} -X[k]= \frac{1}{N} \sum_{n=0}^{N-1} x[n] e^{-j2\pi \frac{kn}{N}} -\end{equation} -\end{definition} -\end{listing} - - \begin{definition} -\label{def:FT} Let $x[n]$ be a sequence of length $N$. Then, its -\textbf{Fourier transform} is given by - -\begin{equation} -\label{eq:FT2} -X[k]= \frac{1}{N} \sum_{n=0}^{N-1} x[n] e^{-j2\pi \frac{kn}{N}} -\end{equation} -\end{definition} - - This is an extremely important tool in signal processing. We put this in -evidence using the \texttt{textboxa} environment -- which is defined -here in the css, and that one should define in the LaTeX counterpart: - -\begin{listing} -\begin{textboxa} -The Fourier transform is an extremely useful tool to have in your toolbox! -\end{textboxa} -\end{listing} - - \begin{textboxa} -The Fourier transform is an extremely useful tool to have in your toolbox! -\end{textboxa} - - As an example, consider the Fourier transform (\ref{eq:FT2}) of a pure -cosine wave given by \begin{equation} -x[n]= \cos(2\pi k_0 n/N), -\end{equation} where $k_0$ is an integer. Its Fourier transform is given by \begin{equation} -X[k] = \frac{1}{2} \left( \delta[k-k_0] + \delta[k-k_0] \right), -\end{equation} modulo $N$. This is illustrated in the following simple script: -% No prompt! -%\textbf{Input \#{}}% -\begin{lstlisting} -%matplotlib inline -import numpy as np -import matplotlib.pyplot as plt -from numpy.fft import fft -k0=4; N=128; n=np.arange(N); k=np.arange(N) -x=np.sin(2*np.pi*k0*n/N) -X=fft(x) -plt.stem(k,np.abs(X)) -plt.xlim([0, 20]) -plt.title("Fourier transform of a cosine") -_=plt.xlabel("Frequency index (k)") -\end{lstlisting}% No prompt! -%\textbf{Output \#{}} -% - \begin{center} - \adjustimage{max size={0.6\linewidth}{0.6\paperheight}}{latex_env_doc_tmp_files/latex_env_doc_tmp_26_0.png} - \end{center} -% { \hspace*{\fill} \\} - - \subsection{Second example}\label{second-example} - - This example shows a series of environments, with different facets; -\textbf{links, references, markdown or/and LaTeX formatting within -environments}. Again, the rendering is done according to the stylesheet -\texttt{latex\_env.css}, which can be tailored. The listing of -environments below is typed using the environment \emph{listing}\ldots{} - - \begin{listing} -\begin{definition} -\label{def:diffeq} We call \textbf{difference equation} an equation of -the form \begin{equation} -\label{eq:diffeq} -y[n]= \sum_{k=1}^{p} a_k y[n-k] + \sum_{i=0}^q b_i x[n-i] -\end{equation} -\end{definition} - -\begin{property} -If all the $a_k$ in equation (\ref{eq:diffeq}) of definition -\ref{def:diffeq} are zero, then the filter has a \textbf{finite impulse -response}. -\end{property} - -\begin{proof} -Let $\delta[n]$ denote the Dirac impulse. Take $x[n]=\delta[n]$ in -(\ref{eq:diffeq}). This yields, by definition, the impulse response: \begin{equation} -\label{eq:fir} -h[n]= \sum_{i=0}^q b_i \delta[n-i], -\end{equation} which has finite support. -\end{proof} - -\begin{theorem} -The poles of a causal stable filter are located within the unit circle -in the complex plane. -\end{theorem} - -\begin{example} -\label{ex:IIR1} Consider $y[n]= a y[n-1] + x[n]$. The pole of the -transfer function is $z=a$. The impulse response $h[n]=a^n$ has infinite -support. -\end{example} - -In the following exercise, you will check that the filter is stable iff $a$<1. - -\begin{exercise} -\label{ex:exofilter} Consider the filter defined in Example -\ref{ex:IIR1}. Using the \textbf{function} \texttt{lfilter} of scipy, -compute and plot the impulse response for several values of $a$. -\end{exercise} - -\end{listing} - - The lines above are rendered as follows (of course everything can be -tailored in the stylesheet): - -\begin{definition} -\label{def:diffeq} We call \textbf{difference equation} an equation of -the form - -\begin{equation} -\label{eq:diffeq} -y[n]= \sum_{k=1}^{p} a_k y[n-k] + \sum_{i=0}^q b_i x[n-i] -\end{equation} -\end{definition} - -Properties of the filter are linked to the coefficients of the -difference equation. For instance, an immediate property is - -\begin{property} -If all the $a_k$ in equation (\ref{eq:diffeq}) of definition -\ref{def:diffeq} are zero, then the filter has a \textbf{finite impulse -response}. -\end{property} - -\begin{proof} -Let $\delta[n]$ denote the Dirac impulse. Take $x[n]=\delta[n]$ in -(\ref{eq:diffeq}). This yields, by definition, the impulse response: - -\begin{equation} -\label{eq:fir} -h[n]= \sum_{i=0}^q b_i \delta[n-i], -\end{equation} - -which has finite support. -\end{proof} - -\begin{theorem} -The poles of a causal stable filter are located within the unit circle -in the complex plane. -\end{theorem} - -\begin{example} -\label{ex:IIR1} Consider $y[n]= a y[n-1] + x[n]$. The pole of the -transfer function is $z=a$. The impulse response $h[n]=a^n$ has infinite -support. -\end{example} - -In the following exercise, you will check that the filter is stable iff -$a$\textless{}1. - -\begin{exercise} -\label{ex:exofilter} Consider the filter defined in Example -\ref{ex:IIR1}. Using the \textbf{function} \texttt{lfilter} of scipy, -compute and plot the impulse response for several values of $a$. -\end{exercise} - - \begin{listing} -The solution of exercise \ref{ex:exofilter}, which uses a difference equation as in Definition \ref{def:diffeq}: -\end{listing} - -The solution of exercise \ref{ex:exofilter}, which uses a difference -equation as in Definition \ref{def:diffeq}: -% No prompt! -%\textbf{Input \#{}}% -\begin{lstlisting} -%matplotlib inline -import numpy as np -import matplotlib.pyplot as plt -from scipy.signal import lfilter -d=np.zeros(100); d[0]=1 #dirac impulse -alist=[0.2, 0.8, 0.9, 0.95, 0.99, 0.999, 1.001, 1.01] -for a in alist: - h=lfilter([1], [1, -a],d) - _=plt.plot(h, label="a={}".format(a)) -plt.ylim([0,1.5]) -plt.xlabel('Time') -_=plt.legend() -\end{lstlisting}% No prompt! -%\textbf{Output \#{}} -% - \begin{center} - \adjustimage{max size={0.6\linewidth}{0.6\paperheight}}{latex_env_doc_tmp_files/latex_env_doc_tmp_32_0.png} - \end{center} -% { \hspace*{\fill} \\} - - Finally, it is sometimes useful to integrate a figure within a markdown -cell. The standard markdown markup for that is -\texttt{!{[}link{]}(image)}, but a limitation is that the image can not -be resized, can not be referenced and is not numbered. Furthermore it -can be useful to re-use existing code. Threfore we have added a limited -support for the \texttt{figure} environment. This enables to do -something like - -\begin{listing} -\begin{figure}[H] -\centerline{\includegraphics[width=10cm]{example.png}} -\caption{\label{fig:example} This is an example of figure included using LaTeX commands.} -\end{figure} -\end{listing} - -which renders as - -\begin{figure}[H] -\centerline{\includegraphics[width=10cm]{example.png}} -\caption{\label{fig:example} This is an example of figure included using LaTeX commands.} -\end{figure} - -Of course, this Figure can now be referenced: - -\begin{listing} -Figure \ref{fig:example} shows a second filter with input $X_2$, output $Y_2$ and an impulse response denoted as $h_2(n)$ -\end{listing} - -Figure \ref{fig:example} shows a second filter with input $X_2$, output -$Y_2$ and an impulse response denoted as $h_2(n)$ - - \subsection{Third example:}\label{third-example} - - This example shows that environments like itemize or enumerate are also -available. As already indicated, this is useful for copying text from a -TeX file. Following the same idea, text formating commands -\texttt{\textbackslash{}textit}, \texttt{\textbackslash{}textbf}, -\texttt{\textbackslash{}underline}, etc are also available. - - \begin{listing} -The following \textit{environments} are available: -\begin{itemize} - \item \textbf{Theorems and likes} - \begin{enumerate} - \item theorem, - \item lemma, - \item corollary - \item ... - \end{enumerate} - \item \textbf{exercises} - \begin{enumerate} - \item problem, - \item example, - \item exercise - \end{enumerate} -\end{itemize} -\end{listing} - - which gives\ldots{} - -The following \textit{environments} are available: - -\begin{itemize} -\item \textbf{Theorems and likes} -\begin{enumerate} -\item theorem, -\item lemma, -\item corollary -\item ... -\end{enumerate} -\item \textbf{exercises} -\begin{enumerate} -\item problem, -\item example, -\item exercise -\end{enumerate} -\end{itemize} - - \section{(post)-Converters}\label{post-converters} - - The extension works in the live-notebook. Since it relies on a bunch of -javascript, the notebook does not render as is in very nice services -such as \texttt{nbviewer} or \texttt{github} viewer. Similarly, -\texttt{nbconvert} does not know of the LaTeX constructs which are used -and therefore do not fully convert notebooks making use of this -extension. Therefore, it is necessary to add a post conversion step to -conversions provided by \texttt{nbconvert}. Though an interface exists -for adding post-converters to nbconvert, this (first) author was too -lazy and not enough strong to implement the post conversion along these -lines. What has be done are simple \texttt{bash} and \texttt{python} -scripts that perform this conversion. - - \subsection{Installation}\label{installation} - - Copy the scripts files to a directory in your search path, or launch the -scripts with the complete path. The two main scripts are -\texttt{ipynb\_thms\_to\_html} (conversion to html, of course:) and -\texttt{ipynb\_thms\_to\_latex} (conversion to LaTeX!). - - \subsection{Conversion to html}\label{conversion-to-html} - - \textbf{Requirements}: You will need \texttt{perl}, \texttt{nodejs}, and -\texttt{ipython3} (the script calls \texttt{ipython3}; if your -interpreter is \texttt{ipython}, edit the script and replace the -different occurences). - -The conversion to html is done by something like - -\begin{verbatim} - [path/]ipynb_thms_to_html filename -\end{verbatim} - -or a list of files such as - -\begin{verbatim} - [path/]ipynb_thms_to_html *.ipynb -\end{verbatim} - -In turn, this script makes somes substitutions using \texttt{perl}, and -then uses the \texttt{nodesj} javascript interpreter to make the very -same substitutions that are done in the live notebook. The conversion -uses the template \texttt{thmsInNb.tpl} (located in the script -directory). It also copies the css \texttt{latex\_env.css} in the -directory of the output html file (it must be copied with html files in -the case of web upload). - - \subsection{Conversion to LaTeX}\label{conversion-to-latex} - - \textbf{Requirements}: You will need \texttt{perl} and -\texttt{ipython3}. - -The conversion to LaTeX is done by something like - -\begin{verbatim} - [path/]ipynb_thms_to_latex filename -\end{verbatim} - -or a list of files such as - -\begin{verbatim} - [path/]ipynb_thms_to_latex *.ipynb - -\end{verbatim} - -The script makes some substitutions and cleaning in arkdown cells, then -calls the legacy \texttt{nbconvert}. Afterward, it runs through the -LaTeX environments and converts their contents (which can contain -markdown markup) to LaTeX. Note that the script contains a list of the -LaTeX environments to process. In the case of the addition of an -environment in the main javascript (\texttt{thmsInNb.js}), this list -must also be updated. - -Finally, the script removes the header and footer in the LaTeX file. -This is a personnal choice, and the corresponding line can be safely -commented. - -\begin{example} -As for an example, the present document has been converted using - -\begin{verbatim} -ipynb_thms_to_latex latex_env_doc.ipynb -\end{verbatim} - -Then the resulting file (without header/footer) has been included in the -main file \texttt{documentation.tex}, where some LaTeX definitions of -environments are done (namely listings, colors, etc) and compiled using - -\begin{verbatim} -xelatex documentation -\end{verbatim} - -The output can be consulted \href{documentation.pdf}{here}. -\end{example} - - \section{Disclaimer, sources and -thanks}\label{disclaimer-sources-and-thanks} - - This is a not-quick but certainly dirty hack. I am a complete beginner -in javascript and of course there are obviously a large amount of -possible improvements of the code, in cleaning, factorizing, etc! -Language also needs improvement. - -\textbf{Contributions will be welcome and deeply appreciated.} - -Originally, I used a piece of code from the nice online markdown editor -\texttt{stackedit} -\url{https://github.com/benweet/stackedit/issues/187}, where the authors -also considered the problem of incorporating LaTeX markup in their -markdown. I also used examples and code from -\url{https://github.com/ipython-contrib/IPython-notebook-extensions}. -% No prompt! -%\textbf{Input \#{}}% -\begin{lstlisting} -%%javascript -IPython.load_extensions('latex_envs'); -\end{lstlisting}% No prompt! -%\textbf{Output \#{}} -% - - \begin{verbatim} - - \end{verbatim} - - - - % Add a bibliography block to the postdoc - - -%\bibliographystyle{ieetran} -%\bibliography{Thesis} - - - \ No newline at end of file diff --git a/testing/latex_envs/conversion/latex_envs.css b/testing/latex_envs/conversion/latex_envs.css deleted file mode 100644 index ffa7e4e..0000000 --- a/testing/latex_envs/conversion/latex_envs.css +++ /dev/null @@ -1,239 +0,0 @@ - /* - - - - -*/ - - -/***************************************************************** -LaTeX things -*****************************************************************/ - - .latex_tmp {text-align: justify;} - - .latex_prob, - .latex_examp, - .latex_excs, - .latex_problem, - .latex_example, - .latex_exercise, - .latex_proof { - font-style: normal; - text-align: justify; - margin-left: 0px; - margin-right: 10px; - margin-top: 0px; - margin-bottom: 15px; - background-color: #CCFFCC; - display: block; - } - - .latex_title { - float: left; - font-weight: bold; - padding-right: 10px; - } - - .latex_proofend { - float: right; - } - - .latex_listing { - display: block; - text-align: justify; - margin-right: 30px; - font-family: 'Lucida Sans Typewriter'; - color:black; - background-color: GhostWhite ; - } - - .rendered_html pre, .rendered_html code { - border: 0; - background-color: rgba(161, 139, 139, 0); - /* color: #000; */ - font-size: 100%; - padding: 0; - } - - - .latex_thm, .latex_theorem, .latex_lem, .latex_cor, .latex_defn, .latex_prop, .latex_rem, .latex_property, - .latex_lemma, .latex_corollary, .latex_definition, .latex_proposition, .latex_remark, .latex_proof { - - display: block; - text-align: justify; - margin-right: 10px; - margin-left: 0px; - margin-top: 0px; - margin-bottom: 15px; - font-style: italic; - color:black; - background-color: beige; - } - - .latex_textboxa { - display: block; - font-weight: bold; - text-align: center; - width: 80%; - margin: auto; - border: 2px solid; - padding-top: 5px; - padding-bottom: 5px; - background-color: #f2dede; - border-color: #eed3d7; - color: #CC0099; - border-radius: 8px; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; - border-radius: 8px - } - - img.latex_img { - display: block; - margin: auto; - /*height: XXXpx; /* */ - width: 75%; - } - - p.latex_img { - display: block; - width: 85%; - margin: auto; - text-align: justify; - } - -/***************************************************************** -GENERAL CONFIG -*****************************************************************/ - - - @font-face { - font-family: "Computer Modern"; - src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunss.otf'); - } - - @font-face { - font-family: "Computer Modern"; - font-weight: bold; - src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunsx.otf'); - } - @font-face { - font-family: "Computer Modern"; - font-style: oblique; - src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunsi.otf'); - } -*/ - /* @font-face { - font-family: "Computer Modern"; - font-style: Typewriter; - src: url('http://mirrors.ctan.org/fonts/cm-unicode/fonts/otf/cmuntt.otf'); - }*/ - - @font-face { - font-family: "Computer Modern"; - font-weight: bold; - font-style: oblique; - src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunso.otf'); - } - - - div.cell{ - width:100%; - margin-left:auto; /*16% !important;* was preconised but pbs with some browsers*/ - margin-right:auto; - } - h1 { - font-family: Helvetica, serif; - } - h2 { - font-family: Helvetica, serif; - color: darkblue; - } - - h4{ - margin-top:12px; - margin-bottom: 3px; - } - - - .rendered_html p {text-align:justify} - - div.text_cell_render{ - font-family: "Computer Modern", Arial, "Helvetica Neue", Helvetica, Geneva, sans-serif; - line-height: 145%; - font-size: 130%; - color: black; - width:100%; - /*width:800px;*/ - margin-left:0px; - margin-right:auto; - - } - .CodeMirror{ - font-family: "Source Code Pro", source-code-pro,Consolas, monospace; -color: darkblue; - } - -/* commented because many people prefer to have the prompt - .prompt{ - display: None; - } -*/ - -/* -div.output_area -{ - display: block; - margin-left: auto; - margin-right: auto -} -*/ -div.output_subarea.output_text -{ - margin-left: +2%; -} - -div.output_subarea.output_png -{ - margin-left: +10%; -} -div.output_subarea.output_svg -{ - margin-left: +10%; -} - - - .text_cell_render h5 { - font-weight: 300; - font-size: 22pt; - color: #4057A1; - font-style: italic; - margin-bottom: .5em; - margin-top: 0.5em; - display: block; - } - - .warning{ - color: rgb( 240, 20, 20 ) - } - - - diff --git a/testing/latex_envs/conversion/post_html_thms.js b/testing/latex_envs/conversion/post_html_thms.js deleted file mode 100644 index 1353887..0000000 --- a/testing/latex_envs/conversion/post_html_thms.js +++ /dev/null @@ -1,37 +0,0 @@ -// Node.js script for html to html conversion, -// substituting html classes to LaTeX theorem like environment constructs -// This applies the same substitutions -// that we use in the live notebook . - - -// read the markdown from stdin -var html_to_analyse=''; -process.stdin.on("data", function (data) { - html_to_analyse += data; -}); - - - -// perform the html transform once stdin is complete -process.stdin.on("end", function () { -var fs = require('fs'); -var IPython; - -var static_path = "/usr/share/ipython/notebook/static/"; -var marked = require( static_path + 'components/marked/lib/marked.js'); - -var eqNum = 0; // begins equation numbering at eqNum+1 -var eqLabelWithNumbers = true; //if true, label equations with equation numbers; otherwise using the tag specified by \label -var conversion_to_html = true; - -// Read the actual conversion script file, located in $HOME/.ipython/nbextensions -eval(fs.readFileSync( process.env['HOME'] + "/.ipython/nbextensions/thmsInNb.js", 'utf8') ); - - - //IPython.mathjaxutils.init(); - var html_converted = thmsInNbConv(marked,html_to_analyse); - - process.stdout.write(html_converted); - -}); - diff --git a/testing/latex_envs/conversion/readme.md b/testing/latex_envs/conversion/readme.md deleted file mode 100644 index 3e16452..0000000 --- a/testing/latex_envs/conversion/readme.md +++ /dev/null @@ -1,24 +0,0 @@ - -This directory contains utilitary functions used to convert the notebook, with embedded LaTeX structures, to LaTeX or html. -Procedures are detailed in the documentation latex_env_doc.* and documentation.pdf. - -Files ------ -File | description ------------------------ | ----------------------------- -documentation.pdf | Documentation (pdf version) -- look at html and notebook version latex_env_doc.* -documentation.tex | Master file for producing documentation (includes latex_env_doc.tex) -header.tex | Header used for LaTeX compilation -ipynb_thms_to_html | Converter from ipynb to html -ipynb_thms_to_latex | Converter from ipynb to LaTeX -latex_env_doc.ipynb | Documentation and demo notebook -latex_env_doc.tex | Documentation and demo converted to LaTeX -latex_env_doc_tmp_files | temporary files from conversion -post_html_thms.js | Utilitary script used during ipynb --> html conversion -readme.md | This file -texheaders_rm.py | Utilitary script used during ipynb --> LaTeX conversion (removes header/footer) -thmInNb_tolatex.py | Utilitary script used during ipynb --> LaTeX conversion -thmsInNb_article.tplx | Template for LaTeX conversion (article style) -thmsInNb_book.tplx | Template for LaTeX conversion (book style) -thmsInNb.tpl | Template for html conversion - diff --git a/testing/latex_envs/conversion/texheaders_rm.py b/testing/latex_envs/conversion/texheaders_rm.py deleted file mode 100644 index 508c613..0000000 --- a/testing/latex_envs/conversion/texheaders_rm.py +++ /dev/null @@ -1,86 +0,0 @@ - -""" -Created on Thu Nov 18 15:34:38 2014 -@author: bercherj -Remove TeX's file headers and footers -""" - -import glob -import os -import sys -import time -from stat import * - - -def texheaders_filtering(input_file): - import re - - st = os.stat(input_file) - atime = st[ST_ATIME] #access time - mtime = st[ST_MTIME] #modification time - - with open(input_file,'rt') as f: - text=f.read() - #print(text) - my_texfile = input_file #file.split('.html')[0] + 'b.html' - if sys.version_info >= (3,0,0): - my_texfile_desc = open(my_texfile, 'wt', newline='') - else: - my_texfile_desc = open(my_texfile_file, 'wt') - - - tex_text=re.search('begin{document}([\s\S]*?)\\\\end{document}',text,flags=re.M) - #print(tex_text) - newtext=tex_text.group(1) - newtext=newtext.replace('\maketitle','') - newtext=newtext.replace('\\tableofcontents','') - - - my_texfile_desc.write(newtext) - - #modify the file timestamp - my_texfile_desc.close() - os.utime(my_texfile,(atime,mtime)) - - - -verbose=True -if __name__ == '__main__': - import argparse - - whatitdoes="""This program filters a tex file in order to remove headers - and footer, that is all what is before the \\begin{document} (included) and - after the \\end{document} (included)""" - myself="(c) JFB 2014" - parser = argparse.ArgumentParser(description=whatitdoes, epilog=myself) - # mandatory argument - parser.add_argument( - help = 'List of files to filter (accepts regular expressions)', - dest = 'argfiles', default = '*.tex', type = str, nargs = '*') - # verbosity flag - parser.add_argument('-v','--verbose', help = 'Prints information', - dest = 'verbose', default = False, #action='store_true' - action='count') - - arguments = parser.parse_args() - verbose=arguments.verbose - if verbose==2: print("script arg: ", arguments.argfiles) - - if isinstance(arguments.argfiles,list): - tex_files=[] - for x in arguments.argfiles: - tex_files = tex_files+glob.glob(x) - else: - tex_files = glob.glob(arguments.argfiles) - if verbose==2: print("glog.glog expansion: ", tex_files, '\n') - if len(tex_files ) == 0: - raise RuntimeError('No TeX files to convert.') - - for file in tex_files: - if verbose: - print("Filtering {}".format(file)) - texheaders_filtering(file) - - - - diff --git a/testing/latex_envs/conversion/thmInNb_tolatex.py b/testing/latex_envs/conversion/thmInNb_tolatex.py deleted file mode 100644 index 31514fe..0000000 --- a/testing/latex_envs/conversion/thmInNb_tolatex.py +++ /dev/null @@ -1,57 +0,0 @@ -# -*- coding: utf-8 -*- -""" -@author: bercherj -The content of selected environments is translated from markdown to latex, via pandoc -The environments are extracted recursively and translated. Then they are inserted back into the tex file. -""" - -#**************************************************************************** -def EnvReplace(message): - - import re - from IPython.nbconvert.utils.pandoc import pandoc - - environmentMap = ['thm','lem', 'cor', 'prop','defn','rem','prob','excs','examp','theorem','lemma','corollary','proposition', - 'definition','remark','problem', 'exercise', 'example','proof','property'] - # this map should match the map defined in .ipython/nbextensions/thmsInNb.js - - def replacement(a): - - w=a.group(0) - theenv=a.group(1) - tobetranslated=a.group(2) - if theenv in environmentMap: - out=pandoc(tobetranslated, 'markdown', 'latex') - result = '/begin{' + theenv + '}\n'+ out + '\n\end{' + theenv + '}'; - else: - result = '/begin{' + theenv + '}'+ tobetranslated + '\end{' + theenv + '}'; - #the transform \begin --> /begin is done in order to avoid the group to match again - - #print(result) - return result - - code="Init" - data=message - while (code!=None): - code=re.search(r'\\begin{(\w+)}([\s\S]*?)\\end{\1}', data) - data=re.sub(r'\\begin{(\w+)}([\s\S]*?)\\end{\1}', replacement, data) - return data - - - #while (message.match(/\\begin{(\w+)}([\s\S]*?)\\end{\1}/gm)!="") { - -if __name__ == '__main__': - # TEST - import sys - infile=sys.argv[1] - outfile=sys.argv[2] - with open (sys.argv[1], "r") as infile: - text=infile.read() - text=text.replace("\\begin{document}","/begin{document}") - out=EnvReplace(text) - out=out.replace("/begin","\\begin") - with open (sys.argv[2], "w") as outfile: - outfile.write("%Thms like environments translated from notebook using thmInNb_tolatex.py\n") - outfile.write(out) - - diff --git a/testing/latex_envs/conversion/thmsInNb.tpl b/testing/latex_envs/conversion/thmsInNb.tpl deleted file mode 100755 index 3daa172..0000000 --- a/testing/latex_envs/conversion/thmsInNb.tpl +++ /dev/null @@ -1,75 +0,0 @@ -{%- extends 'full.tpl' -%} - - -{%- block header -%} - - - - -[{{nb.metadata.name}}] -{% for css in resources.inlining.css -%} - -{% endfor %} - - - - - - - - - - - - - - - - - -{%- endblock header -%} - -{% block body %} - -{{ super() }} - -{%- endblock body %} - -{% block footer %} - -{% endblock footer %} diff --git a/testing/latex_envs/conversion/thmsInNb_article.tplx b/testing/latex_envs/conversion/thmsInNb_article.tplx deleted file mode 100644 index e6a8993..0000000 --- a/testing/latex_envs/conversion/thmsInNb_article.tplx +++ /dev/null @@ -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' *)) - - - - diff --git a/testing/latex_envs/conversion/thmsInNb_book.tplx b/testing/latex_envs/conversion/thmsInNb_book.tplx deleted file mode 100644 index 10f29f7..0000000 --- a/testing/latex_envs/conversion/thmsInNb_book.tplx +++ /dev/null @@ -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' *)) - - - - diff --git a/testing/latex_envs/conversion/toc_and_cln.py b/testing/latex_envs/conversion/toc_and_cln.py deleted file mode 100644 index 5d7296a..0000000 --- a/testing/latex_envs/conversion/toc_and_cln.py +++ /dev/null @@ -1,125 +0,0 @@ - -""" -Created on Thu Nov 18 15:34:38 2014 -@author: JF -""" - -import glob -import os -import sys -import time -from stat import * - - -def texheaders_filtering(input_file): - import re - - st = os.stat(input_file) - atime = st[ST_ATIME] #access time - mtime = st[ST_MTIME] #modification time - - with open(input_file,'rt') as f: - text=f.read() - #print(text) - my_texfile = input_file #file.split('.html')[0] + 'b.html' - if sys.version_info >= (3,0,0): - my_texfile_desc = open(my_texfile, 'wt', newline='') - else: - my_texfile_desc = open(my_texfile_file, 'wt') - - - def remp(intext): - #out=re.findall('\\\\[sub]?section',intext.group(0)) - out=re.findall('(\\\\[sub]?section|\\\\chapter)',intext.group(0)) - - print(out) - """"print(out.group(0)) - return out.group(0) """ - return out[-1] - - #newtext=re.sub('section{Table of Contents}([\s\S]*?)\\[sub]?section{','Remplacement',text,flags=re.M) - newtext=re.sub('\\\\section{Table of Contents}([\s\S]*?)(\\\\[sub]?section|\\\\chapter)',remp,text,flags=re.M) - newtext=re.sub('\\\\begin{verbatim}[\s]*?[\s]*?\\\\end{verbatim}','',newtext,flags=re.M) - newtext=re.sub('\\\\begin{verbatim}[\s]*?[\s]*?\\\\end{verbatim}','',newtext,flags=re.M) - - #bottom page with links to Index/back/next (suppress this) -#'----[\s]*?
[Index](toc.ipynb)[\S ]*?.ipynb\)
' - newtext=re.sub('\\\\begin{center}\\\\rule{3in}{0.4pt}\\\\end{center}[\s]*?\\\\href{toc.ipynb}{Index}[\S\s ]*?.ipynb}{Next}','',newtext,flags=re.M) - - - # figcaption(text,label=) - tofind="figcaption\(([\s\S]*?)\)\n([\s\S]*?)\\\\begin{center}\s*\\\\adjustimage[\s\S]*?}}{([\S]*?)}\s*\\\\end{center}" - - def replacement(text): - cap=re.match("\"([\S\s]*?)\",[\S\s]*?label=\"([\S]*?)\"",text.group(1)) - - if cap==None: - cap=re.match("\"([\S\s]*?)\"",text.group(1)) - caption=cap.group(1) - label="" - rep="\n%s\n\\begin{figure}[H]\n\\centering\n\\includegraphics[width=0.6\\linewidth]{%s}\n\\caption{%s}\n\\end{figure}" % (text.group(2),text.group(3),caption) - else: - caption=cap.group(1) - label=cap.group(2) - rep="\n%s\n\\begin{figure}[H]\n\\centering\n\\includegraphics[width=0.6\\linewidth]{%s}\n\\caption{%s}\n\\label{%s}\n\\end{figure}" % (text.group(2),text.group(3),caption,label) - return rep - code="Init" - - while (code!=None): - code=re.search(tofind,newtext) - newtext=re.sub(tofind,replacement,newtext,flags=re.M) - - - - my_texfile_desc.write(newtext) - - #modify the file timestamp - my_texfile_desc.close() - os.utime(my_texfile,(atime,mtime)) - - - - - -verbose=True -if __name__ == '__main__': - import argparse - - whatitdoes="""This program filters a LaTeX file \n - - in order to remove the first 'table of contents section', - to the next section ; - - it replaces figcaption structures to "\\caption{\\label{}}" LaTeX constructs. - - Finally, it also filters out various 'spurious' outputs""" - myself="(c) JFB 2014" - parser = argparse.ArgumentParser(description=whatitdoes, epilog=myself) - # mandatory argument - parser.add_argument( - help = 'List of files to filter (accepts regular expressions)', - dest = 'argfiles', default = '*.tex', type = str, nargs = '*') - # verbosity flag - parser.add_argument('-v','--verbose', help = 'Prints information', - dest = 'verbose', default = False, #action='store_true' - action='count') - - arguments = parser.parse_args() - verbose=arguments.verbose - if verbose==2: print("script arg: ", arguments.argfiles) - - if isinstance(arguments.argfiles,list): - tex_files=[] - for x in arguments.argfiles: - tex_files = tex_files+glob.glob(x) - else: - tex_files = glob.glob(arguments.argfiles) - if verbose==2: print("glog.glog expansion: ", tex_files, '\n') - if len(tex_files ) == 0: - raise RuntimeError('No TeX files to convert.') - - for file in tex_files: - if verbose: - print("Filtering {}".format(file)) - texheaders_filtering(file) - - - - diff --git a/testing/latex_envs/documentation.pdf b/testing/latex_envs/documentation.pdf deleted file mode 100644 index 6b88038..0000000 Binary files a/testing/latex_envs/documentation.pdf and /dev/null differ diff --git a/testing/latex_envs/example.png b/testing/latex_envs/example.png deleted file mode 100644 index 2433079..0000000 Binary files a/testing/latex_envs/example.png and /dev/null differ diff --git a/testing/latex_envs/icon.png b/testing/latex_envs/icon.png deleted file mode 100644 index fd214a3..0000000 Binary files a/testing/latex_envs/icon.png and /dev/null differ diff --git a/testing/latex_envs/latex_env_doc.html b/testing/latex_envs/latex_env_doc.html deleted file mode 100644 index cbb5b0a..0000000 --- a/testing/latex_envs/latex_env_doc.html +++ /dev/null @@ -1,1459 +0,0 @@ - - - - -[] - - - - - - - - - - - - - - - - - - - - - - - -
-
- -
-
-
-
-
-

(some) LaTeX environments for Jupyter notebook

-
-
-
- -
-
-
In [1]:
-
-
-
%%javascript 
-IPython.load_extensions('calico-document-tools');
-
- -
-
-
- -
-
- - -
- - -
- -
- -
- -
-
- -
-
-
-
In [2]:
-
-
-
%%javascript 
-IPython.load_extensions('latex_envs');
-
- -
-
-
- -
-
- - -
- - -
- -
- -
- -
-
- -
-
-
-
In [ ]:
-
-
-
%%html
-<style>
-    .prompt{
-        display: none;
-    }    
-
-</style>
-
- -
-
-
- -
-
-
-
-
-
-

1. Goal

-
-
-
-
-
-
-
-
-

1.1 Initial goal

-
-
-
-
-
-
-
-
-

The initial goal was only to add an environment theorem in my workflow. That is to be able to type something like -

-\begin{theorem} 
-Let $u$ and $v$ be two vectors of $\mathbb{R}^n$. The dot product can be expressed as
-$$u^Tv = |u||v| \cos \theta,$$ 
-where $\theta$ is the angle between $u$ and $v$ ...
-\end{theorem}
-
-in a markdown cell and have it rendered, like

-Theorem 1
-Let $u$ and $v$ be two vectors of $\mathbb{R}^n$. The dot product can be expressed as $$u^Tv = |u||v| \cos \theta,$$ where $\theta$ is the angle between $u$ and $v$ ... -
-
-
-
-
-
-
-
-
-

1.2 Features

-
-
-
-
-
-
-
-
-

The initial project has evolved to account for more environments and introduce some other features.

- -
-
-
-
-
-
-
-
-

1.2.1 Support for simple LaTeX commands

-
-
-
-
-
-
-
-
-

We also added some LaTeX commands (e.g. \textit, \textbf, \underline) -- this is useful in the case of copy-paste from a LaTeX document. Labels and references are supported, including for equations.

- -
-
-
-
-
-
-
-
-

1.2.2 Available environments

-
-
-
-
-
-
-
-
-
    -
  • theorems-like environments: property, theorem, lemma, corollary, proposition, definition,remark, problem, exercise, example,
  • -
  • lists: enumerate, itemize,
  • -
  • limited support for a figure environment,
  • -
  • an environment listing,
  • -
  • textboxa, wich is a textbox environment defined as a demonstration (see below).
  • -
-

More environments can be added easily in the javascript source file thmsInNb.js. The rendering is done according to the stylesheet latex_env.css, which can be customized.

- -
-
-
-
-
-
-
-
-

1.2.3 Automatic numerotation

-
-
-
-
-
-
-
-
-

Counters for numbering are implemented: one for theorems-like environments, a second for exercises-like environments and a third one for numbering figures.
-Mathjax-equations with a label are also numbered document-wide (in contrast with standard notebook/mathjax numbering where the scope of numbering is limited to cells). -An anchor is created for any label which enables to links things in the document: \label and \ref are both supported. A limitation is that numbering is updated (incremented) each time a cell is rendered. A toolbar button is provided to reset the counters and refresh the rendering of the whole document.

- -
-
-
-
-
-
-
-
-

1.2.4 Other features

-
-
-
-
-
-
-
-
-
    -
  • It is possible to mix LaTeX and markdown markup in environments
  • -
  • Environments can be nested. However, this is not always perfect...
  • -
- -
-
-
-
-
-
-
-
-

2. Usage and examples

-
-
-
-
-
-
-
-
-

2.1 Installation

-
-
-
-
-
-
-
-
-

The extension consists in two javascript scripts: latex_envs.js, thmsInNb.js together with a stylesheet latex_envs.css. -Follow the instructions in the wiki to install the extension. You can simply copy these files in the notebook extension directory (usually ~/.ipython/nbextensions) and load the extension in the notebook by

- -
%%javascript 
-IPython.load_extensions('latex_envs');
- -
-
-
-
-
-
-
-
-

2.2 A first example

-
-
-
-
-
-
-
-
-

This example shows another example of environment, featuring automatic numerotation, and the use of labels and references. Also note that standard markdown can be present in the environment and is interpreted. -The rendering is done according to the stylesheet latex_env.css, which of course, can be tailored to specific uses and tastes.

- -
-
-
-
-
-
-
-
-
-\begin{definition} \label{def:FT}
-Let $x[n]$ be a sequence of length $N$. Then, its **Fourier transform** is given by
-\begin{equation}
-\label{eq:FT}
-X[k]= \frac{1}{N} \sum_{n=0}^{N-1} x[n] e^{-j2\pi \frac{kn}{N}}
-\end{equation}
-\end{definition}
-
-
-
-
-
-
-
-
-
-Definition 2

[def:FT] -Let $x[n]$ be a sequence of length $N$. Then, its Fourier transform is given by -\begin{equation} -\label{eq:FT2} -X[k]= \frac{1}{N} \sum_{n=0}^{N-1} x[n] e^{-j2\pi \frac{kn}{N}} -\end{equation}

-
-
-
-
-
-
-
-
-
-

This is an extremely important tool in signal processing. We put this in evidence using the textboxa environment -- which is defined here in the css, and that one should define in the LaTeX counterpart: -

-\begin{textboxa}
-The Fourier transform is an extremely useful tool to have in your toolbox!
-\end{textboxa}
-

- -
-
-
-
-
-
-
-
-
-The Fourier transform is an extremely useful tool to have in your toolbox! -
-
-
-
-
-
-
-
-
-

As an example, consider the Fourier transform (\ref{eq:FT2}) of a pure cosine wave given by -$$ -x[n]= \cos(2\pi k_0 n/N), -$$ -where $k_0$ is an integer. Its Fourier transform is given by -$$ -X[k] = \frac{1}{2} \left( \delta[k-k_0] + \delta[k-k_0] \right), -$$ -modulo $N$. This is illustrated in the following simple script:

- -
-
-
-
-
-
In [21]:
-
-
-
%matplotlib inline
-import numpy as np
-import matplotlib.pyplot as plt 
-from numpy.fft import fft
-k0=4; N=128; n=np.arange(N); k=np.arange(N)
-x=np.sin(2*np.pi*k0*n/N)
-X=fft(x)
-plt.stem(k,np.abs(X))
-plt.xlim([0, 20])
-plt.title("Fourier transform of a cosine")
-_=plt.xlabel("Frequency index (k)")
-
- -
-
-
- -
-
- - -
- - -
- -
- -
- -
-
- -
-
-
-
-
-
-

2.3 Second example

-
-
-
-
-
-
-
-
-

This example shows a series of environments, with different facets; links, references, markdown or/and LaTeX formatting within environments. Again, the rendering is done according to the stylesheet latex_env.css, which can be tailored. The listing of environments below is typed using the environment listing...

- -
-
-
-
-
-
-
-
-
-\begin{definition} \label{def:diffeq}
-We call \textbf{difference equation} an equation of the form
-$$
-\label{eq:diffeq}
-y[n]= \sum_{k=1}^{p} a_k y[n-k] + \sum_{i=0}^q b_i x[n-i]
-$$
-\end{definition}
-
-\begin{property}
-If all the $a_k$ in equation (\ref{eq:diffeq}) of definition \ref{def:diffeq} are zero, then the filter has a **finite impulse response**. 
-\end{property}
-
-\begin{proof}
-Let $\delta[n]$ denote the Dirac impulse. Take $x[n]=\delta[n]$ in (\ref{eq:diffeq}). This yields, by definition, the impulse response:
-$$
-\label{eq:fir}
-h[n]= \sum_{i=0}^q b_i \delta[n-i],
-$$
-which has finite support. 
-\end{proof}
-
-\begin{theorem}
-The poles of a causal stable filter are located within the unit circle in the complex plane.
-\end{theorem}
-
-\begin{example} \label{ex:IIR1}
-Consider $y[n]= a y[n-1] +  x[n]$. The pole of the transfer function is $z=a$. The impulse response $h[n]=a^n$ has infinite support.
-\end{example}
-
-In the following exercise, you will check that the filter is stable iff $a$<1.
-
-\begin{exercise}\label{ex:exofilter}
-Consider the filter defined in Example \ref{ex:IIR1}. Using the **function** `lfilter` of scipy, compute and plot the impulse response for several values of $a$.
-\end{exercise}
-
-
-
-
-
-
-
-
-
-
-

The lines above are rendered as follows (of course everything can be tailored in the stylesheet):

-Definition 3
[def:diffeq] -We call difference equation an equation of the form -\begin{equation} -\label{eq:diffeq} -y[n]= \sum_{k=1}^{p} a_k y[n-k] + \sum_{i=0}^q b_i x[n-i] -\end{equation} -

Properties of the filter are linked to the coefficients of the difference equation. For instance, an immediate property is

-Property 4

If all the $a_k$ in equation (\ref{eq:diffeq}) of definition [def:diffeq] are zero, then the filter has a finite impulse response.

-
Proof
-Let $\delta[n]$ denote the Dirac impulse. Take $x[n]=\delta[n]$ in (\ref{eq:diffeq}). This yields, by definition, the impulse response: -\begin{equation} -\label{eq:fir} -h[n]= \sum_{i=0}^q b_i \delta[n-i], -\end{equation} -which has finite support. -
Theorem 5
-The poles of a causal stable filter are located within the unit circle in the complex plane. -
Example 1
[ex:IIR1] -Consider $y[n]= a y[n-1] + x[n]$. The pole of the transfer function is $z=a$. The impulse response $h[n]=a^n$ has infinite support. -

In the following exercise, you will check that the filter is stable iff $a$<1.

-Exercise 2

[ex:exofilter] -Consider the filter defined in Example [ex:IIR1]. Using the function lfilter of scipy, compute and plot the impulse response for several values of $a$.

-
-
-
-
-
-
-
-
-
-
-The solution of exercise \ref{ex:exofilter}, which uses a difference equation as in Definition \ref{def:diffeq}:
-

The solution of exercise [ex:exofilter], which uses a difference equation as in Definition [def:diffeq]:

- -
-
-
-
-
-
In [22]:
-
-
-
%matplotlib inline
-import numpy as np
-import matplotlib.pyplot as plt 
-from scipy.signal import lfilter
-d=np.zeros(100); d[0]=1 #dirac impulse
-alist=[0.2, 0.8, 0.9, 0.95, 0.99, 0.999, 1.001, 1.01]
-for a in alist:
-    h=lfilter([1], [1, -a],d)
-    _=plt.plot(h, label="a={}".format(a))
-plt.ylim([0,1.5])
-plt.xlabel('Time')
-_=plt.legend()
-
- -
-
-
- -
-
- - -
- - -
- -
- -
- -
-
- -
-
-
-
-
-
-

Finally, it is sometimes useful to integrate a figure within a markdown cell. The standard markdown markup for that is ![link](image), but a limitation is that the image can not be resized, can not be referenced and is not numbered. Furthermore it can be useful to re-use existing code. Threfore we have added a limited support for the figure environment. This enables to do something like -

-\begin{figure}
-\centerline{\includegraphics[width=10cm]{example.png}}
-\caption{\label{fig:example} This is an example of figure included using LaTeX commands.}
-\end{figure}
-
-which renders as -

Figure 1: [fig:example] This is an example of figure included using LaTeX commands.

-Of course, this Figure can now be referenced: -
-Figure \ref{fig:example} shows a second filter with input $X_2$, output $Y_2$  and an impulse response denoted as $h_2(n)$
-
-Figure [fig:example] shows a second filter with input $X_2$, output $Y_2$ and an impulse response denoted as $h_2(n)$

- -
-
-
-
-
-
-
-
-

2.4 Third example:

-
-
-
-
-
-
-
-
-

This example shows that environments like itemize or enumerate are also available. As already indicated, this is useful for copying text from a TeX file. Following the same idea, text formating commands \textit, \textbf, \underline, etc are also available.

- -
-
-
-
-
-
-
-
-
-The following \textit{environments} are available:
-\begin{itemize}
-    \item \textbf{Theorems and likes}
-    \begin{enumerate}
-        \item theorem,
-        \item lemma,
-        \item corollary
-        \item ...
-    \end{enumerate}
-    \item \textbf{exercises}
-    \begin{enumerate}
-        \item problem,
-        \item example,
-        \item exercise
-    \end{enumerate}
-\end{itemize}
-
-
-
-
-
-
-
-
-
-

which gives...

-

The following environments are available: -

    -
  • Theorems and likes -
      -
    1. theorem, -
    2. lemma, -
    3. corollary -
    4. ... -
    -
  • exercises -
      -
    1. problem, -
    2. example, -
    3. exercise -
    -

- -
-
-
-
-
-
-
-
-

3. (post)-Converters

-
-
-
-
-
-
-
-
-

The extension works in the live-notebook. Since it relies on a bunch of javascript, the notebook does not render as is in very nice services such as nbviewer or github viewer. Similarly, nbconvert does not know of the LaTeX constructs which are used and therefore do not fully convert notebooks making use of this extension. Therefore, it is necessary to add a post conversion step to conversions provided by nbconvert. Though an interface exists for adding post-converters to nbconvert, this (first) author was too lazy and not enough strong to implement the post conversion along these lines. What has be done are simple bash and python scripts that perform this conversion.

- -
-
-
-
-
-
-
-
-

3.1 Installation

-
-
-
-
-
-
-
-
-

Copy the scripts files to a directory in your search path, or launch the scripts with the complete path. The two main scripts are ipynb_thms_to_html (conversion to html, of course:) and ipynb_thms_to_latex (conversion to LaTeX!).

- -
-
-
-
-
-
-
-
-

3.2 Conversion to html

-
-
-
-
-
-
-
-
-

Requirements: You will need perl, nodejs, and ipython3 (the script calls ipython3; if your interpreter is ipython, edit the script and replace the different occurences).

-

The conversion to html is done by something like

- -
    [path/]ipynb_thms_to_html filename
-
-

or a list of files such as

- -
    [path/]ipynb_thms_to_html *.ipynb
-
-

In turn, this script makes somes substitutions using perl, and then uses the nodesj javascript interpreter to make the very same substitutions that are done in the live notebook. -The conversion uses the template thmsInNb.tpl (located in the script directory). It also copies the css latex_env.css in the directory of the output html file (it must be copied with html files in the case of web upload).

- -
-
-
-
-
-
-
-
-

3.3 Conversion to LaTeX

-
-
-
-
-
-
-
-
-

Requirements: You will need perl and ipython3.

-

The conversion to LaTeX is done by something like

- -
    [path/]ipynb_thms_to_latex filename
-
-

or a list of files such as

- -
    [path/]ipynb_thms_to_latex *.ipynb
-
-
-

The script makes some substitutions and cleaning in arkdown cells, then calls the legacy nbconvert. Afterward, it runs through the LaTeX environments and converts their contents (which can contain markdown markup) to LaTeX. Note that the script contains a list of the LaTeX environments to process. In the case of the addition of an environment in the main javascript (thmsInNb.js), this list must also be updated.

-

Finally, the script removes the header and footer in the LaTeX file. This is a personnal choice, and the corresponding line can be safely commented.

-Example 3

As for an example, the present document has been converted using

-
ipynb_thms_to_latex latex_env_doc.ipynb
-

Then the resulting file (without header/footer) has been included in the main file documentation.tex, where some LaTeX definitions of environments are done (namely listings, colors, etc) and compiled using

-
xelatex documentation
-

The output can be consulted here.

-
-
-
-
-
-
-
-
-
-

4. Disclaimer, sources and thanks

-
-
-
-
-
-
-
-
-

This is a not-quick but certainly dirty hack. I am a complete beginner in javascript and of course there are obviously a large amount of possible improvements of the code, in cleaning, factorizing, etc! Language also needs improvement.

-

Contributions will be welcome and deeply appreciated.

-

Originally, I used a piece of code from the nice online markdown editor stackedit https://github.com/benweet/stackedit/issues/187, where the authors also considered the problem of incorporating LaTeX markup in their markdown. I also used examples and code from https://github.com/ipython-contrib/IPython-notebook-extensions.

- -
-
-
-
-
-
In [101]:
-
-
-
%%javascript 
-IPython.load_extensions('latex_envs');
-
- -
-
-
- -
-
- - -
- - -
- -
- -
- -
-
- -
-
-
- - diff --git a/testing/latex_envs/latex_env_doc.ipynb b/testing/latex_envs/latex_env_doc.ipynb deleted file mode 100644 index b3cc5cf..0000000 --- a/testing/latex_envs/latex_env_doc.ipynb +++ /dev/null @@ -1,736 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "

(some) LaTeX environments for Jupyter notebook

" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#Table of Contents\n", - "* [1. Goal](#1.-Goal)\n", - "\t* [1.1 Initial goal](#1.1-Initial-goal)\n", - "\t* [1.2 Features](#1.2-Features)\n", - "\t\t* [1.2.1 Support for simple LaTeX commands](#1.2.1-Support-for-simple-LaTeX-commands)\n", - "\t\t* [1.2.2 Available environments](#1.2.2-Available-environments)\n", - "\t\t* [1.2.3 Automatic numerotation](#1.2.3-Automatic-numerotation)\n", - "\t\t* [1.2.4 Other features](#1.2.4-Other-features)\n", - "* [2. Usage and examples](#2.-Usage-and-examples)\n", - "\t* [2.1 Installation](#2.1-Installation)\n", - "\t* [2.2 A first example](#2.2-A-first-example)\n", - "\t* [2.3 Second example](#2.3-Second-example)\n", - "\t* [2.4 Third example:](#2.4-Third-example:)\n", - "* [3. (post)-Converters](#3.-%28post%29-Converters)\n", - "\t* [3.1 Installation](#3.1-Installation)\n", - "\t* [3.2 Conversion to html](#3.2-Conversion-to-html)\n", - "\t* [3.3 Conversion to LaTeX](#3.3-Conversion-to-LaTeX)\n", - "* [4. Disclaimer, sources and thanks](#4.-Disclaimer,-sources-and-thanks)\n" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "application/javascript": [ - "IPython.load_extensions('calico-document-tools');" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "%%javascript \n", - "IPython.load_extensions('calico-document-tools');" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "application/javascript": [ - "IPython.load_extensions('latex_envs');" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "%%javascript \n", - "IPython.load_extensions('latex_envs');" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": false - }, - "outputs": [], - "source": [ - "%%html\n", - "" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 1. Goal" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 1.1 Initial goal" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The initial goal was only to add an environment `theorem` in my workflow. That is to be able to type something like\n", - "\\begin{listing}\n", - "\\begin{theorem} \n", - "Let $u$ and $v$ be two vectors of $\\mathbb{R}^n$. The dot product can be expressed as\n", - "$$u^Tv = |u||v| \\cos \\theta,$$ \n", - "where $\\theta$ is the angle between $u$ and $v$ ...\n", - "\\end{theorem}\n", - "\\end{listing}\n", - "in a markdown cell and have it rendered, like\n", - "\n", - "\\begin{theorem}\n", - "Let $u$ and $v$ be two vectors of $\\mathbb{R}^n$. The dot product can be expressed as $$u^Tv = |u||v| \\cos \\theta,$$ where $\\theta$ is the angle between $u$ and $v$ ...\n", - "\\end{theorem}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 1.2 Features" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The initial project has evolved to account for more environments and introduce some other features." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 1.2.1 Support for simple LaTeX commands" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We also added some LaTeX commands (e.g. `\\textit`, `\\textbf`, `\\underline`) -- this is useful in the case of copy-paste from a LaTeX document. Labels and references are supported, including for equations." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 1.2.2 Available environments" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "- **theorems-like environments**: *property, theorem, lemma, corollary, proposition, definition,remark, problem, exercise, example*,\n", - "- **lists**: *enumerate, itemize*, \n", - "- limited support for a *figure* environment,\n", - "- an environment *listing*,\n", - "- *textboxa*, wich is a `textbox` environment defined as a demonstration (see below).\n", - "\n", - "More environments can be added easily in the javascript source file `thmsInNb.js`. The rendering is done according to the stylesheet `latex_env.css`, which can be customized." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 1.2.3 Automatic numerotation" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Counters for numbering are implemented: one for theorems-like environments, a second for exercises-like environments and a third one for numbering figures. \n", - "Mathjax-equations with a label are also numbered document-wide (in contrast with standard notebook/mathjax numbering where the scope of numbering is limited to cells). \n", - "An anchor is created for any label which enables to links things in the document: `\\label` and `\\ref` are both supported. A limitation is that numbering is updated (incremented) each time a cell is rendered. A toolbar button is provided to reset the counters and refresh the rendering of the whole document." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### 1.2.4 Other features" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "- It is possible to mix LaTeX and markdown markup in environments \n", - "- Environments can be nested. However, this is not always perfect..." - ] - }, - { - "cell_type": "markdown", - "metadata": { - "collapsed": true - }, - "source": [ - "# 2. Usage and examples" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 2.1 Installation" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The extension consists in two javascript scripts: `latex_envs.js`, `thmsInNb.js` together with a stylesheet `latex_envs.css`. \n", - "Follow the instructions in the [wiki](https://github.com/ipython-contrib/IPython-notebook-extensions/wiki) to install the extension. You can simply copy these files in the notebook extension directory (usually ~/.ipython/nbextensions) and load the extension in the notebook by \n", - "\n", - " %%javascript \n", - " IPython.load_extensions('latex_envs');" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 2.2 A first example" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This example shows another example of environment, featuring automatic numerotation, and the use of labels and references. Also note that standard markdown can be present in the environment and is interpreted. \n", - "*The rendering is done according to the stylesheet `latex_env.css`, which of course, can be tailored to specific uses and tastes*. " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\\begin{listing}\n", - "\\begin{definition} \\label{def:FT}\n", - "Let $x[n]$ be a sequence of length $N$. Then, its **Fourier transform** is given by\n", - "\\begin{equation}\n", - "\\label{eq:FT}\n", - "X[k]= \\frac{1}{N} \\sum_{n=0}^{N-1} x[n] e^{-j2\\pi \\frac{kn}{N}}\n", - "\\end{equation}\n", - "\\end{definition}\n", - "\\end{listing}\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\n", - "\\begin{definition} \\label{def:FT}\n", - "Let $x[n]$ be a sequence of length $N$. Then, its **Fourier transform** is given by\n", - "\\begin{equation}\n", - "\\label{eq:FT2}\n", - "X[k]= \\frac{1}{N} \\sum_{n=0}^{N-1} x[n] e^{-j2\\pi \\frac{kn}{N}}\n", - "\\end{equation}\n", - "\\end{definition}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This is an extremely important tool in signal processing. We put this in evidence using the `textboxa` environment -- which is defined here in the css, and that one should define in the LaTeX counterpart:\n", - "\\begin{listing}\n", - "\\begin{textboxa}\n", - "The Fourier transform is an extremely useful tool to have in your toolbox!\n", - "\\end{textboxa}\n", - "\\end{listing}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\\begin{textboxa}\n", - "The Fourier transform is an extremely useful tool to have in your toolbox!\n", - "\\end{textboxa}\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "As an example, consider the Fourier transform (\\ref{eq:FT2}) of a pure cosine wave given by\n", - "$$\n", - "x[n]= \\cos(2\\pi k_0 n/N),\n", - "$$\n", - "where $k_0$ is an integer. Its Fourier transform is given by \n", - "$$\n", - "X[k] = \\frac{1}{2} \\left( \\delta[k-k_0] + \\delta[k-k_0] \\right), \n", - "$$\n", - "modulo $N$. This is illustrated in the following simple script:" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXIAAAEZCAYAAACKF66QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGkVJREFUeJzt3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9viSgdbjTwCU096E/vW07kXuoR5Ex8pgp5wOvK71UJO0s6Q9o7vR2mKStysW9F7fsswZ4Rpl+\nWVtb/0vSvNLWYknbdDmugR8CiyQ9o2w/X813yUJzv+wP0/Tkfz3JY+j09WXu9hjKFwL8dOIvBzWe\nWqb/HNiB5s6BJ0vavkPbN9L0+Fu9G7hD0r89VFQzvPSA7fuIIEEeU9epN/jQstJ7/g/gW5Kuorkl\n53a2V9OM+X4POA/4LusD85+Bv5F0BfDolvY+CVwDXKHm29s/xvqecad3dtxPM4Z9chluOZ/Sw7d9\nBfBrug+rtLbZrf32x3Bpy+q/BF5fjns1cKikRwMnAm+w/SOaLyfv9BbHS1j/QjZxfGwfS3NN4v1l\n+b7At7rUH5ug3MY2RkrSCcBdtjfK14NJegyw0vYTJ914IysXZVfafuYk270P+K7ts3ttF5uO9Mhj\nNtgovQlJrwa+DfzdxjjeoMpF2ZWSDui2TRlWeR75RqNokR55RETl0iOPiKhcgjwionIJ8oiIyiXI\nIyIqlyCPiKhcgjwionL/H9EXA/71Eb4cAAAAAElFTkSuQmCC\n", - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "%matplotlib inline\n", - "import numpy as np\n", - "import matplotlib.pyplot as plt \n", - "from numpy.fft import fft\n", - "k0=4; N=128; n=np.arange(N); k=np.arange(N)\n", - "x=np.sin(2*np.pi*k0*n/N)\n", - "X=fft(x)\n", - "plt.stem(k,np.abs(X))\n", - "plt.xlim([0, 20])\n", - "plt.title(\"Fourier transform of a cosine\")\n", - "_=plt.xlabel(\"Frequency index (k)\")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 2.3 Second example" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This example shows a series of environments, with different facets; **links, references, markdown or/and LaTeX formatting within environments**. Again, the rendering is done according to the stylesheet `latex_env.css`, which can be tailored. The listing of environments below is typed using the environment *listing*..." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\\begin{listing}\n", - "\\begin{definition} \\label{def:diffeq}\n", - "We call \\textbf{difference equation} an equation of the form\n", - "$$\n", - "\\label{eq:diffeq}\n", - "y[n]= \\sum_{k=1}^{p} a_k y[n-k] + \\sum_{i=0}^q b_i x[n-i]\n", - "$$\n", - "\\end{definition}\n", - "\n", - "\\begin{property}\n", - "If all the $a_k$ in equation (\\ref{eq:diffeq}) of definition \\ref{def:diffeq} are zero, then the filter has a **finite impulse response**. \n", - "\\end{property}\n", - "\n", - "\\begin{proof}\n", - "Let $\\delta[n]$ denote the Dirac impulse. Take $x[n]=\\delta[n]$ in (\\ref{eq:diffeq}). This yields, by definition, the impulse response:\n", - "$$\n", - "\\label{eq:fir}\n", - "h[n]= \\sum_{i=0}^q b_i \\delta[n-i],\n", - "$$\n", - "which has finite support. \n", - "\\end{proof}\n", - "\n", - "\\begin{theorem}\n", - "The poles of a causal stable filter are located within the unit circle in the complex plane.\n", - "\\end{theorem}\n", - "\n", - "\\begin{example} \\label{ex:IIR1}\n", - "Consider $y[n]= a y[n-1] + x[n]$. The pole of the transfer function is $z=a$. The impulse response $h[n]=a^n$ has infinite support.\n", - "\\end{example}\n", - "\n", - "In the following exercise, you will check that the filter is stable iff $a$<1.\n", - "\n", - "\\begin{exercise}\\label{ex:exofilter}\n", - "Consider the filter defined in Example \\ref{ex:IIR1}. Using the **function** `lfilter` of scipy, compute and plot the impulse response for several values of $a$.\n", - "\\end{exercise}\n", - "\n", - "\\end{listing}\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The lines above are rendered as follows (of course everything can be tailored in the stylesheet):\n", - "\n", - "\\begin{definition} \\label{def:diffeq}\n", - "We call \\textbf{difference equation} an equation of the form\n", - "\\begin{equation}\n", - "\\label{eq:diffeq}\n", - "y[n]= \\sum_{k=1}^{p} a_k y[n-k] + \\sum_{i=0}^q b_i x[n-i]\n", - "\\end{equation}\n", - "\\end{definition}\n", - "Properties of the filter are linked to the coefficients of the difference equation. For instance, an immediate property is \n", - "\n", - "\\begin{property}\n", - "If all the $a_k$ in equation (\\ref{eq:diffeq}) of definition \\ref{def:diffeq} are zero, then the filter has a **finite impulse response**. \n", - "\\end{property}\n", - "\n", - "\\begin{proof}\n", - "Let $\\delta[n]$ denote the Dirac impulse. Take $x[n]=\\delta[n]$ in (\\ref{eq:diffeq}). This yields, by definition, the impulse response:\n", - "\\begin{equation}\n", - "\\label{eq:fir}\n", - "h[n]= \\sum_{i=0}^q b_i \\delta[n-i],\n", - "\\end{equation}\n", - "which has finite support. \n", - "\\end{proof}\n", - "\n", - "\n", - "\\begin{theorem}\n", - "The poles of a causal stable filter are located within the unit circle in the complex plane.\n", - "\\end{theorem}\n", - "\n", - "\n", - "\\begin{example} \\label{ex:IIR1}\n", - "Consider $y[n]= a y[n-1] + x[n]$. The pole of the transfer function is $z=a$. The impulse response $h[n]=a^n$ has infinite support.\n", - "\\end{example}\n", - "\n", - "In the following exercise, you will check that the filter is stable iff $a$<1.\n", - "\n", - "\\begin{exercise}\\label{ex:exofilter}\n", - "Consider the filter defined in Example \\ref{ex:IIR1}. Using the **function** `lfilter` of scipy, compute and plot the impulse response for several values of $a$.\n", - "\\end{exercise}\n", - "\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\\begin{listing}\n", - "The solution of exercise \\ref{ex:exofilter}, which uses a difference equation as in Definition \\ref{def:diffeq}:\n", - "\\end{listing}\n", - "The solution of exercise \\ref{ex:exofilter}, which uses a difference equation as in Definition \\ref{def:diffeq}:" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAEKCAYAAAAYd05sAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsnXeYlNX1xz8HBJQmRQRFUAGJFEGiQSnqtaCAQbFEg4A1\nUbEk/tSIGnXYKBE1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2j9juk8cYvoRuxqIx6pxYmk8vKMtGGneCn28oJWmSXEEwM+ZtnjGUu9+9GXjM9neGVs0A\nV5fy1eS+d1rN9h7bW2xvJVei/cb2J+hmLA4Bz0jaVhZdQR5s5Zd0LBbkyuWdkqbL+XIFuRK+i7Fo\njDonZoBdkiYlbSWPC/ynFT/J9lhf5H5lniBXCOwe9/bOpBd5uLzEwqhJ+8i13+cC9wFPAvcC56z1\nvq5yXC4DZkq5k7EA3kYzdGK+at3U4Vh8ifwHbj+5UnGiK7Eg/zd7kNy53TPkhqIjjx3YU3LpAXJH\nkCt+fjR0CiGElhp7Q6cQQghrIxJ8CCG0VCT4EEJoqUjwIYTQUpHgQwihpSLBhxBCS0WCD60j6TWl\nS+J9kv4habaUj0q6ca33L4TVEs/Bh1aT9FXgqO1vrfW+hLDa4go+dIEAJF0+NNDIDZJ+Iul3kv4m\n6SOSviHpL5LuLl3XIukdkh6Q9JCkXzV9hIRwNogEH7psK/Bucv/bPyUPsvBW4EXg/aWjuO8BH7V9\nEXlwhq+t1c6GcLpWHHQ7hBYzcLftgaRHgMr2PWXdfnL3tduANwP35X6wqMn9hoRwVogEH7rsBIDt\nJGluaHkinxsCHrV96VrsXAivVNyiCV217KAjSzwBvFbSTsh9+5dxMUM4K0SCD13goelyZTh5ZBw7\njyP8MeDrkpouny8Z546G8P8Uj0mGEEJLxRV8CCG0VCT4EEJoqUjwIYTQUpHgQwihpSLBhxBCS0WC\nDyGElooEH0IILRUJPoQQWup/lAtzMWJ4g58AAAAASUVORK5CYII=\n", - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "%matplotlib inline\n", - "import numpy as np\n", - "import matplotlib.pyplot as plt \n", - "from scipy.signal import lfilter\n", - "d=np.zeros(100); d[0]=1 #dirac impulse\n", - "alist=[0.2, 0.8, 0.9, 0.95, 0.99, 0.999, 1.001, 1.01]\n", - "for a in alist:\n", - " h=lfilter([1], [1, -a],d)\n", - " _=plt.plot(h, label=\"a={}\".format(a))\n", - "plt.ylim([0,1.5])\n", - "plt.xlabel('Time')\n", - "_=plt.legend()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Finally, it is sometimes useful to integrate a figure within a markdown cell. The standard markdown markup for that is `![link](image)`, but a limitation is that the image can not be resized, can not be referenced and is not numbered. Furthermore it can be useful to re-use existing code. Threfore we have added a limited support for the `figure` environment. This enables to do something like\n", - "\\begin{listing}\n", - "\\begin{figure}\n", - "\\centerline{\\includegraphics[width=10cm]{example.png}}\n", - "\\caption{\\label{fig:example} This is an example of figure included using LaTeX commands.}\n", - "\\end{figure}\n", - "\\end{listing}\n", - "which renders as\n", - "\\begin{figure}\n", - "\\centerline{\\includegraphics[width=10cm]{example.png}}\n", - "\\caption{\\label{fig:example} This is an example of figure included using LaTeX commands.}\n", - "\\end{figure}\n", - "Of course, this Figure can now be referenced: \n", - "\\begin{listing}\n", - "Figure \\ref{fig:example} shows a second filter with input $X_2$, output $Y_2$ and an impulse response denoted as $h_2(n)$\n", - "\\end{listing}\n", - "Figure \\ref{fig:example} shows a second filter with input $X_2$, output $Y_2$ and an impulse response denoted as $h_2(n)$" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 2.4 Third example:" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This example shows that environments like itemize or enumerate are also available. As already indicated, this is useful for copying text from a TeX file. Following the same idea, text formating commands `\\textit`, `\\textbf`, `\\underline`, etc are also available." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "\\begin{listing}\n", - "The following \\textit{environments} are available:\n", - "\\begin{itemize}\n", - " \\item \\textbf{Theorems and likes}\n", - " \\begin{enumerate}\n", - " \\item theorem,\n", - " \\item lemma,\n", - " \\item corollary\n", - " \\item ...\n", - " \\end{enumerate}\n", - " \\item \\textbf{exercises}\n", - " \\begin{enumerate}\n", - " \\item problem,\n", - " \\item example,\n", - " \\item exercise\n", - " \\end{enumerate}\n", - "\\end{itemize}\n", - "\\end{listing}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "which gives... \n", - "\n", - "The following \\textit{environments} are available:\n", - "\\begin{itemize}\n", - "\\item \\textbf{Theorems and likes}\n", - "\\begin{enumerate}\n", - "\\item theorem,\n", - "\\item lemma,\n", - "\\item corollary\n", - "\\item ...\n", - "\\end{enumerate}\n", - "\\item \\textbf{exercises}\n", - "\\begin{enumerate}\n", - "\\item problem,\n", - "\\item example,\n", - "\\item exercise\n", - "\\end{enumerate}\n", - "\\end{itemize}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 3. (post)-Converters" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The extension works in the live-notebook. Since it relies on a bunch of javascript, the notebook does not render as is in very nice services such as `nbviewer` or `github` viewer. Similarly, `nbconvert` does not know of the LaTeX constructs which are used and therefore do not fully convert notebooks making use of this extension. Therefore, it is necessary to add a post conversion step to conversions provided by `nbconvert`. Though an interface exists for adding post-converters to nbconvert, this (first) author was too lazy and not enough strong to implement the post conversion along these lines. What has be done are simple `bash` and `python` scripts that perform this conversion." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 3.1 Installation" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Copy the scripts files to a directory in your search path, or launch the scripts with the complete path. The two main scripts are `ipynb_thms_to_html` (conversion to html, of course:) and `ipynb_thms_to_latex` (conversion to LaTeX!)." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 3.2 Conversion to html" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Requirements**: You will need `perl`, `nodejs`, and `ipython3` (the script calls `ipython3`; if your interpreter is `ipython`, edit the script and replace the different occurences).\n", - "\n", - "The conversion to html is done by something like \n", - "\n", - " [path/]ipynb_thms_to_html filename\n", - "or a list of files such as\n", - "\n", - " [path/]ipynb_thms_to_html *.ipynb\n", - "In turn, this script makes somes substitutions using `perl`, and then uses the `nodesj` javascript interpreter to make the very same substitutions that are done in the live notebook.\n", - "The conversion uses the template `thmsInNb.tpl` (located in the script directory). It also copies the css `latex_env.css` in the directory of the output html file (it must be copied with html files in the case of web upload)." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## 3.3 Conversion to LaTeX" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "**Requirements**: You will need `perl` and `ipython3`. \n", - "\n", - "The conversion to LaTeX is done by something like \n", - "\n", - " [path/]ipynb_thms_to_latex filename\n", - "or a list of files such as\n", - "\n", - " [path/]ipynb_thms_to_latex *.ipynb\n", - " \n", - "The script makes some substitutions and cleaning in arkdown cells, then calls the legacy `nbconvert`. Afterward, it runs through the LaTeX environments and converts their contents (which can contain markdown markup) to LaTeX. Note that the script contains a list of the LaTeX environments to process. In the case of the addition of an environment in the main javascript (`thmsInNb.js`), this list must also be updated. \n", - "\n", - "Finally, the script removes the header and footer in the LaTeX file. This is a personnal choice, and the corresponding line can be safely commented. \n", - "\n", - "\\begin{example}\n", - "As for an example, the present document has been converted using\n", - " \n", - " ipynb_thms_to_latex latex_env_doc.ipynb\n", - " \n", - "Then the resulting file (without header/footer) has been included in the main file `documentation.tex`, where some LaTeX definitions of environments are done (namely listings, colors, etc) and compiled using \n", - " \n", - " xelatex documentation\n", - " \n", - "The output can be consulted [here](documentation.pdf). \n", - "\\end{example}" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# 4. Disclaimer, sources and thanks" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This is a not-quick but certainly dirty hack. I am a complete beginner in javascript and of course there are obviously a large amount of possible improvements of the code, in cleaning, factorizing, etc! Language also needs improvement. \n", - "\n", - "**Contributions will be welcome and deeply appreciated.** \n", - "\n", - "Originally, I used a piece of code from the nice online markdown editor `stackedit` [https://github.com/benweet/stackedit/issues/187](https://github.com/benweet/stackedit/issues/187), where the authors also considered the problem of incorporating LaTeX markup in their markdown. I also used examples and code from [https://github.com/ipython-contrib/IPython-notebook-extensions](https://github.com/ipython-contrib/IPython-notebook-extensions). \n" - ] - }, - { - "cell_type": "code", - "execution_count": 101, - "metadata": { - "collapsed": false - }, - "outputs": [ - { - "data": { - "application/javascript": [ - "IPython.load_extensions('latex_envs');" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "%%javascript \n", - "IPython.load_extensions('latex_envs');" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.4.3+" - } - }, - "nbformat": 4, - "nbformat_minor": 0 -} diff --git a/testing/latex_envs/latex_envs.css b/testing/latex_envs/latex_envs.css deleted file mode 100644 index ffa7e4e..0000000 --- a/testing/latex_envs/latex_envs.css +++ /dev/null @@ -1,239 +0,0 @@ - /* - - - - -*/ - - -/***************************************************************** -LaTeX things -*****************************************************************/ - - .latex_tmp {text-align: justify;} - - .latex_prob, - .latex_examp, - .latex_excs, - .latex_problem, - .latex_example, - .latex_exercise, - .latex_proof { - font-style: normal; - text-align: justify; - margin-left: 0px; - margin-right: 10px; - margin-top: 0px; - margin-bottom: 15px; - background-color: #CCFFCC; - display: block; - } - - .latex_title { - float: left; - font-weight: bold; - padding-right: 10px; - } - - .latex_proofend { - float: right; - } - - .latex_listing { - display: block; - text-align: justify; - margin-right: 30px; - font-family: 'Lucida Sans Typewriter'; - color:black; - background-color: GhostWhite ; - } - - .rendered_html pre, .rendered_html code { - border: 0; - background-color: rgba(161, 139, 139, 0); - /* color: #000; */ - font-size: 100%; - padding: 0; - } - - - .latex_thm, .latex_theorem, .latex_lem, .latex_cor, .latex_defn, .latex_prop, .latex_rem, .latex_property, - .latex_lemma, .latex_corollary, .latex_definition, .latex_proposition, .latex_remark, .latex_proof { - - display: block; - text-align: justify; - margin-right: 10px; - margin-left: 0px; - margin-top: 0px; - margin-bottom: 15px; - font-style: italic; - color:black; - background-color: beige; - } - - .latex_textboxa { - display: block; - font-weight: bold; - text-align: center; - width: 80%; - margin: auto; - border: 2px solid; - padding-top: 5px; - padding-bottom: 5px; - background-color: #f2dede; - border-color: #eed3d7; - color: #CC0099; - border-radius: 8px; - -webkit-border-radius: 8px; - -moz-border-radius: 8px; - border-radius: 8px - } - - img.latex_img { - display: block; - margin: auto; - /*height: XXXpx; /* */ - width: 75%; - } - - p.latex_img { - display: block; - width: 85%; - margin: auto; - text-align: justify; - } - -/***************************************************************** -GENERAL CONFIG -*****************************************************************/ - - - @font-face { - font-family: "Computer Modern"; - src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunss.otf'); - } - - @font-face { - font-family: "Computer Modern"; - font-weight: bold; - src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunsx.otf'); - } - @font-face { - font-family: "Computer Modern"; - font-style: oblique; - src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunsi.otf'); - } -*/ - /* @font-face { - font-family: "Computer Modern"; - font-style: Typewriter; - src: url('http://mirrors.ctan.org/fonts/cm-unicode/fonts/otf/cmuntt.otf'); - }*/ - - @font-face { - font-family: "Computer Modern"; - font-weight: bold; - font-style: oblique; - src: url('http://9dbb143991406a7c655e-aa5fcb0a5a4ec34cff238a2d56ca4144.r56.cf5.rackcdn.com/cmunso.otf'); - } - - - div.cell{ - width:100%; - margin-left:auto; /*16% !important;* was preconised but pbs with some browsers*/ - margin-right:auto; - } - h1 { - font-family: Helvetica, serif; - } - h2 { - font-family: Helvetica, serif; - color: darkblue; - } - - h4{ - margin-top:12px; - margin-bottom: 3px; - } - - - .rendered_html p {text-align:justify} - - div.text_cell_render{ - font-family: "Computer Modern", Arial, "Helvetica Neue", Helvetica, Geneva, sans-serif; - line-height: 145%; - font-size: 130%; - color: black; - width:100%; - /*width:800px;*/ - margin-left:0px; - margin-right:auto; - - } - .CodeMirror{ - font-family: "Source Code Pro", source-code-pro,Consolas, monospace; -color: darkblue; - } - -/* commented because many people prefer to have the prompt - .prompt{ - display: None; - } -*/ - -/* -div.output_area -{ - display: block; - margin-left: auto; - margin-right: auto -} -*/ -div.output_subarea.output_text -{ - margin-left: +2%; -} - -div.output_subarea.output_png -{ - margin-left: +10%; -} -div.output_subarea.output_svg -{ - margin-left: +10%; -} - - - .text_cell_render h5 { - font-weight: 300; - font-size: 22pt; - color: #4057A1; - font-style: italic; - margin-bottom: .5em; - margin-top: 0.5em; - display: block; - } - - .warning{ - color: rgb( 240, 20, 20 ) - } - - - diff --git a/testing/latex_envs/latex_envs.js b/testing/latex_envs/latex_envs.js deleted file mode 100644 index 1ad600f..0000000 --- a/testing/latex_envs/latex_envs.js +++ /dev/null @@ -1,178 +0,0 @@ - -/* - -*/ - -var eqNum = 0; // begins equation numbering at eqNum+1 -var eqLabelWithNumbers = true; //if true, label equations with equation numbers; otherwise using the tag specified by \label -var conversion_to_html = false; - - - -//var run_this = function() { - -define(["require", "/nbextensions/thmsInNb.js"], function (require,thmsInNb) { - - var maps = initmap(); - environmentMap=maps[0]; - cmdsMap=maps[1]; - eqLabNums=maps[2]; - - - - //define(["require"], function (require) { - var load_css = function(name) { - var link = document.createElement("link"); - link.type = "text/css"; - link.rel = "stylesheet"; - link.href = require.toUrl(name); - //link.href = name; - document.getElementsByTagName("head")[0].appendChild(link); - - }; - - var load_ipython_extension = function() { - require(['components/marked/lib/marked'], function(marked) { - "use strict"; - if (IPython.version[0] <= 2) { - console.log("This extension requires IPython >= 2.x") - return - } - - var security = IPython.security; - var _on_reload = true; /* make sure cells render on reload */ - - - - - /* Override original markdown render function */ - /* The idea was took from python-markdown extension https://gist.github.com/juhasch/c37408a0d79156f28c17#file-python-markdown-js */ - - // This used to work in IPython 2.x - - /* IPython.MarkdownCell.prototype.render = function() { - var cont = IPython.TextCell.prototype.render.apply(this); - console.log("result of textcell prototype",cont) - - cont = cont || IPython.notebook.dirty || _on_reload - if (cont) { - console.log("overriding markdown cell renderer") - var text = this.get_text(); - var math = null; - if (text === "") { - text = this.placeholder; - } - var text_and_math = IPython.mathjaxutils.remove_math(text); - text = text_and_math[0]; - math = text_and_math[1]; - console.log("text",text) - var html = marked.parser(marked.lexer(text)); - html = IPython.mathjaxutils.replace_math(html, math); - html = thmsInNbConv(html); //<----- thmsInNb patch here - html = security.sanitize_html(html); - console.log("html",html) - html = $($.parseHTML(html)); - // links in markdown cells should open in new tabs - html.find("a[href]").not('[href^="#"]').attr("target", "_blank"); - this.set_rendered(html); - this.element.find('div.input_area').hide(); - this.element.find("div.text_cell_render").show(); - this.typeset(); - - } - return cont - };*/ - - // for IPython v 3 - IPython.MarkdownCell.prototype.render = function () { - var cont = IPython.TextCell.prototype.render.apply(this); - if (cont || IPython.notebook.dirty || _on_reload) { - var that = this; - var text = this.get_text(); - var math = null; - if (text === "") { text = this.placeholder; } - var text_and_math = IPython.mathjaxutils.remove_math(text); - text = text_and_math[0]; - math = text_and_math[1]; - marked(text, function (err, html) { - html = IPython.mathjaxutils.replace_math(html, math); - html = thmsInNbConv(marked,html); //<----- thmsInNb patch here - html = security.sanitize_html(html); - html = $($.parseHTML(html)); - // add anchors to headings - html.find(":header").addBack(":header").each(function (i, h) { - h = $(h); - var hash = h.text().replace(/ /g, '-'); - h.attr('id', hash); - h.append( - $('') - .addClass('anchor-link') - .attr('href', '#' + hash) - .text('¶') - ); - }); - // links in markdown cells should open in new tabs - html.find("a[href]").not('[href^="#"]').attr("target", "_blank"); - that.set_rendered(html); - that.typeset(); - that.events.trigger("rendered.MarkdownCell", {cell: that}); - }); - } - return cont; - }; - - - - var init_cells = function() { - - var ncells = IPython.notebook.ncells(); - var cells = IPython.notebook.get_cells(); - var maps = initmap(); // this is to reset the counters in case of reload - environmentMap=maps[0]; cmdsMap=maps[1]; eqLabNums=maps[2]; - eqNum = 0; - console.log("reloading cells"); - for (var i = 0; i < ncells; i++) { - var cell = cells[i]; - if (cell instanceof IPython.TextCell) { - cell.render();}; - } - } - init_cells(); - - /* on reload */ - $([IPython.events]).on('status_started.Kernel', function() { - - init_cells(); - _on_reload = false; - }) - - - IPython.toolbar.add_buttons_group([ - { - id : 'doReload', - label : 'latex_envs: Refresh rendering ', - icon : 'fa-retweet', - callback : init_cells - } - ]); - - - - }); - }; - - console.log("Loading latex_envs.css"); - - //load_css('/nbextensions/latex_envs.css') - load_css('./latex_envs.css') - - - - //load_ipython_extension(); - return { - load_ipython_extension: load_ipython_extension, - }; -}); //End of run_this - -//run_this(); -console.log("Loading ./latex_envs.js"); diff --git a/testing/latex_envs/latex_envs.yaml b/testing/latex_envs/latex_envs.yaml deleted file mode 100644 index ff129f4..0000000 --- a/testing/latex_envs/latex_envs.yaml +++ /dev/null @@ -1,7 +0,0 @@ -Type: IPython Notebook Extension -Name: (some) LaTeX environments for Jupyter -Description: Enable to use laTeX environments in Jupyter's markdown cells -Link: https://github.com/jfbercher/IPython-notebook-extensions/tree/master/testing/latex_envs/ -Icon: icon.png -Main: latex_envs.js -Compatibility: 3.x diff --git a/testing/latex_envs/readme.md b/testing/latex_envs/readme.md deleted file mode 100644 index fbc27b6..0000000 --- a/testing/latex_envs/readme.md +++ /dev/null @@ -1,51 +0,0 @@ -# (some) LaTeX environments for Jupyter notebook - -This extension enables to use some LaTeX structures directly in markdown cells of the notebook. Supported structures include - -- theorems like structures: theorem, lemma, corollary, definition, example, problem, ... -- itemize, enumerate, ... - -More environments can be simply added in the source file (`thsInNb.js`). - -An automatic numbering of environments is implemented. Labels, cross-references and links between environments and equations are supported. - -In addition, the extension also enables to use simple LaTeX markup such as \textit{}, \textbf{}, \textem{}, \underline{}, etc. -This is useful for copying snippets of text to/from a LaTeX file. -The rendering of the LaTeX structures (theorems, definitions, exercises..) can be tailored via the stylesheet `latex_envs.css` - -The `conversion` directory contains scripts for converting the notebooks to html and LaTeX while taking into account the structures -enabled by the extension. Theses scripts require nodejs, perl, ipython3. - -# Installation - -You should follow the instructions in the wiki. A manual installation consists in copying latex_envs.js, thmsInNb.js, latex_envs.css to -the notebook extension directory, usually ~/.ipython/nbextensions. -Copy the scripts in conversion/ to some directory (preferably in your path). -Either load the extension from your `custom.js` or use a code cell with - - - %%javascript - IPython.load_extensions('latex_envs'); - - -# Demo/documentation - -A demo notebook `latex_env_doc.ipynb` is provided. Its html version is [latex_env_doc.html](https://rawgit.com/jfbercher/IPython-notebook-extensions/master/testing/latex_envs/latex_env_doc.html) and a pdf resulting -from conversion to LaTeX is available as `documentation.pdf`. Code needs improvements. -**Contributions, comments, issues are most welcome and will be deeply appreciated.** - -The original idea and starting code come from a discussion here: [https://github.com/benweet/stackedit/issues/187](https://github.com/benweet/stackedit/issues/187). - - -## Files - -File | description ------------------------ | ----------------------------- -conversion | Directory containing utilitary files for converting the notebook to html/LaTeX -documentation.pdf | Documentation -latex_env_doc.html | Documentation and demo notebook (html) version -latex_env_doc.ipynb | Documentation and demo notebook -latex_envs.css | Stylesheet for rendering the notebook/html -latex_envs.js | LaTeX_envs extension (main script) -thmsInNb.js | LaTeX_envs extension (does the actual conversion) -readme.md | This file. diff --git a/testing/latex_envs/thmsInNb.js b/testing/latex_envs/thmsInNb.js deleted file mode 100644 index d983339..0000000 --- a/testing/latex_envs/thmsInNb.js +++ /dev/null @@ -1,271 +0,0 @@ - -/* -This script goes through the input text (actually it is triggered each time a markdown cell is rendered. The imput text is the content of the cell. -It replaces the latex structures by html tags, typically wit a
foo - var cmdsMap = { - underline: { replacement: "u" }, - textit: { replacement: "i" }, - textbf: { replacement: "b" }, - textem: { replacement: "em" }, - section: { replacement: "h1" }, - subsection: { replacement: "h2" }, - } - return [environmentMap, cmdsMap, eqLabNums] -} - -var maps = initmap(); -environmentMap=maps[0]; -cmdsMap=maps[1]; -eqLabNums=maps[2]; - - - - -/*********/ - -function thmsInNbConv(marked,text) { - - var listings = []; - - { //**************************************************************************** - var EnvReplace = function(message) { - //console.log(message); - - //Look for pairs [ ] - var message = message.replace(/^(?:

)?\[([\s\S]*?)^(?:

)?\]/gm, - function(wholeMatch, m1) { - //return "\\["+m1+"\\]"; - m1 = m1.replace(/<[/]?em>/g, "_"); //correct possible incorrect md remplacements in eqs - m1 = m1.replace(/left{/g, "left\\{"); //correct possible incorrect md remplacements in eqs - return "\\[" + m1 + "\\]"; - } - ); - - var message = message.replace(/(?:

)?([$]{1,2})([\s\S]*?)(?:

)?\1/gm, - function(wholeMatch, m1) { - //return "\\["+m1+"\\]"; - wholeMatch = wholeMatch.replace(/<[/]?em>/g, "_"); //correct possible incorrect md remplacements in eqs - wholeMatch = wholeMatch.replace(/left{/g, "left\\{"); //correct possible incorrect md remplacements in eqs - return wholeMatch; - } - ); - - - var out = message.replace(/\\begin{(\w+)}([\s\S]*?)\\end{\1}/gm, function(wholeMatch, m1, m2) { - - - //if(!environmentMap[m1]) return wholeMatch; - var environment = environmentMap[m1]; - if (!environment) return wholeMatch; - - - var title = environment.title; - if (environment.counter) { - environment.counter.num++; - title += ' ' + environment.counter.num; - } - //The conversion machinery (see marked.js or mathjaxutils.js) extracts text and math and converts text to markdown. - //Here, we also want to convert thm like env. - //So we do it here. However, environments with blank lines are *not* extracted before and thus already converted. - // Thus we avoid to process them again. - // Try to check if there is remaining Markdown - // |\n\s-[\s]*(\w+)/gm - // /\*{1,2}([\s\S]*?)\*{1,2}|\_{1,2}([\s\S]*?)\_{1,2}/gm) - if (m2.match(/\*{1,2}([\s\S]*?)\*{1,2}|\_{1,2}([\S]*?)\_{1,2}|```/gm)) { - var m2 = marked.parser(marked.lexer(m2)); - } - - - var result = '' + title + '

' + m2; - - // case of the figure environment. We look for an \includegraphics directive, gobble its parameters except the image name, - // look for a caption and a label and construct an image representation with a caption and an anchor. Style can be customized - // via the class latex_img - - if (m1 == "figure") { - - var caption = /\\caption{([\s\S]*?)}/gm.exec(m2)[1]; - var graphic = /\\includegraphics(?:[\S\s]*?){([\s\S]*?)}/gm.exec(m2)[1]; - var label = m2.match(//gm); - if (!caption.match(//gm)) {caption=label+caption}; - - var result = '

' + title+': ' + caption + '

'; - }; - - - - if (m1 == "proof") { - result += ''; - } - - if (m1 == "itemize") { - var result = "
    " + m2.replace(/\\item/g, "
  • ") + "
"; - }; - - if (m1 == "enumerate") { - var result = "
    " + m2.replace(/\\item/g, "
  1. ") + "
"; - }; - - if (m1 != "listing") { - result = EnvReplace(result); - }; //try to do further replacements - - return result + '
'; - }); - //out = EnvReplace(out); - - return out; //} - - } - } - //********************************************************************************** - // What follows is done on the whole text, environments included: - // - substitutions of labels with anchors - // - substitutions of ref with links - // - LaTeX commands (textbf, textit, etc) replaced by html tags - - // We want to preserve a "listing" environment from **any modification** - // therefore we remove them and insert them back at the end - - var remove_listing = function (text) { - text = text.replace(/\\begin{listing}([\s\S]*?)\\end{listing}/gm, function(wholeMatch, m1) { - listings.push(m1); - return '!@!Listing'+listings.length+'!@!'; //originallistings location are marked by !@!Listingn!@!, n being the index of listing - }); - - return text; - }; - - text = remove_listing(text) - - - // Now we can do our stuff - - - { - // This is to replace references by links to the correct environment, - //while preserving links to equations - // which are worked out by MathJax - - //LABELS - var text = text.replace(/\\label{(\S+):(\S+)}/g, function(wholeMatch, m1, m2) { - m2 = m2.replace(/<[/]?em>/g, "_"); - if (m1 == "eq") { - if (conversion_to_html) { - /* if (eqLabelWithNumbers) { - eqNum++; - return wholeMatch + '\\tag{'+eqNum+'}' ; - */ - return wholeMatch; //+ '\\tag{'+m1+':'+m2+'}' ; - } else { - if (eqLabelWithNumbers) { - eqNum++; - //return '
' + '['+m1+':'+m2+']' + '' + '\\tag{'+eqNum+'}' ; - eqLabNums[m2] = eqNum.toString(); - - return '\\tag{' + eqNum + '}' + '' ; - } - return '\\tag{' + m2 + '}' + ''; - }; - } - return '' + '[' + m1 + ':' + m2 + ']' + ''; - }); - - - //REFERENCES - var text = text.replace(/\\ref{(\S+):(\S+)}/g, function(wholeMatch, m1, m2) { - m2 = m2.replace(/<[/]?em>/g, "_"); - if (conversion_to_html) { - if (m1 == "eq") return wholeMatch; - } else { - if (m1 == "eq") { - if (eqLabelWithNumbers) { - return eqLabNums[m2]; - } else return m1 + ':' + m2; - } - } - - return '' + '[' + m1 + ':' + m2 + ']' + ''; - }); - - - - { - - - text = EnvReplace(text); - - // LaTeX commands replacements (eg \textbf, \texit, etc) - var text = text.replace(/\\([\w]*){(.+?)}/g, function(wholeMatch, m1, m2) { - - var cmd = cmdsMap[m1]; - if (!cmd) return wholeMatch; - var tag = cmd.replacement; - return '<' + tag + '>' + m2 + ''; - }); - - //Other small replacements - var text = text.replace(/\\index{(.+?)}/g, function(wholeMatch, m1) { - return ''; - }); - var text = text.replace(/\\noindent/g, ""); - var text = text.replace(/\\(?:<\/p>)/g, "

"); - - - - }; - - }; - - //insert back listings in the text - - text = text.replace(/!@!Listing(\d+)!@!/gm, function(wholeMatch, n) { - return '
' + listings[n-1] + '
'; - }); - - return text; - - };