Avery 5160 邮寄标签

Avery 5160 邮寄标签

我最近使用下面的方法将我的圣诞节邮件标签从 MS Word 转换为 LaTeX,想知道是否有人知道更好的解决方案。我承认是一个更通用的解决方案,但我还有一盒几乎满满的 Avery 5160 标签。

\documentclass[letterpaper]{article}% Avery 5160
\usepackage[top=0.5in, bottom=0.5in, left=0.125in, right=0.125in, noheadfoot]{geometry}
\usepackage{varwidth}

\newenvironment{cell}{\minipage[c][1in][c]{2.75in}\centering% Avery 5160 described as 1in by 2.625in
  \varwidth{2.625in}\raggedright}% but measures 2.75in wide
{\endvarwidth\endminipage\allowbreak\ignorespaces}
  
\parindent=0pt
\pagestyle{empty}

\begin{document}
\large% set font etc.
\begin{cell}
Name\\
Address\\
City, State Zip\\
extra line if needed
\end{cell}
\begin{cell}
Name\\
Address\\
Very wide city name, State Zip
\end{cell}
\begin{cell}
Name\\
Address\\
City, State Zip
\end{cell}
\begin{cell}
Name\\
Address\\
City, State Zip
\end{cell}
\end{document}

答案1

以下是我设置和执行的方法,需要适应多标签宽度页面,因为我的标签是 Avery 4013,“3.5” x 15/16“ 一个”。它基本上是单列上的 12 个标签条。我\setlabel调整内容的垂直范围以适合标签空间。如果您认为它太大,请添加一个空白行。在序言中,我强调了一些可以调整的参数,如果我更改标签格式。

可以通过指定更宽的纸张、删除同一行条目之间的空行以及从定义中\setlabel删除来将格式调整为多标签宽度格式。请参阅下面的第一个解决方案。\par\setlabel

\documentclass[12pt]{article}
\usepackage[paperwidth=4.3275in,paperheight=12in,left=0.4in,right=0.4in,
  top=.63in,bottom=.12in]{geometry}% top= tuned to your printer
\usepackage{scalerel}
\usepackage[usestackEOL]{stackengine}
\parindent 0in
\parskip .24in% Related to label width
\usepackage{Palatino}% Pick a font with good stroke width
\newlength\htone
\newlength\httwo
\htone=.73in% related to label height
\httwo=.73in% related to label height

\renewcommand\stackalignment{l}
\strutlongstacks{T}

\def\setlabel#1{\hfil%
  \rule[-\dp\strutbox]{0in}{\htone}\scaleto{\Longstack{#1}}{\httwo}%
  \par%
}
\frenchspacing
\begin{document}

\setlabel{
Pastor Theophilus Jones\\
St. Luke Lutheran Church}% Wife Betsy

\setlabel{
Dr. \& Mrs. Greg Lastname \& Family\\
908 Streetname Dr.\\
Lancaster, PA 17601}% Liz + Kenny and Susie

\setlabel{
Herr Doktor Johann Schmidt\\
Birkenstrasse 27\\
86240 Biburg\\
GERMANY}% Mom's Uncle
\end{document}

在此处输入图片描述


多宽度

\documentclass[12pt]{article}
\usepackage[paperwidth=10in,paperheight=12in,left=0.4in,right=0.4in,
  top=.63in,bottom=.12in]{geometry}% top= tuned to your printer
\usepackage{scalerel}
\usepackage[usestackEOL]{stackengine}
\parindent 0in
\parskip .24in% Related to label width
\usepackage{Palatino}% Pick a font with good stroke width
\newlength\htone
\newlength\httwo
\htone=.73in% related to label height
\httwo=.73in% related to label height

\renewcommand\stackalignment{l}
\strutlongstacks{T}

\def\setlabel#1{\hfil%
  \rule[-\dp\strutbox]{0in}{\htone}\scaleto{\Longstack{#1}}{\httwo}%
%  \par%
}
\frenchspacing
\begin{document}

\setlabel{
Pastor Theophilus Jones\\
St. Luke Lutheran Church}% Wife Betsy
\setlabel{
Dr. \& Mrs. Greg Lastname \& Family\\
908 Streetname Dr.\\
Lancaster, PA 17601}% Liz + Kenny and Susie

\setlabel{
Herr Doktor Johann Schmidt\\
Birkenstrasse 27\\
86240 Biburg\\
GERMANY}% Mom's Uncle
\setlabel{
Frau Doktor Johanna Schmidt\\
Birkenstrasse 27\\
86240 Biburg\\
GERMANY}% Mom's Uncle
\end{document}

在此处输入图片描述

相关内容