我正在用乳胶写一本书,并遇到与小节内容破坏相关的问题。
我知道,我必须展示一些最小的例子,但这样做非常复杂(但我稍后会尝试)。完整项目在这里
感谢您的任何帮助
我的MWE
\documentclass{article}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage[left=1.5cm,right=1.0cm,top=1.5cm,bottom=1.5cm,bindingoffset=0cm]{geometry}
\definecolor{white}{RGB}{255,255,255}
\definecolor{gray}{HTML}{4D4D4D}
\definecolor{maingray}{HTML}{B9B9B9}
\newcommand\skills[1]{
\begin{tikzpicture}
\foreach [count=\i] \x/\y in {#1}{
\draw[fill=maingray,maingray] (0,\i) rectangle (6,\i+0.4);
\draw[fill=white,gray](0,\i) rectangle (\y,\i+0.4);
\node[above right] at (0,\i+0.4) {\x};
}
\end{tikzpicture}
}
\begin{document}
\lipsum[1-6]
\subsection{Levels of skills }
\begin{table}[h!]
\begin{tabular}{c | c}
\begin{minipage}[m]{0.4\textwidth}
\skills{{Word/1}}\\
\skills{{\LaTeX/6}}\\
\skills{{C++/2}}\\
\skills{{Python/3}}\\
\end{minipage}
&
\begin{minipage}[m]{0.55\textwidth}
\begin{verbatim}
\documentclass{report}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usepackage{xcolor}
\definecolor{white}{RGB}{255,255,255}
\definecolor{gray}{HTML}{4D4D4D}
\definecolor{maingray}{HTML}{B9B9B9}
\newcommand\skills[1]{
\begin{tikzpicture}
\foreach [count=\i] \x/\y in {#1}{
\draw[fill=maingray,maingray] (0,\i) rectangle (6,\i+0.4);
\draw[fill=white,gray](0,\i) rectangle (\y,\i+0.4);
\node[above right] at (0,\i+0.4) {\x};
}
\end{tikzpicture}
}
\begin{document}
\skills{{b/2}}
\skills{{a/1}}
\end{document}
\end{verbatim}
\end{minipage}
\end{tabular}
\end{table}
\end{document}
如何摆脱破坏性的小节标题及其内容?