
Me gustaría que mi texto se ajuste a un "cuadro" de cierto tamaño en una ubicación específica. Los dos problemas que estoy encontrando son los siguientes:
Esta cuerda larga debería enrollarse cuando alcance el límite de 4,5 pulgadas, pero no es así:
\documentclass[landscape]{article}
\usepackage[top=1.5in, bottom=1.125in, left=.25in, right=6.25in,textwidth=4.5in, textheight=5.875in]{geometry}
\begin{document}
ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
\end{document}
Y este permanece constante, pero me gustaría forzarlo para que se ajuste a todo el cuadro de 4,5 x 5,875 pulgadas, como ampliar el texto para que se ajuste al cuadro.
\documentclass[landscape]{article}
\usepackage[top=1.5in, bottom=1.125in, left=.25in, right=6.25in,textwidth=4.5in, textheight=5.875in]{geometry}
\begin{document}
{\Huge This should fit in a 4.5in x 5.875in box but that is close to the left edge of paper, but it is not conforming to the box size desired....
\end{document}
Gracias por la ayuda.
Respuesta1
Este podría ser un trabajo para elcaja de ajusteOpciones de paquete tcolorbox
. Como se comentó, su primer texto necesita guiones. Pero su segundo texto se puede dimensionar usando el siguiente código. Agregué un fondo amarillo para mostrar el cuadro de 4,5 x 5,875 pulgadas.
Tenga en cuenta que incluí un paquete de fuentes escalables ( lmodern
) para habilitar el mecanismo de escala de fuentes.
\documentclass[landscape]{article}
\usepackage[top=1.5in, bottom=1.125in, left=.25in, right=6.25in,textwidth=4.5in, textheight=5.875in]{geometry}
\usepackage{lmodern}% for scalable fonts!
\usepackage[many]{tcolorbox}
\begin{document}
\tcboxfit[blank,width=4.5in,height=5.875in,
fit basedim=20pt,fit fontsize macros,valign=center,
frame style={fill=yellow!50!white}% remove this line to remove the yellow background
]%
{\Huge This should fit in a 4.5in x 5.875in box but that is close to the left edge of paper, but it is not conforming to the box size desired....}
\end{document}
El primer código adapta la fuente para que quepa en el texto dentro del cuadro dado. Aún así, en la parte superior e inferior del cuadro quedan dos áreas en blanco muy pequeñas. Si es importante eliminarlos, se puede agregar un estiramiento final usando el siguiente código. Tenga en cuenta que el cuadro exterior es sólo para colorear el ejemplo.
\documentclass[landscape]{article}
\usepackage[top=1.5in, bottom=1.125in, left=.25in, right=6.25in,textwidth=4.5in, textheight=5.875in]{geometry}
\usepackage{lmodern}% for scalable fonts!
\usepackage[many]{tcolorbox}
\begin{document}
\tcbox[blank,width=4.5in,height=5.875in,frame style={fill=yellow!50!white}]{% just for the background
%
\resizebox{4.5in}{5.875in}{\tcboxfit[blank,width=4.5in,fit height from=5in to 5.875in,fit basedim=20pt,fit fontsize macros]%
{\Huge This should fit in a 4.5in x 5.875in box but that is close to the left edge of paper, but it is not conforming to the box size desired....}}
%
}% just for the background
\end{document}