2015-05-29 130 views
2

在下面的輸出中,我試圖將作者與其旁邊的框對齊。我已經嘗試了幾個不同的盒子,但是我不能正確對齊。將文本垂直對齊框旁邊的框

Output

下面的代碼:

\mbox{ 
Author 
} 
\fbox{\begin{minipage}[c]{12cm} 
\medskip 
$for(author)$ 
    $author.name$\\$if(author.title)$\emph{$author.title$}\\$endif$$if(author.company)$$author.company$$endif$ 
    \par\medskip 
$endfor$ 
\medskip 
\end{minipage}} 

回答

2

你應該設置整個建設tabular裏面,然後還使用了[t] OP對齊的框架箱式結構tabular

enter image description here

\documentclass{article} 
\begin{document} 

\begin{tabular}{l | l |} 
    \cline{2-2} 
    Author & \begin{tabular}[t]{@{}p{12cm}@{}} 
    Jack Appleseed \\ 
    \emph{Marketing Manager} \\ 
    Unimaginitive Solutions \\ \\ 
    John Appleseed \\ 
    \emph{Business Development Manager} \\ 
    Unimaginitive Solutions \\ 
    \end{tabular} \\ 
    \cline{2-2} 
\end{tabular} 

\end{document} 

我假設你可以使用下面的Pandoc建設(我沒用過Pandoc):

\begin{tabular}{l | l |} 
    \cline{2-2} 
    Author & \begin{tabular}[t]{@{}p{12cm}@{}} 
    $for(author)$ 
     $author.name$ \\ $if(author.title)$\emph{$author.title$} \\ $endif$ $if(author.company)$ $author.company$ \\ $endif$ 
    $endfor$ 
    \end{tabular} \\ 
    \cline{2-2} 
\end{tabular}