Etichette postali per Avery 5160

Dec 19 2020

Recentemente ho cambiato le mie etichette postali natalizie da MS Word a LaTeX usando quanto segue e mi chiedevo se qualcuno conoscesse una soluzione migliore. Devo ammettere che questa è una soluzione più generale, ma ho ancora una scatola quasi piena di etichette 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}

Risposte

3 StevenB.Segletes Dec 19 2020 at 05:31

Ecco come imposto ed eseguo il mio, che dovrà essere adattato a una pagina con più etichette, poiché i miei sono Avery 4013, "3,5" x 15/16 "One Across". È fondamentalmente una striscia di 12 etichette su una singola colonna. Il mio \setlabelsintonizza l'estensione verticale del contenuto per adattarlo allo spazio dell'etichetta. Se pensi che sia troppo grande, aggiungi una riga vuota. Nel preambolo, evidenzio alcuni dei parametri che possono essere modificati se cambio il formato dell'etichetta.

Il formato può essere adattato al formato a larghezza multipla specificando un foglio più largo, rimuovendo le righe vuote tra le \setlabelvoci sulla stessa riga e rimuovendo il simbolo \pardalla definizione di \setlabel. VEDI SOTTO LA PRIMA SOLUZIONE.

\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}


MULTI-LARGHEZZA

\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}