答案1
\framebox
这是和的工作tabular*
。
第一行设在一个\textwidth
宽框中,以避免填充过满; 的宽度恰好等于两边和的\framebox
宽度,因此文本的排版正好与文本宽度一致。 内部会破坏所有其他可拉伸性。\fboxsep
\fboxrule
\hfill
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\begin{document}
{% the header
\centering\scshape
\makebox[\textwidth]{%
\framebox[\dimexpr\textwidth+2\fboxsep+2\fboxrule][s]{%
Zentrum Matematik\hfill
Technische Universität München%
}%
}
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}}lr@{}}
Prof. Dr. Daniel Matthes & WS 2015/16 \\
Dr. Carl-Friedrich Kreiner & Info-Blatt
\end{tabular*}
}
\begin{center}
\Large\bfseries Analysis I
\end{center}
\noindent
Zur Vorlesung \emph{Analysis I} gehören blah blah
Zur Vorlesung \emph{Analysis I} gehören blah blah
Zur Vorlesung \emph{Analysis I} gehören blah blah
Zur Vorlesung \emph{Analysis I} gehören blah blah
\end{document}
答案2
这里有两个解决方案。
\documentclass{article}
\begin{document}
bla bla
{\noindent\setlength{\tabcolsep}{2pt}%
\begin{tabular}{lr}
\hline
\multicolumn{1}{|p{\dimexpr.5\textwidth-2\tabcolsep-\arrayrulewidth\relax}}{Some text at left}&
\multicolumn{1}{p{\dimexpr.5\textwidth-2\tabcolsep-\arrayrulewidth\relax}|}{\raggedleft Some text at right}\\
\hline
Some text at left & Some text at left\\
Some text at left & Some text at left\\
\end{tabular}}
bla bla foo bar
{\noindent
\framebox[\textwidth]{Some text at left \hfill Some text at left}
Some text at left \hfill Some text at left
\noindent
Some text at left \hfill Some text at left}
\end{document}