我尝试将两个minted
环境并排放置。我决定使用minipage
这个方法。每个minted
环境都有灰色背景。不幸的是,这两个代码片段的高度不一样,所以两个框之间有一个可见的台阶。
我怎样才能强制两个小页面具有相同的高度?
\documentclass[twoside=true, % doppelseitiger Druck
DIV=15,% DIV Faktor für Satzspiegelberechnung, sie Doku zu KOMA Script
BCOR=15mm, % Bindekorrektur
chapterprefix=false,
headinclude=true,
footinclude=false,
pagesize,% write pagesize to DVI or PDF
fontsize=11pt,% use this font size
paper=a4,% use ISO A4
bibliography=totoc,% write bibliography-chapter to table of contents
index=totoc,% write index-chapter to table of contents
cleardoublepage=plain,% \cleardoublepage generates pages with pagestyle empty
headings=big,% A4/B5
listof=flat,% improved list of tables
numbers=noenddot
]{scrbook}
\usepackage{xcolor} % z.B. für schattierte Boxen
\usepackage[facing=yes]{floatrow} % mehrere Gleitobjekte nebeneinander/caption neben Bild/Tabelle
\usepackage[chapter,newfloat]{minted}
\definecolor{bg}{rgb}{0.95,0.95,0.95}
\setminted{breaklines=true,
bgcolor=bg,
curlyquotes=false}
\usemintedstyle{vs}
\begin{document}
\begin{listing}[tb]
\begin{minipage}[t]{0.5\textwidth}
\begin{minted}{yaml}
Test
New Line
\end{minted}
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
\begin{minted}{yaml}
Test
\end{minted}
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
\caption{\texttt{DeploymentConfig} des Spark-Master}
\label{lst:deploymentconfigsparkmaster}
\end{minipage}
\begin{minipage}[t]{0.5\textwidth}
\caption{\texttt{DeploymentConfig} der Spark-Worker}
\label{lst:deploymentconfigsparkworker}
\end{minipage}
\end{listing}
\end{document}