You can adjust the inner-text using the optional parameters for parbox
\parbox[position][height][inner-pos]{width}{text}
Here is a minimal example.
\documentclass{article}
\begin{document}
\begin{tabular}{|r|l|}
\hline
\parbox[t][][t]{3cm}{\raggedleft First Line\\SecondLine} &
\parbox[t][][t]{5cm}{\textbf{First line goes here}\\
Second line would be here\\
And so on, ...\\
... until the very end.} \\
\hline
\end{tabular}
\end{document}
You can read more at TUG's LaTeX tutorial
UPDATE (to reflect revised MWE):
The only thing I changed from your non-working MWE is that I added a \relax\strut\ignorespaces
to the end of \argitem
. If I am understanding it properly, the \item
had to be ended, because you had no text as part of the item (the \parbox
was part of the \item
's optional argument). So any \strut
applied immediately afterward was set back on the top line of the paragraph (as part of the \item
). The \relax
basically stopped the \strut
from being gobbled by the \item
. I'm probably wrong in this explanation, but someone will correct me.
\documentclass{article}
\usepackage{setspace,lipsum}
\makeatletter
\newcommand\singlelipsum[1]{%
\begingroup\let\lips@par\relax\csname lipsum@\@roman{#1}\endcsname
\endgroup }
\newlength{\argwidth}
\newcommand{\argparams}[1]{%
\parbox[t]{\argwidth}{%
\setstretch{1.5}%
#1)%
%\par\xdef\tpd{\the\prevdepth}% [1]
%\strut% [2]
}%
%\par\prevdepth\tpd% [1]
%\\\strut\ignorespaces% [2]
}
\newcommand{\argfunc}[1]{\textbf{#1}(}
\newcommand{\argitem}[2]{
\settowidth{\argwidth}{\argfunc{#1}}%
\addtolength{\argwidth}{-2\argwidth}%
\addtolength{\argwidth}{\textwidth}%
\item[\argfunc{#1}\argparams{#2}]\relax\strut\ignorespaces%
}
\newcommand{\argitemlabel}[1]{%
\@tempdima\linewidth%
\advance\@tempdima \leftmargin\makebox[\@tempdima][l]{#1}%
}
\newenvironment{arglist}{
\begin{list}{}{%
\setlength\labelwidth{\leftmargin}
\setlength\labelsep{0pt}
\setlength\rightmargin{0pt}
\let\makelabel=\argitemlabel%
}%
}{\end{list}}
\makeatother
\begin{document}
\setstretch{2}
\begin{arglist}
\argitem{function}{args} body
\argitem{function}{\singlelipsum{4}} \singlelipsum{2}
\end{arglist}
\end{document}
ORIGINAL SOLUTION (for original MWE):
I see two things going on. The first, concerning the bottom of a \parbox
can be resolved with judicious use of \strut
s.
The second issue relates to the \lipsum[]
material commonly used in MWEs. When lipsum paragraphs are output, they contain more than text. They contain paragraph formatting, in the form of \par
s and stuff like that. Typically, if one were typing text as an argument for \arrowed
, one would not end on a \par
. And so, it would be better to get lipsum to output just the text of a paragraph, without the ending \par
and such.
The author of lipsum
told me how to do that:
\newcommand\singlelipsum[1]{%
\begingroup\let\lips@par\relax\csname lipsum@\@roman{#1}\endcsname
\endgroup }
And so, with the combination of \strut
and \singlelipsum
(which gives just the text of a single lipsum paragraph), one can fix the problem with
\documentclass{article}
\usepackage{lipsum}
\usepackage{setspace}
\setstretch{1.5}
\setlength{\parindent}{0pt}
\makeatletter
\newcommand\singlelipsum[1]{%
\begingroup\let\lips@par\relax\csname lipsum@\@roman{#1}\endcsname
\endgroup }
\makeatother
\newlength{\len}
\newcommand{\arrowed}[1]{%
% draw an arrow, then a parbox that's exactly
% the remaining width of the line
\settowidth{\len}{$\rightarrow$}%
\addtolength{\len}{-2\len}%
\addtolength{\len}{\textwidth}%
$\rightarrow$\parbox[t]{\len}{#1\strut}\\\strut\ignorespaces%
}
\begin{document}
\lipsum[2]
\arrowed{\singlelipsum{4}}
\lipsum[6]
\arrowed{But this is OK, since it's only one line.}
\lipsum[2]
\end{document}
Best Answer
An alternative is use Tikz with current page node. You may change the shift coordinates to the place you want.
Code: