\parbox[pos][height][contentpos]{width}{text} gives me a box where height is actually "minimal height", while width= exact width. I would like height to also be "exact height". How can I do this? Text that is larger then the content should
- disappear "within the box" and not appear outside the boxes borders or
- be adjusted in size so that it fits into the box.
Though I think 2 is asking to much.
Here is how far I got:
\RequirePackage[l2tabu, orthodox]{nag} % Warning when old or wrong commands are used
\RequirePackage{fix-cm} % permits Computer Modern fonts at arbitrary sizes
\documentclass[a4paper,10pt,oneside]{article}
\usepackage{geometry}
\usepackage{blindtext}
\usepackage{adjustbox}
\usepackage[many]{tcolorbox}
\usepackage{lmodern}% or any other vector / postscript font
\usepackage{lipsum}
\geometry{
a4paper,
centering,
hmargin=0.5mm,
vmargin=1mm,
ignoreall,
showframe
}
\setlength{\parindent}{0cm}
\setlength{\fboxsep}{0pt}
\begin{document}
\selectlanguage{ngerman}
\renewcommand{\familydefault}{\sfdefault}
\pagestyle{empty}
\newcommand{\myboxI}{%
\fbox{\adjustbox{totalheight=21.2mm, width=52.5mm, keepaspectratio, rotate=0, minipage=[r][21.2mm][t]{52.5mm}}{%
wefewf wwkeföjwlkej fkewjf ölkewjflkewjf \\ ölkewjf lwkejf lkwjlkwejf lkwejf \\ asdf wef we \\ werwer we \\ werwerewfewfewfewfewfwef wef ewf ewf wef we f \\ wefewf wefwe%
}}%
}
\newcommand{\myboxII}{%
\begin{tcolorbox}[%
fit,width=52.5mm,height=21.2mm,blank,
borderline={0.4pt}{0pt}{red!20!white},
%watermark text={6cm $\times$ 6cm},nobeforeafter
]
wefewf wwkeföjwlkej fkewjf ölkewjflkewjf \\ ölkewjf lwkejf lkwjlkwejf lkwejf \\ asdf wef we \\ werwer we \\ werwerewfewfewfewfewfwef wef ewf ewf wef we f \\ wefewf wefwe
\end{tcolorbox}%
}
\myboxI\hspace{-1cm}\hfill\myboxI\hspace{-1cm}\hfill\myboxI\hspace{-1cm}\hfill\myboxI
\bigskip
\myboxII\hspace{-1cm}\hfill\myboxII\hspace{-1cm}\hfill\myboxII\hspace{-1cm}\hfill\myboxII
\end{document}
The first attempt does not really scale the content, as I had hoped. Also I had expected that the boxes are just next to each other, not overlap.
The second does not allow the boxes to be next to each other.



\strutat the beginning of the text in the box, and another at the end of that text (no intervening space) to mimic the normal baselines and ensure the depth of descenders in the bottom line. – barbara beeton Apr 15 '16 at 20:55fix-cmif you loadlmodernthat I know of. – cfr Apr 15 '16 at 22:44