restyle RST option lists (#17637)
* WIP: restyle RST option lists * apply similar style to Latex * fix tests * minor visual tweaks * update tests * remove leftover comments
This commit is contained in:
parent
08262206d3
commit
2150cd1826
7 changed files with 103 additions and 21 deletions
|
|
@ -50,7 +50,7 @@ doc.file = """
|
|||
\usepackage{fancyvrb, courier}
|
||||
\usepackage{tabularx}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{enumitem} % for enumList and rstfootnote
|
||||
\usepackage{enumitem} % for option list, enumList, and rstfootnote
|
||||
|
||||
\usepackage{xcolor}
|
||||
\usepackage[tikz]{mdframed}
|
||||
|
|
@ -77,6 +77,15 @@ bottomline=false}
|
|||
|
||||
\newenvironment{rstpre}{\VerbatimEnvironment\begingroup\begin{Verbatim}[fontsize=\footnotesize , commandchars=\\\{\}]}{\end{Verbatim}\endgroup}
|
||||
\newenvironment{rstfootnote}{\begin{description}[labelindent=1em,leftmargin=1em,labelwidth=2.6em]}{\end{description}}
|
||||
\ifdim\linewidth<30em
|
||||
\def\rstoptleftmargin{0.4\linewidth}
|
||||
\def\rstoptlabelwidth{0.35\linewidth}
|
||||
\else
|
||||
\def\rstoptleftmargin{12em}
|
||||
\def\rstoptlabelwidth{10.5em}
|
||||
\fi
|
||||
\newenvironment{rstoptlist}{%
|
||||
\begin{description}[font=\sffamily\bfseries,style=nextline,leftmargin=\rstoptleftmargin,labelwidth=\rstoptlabelwidth]}{\end{description}}
|
||||
|
||||
% to pack tabularx into a new environment, special syntax is needed :-(
|
||||
\newenvironment{rsttab}[1]{\tabularx{\linewidth}{#1}}{\endtabularx}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue