Here's an attempt: I compute the area and then with some math I set the box width.
\documentclass{article}
\usepackage{environ,expl3}
\ExplSyntaxOn
\box_new:N \l_yossi_longline_box
\box_new:N \l_yossi_final_box
\dim_new:N \l_yossi_base_dim
\NewEnviron{aspectparagraph}[1]
{
\hbox_set:Nn \l_yossi_longline_box { \BODY }
\dim_set:Nn \l_yossi_base_dim
{
\fp_to_dim:n {
sqrt (
\dim_to_fp:n { \box_wd:N \l_yossi_longline_box } *
\dim_to_fp:n { \baselineskip } * #1
)
}
}
\vbox_set:Nn \l_yossi_final_box
{
\hsize = \l_yossi_base_dim
\emergencystretch = \hsize
\hyphenpenalty=0
\parindent = 0pt
\strut\BODY\strut
}
% the next two lines are just for debugging
\par Height~ = ~ \dim_eval:n { \box_ht:N \l_yossi_final_box }
\par Width ~ = ~ \dim_eval:n { \box_wd:N \l_yossi_final_box } \par
\leavevmode \box_use_drop:N \l_yossi_final_box
}
\ExplSyntaxOff
\begin{document}
\begin{aspectparagraph}{2.5}
some text, which would automatically be formatted with
different widths, so as to find the width which is closest
to (in this case) 2.5. This could be approximated by computing the total
text ``natural'' length, and then computing an approximate width based on the
line height.
\end{aspectparagraph}
\begin{aspectparagraph}{2}
some text, which would automatically be formatted with
different widths, so as to find the width which is closest
to (in this case) 2. This could be approximated by computing the total
text ``natural'' length, and then computing an approximate width based on the
line height.
\end{aspectparagraph}
\begin{aspectparagraph}{1}
some text, which would automatically be formatted with
different widths, so as to find the width which is closest
to (in this case) 1. This could be approximated by computing the total
text ``natural'' length, and then computing an approximate width based on the
line height.
\end{aspectparagraph}
\end{document}

Maybe one can imagine doing some tentative attempts and then choose the “best” one.
aspectparagraph
. Could you please provide a full MWE? And if this is a customized environment, could you explain what it's supposed to do? – A.Ellett Jan 5 '14 at 22:37