我正在尝试使用 tcolor box 在 LaTex 中制作分类广告纸。我是新手,所以请耐心等待。这是我尝试模拟的屏幕截图。
以下是我目前能够创建的内容:
我需要能够在每个广告之间设置一条线,间距最小,两侧都有不可见的边框。请建议我如何修改代码,或者是否有更好的代码我应该使用。谢谢。
这是我的 LaTeX .tex 代码:
\documentclass[11pt]{article}
\usepackage[many]{tcolorbox}
\usepackage{lipsum}
\usepackage{graphicx}
\graphicspath{ {../images/} }
\begin{document}
\section{Example}
An early version of an example document that eventually will render classified ads using \LaTeX , tcolorbox and multirow. Possibly ltablex too.
The page below is an example image of the look we are aiming for. The third page is going to attempt to render using LaTeX and specific extensions.
\includegraphics{exampleclassified.ps}
\section{First try example}
\begin{tcbraster}[raster equal height=rows,raster every box/.style={colframe=black!50!black,colback=white}]\begin{tcolorbox}[blankest]\begin{tcbraster}[raster columns=1]\begin{tcolorbox}[natural height,
space to upper,
skin=bicolor,
colbacklower=black!95,
collower=white,
title={X-should be blank and the same dimensions as the orginal },
halign=center,
valign=center,
nobeforeafter,
halign lower=flush right,
bottom=0mm,
height=3cm
]
\$ CASH \$ For Broken Autos.
Paying \$50 to \$500. I Tow!
Call Doug Anytime 7-Days,
(269)501-5763.\end{tcolorbox}
\begin{tcolorbox}
\$ \$ \$ WE BUY USED \& Unwanted Autos.
Any condition, Top \$ \$ \$
paid. Will pick up Free.
Airway Auto Parts
(269)962-9521
\end{tcolorbox}
\begin{tcolorbox}
\$500! POLICE IMPOUNDS!
Hondas/Chevys/Jeeps!
Cars from \$500! For listings:
800-619-3790 ext.2938
\end{tcolorbox}
\end{tcbraster}\end{tcolorbox}\end{tcbraster}
\end{document}
答案1
由于最初的提案是用 完成的tcolorbox
,因此这里有两种可能的解决方案tcolorbox
。正如 OP 已经提出的,这些解决方案基于tcbraster
。第一个在多列环境中使用单列 tcbraster,第二个使用三列 tcbraster。
内部框以样式定义classified
,它们是blank
添加了上下边距和底部边框的框。
就这样!
\documentclass[11pt]{article}
\usepackage[many]{tcolorbox}
\usepackage{multicol}
\tcbset{classified/.style={enhanced, blanker, borderline south={2pt}{0pt}{black}, top=1mm, bottom=1mm}}
\begin{document}
\begin{multicols}{3}
\begin{tcbitemize}[raster columns=1, raster row skip = 0pt, classified]
\tcbitem \$ CASH \$ For Broken Autos. Paying \$50 to \$500. I Tow! Call Doug Anytime 7-Days, (269)501-5763.
\tcbitem \$ \$ \$ WE BUY USED \& Unwanted Autos. Any condition, Top \$ \$ \$ paid. Will pick up Free. Airway Auto Parts (269)962-9521
\tcbitem \$500! POLICE IMPOUNDS! Hondas/Chevys/Jeeps! Cars from \$500! For listings: 800-619-3790 ext.2938
\tcbitem \$ CASH \$ For Broken Autos. Paying \$50 to \$500. I Tow! Call Doug Anytime 7-Days, (269)501-5763.
\tcbitem \$ \$ \$ WE BUY USED \& Unwanted Autos. Any condition, Top \$ \$ \$ paid. Will pick up Free. Airway Auto Parts (269)962-9521
\tcbitem \$500! POLICE IMPOUNDS! Hondas/Chevys/Jeeps! Cars from \$500! For listings: 800-619-3790 ext.2938
\tcbitem \$ CASH \$ For Broken Autos. Paying \$50 to \$500. I Tow! Call Doug Anytime 7-Days, (269)501-5763.
\tcbitem \$ \$ \$ WE BUY USED \& Unwanted Autos. Any condition, Top \$ \$ \$ paid. Will pick up Free. Airway Auto Parts (269)962-9521
\tcbitem \$500! POLICE IMPOUNDS! Hondas/Chevys/Jeeps! Cars from \$500! For listings: 800-619-3790 ext.2938
\tcbitem \$ CASH \$ For Broken Autos. Paying \$50 to \$500. I Tow! Call Doug Anytime 7-Days, (269)501-5763.
\tcbitem \$ \$ \$ WE BUY USED \& Unwanted Autos. Any condition, Top \$ \$ \$ paid. Will pick up Free. Airway Auto Parts (269)962-9521
\tcbitem \$500! POLICE IMPOUNDS! Hondas/Chevys/Jeeps! Cars from \$500! For listings: 800-619-3790 ext.2938
\tcbitem \$ CASH \$ For Broken Autos. Paying \$50 to \$500. I Tow! Call Doug Anytime 7-Days, (269)501-5763.
\tcbitem \$ \$ \$ WE BUY USED \& Unwanted Autos. Any condition, Top \$ \$ \$ paid. Will pick up Free. Airway Auto Parts (269)962-9521
\tcbitem \$500! POLICE IMPOUNDS! Hondas/Chevys/Jeeps! Cars from \$500! For listings: 800-619-3790 ext.2938
\tcbitem \$ CASH \$ For Broken Autos. Paying \$50 to \$500. I Tow! Call Doug Anytime 7-Days, (269)501-5763.
\tcbitem \$ \$ \$ WE BUY USED \& Unwanted Autos. Any condition, Top \$ \$ \$ paid. Will pick up Free. Airway Auto Parts (269)962-9521
\end{tcbitemize}
\end{multicols}
\begin{tcbitemize}[raster columns=3, raster row skip = 0pt, raster equal height=rows, classified]
\tcbitem \$ CASH \$ For Broken Autos. Paying \$50 to \$500. I Tow! Call Doug Anytime 7-Days, (269)501-5763.
\tcbitem \$ \$ \$ WE BUY USED \& Unwanted Autos. Any condition, Top \$ \$ \$ paid. Will pick up Free. Airway Auto Parts (269)962-9521
\tcbitem \$500! POLICE IMPOUNDS! Hondas/Chevys/Jeeps! Cars from \$500! For listings: 800-619-3790 ext.2938
\tcbitem \$ CASH \$ For Broken Autos. Paying \$50 to \$500. I Tow! Call Doug Anytime 7-Days, (269)501-5763.
\tcbitem \$ \$ \$ WE BUY USED \& Unwanted Autos. Any condition, Top \$ \$ \$ paid. Will pick up Free. Airway Auto Parts (269)962-9521
\tcbitem \$500! POLICE IMPOUNDS! Hondas/Chevys/Jeeps! Cars from \$500! For listings: 800-619-3790 ext.2938
\tcbitem \$ CASH \$ For Broken Autos. Paying \$50 to \$500. I Tow! Call Doug Anytime 7-Days, (269)501-5763.
\tcbitem \$ \$ \$ WE BUY USED \& Unwanted Autos. Any condition, Top \$ \$ \$ paid. Will pick up Free. Airway Auto Parts (269)962-9521
\tcbitem \$500! POLICE IMPOUNDS! Hondas/Chevys/Jeeps! Cars from \$500! For listings: 800-619-3790 ext.2938
\tcbitem \$ CASH \$ For Broken Autos. Paying \$50 to \$500. I Tow! Call Doug Anytime 7-Days, (269)501-5763.
\tcbitem \$ \$ \$ WE BUY USED \& Unwanted Autos. Any condition, Top \$ \$ \$ paid. Will pick up Free. Airway Auto Parts (269)962-9521
\tcbitem \$500! POLICE IMPOUNDS! Hondas/Chevys/Jeeps! Cars from \$500! For listings: 800-619-3790 ext.2938
\tcbitem \$ CASH \$ For Broken Autos. Paying \$50 to \$500. I Tow! Call Doug Anytime 7-Days, (269)501-5763.
\tcbitem \$ \$ \$ WE BUY USED \& Unwanted Autos. Any condition, Top \$ \$ \$ paid. Will pick up Free. Airway Auto Parts (269)962-9521
\tcbitem \$500! POLICE IMPOUNDS! Hondas/Chevys/Jeeps! Cars from \$500! For listings: 800-619-3790 ext.2938
\tcbitem \$ CASH \$ For Broken Autos. Paying \$50 to \$500. I Tow! Call Doug Anytime 7-Days, (269)501-5763.
\tcbitem \$ \$ \$ WE BUY USED \& Unwanted Autos. Any condition, Top \$ \$ \$ paid. Will pick up Free. Airway Auto Parts (269)962-9521
\end{tcbitemize}
\end{document}
答案2
我不确定您希望整个页面看起来是什么样子,但您可以考虑使用迷你页面,只用一条线将广告分开。类似这样。我在其他迷你页面中添加了随机文本,但您可以继续在每个迷你页面之间添加更多行。同样,我不确定这是否是您想要的,但它可能是开始并进行更多研究的地方:
\documentclass[11pt]{article}
\usepackage[many]{tcolorbox}
\usepackage{lipsum}
\usepackage{graphicx}
\graphicspath{ {../images/} }
\begin{document}
\begin{minipage}[t]{0.3\textwidth}
\$ CASH \$ For Broken Autos.
Paying \$50 to \$500. I Tow!
Call Doug Anytime 7-Days,
(269)501-5763.
\noindent\rule{3.8cm}{0.8pt}
\$ CASH \$ For Broken Autos.
Paying \$50 to \$500. I Tow!
Call Doug Anytime 7-Days,
(269)501-5763.
\noindent\rule{3.8cm}{0.8pt}
\$ CASH \$ For Broken Autos.
Paying \$50 to \$500. I Tow!
Call Doug Anytime 7-Days,
(269)501-5763.
\noindent\rule{3.8cm}{0.8pt}
This is a test. This is a test. This is a test. This is a test. This is a test. This is a test This is a test. This is a test. This is a test This is a test. This is a test. This is a test This is a test. This is a test. This is a test
\end{minipage}
\hspace{0.5cm}
%%%%%
%%%%%
%%%%%
%%%%%
%%%%%
\begin{minipage}[t]{0.3\textwidth}
This is a test. This is a test. This is a test. This is a test. This is a test. This is a test This is a test. This is a test. This is a test This is a test. This is a test. This is a test This is a test. This is a test. This is a test
\end{minipage}
\hspace{0.5cm}
%%%%%
%%%%%
%%%%%
%%%%%
%%%%%
\begin{minipage}[t]{0.3\textwidth}
This is a test. This is a test. This is a test. This is a test. This is a test. This is a test This is a test. This is a test. This is a test This is a test. This is a test. This is a test This is a test. This is a test. This is a test
\end{minipage}
\end{document}