gpt4 book ai didi

forms - 使用 LaTeX 的 PDF 表单 : how to create\TextField of exactly 4in width?

转载 作者:行者123 更新时间:2023-12-02 17:21:29 24 4
gpt4 key购买 nike

我使用 PDFLaTeX 创建表单,并遇到了定义输入字段的\TextField 宏的问题:

\TextField[width=4in,name=sample]{}

生成的字段比 4 英寸宽一点,我不明白为什么。下面的示例通过导致溢出的水平盒(通过溢出规则突出显示)来说明该问题。

\documentclass[a4paper,11pt]{article}
\usepackage[latin1]{inputenc}
\usepackage[pdftex]{hyperref}

\overfullrule3pt

\begin{document}
\noindent \TextField[name=one, width=\hsize]{type here:}
\end{document}

尽管已准确指定可用空间作为所需宽度,生成的 PDF 仍将显示过满的输入字段。

最佳答案

hyperref 包的作者 Heiko Oberdiek 给我发了一封电子邮件,并解释了为什么宽度默认大于指定值。每个\TextField 都通过以下宏进行布局:

\def\LayoutTextField#1#2{% label, field
#1 #2%
}

因此,我们最终得到了标签、空格和输入字段。宽度参数仅影响输入字段。通过重新定义布局,我们可以确保最终得到指定的所需宽度:

\def\LayoutTextField#1#2{#2}

此布局只需放下标签(“在此处键入:”)即可到达所需宽度的输入字段。

关于forms - 使用 LaTeX 的 PDF 表单 : how to create\TextField of exactly 4in width?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3944863/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com