Browse Source

more text

Hans Petter Langtangen 13 năm trước cách đây
mục cha
commit
e91d2d0417

+ 656 - 0
doc/src/sketcher/.ptex2tex.cfg

@@ -0,0 +1,656 @@
+
+# plain Verbatim environment:
+[Verb]
+breplace = \begin{Verbatim}
+ereplace = \end{Verbatim}
+
+# white background, rules above and below, with a title box "Code"
+[CodeRule]
+breplace = \vspace{4pt}
+	   \begin{Verbatim}[numbers=none,frame=lines,label=\fbox{{\tiny %(boxtext)s}},fontsize=\%(fontsize)s,
+	   labelposition=topline,framesep=2.5mm,framerule=1pt]
+ereplace = \end{Verbatim}
+boxtext = Code
+fontsize = fontsize{9pt}{9pt}
+
+# white background, rules above and below, with a title box "Terminal"
+[CodeTerminal]
+breplace = \vspace{4pt}
+	   \begin{Verbatim}[numbers=none,frame=lines,label=\fbox{{\tiny %(boxtext)s}},fontsize=\%(fontsize)s,
+	   labelposition=topline,framesep=2.5mm,framerule=0.7pt]
+ereplace = \end{Verbatim}
+fontsize = fontsize{9pt}{9pt}
+boxtext = Terminal
+
+# more plain Verbatim environment
+[Code]
+breplace = \begin{Verbatim}[fontsize=\%(fontsize)s,tabsize=8,baselinestretch=%(bstretch)s]
+ereplace = \end{Verbatim}
+	   \noindent
+bstretch = 0.85
+fontsize = fontsize{9pt}{9pt}
+
+# as Code, but with line numbers
+[CodeLineNo]
+breplace = \begin{Verbatim}[numbers=left,fontsize=\%(fontsize)s,tabsize=8,baselinestretch=%(bstretch)s]
+ereplace = \end{Verbatim}
+           \noindent
+bstretch = 0.85
+fontsize = fontsize{9pt}{9pt}
+
+# as Code, but indented:
+[CodeIndented]
+breplace = \begin{Verbatim}[fontsize=\%(fontsize)s,tabsize=8,baselinestretch=%(bstretch)s,
+	   fontfamily=tt,xleftmargin=7mm]
+ereplace = \end{Verbatim}
+	   \noindent
+bstretch = 0.85
+fontsize = fontsize{9pt}{9pt}
+
+
+# as CodeIndented, but larger font (10pt9:
+[CodeIndented10]
+breplace = \begin{Verbatim}[fontsize=\%(fontsize)s,tabsize=8,baselinestretch=%(bstretch)s,
+	   fontfamily=tt,xleftmargin=7mm]
+ereplace = \end{Verbatim}
+	   \noindent
+bstretch = 0.85
+fontsize = fontsize{10pt}{10pt}
+
+
+# Verbatim environments arising from the package pythonhighlight.sty,
+# now extended to anslistings.sty. Python_ANSt is with a title ("Python"),
+# while Python_ANS is without the title. Similar for other languages.
+[Python_ANSt]
+breplace = \begin{python}
+ereplace = \end{python}
+
+[Python_ANS]
+breplace = \begin{python:nt}
+ereplace = \end{python:nt}
+
+[Cpp_ANSt]
+breplace = \begin{c++}
+ereplace = \end{c++}
+
+[Cpp_ANS]
+breplace = \begin{c++:nt}
+ereplace = \end{c++:nt}
+
+[Matlab_ANS]
+breplace = \begin{matlab}
+ereplace = \end{matlab}
+
+[Bash_ANSt]
+breplace = \begin{bash}
+ereplace = \end{bash}
+
+[Bash_ANS]
+breplace = \begin{bash:nt}
+ereplace = \end{bash:nt}
+
+[Swig_ANSt]
+breplace = \begin{swigcode}
+ereplace = \end{swigcode}
+
+[Swig_ANS]
+breplace = \begin{swigcode:nt}
+ereplace = \end{swigcode:nt}
+
+[gencode_ANSt]
+breplace = \begin{gencode}
+ereplace = \end{gencode}
+
+[gencode_ANS]
+breplace = \begin{gencode:nt}
+ereplace = \end{gencode:nt}
+
+[UFL_ANSt]
+breplace = \begin{uflcode}
+ereplace = \end{uflcode}
+
+[UFL_ANS]
+breplace = \begin{uflcode:nt}
+ereplace = \end{uflcode:nt}
+
+[Output_ANSt]
+breplace = \begin{progoutput}
+ereplace = \end{progoutput}
+
+[Output_ANS]
+breplace = \begin{progoutput:nt}
+ereplace = \end{progoutput:nt}
+
+
+# Several minted styles (requires minted LaTeX package and Pygments)
+[Minted_Python]
+breplace = \begin{minted}[fontsize=\%(fontsize)s,linenos=false,mathescape,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]{python}
+ereplace = \end{minted}
+	   \noindent
+bstretch = 1.0
+fontsize = fontsize{9pt}{9pt}
+
+[Minted_Cython]
+breplace = \begin{minted}[fontsize=\%(fontsize)s,linenos=false,mathescape,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]{cython}
+ereplace = \end{minted}
+	   \noindent
+bstretch = 1.0
+fontsize = fontsize{9pt}{9pt}
+
+[Minted_Cpp]
+breplace = \begin{minted}[fontsize=\%(fontsize)s,linenos=false,mathescape,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]{c++}
+ereplace = \end{minted}
+	   \noindent
+bstretch = 1.0
+fontsize = fontsize{9pt}{9pt}
+
+[Minted_C]
+breplace = \begin{minted}[fontsize=\%(fontsize)s,linenos=false,mathescape,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]{c}
+ereplace = \end{minted}
+	   \noindent
+bstretch = 1.0
+fontsize = fontsize{9pt}{9pt}
+
+[Minted_Fortran]
+breplace = \begin{minted}[fontsize=\%(fontsize)s,linenos=false,mathescape,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]{fortran}
+ereplace = \end{minted}
+	   \noindent
+bstretch = 1.0
+fontsize = fontsize{9pt}{9pt}
+
+[Minted_Matlab]
+breplace = \begin{minted}[fontsize=\%(fontsize)s,linenos=false,mathescape,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]{matlab}
+ereplace = \end{minted}
+	   \noindent
+bstretch = 1.0
+fontsize = fontsize{9pt}{9pt}
+
+
+[Minted_Bash]
+breplace = \begin{minted}[fontsize=\%(fontsize)s,linenos=false,mathescape,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]{bash}
+ereplace = \end{minted}
+	   \noindent
+bstretch = 1.0
+fontsize = fontsize{9pt}{9pt}
+
+[Minted_Perl]
+breplace = \begin{minted}[fontsize=\%(fontsize)s,linenos=false,mathescape,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]{perl}
+ereplace = \end{minted}
+	   \noindent
+bstretch = 1.0
+fontsize = fontsize{9pt}{9pt}
+
+
+
+# warning box, pink background, warning sign
+[Warnings]
+breplace = \definecolor{warnback}{rgb}{1.0, 0.8235294, 0.8235294}
+	   \setlength{\fboxrule}{2pt}
+	   \begin{center}
+	   \fcolorbox{black}{warnback}{
+	   \begin{minipage}{0.8\textwidth}
+	   \includegraphics[height=0.3in]{warning.eps}
+	   \vskip-0.3in\hskip1.5in{\large\bf WARNING} \\[0.2cm]
+ereplace = \end{minipage}}
+	   \end{center}
+	   \setlength{\fboxrule}{0.4pt} %% Back to default
+
+# tip box, light blue background, "i" (info) sign
+[Tip]
+breplace = \definecolor{tipback}{rgb}{0.87843, 0.95686, 1.0}
+	   \setlength{\fboxrule}{2pt}
+	   \begin{center}
+	   \fcolorbox{black}{tipback}{
+	   \begin{minipage}{0.8\textwidth}
+	   \includegraphics[height=0.3in]{tip.eps}
+	   \vskip-0.3in\hskip1.5in{\large\bf TIP} \\[0.2cm]
+ereplace = \end{minipage}}
+	   \end{center}
+	   \setlength{\fboxrule}{0.4pt} %% Back to default
+
+# note box, "i" (info) sign
+[Note]
+breplace = \definecolor{noteback}{rgb}{0.988235, 0.964706, 0.862745}
+	   \setlength{\fboxrule}{2pt}
+	   \begin{center}
+	   \fcolorbox{black}{noteback}{
+	   \begin{minipage}{0.8\textwidth}
+	   \includegraphics[height=0.3in]{tip.eps}
+	   \vskip-0.3in\hskip1.5in{\large\bf NOTE} \\[0.2cm]
+ereplace = \end{minipage}}
+	   \end{center}
+	   \setlength{\fboxrule}{0.4pt} %% Back to default
+
+
+# colored box, can handle multiple pages
+[Blue]
+shadecolor = 0.87843, 0.95686, 1.0
+envname    = Blue
+define   = True
+newenv   = \providecommand{\shadedskip}{}
+           \definecolor{shadecolor}{rgb}{%(shadecolor)s}
+           \renewenvironment{shadedskip}{
+           \def\FrameCommand{\colorbox{shadecolor}}\FrameRule0.6pt
+           \MakeFramed {\FrameRestore}\vskip3mm}{\vskip0mm\endMakeFramed}
+           \providecommand{\shadedquote%(envname)s}{}
+           \renewenvironment{shadedquote%(envname)s}[1][]{
+           \bgroup\rmfamily
+           \fboxsep=0mm\relax
+           \begin{shadedskip}
+           \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
+	   \rightmargin=2\leftmargin\leftmargin=4pt\relax}
+           \item\relax}
+           {\endlist\end{shadedskip}\egroup}
+breplace = \begin{shadedquote%(envname)s}
+#           \centering{\large\bf Program} \\[0.2cm]
+           \fontsize{9pt}{9pt}
+           \begin{Verbatim}
+ereplace = \end{Verbatim}
+           \end{shadedquote%(envname)s}
+           \noindent
+
+# colored box, can handle multiple pages
+# \fcolorbox{black}{yellow}
+[BlueFrame]
+shadecolor = 0.87843, 0.95686, 1.0
+envname    = BlueFrame
+define   = True
+newenv   = \providecommand{\shadedskip}{}
+           \definecolor{shadecolor}{rgb}{%(shadecolor)s}
+           \renewenvironment{shadedskip}{
+           \def\FrameCommand{\fcolorbox{black}{shadecolor}}\FrameRule0.6pt
+           \MakeFramed {\FrameRestore}\vskip3mm}{\vskip0mm\endMakeFramed}
+           \providecommand{\shadedquote%(envname)s}{}
+           \renewenvironment{shadedquote%(envname)s}[1][]{
+           \bgroup\rmfamily
+           \fboxsep=0mm\relax
+           \begin{shadedskip}
+           \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
+	   \rightmargin=2\leftmargin\leftmargin=4pt\relax}
+           \item\relax}
+           {\endlist\end{shadedskip}\egroup}
+breplace = \begin{shadedquote%(envname)s}
+#           \centering{\large\bf Program} \\[0.2cm]
+           \fontsize{9pt}{9pt}
+           \begin{Verbatim}
+ereplace = \end{Verbatim}
+           \end{shadedquote%(envname)s}
+           \noindent
+
+
+# colored box with left vertical bar, can handle multiple pages
+[BlueBar]
+shadecolor = 0.87843, 0.95686, 1.0
+barcolor   = 0.7,     0.95686, 1
+envname    = BlueBar
+define   = True
+newenv   = \providecommand{\shadedwbar}{}
+           \definecolor{shadecolor}{rgb}{%(shadecolor)s}
+           \renewenvironment{shadedwbar}{
+           \def\FrameCommand{\color[rgb]{%(barcolor)s}\vrule width 1mm\normalcolor\colorbox{shadecolor}}\FrameRule0.6pt
+           \MakeFramed {\advance\hsize-2mm\FrameRestore}\vskip3mm}{\vskip0mm\endMakeFramed}
+           \providecommand{\shadedquote%(envname)s}{}
+           \renewenvironment{shadedquote%(envname)s}[1][]{
+           \bgroup\rmfamily
+           \fboxsep=0mm\relax
+           \begin{shadedwbar}
+           \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
+	   \rightmargin=2\leftmargin\leftmargin=4pt\relax}
+           \item\relax}
+           {\endlist\end{shadedwbar}\egroup}
+breplace = \begin{shadedquote%(envname)s}
+#           \centering{\large\bf Program} \\[0.2cm]
+           \fontsize{9pt}{9pt}
+           \begin{Verbatim}
+ereplace = \end{Verbatim}
+           \end{shadedquote%(envname)s}
+           \noindent
+
+
+# colored box, can handle multiple pages
+[Red]
+shadecolor = 1, 0.97, 0.85
+envname    = Red
+define   = True
+newenv   = \providecommand{\shadedskip}{}
+           \definecolor{shadecolor}{rgb}{%(shadecolor)s}
+           \renewenvironment{shadedskip}{
+           \def\FrameCommand{\colorbox{shadecolor}}\FrameRule0.6pt
+           \MakeFramed {\FrameRestore}\vskip3mm}{\vskip0mm\endMakeFramed}
+           \providecommand{\shadedquote%(envname)s}{}
+           \renewenvironment{shadedquote%(envname)s}[1][]{
+           \bgroup\rmfamily
+           \fboxsep=0mm\relax
+           \begin{shadedskip}
+           \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
+	   \rightmargin=2\leftmargin\leftmargin=4pt\relax}
+           \item\relax}
+           {\endlist\end{shadedskip}\egroup}
+breplace = \begin{shadedquote%(envname)s}
+#           \centering{\large\bf Program} \\[0.2cm]
+           \fontsize{9pt}{9pt}
+           \begin{Verbatim}
+ereplace = \end{Verbatim}
+           \end{shadedquote%(envname)s}
+           \noindent
+
+# colored box, can handle multiple pages
+[RedFrame]
+shadecolor = 1, 0.97, 0.85
+envname    = RedFrame
+define   = True
+newenv   = \providecommand{\shadedskip}{}
+           \definecolor{shadecolor}{rgb}{%(shadecolor)s}
+           \renewenvironment{shadedskip}{
+           \def\FrameCommand{\fcolorbox{black}{shadecolor}}\FrameRule0.6pt
+           \MakeFramed {\FrameRestore}\vskip3mm}{\vskip0mm\endMakeFramed}
+           \providecommand{\shadedquote%(envname)s}{}
+           \renewenvironment{shadedquote%(envname)s}[1][]{
+           \bgroup\rmfamily
+           \fboxsep=0mm\relax
+           \begin{shadedskip}
+           \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
+	   \rightmargin=2\leftmargin\leftmargin=4pt\relax}
+           \item\relax}
+           {\endlist\end{shadedskip}\egroup}
+breplace = \begin{shadedquote%(envname)s}
+#           \centering{\large\bf Program} \\[0.2cm]
+           \fontsize{9pt}{9pt}
+           \begin{Verbatim}
+ereplace = \end{Verbatim}
+           \end{shadedquote%(envname)s}
+           \noindent
+
+
+# colored box with left vertical bar, can handle multiple pages
+[RedBar]
+shadecolor = 1, 0.97, 0.85
+barcolor   = 1, 0.85, 0.85
+envname    = RedBar
+define   = True
+newenv   = \providecommand{\shadedwbar}{}
+           \definecolor{shadecolor}{rgb}{%(shadecolor)s}
+           \renewenvironment{shadedwbar}{
+           \def\FrameCommand{\color[rgb]{%(barcolor)s}\vrule width 1mm\normalcolor\colorbox{shadecolor}}\FrameRule0.6pt
+           \MakeFramed {\advance\hsize-2mm\FrameRestore}\vskip3mm}{\vskip0mm\endMakeFramed}
+           \providecommand{\shadedquote%(envname)s}{}
+           \renewenvironment{shadedquote%(envname)s}[1][]{
+           \bgroup\rmfamily
+           \fboxsep=0mm\relax
+           \begin{shadedwbar}
+           \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
+	   \rightmargin=2\leftmargin\leftmargin=4pt\relax}
+           \item\relax}
+           {\endlist\end{shadedwbar}\egroup}
+breplace = \begin{shadedquote%(envname)s}
+#           \centering{\large\bf Program} \\[0.2cm]
+           \fontsize{9pt}{9pt}
+           \begin{Verbatim}
+ereplace = \end{Verbatim}
+           \end{shadedquote%(envname)s}
+           \noindent
+
+# colored box, can handle multiple pages
+[Yellow]
+shadecolor = 1.0, 1.0, 0.7
+envname    = Yellow
+define   = True
+newenv   = \providecommand{\shadedskip}{}
+           \definecolor{shadecolor}{rgb}{%(shadecolor)s}
+           \renewenvironment{shadedskip}{
+           \def\FrameCommand{\colorbox{shadecolor}}\FrameRule0.6pt
+           \MakeFramed {\FrameRestore}\vskip3mm}{\vskip0mm\endMakeFramed}
+           \providecommand{\shadedquote%(envname)s}{}
+           \renewenvironment{shadedquote%(envname)s}[1][]{
+           \bgroup\rmfamily
+           \fboxsep=0mm\relax
+           \begin{shadedskip}
+           \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
+	   \rightmargin=2\leftmargin\leftmargin=4pt\relax}
+           \item\relax}
+           {\endlist\end{shadedskip}\egroup}
+breplace = \begin{shadedquote%(envname)s}
+#           \centering{\large\bf Program} \\[0.2cm]
+           \fontsize{9pt}{9pt}
+           \begin{Verbatim}
+ereplace = \end{Verbatim}
+           \end{shadedquote%(envname)s}
+           \noindent
+
+
+# colored box, can handle multiple pages
+[Gray]
+envname  = Gray
+define   = True
+newenv   = \providecommand{\shadedskip}{}
+           \definecolor{shadecolor}{gray}{0.93}
+           \renewenvironment{shadedskip}{
+           \def\FrameCommand{\colorbox{shadecolor}}\FrameRule0.6pt
+           \MakeFramed {\FrameRestore}\vskip3mm}{\vskip0mm\endMakeFramed}
+           \providecommand{\shadedquote%(envname)s}{}
+           \renewenvironment{shadedquote%(envname)s}[1][]{
+           \bgroup\rmfamily
+           \fboxsep=0mm\relax
+           \begin{shadedskip}
+           \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
+	   \rightmargin=2\leftmargin\leftmargin=4pt\relax}
+           \item\relax}
+           {\endlist\end{shadedskip}\egroup}
+breplace = \begin{shadedquote%(envname)s}
+#           \centering{\large\bf Program} \\[0.2cm]
+           \fontsize{9pt}{9pt}
+           \begin{Verbatim}
+ereplace = \end{Verbatim}
+           \end{shadedquote%(envname)s}
+           \noindent
+
+
+
+# light blue shaded box, can handle multiple pages, "snippet" to the right
+[Blue_snippet]
+define   = True
+newenv   = \providecommand{\shadedquoteBluesnippet}{}
+           \renewenvironment{shadedquoteBluesnippet}[1][]{
+           \definecolor{shadecolor}{rgb}{0.87843, 0.95686, 1.0}
+           \definecolor{shadetitle}{rgb}{0.5, 0.95686, 1}
+           \bgroup\rmfamily
+           \fboxsep=0mm\relax
+           \begin{shaded}
+           {{\hfill\tiny\textsf{\textcolor{shadetitle}{Snippet\ \ }}}}
+           \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
+	   \rightmargin=2\leftmargin\leftmargin=4pt\relax}
+           \item\relax}
+           {\endlist{\textcolor{shadecolor}{\ }}\end{shaded}\egroup}
+breplace = \begin{shadedquoteBluesnippet}
+#           \centering{\large\bf Program} \\[0.2cm]
+           \fontsize{9pt}{9pt}
+           \begin{Verbatim}
+ereplace = \end{Verbatim}
+           \end{shadedquoteBluesnippet}
+           \noindent
+
+# light blue, shaded box, can not handle multiple pages (sp = single page)
+[Blue_singlepage]
+breplace = \begin{SaveVerbatim}{Snippet}
+ereplace = \end{SaveVerbatim}
+           \setlength{\fboxrule}{0pt}
+           \begin{center}
+           \definecolor{shadecolor}{rgb}{0.87843, 0.95686, 1.0}
+           \fcolorbox{black}{shadecolor}{
+           \begin{minipage}{0.97\textwidth}
+#           \centering{\large\bf Program snippet} \\[0.2cm]
+           \raggedright
+           \fontsize{9pt}{9pt}\selectfont{\BUseVerbatim{Snippet}}
+           \end{minipage}}
+           \end{center}
+           \setlength{\fboxrule}{0.4pt} %% Back to default
+           \noindent
+
+# light gray, shaded box, can not handle multiple pages (sp = single page)
+[Gray_singlepage]
+breplace = \begin{SaveVerbatim}{Programsingle}
+ereplace = \end{SaveVerbatim}
+           \setlength{\fboxrule}{0pt}
+           \begin{center}
+           \definecolor{shadecolor}{gray}{0.93}
+           \fcolorbox{black}{shadecolor}{
+           \begin{minipage}{0.97\textwidth}
+#           \centering{\large\bf Program line} \\[0.2cm]
+           \raggedright
+           \fontsize{9pt}{9pt}\selectfont{\BUseVerbatim{Programsingle}}
+           \end{minipage}}
+           \end{center}
+           \setlength{\fboxrule}{0.4pt} %% Back to default
+           \noindent
+
+
+# Tiago Quintino's code environment
+[PythonTiago]
+breplace = \lstset{language=Python}
+           \lstset{frame=single,numbers=left,numberstyle=\tiny,numbersep=6pt,
+                   stepnumber=2}
+           \lstset{framexleftmargin=0mm,
+                   framexrightmargin=0mm,
+                   frame=shadowbox,
+                   rulesepcolor=\color{dgray}}
+           {\fontsize{9pt}{9pt}
+           \begin{lstlisting}
+ereplace = \end{lstlisting}}\vspace{3mm}
+
+# Tiago Quintino's code environment
+[CppTiago]
+breplace = \lstset{language=[ISO]{C++}}
+           \lstset{frame=single,numbers=left,numberstyle=\tiny,numbersep=6pt,
+                   stepnumber=2}
+           \lstset{framexleftmargin=0mm,
+                   framexrightmargin=0mm,
+                   frame=shadowbox,
+                   rulesepcolor=\color{dgray}}
+           {\fontsize{9pt}{9pt}
+           \begin{lstlisting}
+ereplace = \end{lstlisting}}\vspace{3mm}
+
+# old FEniCS style code environment
+[oldFEniCS]
+define   = True
+newenv   = \providecommand{\fenicscode}{}
+           \renewenvironment{fenicscode}[1]{
+           \center\tabular{c}\hline\\ \footnotesize
+           \minipage{#1\textwidth}\verbatim}
+           {\endverbatim\endminipage\\ \\ \hline\endtabular\endcenter}
+breplace = \begin{fenicscode}{0.9}
+ereplace = \end{fenicscode}
+
+# old FEniCS style code environment
+[oldFEniCSsmall]
+define   = True
+newenv   = \providecommand{\fenicscodesmall}{}
+           \renewenvironment{fenicscodesmall}[1]{
+           \center\footnotesize\minipage{#1\textwidth}\verbatim}
+           {\endverbatim\endminipage\endcenter}
+breplace = \begin{fenicscodesmall}{0.9}
+ereplace = \end{fenicscodesmall}
+
+
+# NOTE: The CodeGrayWhite1/2 redefine \FancyVerbFormatLine and this
+# will affect all forthcoming styles that use fancyvrb (quite many!).
+# Be careful with this environment
+
+# Code with gray background and white split between lines:
+[CodeGrayWhite1]
+breplace = \definecolor{Light}{gray}{.80}
+            \renewcommand{\FancyVerbFormatLine}[1]{\colorbox{Light}{\makebox[\linewidth][l]{#1}}}
+           \begin{Verbatim}[fontsize=\%(fontsize)s,numbers=left,tabsize=8,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]
+ereplace = \end{Verbatim}
+	   \noindent
+bstretch = 0.85
+fontsize = fontsize{9pt}{9pt}
+
+# as CodeGrayWhite1, but no line numbers:
+[CodeGrayWhite2]
+breplace = \definecolor{Light}{gray}{.80}
+            \renewcommand{\FancyVerbFormatLine}[1]{\colorbox{Light}{\makebox[\linewidth][l]{#1}}}
+           \begin{Verbatim}[fontsize=\%(fontsize)s,tabsize=8,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]
+ereplace = \end{Verbatim}
+	   \noindent
+bstretch = 0.85
+fontsize = fontsize{9pt}{9pt}
+
+
+[inline_code]
+font = 10
+
+[preprocess]
+#defines = T2
+#undefines = T2
+#includes = /home/some/body/myfile
+
+[names]
+# the names below are just examples - new names can be
+# defined instead or in addition to those listed here
+
+
+# computer code in quote environment (gives a left margin):
+ccq  = CodeIndented
+# computer code with no left margin:
+cc   = Code
+# computer code with line numbering:
+ccl  = CodeLineNo
+# program box:
+pro  = BlueBar
+pypro  = BlueBar
+cypro  = BlueBar
+cpppro = BlueBar
+cpro   = BlueBar
+fpro   = BlueBar
+plpro  = BlueBar
+shpro  = BlueBar
+mpro   = BlueBar
+# computer code box (snippet, not complete program):
+cod  = Blue
+pycod  = Blue
+cycod  = Blue
+cppcod = Blue
+ccod   = Blue
+fcod   = Blue
+plcod  = Blue
+shcod  = Blue
+mcod   = Blue
+# computer code box (snippet, not complete program):
+#ccod   = Cpp_ANS
+#cppcod = Cpp_ANS
+#pycod  = Python_ANS
+#cycod  = Cython_ANS
+#cans   = Cpp_ANS
+cppans = Cpp_ANS
+pyans  = Python_ANS
+bashans= Bash_ANS
+swigans= Swig_ANS
+uflans = UFL_ANS
+# computer code box (snippet, not complete program):
+#sni  = Blue_snippet
+sni  = Blue
+# data file:
+dat  = CodeIndented
+# data file snippet:
+dsni = CodeIndented
+# system commands (in terminal window):
+sys  = CodeTerminal
+# one-line system command (in terminal window):
+slin = Code
+# IPython interactive session:
+ipy  = Code
+# standard interactive python session:
+py   = Code
+# execution of a Python program ("run python"):
+rpy  = CodeTerminal
+# one-line program code:
+plin = Code
+# verbatim environment:
+ver  = Verb
+# warning box:
+warn = Warnings
+# tip box:
+rule = Tip
+# note box:
+summ = Note

+ 12 - 6
doc/src/sketcher/basics.do.txt

@@ -37,10 +37,16 @@ FIGURE: [figs-sketcher/wheel_on_inclined_plane.png, width=600] Sketch of a physi
 # #ifdef PRIMER_BOOK
 Classes are very suitable for implementing the various components that
 build up a sketch and their functionality. In particular, we shall
-demonstrate that as soon some classes are established, more are easily
-added. Enhanced functionality for all the classes is also easy to
-implement in common, generic code that can immediately be shared by all
-present and future classes.
+demonstrate that as soon as some classes are established, more are
+easily added. Enhanced functionality for all the classes is also easy
+to implement in common, generic code that can immediately be shared by
+all present and future classes. The fundamental data structure
+involved in this case study is a hierarchical tree, and much of the
+material on implementation issues targets how to traverse tree
+structures with recursive function calls in object hierarchies. This
+topic is of key relevance in a wide range of other applications as
+well. In total, the drawing program to be presented constitutes an
+excellent example on the power of class programming.
 
 ===== Using the Object Collection =====
 
@@ -275,7 +281,7 @@ working with complex figures that involve layers of subfigures.
 FIGURE: [figs-sketcher/vehicle0_hier2.png, width=500] Hierarchical relation between figure objects, including their class names. label{sketcher:fig:vehicle0:hier2}
 
 Any of the objects can in the program be reached through their names, e.g.,
-!bc pycodc
+!bc pycod
 fig['vehicle']
 fig['vehicle']['wheels']
 fig['vehicle']['wheels']['wheel2']
@@ -334,7 +340,7 @@ drawing will not be visible.
 
 Let us make a velocity function and move the object according
 to that velocity in small steps of time:
-!bc pydoc
+!bc pycod
 def v(t):
     return -8*R*t*(1 - t/(2*R))
 

+ 18 - 5
doc/src/sketcher/implementation.do.txt

@@ -5,13 +5,26 @@
 ======= Inner Workings of the Pysketcher Tool =======
 # #endif
 
-We shall now explain how we can, quite easily, realize software
-with the capabilities demonstrated above. Each object in the
-figure is represented as a class in a class hierarchy. Using
-inheritance, classes can inherit properties from parent classes
-and add new geometric features.
+We shall now explain how we can, quite easily, realize software with
+the capabilities demonstrated in the previous examples. Each object in
+the figure is represented as a class in a class hierarchy. Using
+inheritance, classes can inherit properties from parent classes and
+add new geometric features.
 
 # #ifndef PRIMER_BOOK
+
+Class programming is a key technology for realizing Pysketcher.
+As soon as some classes are established, more are easily
+added. Enhanced functionality for all the classes is also easy to
+implement in common, generic code that can immediately be shared by
+all present and future classes. The fundamental data structure
+involved in the `pysketcher` package is a hierarchical tree, and much
+of the material on implementation issues targets how to traverse tree
+structures with recursive function calls in object hierarchies. This
+topic is of key relevance in a wide range of other applications as
+well. In total, the inner workings of Pysketcher constitute an
+excellent example on the power of class programming.
+
 ===== Example of Classes for Geometric Objects =====
 # #endif
 

+ 21 - 7
doc/src/sketcher/make.sh

@@ -2,17 +2,31 @@
 
 main=wrap_sketcher
 doconce format html $main
-exit 1
-
-doconce format sphinx $main --skip_inline_comments
-rm -rf sphinx-rootdir
-doconce sphinx_dir author="H. P. Langtangen" version=0.1 theme=pyramid $main
-python automake-sphinx.py
 
+cp .ptex2tex.cfg-primer .ptex2tex.cfg
 doconce format latex $main -DPRIMER_BOOK
-ptex2tex -DMINTED $main
+ptex2tex $main
 latex $main
 makeindex $main
 latex $main
 latex $main
 dvipdf $main
+mv $main.pdf ${main}_primer.pdf
+
+cp .ptex2tex.cfg-minted .ptex2tex.cfg
+doconce format pdflatex $main
+ptex2tex -DMINTED $main
+pdflatex -shell-escape $main
+makeindex $main
+pdflatex -shell-escape $main
+pdflatex -shell-escape $main
+
+doconce format sphinx $main --skip_inline_comments
+rm -rf sphinx-rootdir
+doconce sphinx_dir author="H. P. Langtangen" version=0.1 theme=pyramid $main
+python automake-sphinx.py
+
+cp ${main}_primer.pdf ../../tutorial/pysketcher_blue.pdf
+cp ${main}.pdf ../../tutorial/pysketcher.pdf
+#cp $main.html ../../tutorial/pysketcher.html
+cp -r sphinx-rootdir/_build/html ../../tutorial/html

+ 11 - 3
doc/src/sketcher/make_primer.sh

@@ -1,7 +1,15 @@
 #!/bin/sh
 
-doconce format latex sketcher -DPRIMER_BOOK
+doconce format latex basics -DPRIMER_BOOK
+doconce format latex implemention -DPRIMER_BOOK
+doconce format latex exercises -DPRIMER_BOOK
 # fix \code{} in figure captions
-doconce replace "Hierarchy of figure elements in an instance of class \code{Vehicle0" "Hierarchy of figure elements in an instance of class \codett{Vehicle0" sketcher.p.tex
+doconce replace "Hierarchy of figure elements in an instance of class \code{Vehicle0" "Hierarchy of figure elements in an instance of class \codett{Vehicle0" implementation.p.tex
 
-ptex2tex sketcher
+# Modify syntax in exercises
+doconce subst '\\subsection\{' '\\begin{exercise}\n\\exerentry{' exercises.p.tex
+doconce subst '\\noindent\nFilename: \\code\{(.+?)\}' 'Name of program file: \\code{\g<1>}.\n\\hfill $\\diamond$\n\\end{exercise}' exercises.p.tex
+
+cp basics.p.tex pysketcher_basics.p.tex
+cp implementation.p.tex pysketcher_impl.p.tex
+cp exercises.p.tex pysketcher_ex.p.tex

+ 27 - 1
doc/src/sketcher/wrap_sketcher.do.txt

@@ -1,7 +1,33 @@
-TITLE: Creating Principal Sketches of Physics Systems Using Pysketcher
+TITLE: Using Pysketcher to Create Principal Sketches of Physics Problems
 AUTHOR: Hans Petter Langtangen at Center for Biomedical Computing, Simula Research Laboratory and Department of Informatics, University of Oslo
 DATE: today
 
+__Abstract.__
+Pysketcher is a Python package which allows principal sketches of
+physics and mechanics problems to be realized through short programs
+instead of interactive (and potentially tedious and inaccurate)
+drawing.  Elements of the sketch, such as lines, circles, angles,
+forces, coordinate systems, etc., are realized as objects and
+collected in hierarchical structures. Parts of the hierarchical
+structures can easily change line styles and colors, or be copied,
+scaled, translated, and rotated. These features make it
+straightforward to move parts of the sketch to create animation,
+usually in accordance with the physics of the underlying problem.
+Exact dimensioning of the elements in the sketch is trivial to obtain
+since distances are specified in computer code.
+
+Pysketcher is easy to learn from a number of examples. Beyond
+essential Python programming and a knowledge about mechanics problems,
+no further background is required.
+
+
+# Task (can be questions): make sketches of physical problems, see fig
+#   through user-friendly composition of basic shapes
+# Desired knowledge: plotting curves, basic OO (ch. X.Y, ...)
+# Required knowledge?
+# Learning Goals: these targets the inner workings of pysketcher,
+# which is just a part of this document...
+
 # #include "basics.do.txt"
 
 # #include "implementation.do.txt"