我有一个精心设计的代码清单,显示在多列环境中,各列之间有分隔边框:
边框离某些内容太近,例如stracka(1,sg,ka).
和stracka(3,sg,ka).
。有什么好方法可以修复它?
测试.tex:
RequirePackage[l2tabu, orthodox]{nag}
\documentclass[a4paper,12pt,oneside]{scrartcl}
\usepackage{multicol}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[swedish]{babel}
\usepackage{lmodern}
\usepackage[a4paper]{geometry}
\usepackage{microtype}
\usepackage{color}
\usepackage[all]{xy}
\usepackage{minted}
\usepackage{caption}
\setkomafont{disposition}{\normalfont\bfseries}
\renewcommand\listingscaption{Kodlistning}
\begin{document}
\setlength{\columnseprule}{0.5pt}
\begin{multicols}{4}
\inputminted[]{prolog}{someprolog.pl}
\end{multicols}
\label{Blah}
\captionof{listing}{Beskrivande text}
\end{document}
someprolog.pl:
stracka(1,c,sg).
stracka(1,sg,ka).
stracka(1,ka,o).
stracka(1,o,t).
stracka(2,c,sg).
stracka(2,sg,sm).
stracka(2,sm,r).
stracka(2,r,h).
stracka(3,c,sg).
stracka(3,sg,ka).
stracka(3,ka,o).
stracka(3,o,kr).
stracka(4,c,sg).
stracka(4,sg,ka).
stracka(4,ka,o).
stracka(4,o,j).
stracka(5,c,sg).
stracka(5,sg,sm).
stracka(5,sm,r).
stracka(5,r,n).
stracka(6,c,sg).
stracka(6,sg,sm).
stracka(6,sm,r).
stracka(6,r,h).
stracka(7,c,st).
答案1
我无法运行它,但仅将其作为文本包含在内就会显示相同的内容:
您会在日志中收到有关此问题的警告(而不是在终端输出中)
Overfull \hbox (15.33626pt too wide) in paragraph at lines 2--2
[]\T1/lmtt/m/n/12 stracka(1,sg,ka).
您需要减少列数或缩小字体,或者允许换行。增加列间距而不\setlength\columnsep{...}
减少列数只会让情况变得更糟,因为这会使列变窄。
\RequirePackage[l2tabu, orthodox]{nag}
\documentclass[a4paper,12pt,oneside]{scrartcl}
\usepackage{multicol}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[a4paper]{geometry}
\usepackage{microtype}
\usepackage{color}
%\usepackage[all]{xy}
%\usepackage{minted}
\usepackage{caption}
\setkomafont{disposition}{\normalfont\bfseries}
%\renewcommand\listingscaption{Kodlistning}
\begin{document}
\setlength{\columnseprule}{0.5pt}
\begin{multicols}{4}
\ttfamily\obeylines\footnot
\input{someprolog.pl}
\end{multicols}
\label{Blah}
\captionof{figure}{Beskrivande text}
\end{document}