.ptex2tex.cfg-primer 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. # plain Verbatim environment:
  2. [Verb]
  3. breplace = \begin{Verbatim}
  4. ereplace = \end{Verbatim}
  5. # white background, rules above and below, with a title box "Code"
  6. [CodeRule]
  7. breplace = \vspace{4pt}
  8. \begin{Verbatim}[numbers=none,frame=lines,label=\fbox{{\tiny %(boxtext)s}},fontsize=\%(fontsize)s,
  9. labelposition=topline,framesep=2.5mm,framerule=1pt]
  10. ereplace = \end{Verbatim}
  11. boxtext = Code
  12. fontsize = fontsize{9pt}{9pt}
  13. # white background, rules above and below, with a title box "Terminal"
  14. [CodeTerminal]
  15. breplace = \vspace{4pt}
  16. \begin{Verbatim}[numbers=none,frame=lines,label=\fbox{{\tiny %(boxtext)s}},fontsize=\%(fontsize)s,
  17. labelposition=topline,framesep=2.5mm,framerule=0.7pt]
  18. ereplace = \end{Verbatim}
  19. fontsize = fontsize{9pt}{9pt}
  20. boxtext = Terminal
  21. # more plain Verbatim environment
  22. [Code]
  23. breplace = \begin{Verbatim}[fontsize=\%(fontsize)s,tabsize=8,baselinestretch=%(bstretch)s]
  24. ereplace = \end{Verbatim}
  25. \noindent
  26. bstretch = 0.85
  27. fontsize = fontsize{9pt}{9pt}
  28. # as Code, but with line numbers
  29. [CodeLineNo]
  30. breplace = \begin{Verbatim}[numbers=left,fontsize=\%(fontsize)s,tabsize=8,baselinestretch=%(bstretch)s]
  31. ereplace = \end{Verbatim}
  32. \noindent
  33. bstretch = 0.85
  34. fontsize = fontsize{9pt}{9pt}
  35. # as Code, but indented:
  36. [CodeIndented]
  37. breplace = \begin{Verbatim}[fontsize=\%(fontsize)s,tabsize=8,baselinestretch=%(bstretch)s,
  38. fontfamily=tt,xleftmargin=7mm]
  39. ereplace = \end{Verbatim}
  40. \noindent
  41. bstretch = 0.85
  42. fontsize = fontsize{9pt}{9pt}
  43. # as CodeIndented, but larger font (10pt9:
  44. [CodeIndented10]
  45. breplace = \begin{Verbatim}[fontsize=\%(fontsize)s,tabsize=8,baselinestretch=%(bstretch)s,
  46. fontfamily=tt,xleftmargin=7mm]
  47. ereplace = \end{Verbatim}
  48. \noindent
  49. bstretch = 0.85
  50. fontsize = fontsize{10pt}{10pt}
  51. # Verbatim environments arising from the package pythonhighlight.sty,
  52. # now extended to anslistings.sty. Python_ANSt is with a title ("Python"),
  53. # while Python_ANS is without the title. Similar for other languages.
  54. [Python_ANSt]
  55. breplace = \begin{python}
  56. ereplace = \end{python}
  57. [Python_ANS]
  58. breplace = \begin{python:nt}
  59. ereplace = \end{python:nt}
  60. [Cpp_ANSt]
  61. breplace = \begin{c++}
  62. ereplace = \end{c++}
  63. [Cpp_ANS]
  64. breplace = \begin{c++:nt}
  65. ereplace = \end{c++:nt}
  66. [Matlab_ANS]
  67. breplace = \begin{matlab}
  68. ereplace = \end{matlab}
  69. [Bash_ANSt]
  70. breplace = \begin{bash}
  71. ereplace = \end{bash}
  72. [Bash_ANS]
  73. breplace = \begin{bash:nt}
  74. ereplace = \end{bash:nt}
  75. [Swig_ANSt]
  76. breplace = \begin{swigcode}
  77. ereplace = \end{swigcode}
  78. [Swig_ANS]
  79. breplace = \begin{swigcode:nt}
  80. ereplace = \end{swigcode:nt}
  81. [gencode_ANSt]
  82. breplace = \begin{gencode}
  83. ereplace = \end{gencode}
  84. [gencode_ANS]
  85. breplace = \begin{gencode:nt}
  86. ereplace = \end{gencode:nt}
  87. [UFL_ANSt]
  88. breplace = \begin{uflcode}
  89. ereplace = \end{uflcode}
  90. [UFL_ANS]
  91. breplace = \begin{uflcode:nt}
  92. ereplace = \end{uflcode:nt}
  93. [Output_ANSt]
  94. breplace = \begin{progoutput}
  95. ereplace = \end{progoutput}
  96. [Output_ANS]
  97. breplace = \begin{progoutput:nt}
  98. ereplace = \end{progoutput:nt}
  99. # Several minted styles (requires minted LaTeX package and Pygments)
  100. [Minted_Python]
  101. breplace = \begin{minted}[fontsize=\%(fontsize)s,linenos=false,mathescape,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]{python}
  102. ereplace = \end{minted}
  103. \noindent
  104. bstretch = 1.0
  105. fontsize = fontsize{9pt}{9pt}
  106. [Minted_Cython]
  107. breplace = \begin{minted}[fontsize=\%(fontsize)s,linenos=false,mathescape,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]{cython}
  108. ereplace = \end{minted}
  109. \noindent
  110. bstretch = 1.0
  111. fontsize = fontsize{9pt}{9pt}
  112. [Minted_Cpp]
  113. breplace = \begin{minted}[fontsize=\%(fontsize)s,linenos=false,mathescape,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]{c++}
  114. ereplace = \end{minted}
  115. \noindent
  116. bstretch = 1.0
  117. fontsize = fontsize{9pt}{9pt}
  118. [Minted_C]
  119. breplace = \begin{minted}[fontsize=\%(fontsize)s,linenos=false,mathescape,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]{c}
  120. ereplace = \end{minted}
  121. \noindent
  122. bstretch = 1.0
  123. fontsize = fontsize{9pt}{9pt}
  124. [Minted_Fortran]
  125. breplace = \begin{minted}[fontsize=\%(fontsize)s,linenos=false,mathescape,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]{fortran}
  126. ereplace = \end{minted}
  127. \noindent
  128. bstretch = 1.0
  129. fontsize = fontsize{9pt}{9pt}
  130. [Minted_Matlab]
  131. breplace = \begin{minted}[fontsize=\%(fontsize)s,linenos=false,mathescape,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]{matlab}
  132. ereplace = \end{minted}
  133. \noindent
  134. bstretch = 1.0
  135. fontsize = fontsize{9pt}{9pt}
  136. [Minted_Bash]
  137. breplace = \begin{minted}[fontsize=\%(fontsize)s,linenos=false,mathescape,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]{bash}
  138. ereplace = \end{minted}
  139. \noindent
  140. bstretch = 1.0
  141. fontsize = fontsize{9pt}{9pt}
  142. [Minted_Perl]
  143. breplace = \begin{minted}[fontsize=\%(fontsize)s,linenos=false,mathescape,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]{perl}
  144. ereplace = \end{minted}
  145. \noindent
  146. bstretch = 1.0
  147. fontsize = fontsize{9pt}{9pt}
  148. # warning box, pink background, warning sign
  149. [Warnings]
  150. breplace = \definecolor{warnback}{rgb}{1.0, 0.8235294, 0.8235294}
  151. \setlength{\fboxrule}{2pt}
  152. \begin{center}
  153. \fcolorbox{black}{warnback}{
  154. \begin{minipage}{0.8\textwidth}
  155. \includegraphics[height=0.3in]{warning.eps}
  156. \vskip-0.3in\hskip1.5in{\large\bf WARNING} \\[0.2cm]
  157. ereplace = \end{minipage}}
  158. \end{center}
  159. \setlength{\fboxrule}{0.4pt} %% Back to default
  160. # tip box, light blue background, "i" (info) sign
  161. [Tip]
  162. breplace = \definecolor{tipback}{rgb}{0.87843, 0.95686, 1.0}
  163. \setlength{\fboxrule}{2pt}
  164. \begin{center}
  165. \fcolorbox{black}{tipback}{
  166. \begin{minipage}{0.8\textwidth}
  167. \includegraphics[height=0.3in]{tip.eps}
  168. \vskip-0.3in\hskip1.5in{\large\bf TIP} \\[0.2cm]
  169. ereplace = \end{minipage}}
  170. \end{center}
  171. \setlength{\fboxrule}{0.4pt} %% Back to default
  172. # note box, "i" (info) sign
  173. [Note]
  174. breplace = \definecolor{noteback}{rgb}{0.988235, 0.964706, 0.862745}
  175. \setlength{\fboxrule}{2pt}
  176. \begin{center}
  177. \fcolorbox{black}{noteback}{
  178. \begin{minipage}{0.8\textwidth}
  179. \includegraphics[height=0.3in]{tip.eps}
  180. \vskip-0.3in\hskip1.5in{\large\bf NOTE} \\[0.2cm]
  181. ereplace = \end{minipage}}
  182. \end{center}
  183. \setlength{\fboxrule}{0.4pt} %% Back to default
  184. # colored box, can handle multiple pages
  185. [Blue]
  186. shadecolor = 0.87843, 0.95686, 1.0
  187. envname = Blue
  188. define = True
  189. newenv = \providecommand{\shadedskip}{}
  190. \definecolor{shadecolor}{rgb}{%(shadecolor)s}
  191. \renewenvironment{shadedskip}{
  192. \def\FrameCommand{\colorbox{shadecolor}}\FrameRule0.6pt
  193. \MakeFramed {\FrameRestore}\vskip3mm}{\vskip0mm\endMakeFramed}
  194. \providecommand{\shadedquote%(envname)s}{}
  195. \renewenvironment{shadedquote%(envname)s}[1][]{
  196. \bgroup\rmfamily
  197. \fboxsep=0mm\relax
  198. \begin{shadedskip}
  199. \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
  200. \rightmargin=2\leftmargin\leftmargin=4pt\relax}
  201. \item\relax}
  202. {\endlist\end{shadedskip}\egroup}
  203. breplace = \begin{shadedquote%(envname)s}
  204. # \centering{\large\bf Program} \\[0.2cm]
  205. \fontsize{9pt}{9pt}
  206. \begin{Verbatim}
  207. ereplace = \end{Verbatim}
  208. \end{shadedquote%(envname)s}
  209. \noindent
  210. # colored box, can handle multiple pages
  211. # \fcolorbox{black}{yellow}
  212. [BlueFrame]
  213. shadecolor = 0.87843, 0.95686, 1.0
  214. envname = BlueFrame
  215. define = True
  216. newenv = \providecommand{\shadedskip}{}
  217. \definecolor{shadecolor}{rgb}{%(shadecolor)s}
  218. \renewenvironment{shadedskip}{
  219. \def\FrameCommand{\fcolorbox{black}{shadecolor}}\FrameRule0.6pt
  220. \MakeFramed {\FrameRestore}\vskip3mm}{\vskip0mm\endMakeFramed}
  221. \providecommand{\shadedquote%(envname)s}{}
  222. \renewenvironment{shadedquote%(envname)s}[1][]{
  223. \bgroup\rmfamily
  224. \fboxsep=0mm\relax
  225. \begin{shadedskip}
  226. \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
  227. \rightmargin=2\leftmargin\leftmargin=4pt\relax}
  228. \item\relax}
  229. {\endlist\end{shadedskip}\egroup}
  230. breplace = \begin{shadedquote%(envname)s}
  231. # \centering{\large\bf Program} \\[0.2cm]
  232. \fontsize{9pt}{9pt}
  233. \begin{Verbatim}
  234. ereplace = \end{Verbatim}
  235. \end{shadedquote%(envname)s}
  236. \noindent
  237. # colored box with left vertical bar, can handle multiple pages
  238. [BlueBar]
  239. shadecolor = 0.87843, 0.95686, 1.0
  240. barcolor = 0.7, 0.95686, 1
  241. envname = BlueBar
  242. define = True
  243. newenv = \providecommand{\shadedwbar}{}
  244. \definecolor{shadecolor}{rgb}{%(shadecolor)s}
  245. \renewenvironment{shadedwbar}{
  246. \def\FrameCommand{\color[rgb]{%(barcolor)s}\vrule width 1mm\normalcolor\colorbox{shadecolor}}\FrameRule0.6pt
  247. \MakeFramed {\advance\hsize-2mm\FrameRestore}\vskip3mm}{\vskip0mm\endMakeFramed}
  248. \providecommand{\shadedquote%(envname)s}{}
  249. \renewenvironment{shadedquote%(envname)s}[1][]{
  250. \bgroup\rmfamily
  251. \fboxsep=0mm\relax
  252. \begin{shadedwbar}
  253. \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
  254. \rightmargin=2\leftmargin\leftmargin=4pt\relax}
  255. \item\relax}
  256. {\endlist\end{shadedwbar}\egroup}
  257. breplace = \begin{shadedquote%(envname)s}
  258. # \centering{\large\bf Program} \\[0.2cm]
  259. \fontsize{9pt}{9pt}
  260. \begin{Verbatim}
  261. ereplace = \end{Verbatim}
  262. \end{shadedquote%(envname)s}
  263. \noindent
  264. # colored box, can handle multiple pages
  265. [Red]
  266. shadecolor = 1, 0.97, 0.85
  267. envname = Red
  268. define = True
  269. newenv = \providecommand{\shadedskip}{}
  270. \definecolor{shadecolor}{rgb}{%(shadecolor)s}
  271. \renewenvironment{shadedskip}{
  272. \def\FrameCommand{\colorbox{shadecolor}}\FrameRule0.6pt
  273. \MakeFramed {\FrameRestore}\vskip3mm}{\vskip0mm\endMakeFramed}
  274. \providecommand{\shadedquote%(envname)s}{}
  275. \renewenvironment{shadedquote%(envname)s}[1][]{
  276. \bgroup\rmfamily
  277. \fboxsep=0mm\relax
  278. \begin{shadedskip}
  279. \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
  280. \rightmargin=2\leftmargin\leftmargin=4pt\relax}
  281. \item\relax}
  282. {\endlist\end{shadedskip}\egroup}
  283. breplace = \begin{shadedquote%(envname)s}
  284. # \centering{\large\bf Program} \\[0.2cm]
  285. \fontsize{9pt}{9pt}
  286. \begin{Verbatim}
  287. ereplace = \end{Verbatim}
  288. \end{shadedquote%(envname)s}
  289. \noindent
  290. # colored box, can handle multiple pages
  291. [RedFrame]
  292. shadecolor = 1, 0.97, 0.85
  293. envname = RedFrame
  294. define = True
  295. newenv = \providecommand{\shadedskip}{}
  296. \definecolor{shadecolor}{rgb}{%(shadecolor)s}
  297. \renewenvironment{shadedskip}{
  298. \def\FrameCommand{\fcolorbox{black}{shadecolor}}\FrameRule0.6pt
  299. \MakeFramed {\FrameRestore}\vskip3mm}{\vskip0mm\endMakeFramed}
  300. \providecommand{\shadedquote%(envname)s}{}
  301. \renewenvironment{shadedquote%(envname)s}[1][]{
  302. \bgroup\rmfamily
  303. \fboxsep=0mm\relax
  304. \begin{shadedskip}
  305. \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
  306. \rightmargin=2\leftmargin\leftmargin=4pt\relax}
  307. \item\relax}
  308. {\endlist\end{shadedskip}\egroup}
  309. breplace = \begin{shadedquote%(envname)s}
  310. # \centering{\large\bf Program} \\[0.2cm]
  311. \fontsize{9pt}{9pt}
  312. \begin{Verbatim}
  313. ereplace = \end{Verbatim}
  314. \end{shadedquote%(envname)s}
  315. \noindent
  316. # colored box with left vertical bar, can handle multiple pages
  317. [RedBar]
  318. shadecolor = 1, 0.97, 0.85
  319. barcolor = 1, 0.85, 0.85
  320. envname = RedBar
  321. define = True
  322. newenv = \providecommand{\shadedwbar}{}
  323. \definecolor{shadecolor}{rgb}{%(shadecolor)s}
  324. \renewenvironment{shadedwbar}{
  325. \def\FrameCommand{\color[rgb]{%(barcolor)s}\vrule width 1mm\normalcolor\colorbox{shadecolor}}\FrameRule0.6pt
  326. \MakeFramed {\advance\hsize-2mm\FrameRestore}\vskip3mm}{\vskip0mm\endMakeFramed}
  327. \providecommand{\shadedquote%(envname)s}{}
  328. \renewenvironment{shadedquote%(envname)s}[1][]{
  329. \bgroup\rmfamily
  330. \fboxsep=0mm\relax
  331. \begin{shadedwbar}
  332. \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
  333. \rightmargin=2\leftmargin\leftmargin=4pt\relax}
  334. \item\relax}
  335. {\endlist\end{shadedwbar}\egroup}
  336. breplace = \begin{shadedquote%(envname)s}
  337. # \centering{\large\bf Program} \\[0.2cm]
  338. \fontsize{9pt}{9pt}
  339. \begin{Verbatim}
  340. ereplace = \end{Verbatim}
  341. \end{shadedquote%(envname)s}
  342. \noindent
  343. # colored box, can handle multiple pages
  344. [Yellow]
  345. shadecolor = 1.0, 1.0, 0.7
  346. envname = Yellow
  347. define = True
  348. newenv = \providecommand{\shadedskip}{}
  349. \definecolor{shadecolor}{rgb}{%(shadecolor)s}
  350. \renewenvironment{shadedskip}{
  351. \def\FrameCommand{\colorbox{shadecolor}}\FrameRule0.6pt
  352. \MakeFramed {\FrameRestore}\vskip3mm}{\vskip0mm\endMakeFramed}
  353. \providecommand{\shadedquote%(envname)s}{}
  354. \renewenvironment{shadedquote%(envname)s}[1][]{
  355. \bgroup\rmfamily
  356. \fboxsep=0mm\relax
  357. \begin{shadedskip}
  358. \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
  359. \rightmargin=2\leftmargin\leftmargin=4pt\relax}
  360. \item\relax}
  361. {\endlist\end{shadedskip}\egroup}
  362. breplace = \begin{shadedquote%(envname)s}
  363. # \centering{\large\bf Program} \\[0.2cm]
  364. \fontsize{9pt}{9pt}
  365. \begin{Verbatim}
  366. ereplace = \end{Verbatim}
  367. \end{shadedquote%(envname)s}
  368. \noindent
  369. # colored box, can handle multiple pages
  370. [Gray]
  371. envname = Gray
  372. define = True
  373. newenv = \providecommand{\shadedskip}{}
  374. \definecolor{shadecolor}{gray}{0.93}
  375. \renewenvironment{shadedskip}{
  376. \def\FrameCommand{\colorbox{shadecolor}}\FrameRule0.6pt
  377. \MakeFramed {\FrameRestore}\vskip3mm}{\vskip0mm\endMakeFramed}
  378. \providecommand{\shadedquote%(envname)s}{}
  379. \renewenvironment{shadedquote%(envname)s}[1][]{
  380. \bgroup\rmfamily
  381. \fboxsep=0mm\relax
  382. \begin{shadedskip}
  383. \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
  384. \rightmargin=2\leftmargin\leftmargin=4pt\relax}
  385. \item\relax}
  386. {\endlist\end{shadedskip}\egroup}
  387. breplace = \begin{shadedquote%(envname)s}
  388. # \centering{\large\bf Program} \\[0.2cm]
  389. \fontsize{9pt}{9pt}
  390. \begin{Verbatim}
  391. ereplace = \end{Verbatim}
  392. \end{shadedquote%(envname)s}
  393. \noindent
  394. # light blue shaded box, can handle multiple pages, "snippet" to the right
  395. [Blue_snippet]
  396. define = True
  397. newenv = \providecommand{\shadedquoteBluesnippet}{}
  398. \renewenvironment{shadedquoteBluesnippet}[1][]{
  399. \definecolor{shadecolor}{rgb}{0.87843, 0.95686, 1.0}
  400. \definecolor{shadetitle}{rgb}{0.5, 0.95686, 1}
  401. \bgroup\rmfamily
  402. \fboxsep=0mm\relax
  403. \begin{shaded}
  404. {{\hfill\tiny\textsf{\textcolor{shadetitle}{Snippet\ \ }}}}
  405. \list{}{\parsep=-2mm\parskip=0mm\topsep=0pt\leftmargin=2mm
  406. \rightmargin=2\leftmargin\leftmargin=4pt\relax}
  407. \item\relax}
  408. {\endlist{\textcolor{shadecolor}{\ }}\end{shaded}\egroup}
  409. breplace = \begin{shadedquoteBluesnippet}
  410. # \centering{\large\bf Program} \\[0.2cm]
  411. \fontsize{9pt}{9pt}
  412. \begin{Verbatim}
  413. ereplace = \end{Verbatim}
  414. \end{shadedquoteBluesnippet}
  415. \noindent
  416. # light blue, shaded box, can not handle multiple pages (sp = single page)
  417. [Blue_singlepage]
  418. breplace = \begin{SaveVerbatim}{Snippet}
  419. ereplace = \end{SaveVerbatim}
  420. \setlength{\fboxrule}{0pt}
  421. \begin{center}
  422. \definecolor{shadecolor}{rgb}{0.87843, 0.95686, 1.0}
  423. \fcolorbox{black}{shadecolor}{
  424. \begin{minipage}{0.97\textwidth}
  425. # \centering{\large\bf Program snippet} \\[0.2cm]
  426. \raggedright
  427. \fontsize{9pt}{9pt}\selectfont{\BUseVerbatim{Snippet}}
  428. \end{minipage}}
  429. \end{center}
  430. \setlength{\fboxrule}{0.4pt} %% Back to default
  431. \noindent
  432. # light gray, shaded box, can not handle multiple pages (sp = single page)
  433. [Gray_singlepage]
  434. breplace = \begin{SaveVerbatim}{Programsingle}
  435. ereplace = \end{SaveVerbatim}
  436. \setlength{\fboxrule}{0pt}
  437. \begin{center}
  438. \definecolor{shadecolor}{gray}{0.93}
  439. \fcolorbox{black}{shadecolor}{
  440. \begin{minipage}{0.97\textwidth}
  441. # \centering{\large\bf Program line} \\[0.2cm]
  442. \raggedright
  443. \fontsize{9pt}{9pt}\selectfont{\BUseVerbatim{Programsingle}}
  444. \end{minipage}}
  445. \end{center}
  446. \setlength{\fboxrule}{0.4pt} %% Back to default
  447. \noindent
  448. # Tiago Quintino's code environment
  449. [PythonTiago]
  450. breplace = \lstset{language=Python}
  451. \lstset{frame=single,numbers=left,numberstyle=\tiny,numbersep=6pt,
  452. stepnumber=2}
  453. \lstset{framexleftmargin=0mm,
  454. framexrightmargin=0mm,
  455. frame=shadowbox,
  456. rulesepcolor=\color{dgray}}
  457. {\fontsize{9pt}{9pt}
  458. \begin{lstlisting}
  459. ereplace = \end{lstlisting}}\vspace{3mm}
  460. # Tiago Quintino's code environment
  461. [CppTiago]
  462. breplace = \lstset{language=[ISO]{C++}}
  463. \lstset{frame=single,numbers=left,numberstyle=\tiny,numbersep=6pt,
  464. stepnumber=2}
  465. \lstset{framexleftmargin=0mm,
  466. framexrightmargin=0mm,
  467. frame=shadowbox,
  468. rulesepcolor=\color{dgray}}
  469. {\fontsize{9pt}{9pt}
  470. \begin{lstlisting}
  471. ereplace = \end{lstlisting}}\vspace{3mm}
  472. # old FEniCS style code environment
  473. [oldFEniCS]
  474. define = True
  475. newenv = \providecommand{\fenicscode}{}
  476. \renewenvironment{fenicscode}[1]{
  477. \center\tabular{c}\hline\\ \footnotesize
  478. \minipage{#1\textwidth}\verbatim}
  479. {\endverbatim\endminipage\\ \\ \hline\endtabular\endcenter}
  480. breplace = \begin{fenicscode}{0.9}
  481. ereplace = \end{fenicscode}
  482. # old FEniCS style code environment
  483. [oldFEniCSsmall]
  484. define = True
  485. newenv = \providecommand{\fenicscodesmall}{}
  486. \renewenvironment{fenicscodesmall}[1]{
  487. \center\footnotesize\minipage{#1\textwidth}\verbatim}
  488. {\endverbatim\endminipage\endcenter}
  489. breplace = \begin{fenicscodesmall}{0.9}
  490. ereplace = \end{fenicscodesmall}
  491. # NOTE: The CodeGrayWhite1/2 redefine \FancyVerbFormatLine and this
  492. # will affect all forthcoming styles that use fancyvrb (quite many!).
  493. # Be careful with this environment
  494. # Code with gray background and white split between lines:
  495. [CodeGrayWhite1]
  496. breplace = \definecolor{Light}{gray}{.80}
  497. \renewcommand{\FancyVerbFormatLine}[1]{\colorbox{Light}{\makebox[\linewidth][l]{#1}}}
  498. \begin{Verbatim}[fontsize=\%(fontsize)s,numbers=left,tabsize=8,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]
  499. ereplace = \end{Verbatim}
  500. \noindent
  501. bstretch = 0.85
  502. fontsize = fontsize{9pt}{9pt}
  503. # as CodeGrayWhite1, but no line numbers:
  504. [CodeGrayWhite2]
  505. breplace = \definecolor{Light}{gray}{.80}
  506. \renewcommand{\FancyVerbFormatLine}[1]{\colorbox{Light}{\makebox[\linewidth][l]{#1}}}
  507. \begin{Verbatim}[fontsize=\%(fontsize)s,tabsize=8,baselinestretch=%(bstretch)s,fontfamily=tt,xleftmargin=7mm]
  508. ereplace = \end{Verbatim}
  509. \noindent
  510. bstretch = 0.85
  511. fontsize = fontsize{9pt}{9pt}
  512. [inline_code]
  513. font = 10
  514. [preprocess]
  515. #defines = T2
  516. #undefines = T2
  517. #includes = /home/some/body/myfile
  518. [names]
  519. # the names below are just examples - new names can be
  520. # defined instead or in addition to those listed here
  521. # computer code in quote environment (gives a left margin):
  522. ccq = CodeIndented
  523. # computer code with no left margin:
  524. cc = Code
  525. # computer code with line numbering:
  526. ccl = CodeLineNo
  527. # program box:
  528. pro = BlueBar
  529. pypro = BlueBar
  530. cypro = BlueBar
  531. cpppro = BlueBar
  532. cpro = BlueBar
  533. fpro = BlueBar
  534. plpro = BlueBar
  535. shpro = BlueBar
  536. mpro = BlueBar
  537. # computer code box (snippet, not complete program):
  538. cod = Blue
  539. pycod = Blue
  540. cycod = Blue
  541. cppcod = Blue
  542. ccod = Blue
  543. fcod = Blue
  544. plcod = Blue
  545. shcod = Blue
  546. mcod = Blue
  547. # computer code box (snippet, not complete program):
  548. #ccod = Cpp_ANS
  549. #cppcod = Cpp_ANS
  550. #pycod = Python_ANS
  551. #cycod = Cython_ANS
  552. #cans = Cpp_ANS
  553. cppans = Cpp_ANS
  554. pyans = Python_ANS
  555. bashans= Bash_ANS
  556. swigans= Swig_ANS
  557. uflans = UFL_ANS
  558. # computer code box (snippet, not complete program):
  559. #sni = Blue_snippet
  560. sni = Blue
  561. # data file:
  562. dat = CodeIndented
  563. # data file snippet:
  564. dsni = CodeIndented
  565. # system commands (in terminal window):
  566. sys = CodeTerminal
  567. # one-line system command (in terminal window):
  568. slin = Code
  569. # IPython interactive session:
  570. ipy = Code
  571. # standard interactive python session:
  572. py = Code
  573. # execution of a Python program ("run python"):
  574. rpy = CodeTerminal
  575. # one-line program code:
  576. plin = Code
  577. # verbatim environment:
  578. ver = Verb
  579. # warning box:
  580. warn = Warnings
  581. # tip box:
  582. rule = Tip
  583. # note box:
  584. summ = Note