\documentclass[10pt,a4paper,english]{scrartcl} \usepackage{babel} \usepackage[T1]{fontenc} \usepackage{shortvrb} \usepackage{ucs} \usepackage[utf8x]{inputenc} \usepackage{tabularx} \usepackage{longtable} \usepackage{booktabs} \setlength{\extrarowheight}{2pt} \usepackage{amsmath} \usepackage{graphicx} \usepackage{color} \usepackage{multirow} \usepackage{ifthen} \typearea{12} % generated by Docutils \newlength{\admonitionwidth} \setlength{\admonitionwidth}{0.9\textwidth} \newlength{\docinfowidth} \setlength{\docinfowidth}{0.9\textwidth} \newlength{\locallinewidth} \newcommand{\optionlistlabel}[1]{\bf #1 \hfill} \newenvironment{optionlist}[1] {\begin{list}{} {\setlength{\labelwidth}{#1} \setlength{\rightmargin}{1cm} \setlength{\leftmargin}{\rightmargin} \addtolength{\leftmargin}{\labelwidth} \addtolength{\leftmargin}{\labelsep} \renewcommand{\makelabel}{\optionlistlabel}} }{\end{list}} \newlength{\lineblockindentation} \setlength{\lineblockindentation}{2.5em} \newenvironment{lineblock}[1] {\begin{list}{} {\setlength{\partopsep}{\parskip} \addtolength{\partopsep}{\baselineskip} \topsep0pt\itemsep0.15\baselineskip\parsep0pt \leftmargin#1} \raggedright} {\end{list}} % begin: floats for footnotes tweaking. \setlength{\floatsep}{0.5em} \setlength{\textfloatsep}{\fill} \addtolength{\textfloatsep}{3em} \renewcommand{\textfraction}{0.5} \renewcommand{\topfraction}{0.5} \renewcommand{\bottomfraction}{0.5} \setcounter{totalnumber}{50} \setcounter{topnumber}{50} \setcounter{bottomnumber}{50} % end floats for footnotes % some commands, that could be overwritten in the style file. \newcommand{\rubric}[1]{\subsection*{~\hfill {\it #1} \hfill ~}} \newcommand{\titlereference}[1]{\textsl{#1}} % end of "some commands" % user specified packages and stylesheets: \usepackage{../data/pygments-docutilsroles} \ifthenelse{\isundefined{\hypersetup}}{ \usepackage[colorlinks=true,linkcolor=blue,urlcolor=blue]{hyperref} }{} % Custom roles: % \DUrole{NAME}{content} calls \docutilsroleNAME if it exists \providecommand{\DUrole}[2]{% \ifcsname docutilsrole#1\endcsname% \csname docutilsrole#1\endcsname{#2}% \else% #2% \fi% } \title{} \author{} \date{} \raggedbottom \begin{document} \setlength{\locallinewidth}{\linewidth} This is a test of the new code-block directive: % Translate this document to HTML with a pygments enhanced frontend, e.g. % % rst2html-highlight --stylesheet=../data/pygments-default.css --link-stylesheet % % rst2latex-highlight --stylesheet=../data/pygments-docutileroles.sty \begin{quote}{\ttfamily \raggedright \noindent \DUrole{k}{def}~\DUrole{nf}{my{\_}function}\DUrole{p}{():}~\\ ~~~~\DUrole{s}{"just~a~test"}~\\ ~~~~\DUrole{k}{print}~\DUrole{mf}{8}\DUrole{o}{/}\DUrole{mf}{2}~\\ }\end{quote} \end{document}