TransWikia.com

How do I create a text box that will have a fixed size and could be filled with text after the pdf is compiled?

TeX - LaTeX Asked on July 29, 2021

I’m sure this has been answered already but I couldn’t find it.

Because I have no idea how it’s called I don’t know what tag to use, this may have nothing to do with text manipulation.

I want to make a form with empty boxes that the user could write in (change the text after the pdf compiles).

I should be able to:

  1. Set the color inside the box
  2. Set the size of the box

Please include in the answer all packages required and an example would also be appreciated.

2 Answers

A simple, minimal example to get started for just what you want:

Textbox image with TextField

documentclass{article}

usepackage{xcolor}
usepackage{hyperref}

newcommand{TF}[2][15em]{TextField[borderwidth=0.1pt,
                                     width=#1,
                                     height=1.25em,
                                     charsize=10pt,
                                     backgroundcolor=blue!50!gray!20,
                                     color=blue!33!black,
                                     bordercolor=red!20,
                                     name=#2
                                    ]{}}

begin{document}

My name is: TF{a}

I would like to: TF[25em]{b}

end{document}

Correct answer by Partha D. on July 29, 2021

Not sure to understand the question. Empty boxes can be done with tcolorbox.

documentclass{article}
usepackage[most]{tcolorbox}
usepackage{lmodern}

tcbset{sharp corners}

begin{document}
Name: tcbox[colback=red!30, on line]{hspace*{3cm}}

Explain what you want
begin{tcolorbox}[colback=blue!20, height=5cm]
end{tcolorbox}
end{document}

enter image description here

Answered by Ignasi on July 29, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP