我正在处理一个如下所示的 tex 文件:
\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{caption}
\usepackage{amssymb}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{float}
\usepackage{floatflt}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{wrapfig}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
\renewcommand*{\DefaultHeightofTextMultiline}{6\baselineskip}
\renewcommand*{\LayoutTextField}[2]{\makebox[3.5cm][l]{#1: }%
\raisebox{\baselineskip}{\raisebox{-\height}{#2}}}
\def\LayoutChoiceField#1#2{\makebox[6em][l]{#1: }#2}
\newdimen\longline
\longline=\textwidth\advance\longline-6em
\begin{document}
\begin{Form}
\TextField[name=Beschreibung,multiline=true,height=8\baselineskip,
width=\longline,borderwidth=0,backgroundcolor={.85 .85 .85}]
{\textbf{foobar foobar foobar foobar foobar foobar foobar foobar }}\vskip2ex
\end{Form}
\end{document}
如您所见,foobar 文本未在左侧对齐,而是位于文本字段下方。我尝试使用 break,但不起作用。如果您能帮助我,我将非常高兴。
答案1
我不确定我是否理解你想要什么输出,但也许你的意思是
\documentclass[11pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{caption}
\usepackage{amssymb}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{float}
\usepackage{floatflt}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{wrapfig}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}p{#1}}
\renewcommand*{\DefaultHeightofTextMultiline}{6\baselineskip}
\renewcommand*{\LayoutTextField}[2]{\makebox[3.5cm][l]{#1: }%
\raisebox{\baselineskip}{\raisebox{-\height}{#2}}}
\def\LayoutChoiceField#1#2{\makebox[6em][l]{#1: }#2}
\newdimen\longline
\longline=\textwidth\advance\longline-6em
\begin{document}
\begin{Form}
\TextField[name=Beschreibung,multiline=true,height=8\baselineskip,
width=\longline,borderwidth=0,backgroundcolor={.85 .85 .85}]
{\textbf{\parbox[t]{3cm}{\raggedleft foobar foobar foobar foobar foobar foobar foobar foobar}}}%
\vspace{2ex}%
\end{Form}
\end{document}