Skip to content

Commit

Permalink
Make pysyntax breakable
Browse files Browse the repository at this point in the history
  • Loading branch information
hmenke committed Jan 11, 2017
1 parent cec18ce commit bab30fe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion doc/misc/common.tex
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
% Do magic that \bfseries for keywords actually works
\DeclareFontShape{OT1}{cmtt}{bx}{n}{<5><6><7><8><9><10><10.95><12><14.4><17.28><20.74><24.88>cmttb10}{}
\usepackage{lmodern} % use the Latin Modern fonts

% Custom colors
\definecolor{stringblue}{rgb}{0.09,0.211,0.57}
Expand Down
34 changes: 18 additions & 16 deletions doc/ug/pypresso.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
\usepackage{xparse}
\usepackage{framed}

\colorlet{optcolor}{gray!80!black}
\colorlet{parcolor}{blue}
Expand Down Expand Up @@ -106,9 +107,9 @@
\phantomsection
\IfValueT{ #1 }{ \label {pysyntax:\detokenize{#1}} }
\minisec{Python ~ Syntax ~ \textup{(\arabic { pysyntax_counter })}}
\nopagebreak
\nopagebreak[4]
\smallskip
\nopagebreak
\nopagebreak[4]
}
}

Expand Down Expand Up @@ -163,22 +164,23 @@

% Place heading and put everything in a coffin
\pypresso_heading:n { #1 }
\vcoffin_set:Nnw \l_pypresso_syntax_coffin { \linewidth - 1.5em - 1em - 1pt }
\dim_zero:N \OuterFrameSep
\cs_set:Npn \FrameCommand
{
\tex_kern:D 1.5em
\textcolor { black } { \tex_vrule:D width 1pt }
\tex_kern:D 0.5em
}
\MakeFramed
{
\dim_add:Nn \hsize { -\width }
\FrameRestore
\cs_set_eq:cN { if@nobreak } \iftrue
}
\pypresso_init:
}
{
\vcoffin_set_end:
% Place the coffin with that fancy rule
\bool_if:NT \l_pypresso_enable_bool
{
\tex_noindent:D
\tex_kern:D 1.5em
\tex_vrule:D width 1pt
height \coffin_ht:N \l_pypresso_syntax_coffin
depth \coffin_dp:N \l_pypresso_syntax_coffin
\tex_kern:D 0.5em
\coffin_typeset:Nnnnn \l_pypresso_syntax_coffin { l } { B } { 0pt } { 0pt }
}
\endMakeFramed
}

\ExplSyntaxOff
\ExplSyntaxOff

0 comments on commit bab30fe

Please sign in to comment.