如何使用 tcolorbox 减少边框选项中虚线的间隙,请查看我的 MWE 文件:
\documentclass{book}
\RequirePackage[breakable,hooks]{tcolorbox}
\tcbuselibrary{breakable,skins}
\makeatletter
\newtcolorbox{Boxone}[1][]{%
enhanced,
breakable,
sharp corners,arc=0pt,outer arc=0pt,
boxrule=2pt,boxsep=0pt,top=9pt,left=9pt,right=9pt,bottom=6.5pt,middle=0pt,
colback=gray,
colframe=gray,
boxed title style={arc=0pt,outer arc=0pt,boxrule=0.5pt,boxsep=0pt,top=0pt,left=0pt,right=6pt,bottom=0pt,colframe=red,colback=gray},
title={\textcolor{green}{#1}},
toptitle=7.5pt,bottomtitle=3.5pt,
fonttitle=\sffamily,
pad at break=12pt,bottomrule at break=0pt,toprule at break=0pt,
borderline east={0.3pt}{-0.25pt}{blue,dashed},
borderline west={0.3pt}{-0.25pt}{blue,dashed},
borderline south={0.3pt}{-0.25pt}{blue,dashed},
borderline north={0.3pt}{-0.25pt}{blue,dashed},
%borderline={0.3pt}{-0.25pt}{boxonerulecolor,dashed},
}%
\makeatother
\begin{document}
\begin{Boxone}[VOICES FROM THE SECTOR]
\textit{“For our business, seasonality in terms of harvest cycles and consumer demand is a major factor.
Our customers have to pay for our services early in the season, but mostly generate profit only at
the end of the season.” – CEO of a company offering digital technologies for integration along
the value chain}
\textit{“Farmers are quite conservative. In our experience, they do not invest much per year and are quite
risk-averse. Hence, it is key to convince the farmer of the added value. Furthermore, data handling
is crucial.” – CEO of an innovative agri-tech company}
\textit{“Digitalisation can increase consumer trust by ensuring transparency along the whole agri-food
value chain.” – Founder of a company developing innovative technologies for food processing}
\textit{“For our business, seasonality in terms of harvest cycles and consumer demand is a major factor.
Our customers have to pay for our services early in the season, but mostly generate profit only at
the end of the season.” – CEO of a company offering digital technologies for integration along
the value chain}
\textit{“Farmers are quite conservative. In our experience, they do not invest much per year and are quite
risk-averse. Hence, it is key to convince the farmer of the added value. Furthermore, data handling
is crucial.” – CEO of an innovative agri-tech company}
\textit{“Digitalisation can increase consumer trust by ensuring transparency along the whole agri-food
value chain.” – Founder of a company developing innovative technologies for food processing}
\textit{“For our business, seasonality in terms of harvest cycles and consumer demand is a major factor.
Our customers have to pay for our services early in the season, but mostly generate profit only at
the end of the season.” – CEO of a company offering digital technologies for integration along
the value chain}
\textit{“Farmers are quite conservative. In our experience, they do not invest much per year and are quite
risk-averse. Hence, it is key to convince the farmer of the added value. Furthermore, data handling
is crucial.” – CEO of an innovative agri-tech company}
\textit{“Digitalisation can increase consumer trust by ensuring transparency along the whole agri-food
value chain.” – Founder of a company developing innovative technologies for food processing}
\textit{“For our business, seasonality in terms of harvest cycles and consumer demand is a major factor.
Our customers have to pay for our services early in the season, but mostly generate profit only at
the end of the season.” – CEO of a company offering digital technologies for integration along
the value chain}
\textit{“Farmers are quite conservative. In our experience, they do not invest much per year and are quite
risk-averse. Hence, it is key to convince the farmer of the added value. Furthermore, data handling
is crucial.” – CEO of an innovative agri-tech company}
\textit{“Digitalisation can increase consumer trust by ensuring transparency along the whole agri-food
value chain.” – Founder of a company developing innovative technologies for food processing}
\textit{“For our business, seasonality in terms of harvest cycles and consumer demand is a major factor.
Our customers have to pay for our services early in the season, but mostly generate profit only at
the end of the season.” – CEO of a company offering digital technologies for integration along
the value chain}
\textit{“Farmers are quite conservative. In our experience, they do not invest much per year and are quite
risk-averse. Hence, it is key to convince the farmer of the added value. Furthermore, data handling
is crucial.” – CEO of an innovative agri-tech company}
\textit{“Digitalisation can increase consumer trust by ensuring transparency along the whole agri-food
value chain.” – Founder of a company developing innovative technologies for food processing}
\textit{“For our business, seasonality in terms of harvest cycles and consumer demand is a major factor.
Our customers have to pay for our services early in the season, but mostly generate profit only at
the end of the season.” – CEO of a company offering digital technologies for integration along
the value chain}
\textit{“Farmers are quite conservative. In our experience, they do not invest much per year and are quite
risk-averse. Hence, it is key to convince the farmer of the added value. Furthermore, data handling
is crucial.” – CEO of an innovative agri-tech company}
\textit{“Digitalisation can increase consumer trust by ensuring transparency along the whole agri-food
value chain.” – Founder of a company developing innovative technologies for food processing}
\end{Boxone}
\end{document}
答案1
有多种虚线图案可供选择。要使虚线更密集,您可以使用densely dashed
,请参阅TikZ/PGF 手册部分图形参数:虚线图案(CTAN 当前版本 3.1.2 中的第 15.3.2 节,第 170 页)。
梅威瑟:
\documentclass{book}
\RequirePackage[breakable,hooks]{tcolorbox}
\tcbuselibrary{breakable,skins}
\makeatletter
\newtcolorbox{Boxone}[1][]{%
enhanced,
breakable,
sharp corners,arc=0pt,outer arc=0pt,
boxrule=2pt,boxsep=0pt,top=9pt,left=9pt,right=9pt,bottom=6.5pt,middle=0pt,
colback=gray,
colframe=gray,
boxed title style={arc=0pt,outer arc=0pt,boxrule=0.5pt,boxsep=0pt,top=0pt,left=0pt,right=6pt,bottom=0pt,colframe=red,colback=gray},
title={\textcolor{green}{#1}},
toptitle=7.5pt,bottomtitle=3.5pt,
fonttitle=\sffamily,
pad at break=12pt,bottomrule at break=0pt,toprule at break=0pt,
borderline east={0.3pt}{-0.25pt}{blue,dashed},
borderline west={0.3pt}{-0.25pt}{blue,densely dashed},
borderline south={0.3pt}{-0.25pt}{blue,loosely dashed},
borderline north={0.3pt}{-0.25pt}{blue,dotted},
%borderline={0.3pt}{-0.25pt}{boxonerulecolor,dashed},
}%
\makeatother
\begin{document}
\begin{Boxone}[VOICES FROM THE SECTOR]
\textit{“For our business, seasonality in terms of harvest cycles and consumer demand is a major factor.
Our customers have to pay for our services early in the season, but mostly generate profit only at
the end of the season.” – CEO of a company offering digital technologies for integration along
the value chain}
\textit{“Farmers are quite conservative. In our experience, they do not invest much per year and are quite
risk-averse. Hence, it is key to convince the farmer of the added value. Furthermore, data handling
is crucial.” – CEO of an innovative agri-tech company}
\end{Boxone}
\end{document}
结果:
如果预定义样式均不合适,您还可以定义自定义虚线图案,这在手册部分的开头有所描述。