Back to home page

EIC code displayed by LXR

 
 

    


Warning, /epic-analysis/deps/delphes_EIC/notebooks/hidecode.tplx is written in an unsupported language. File is not indexed.

0001 ((*- extends 'article.tplx' -*))
0002 % Disable input cells
0003 ((* block input_group *))
0004 ((* endblock input_group *))
0005 
0006 %===============================================================================
0007 % Input
0008 %===============================================================================
0009 
0010 ((* block input scoped *))
0011    ((( custom_add_prompt(cell.source | wrap_text(88) | highlight_code(strip_verbatim=True), cell, 'In ', 'incolor') )))
0012 ((* endblock input *))
0013 
0014 %===============================================================================
0015 % Output
0016 %===============================================================================
0017 
0018 % Display stream ouput with coloring
0019 ((* block stream *))
0020     \begin{verbatim}[commandchars=\\\{\},fontsize=\footnotesize]
0021 ((( output.text | wrap_text(72) | escape_latex | ansi2latex )))
0022     \end{verbatim}
0023 ((* endblock stream *))
0024 
0025 
0026 %==============================================================================
0027 % Define macro custom_add_prompt() (derived from add_prompt() macro in style_ipython.tplx)
0028 %==============================================================================
0029 
0030 ((* macro custom_add_prompt(text, cell, prompt, prompt_color) -*))
0031     ((*- if cell.execution_count is defined -*))
0032     ((*- set execution_count = "" ~ (cell.execution_count | replace(None, " ")) -*))
0033     ((*- else -*))
0034     ((*- set execution_count = " " -*))
0035     ((*- endif -*))
0036     ((*- set indention =  " " * (execution_count | length + 7) -*))
0037 \begin{verbatim}[commandchars=\\\{\},fontsize=\scriptsize]
0038 ((( text | add_prompts(first='{\color{' ~ prompt_color ~ '}' ~ prompt ~ '[{\\color{' ~ prompt_color ~ '}' ~ execution_count ~ '}]:} ', cont=indention) )))
0039 \end{verbatim}
0040 ((*- endmacro *))
0041