How to draw multiple fillable PDF forms inside a rectangle using `tikzpicture` environment
I would like to draw two differents pictures. One of them consists of two rectangles, one with text and the other (below the first) with fillable text, as shown below:
Here is text of this length
is just normal text, and the fillable text consists in three TextField
of the hyperref
package separated by a /
, like the date DD/MM/YYYY
.
The other picture is very similar but the only difference is that the fillable text is deleted:
However, I am not able to produce the combination of the two rectangles in one (so that the bottom one is centered) using tikzset
.
MWE:
documentclass{article}
usepackage[english]{babel}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{hyperref}
usepackage{pgfplots}
pgfplotsset{compat=1.15}
usetikzlibrary{shapes.multipart}
tikzset{pics/fillable subject/.style n args={1}{code={node[draw,text height=1.5ex,text width=5em,rounded corners] (#1) {TextField[name=day,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1 1}]~/~TextField[name=month,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1 1}]~/~TextField[name=year,width=2em,charsize=7pt,maxlen=4,bordercolor={1 1 1}]\};}}}
begin{document}
begin{Form}
begin{tikzpicture}
pic at (0,0) {fillable subject={Geography}};
end{tikzpicture}
end{Form}
end{document}
Requirements
- There are two pictures:
fillable subject
andnon-fillable subject
.
fillable subject
must have one argument: the name of the subject (Math, History, etc.).non-fillable subject
must have no arguments.- Each picture has a specified size, it does not change depending on the length of the text.
- There are a lot of them in one
tikzpicture
environment, so the code should be as handle as possible, since we can add several pictures one next to the other. - We must be able to create an arrow between two pictures that connect the upper rectangles.
This is what I want:
Thanks!!
tikz-pgf hyperref diagrams
add a comment |
I would like to draw two differents pictures. One of them consists of two rectangles, one with text and the other (below the first) with fillable text, as shown below:
Here is text of this length
is just normal text, and the fillable text consists in three TextField
of the hyperref
package separated by a /
, like the date DD/MM/YYYY
.
The other picture is very similar but the only difference is that the fillable text is deleted:
However, I am not able to produce the combination of the two rectangles in one (so that the bottom one is centered) using tikzset
.
MWE:
documentclass{article}
usepackage[english]{babel}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{hyperref}
usepackage{pgfplots}
pgfplotsset{compat=1.15}
usetikzlibrary{shapes.multipart}
tikzset{pics/fillable subject/.style n args={1}{code={node[draw,text height=1.5ex,text width=5em,rounded corners] (#1) {TextField[name=day,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1 1}]~/~TextField[name=month,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1 1}]~/~TextField[name=year,width=2em,charsize=7pt,maxlen=4,bordercolor={1 1 1}]\};}}}
begin{document}
begin{Form}
begin{tikzpicture}
pic at (0,0) {fillable subject={Geography}};
end{tikzpicture}
end{Form}
end{document}
Requirements
- There are two pictures:
fillable subject
andnon-fillable subject
.
fillable subject
must have one argument: the name of the subject (Math, History, etc.).non-fillable subject
must have no arguments.- Each picture has a specified size, it does not change depending on the length of the text.
- There are a lot of them in one
tikzpicture
environment, so the code should be as handle as possible, since we can add several pictures one next to the other. - We must be able to create an arrow between two pictures that connect the upper rectangles.
This is what I want:
Thanks!!
tikz-pgf hyperref diagrams
P.S. When I delete\
inside the argument ofsubject/.style
I get! Paragraph ended before @TextField was complete
. Is it possible to eliminate the redundant line break? I do not know why it happens.
– manooooh
54 mins ago
1
You can replace\
by{}
. Perhaps you can mention that the blue boxes only appear on certain viewers.
– marmot
33 mins ago
add a comment |
I would like to draw two differents pictures. One of them consists of two rectangles, one with text and the other (below the first) with fillable text, as shown below:
Here is text of this length
is just normal text, and the fillable text consists in three TextField
of the hyperref
package separated by a /
, like the date DD/MM/YYYY
.
The other picture is very similar but the only difference is that the fillable text is deleted:
However, I am not able to produce the combination of the two rectangles in one (so that the bottom one is centered) using tikzset
.
MWE:
documentclass{article}
usepackage[english]{babel}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{hyperref}
usepackage{pgfplots}
pgfplotsset{compat=1.15}
usetikzlibrary{shapes.multipart}
tikzset{pics/fillable subject/.style n args={1}{code={node[draw,text height=1.5ex,text width=5em,rounded corners] (#1) {TextField[name=day,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1 1}]~/~TextField[name=month,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1 1}]~/~TextField[name=year,width=2em,charsize=7pt,maxlen=4,bordercolor={1 1 1}]\};}}}
begin{document}
begin{Form}
begin{tikzpicture}
pic at (0,0) {fillable subject={Geography}};
end{tikzpicture}
end{Form}
end{document}
Requirements
- There are two pictures:
fillable subject
andnon-fillable subject
.
fillable subject
must have one argument: the name of the subject (Math, History, etc.).non-fillable subject
must have no arguments.- Each picture has a specified size, it does not change depending on the length of the text.
- There are a lot of them in one
tikzpicture
environment, so the code should be as handle as possible, since we can add several pictures one next to the other. - We must be able to create an arrow between two pictures that connect the upper rectangles.
This is what I want:
Thanks!!
tikz-pgf hyperref diagrams
I would like to draw two differents pictures. One of them consists of two rectangles, one with text and the other (below the first) with fillable text, as shown below:
Here is text of this length
is just normal text, and the fillable text consists in three TextField
of the hyperref
package separated by a /
, like the date DD/MM/YYYY
.
The other picture is very similar but the only difference is that the fillable text is deleted:
However, I am not able to produce the combination of the two rectangles in one (so that the bottom one is centered) using tikzset
.
MWE:
documentclass{article}
usepackage[english]{babel}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{hyperref}
usepackage{pgfplots}
pgfplotsset{compat=1.15}
usetikzlibrary{shapes.multipart}
tikzset{pics/fillable subject/.style n args={1}{code={node[draw,text height=1.5ex,text width=5em,rounded corners] (#1) {TextField[name=day,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1 1}]~/~TextField[name=month,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1 1}]~/~TextField[name=year,width=2em,charsize=7pt,maxlen=4,bordercolor={1 1 1}]\};}}}
begin{document}
begin{Form}
begin{tikzpicture}
pic at (0,0) {fillable subject={Geography}};
end{tikzpicture}
end{Form}
end{document}
Requirements
- There are two pictures:
fillable subject
andnon-fillable subject
.
fillable subject
must have one argument: the name of the subject (Math, History, etc.).non-fillable subject
must have no arguments.- Each picture has a specified size, it does not change depending on the length of the text.
- There are a lot of them in one
tikzpicture
environment, so the code should be as handle as possible, since we can add several pictures one next to the other. - We must be able to create an arrow between two pictures that connect the upper rectangles.
This is what I want:
Thanks!!
tikz-pgf hyperref diagrams
tikz-pgf hyperref diagrams
edited 52 mins ago
manooooh
asked 1 hour ago
manoooohmanooooh
1,0261516
1,0261516
P.S. When I delete\
inside the argument ofsubject/.style
I get! Paragraph ended before @TextField was complete
. Is it possible to eliminate the redundant line break? I do not know why it happens.
– manooooh
54 mins ago
1
You can replace\
by{}
. Perhaps you can mention that the blue boxes only appear on certain viewers.
– marmot
33 mins ago
add a comment |
P.S. When I delete\
inside the argument ofsubject/.style
I get! Paragraph ended before @TextField was complete
. Is it possible to eliminate the redundant line break? I do not know why it happens.
– manooooh
54 mins ago
1
You can replace\
by{}
. Perhaps you can mention that the blue boxes only appear on certain viewers.
– marmot
33 mins ago
P.S. When I delete
\
inside the argument of subject/.style
I get ! Paragraph ended before @TextField was complete
. Is it possible to eliminate the redundant line break? I do not know why it happens.– manooooh
54 mins ago
P.S. When I delete
\
inside the argument of subject/.style
I get ! Paragraph ended before @TextField was complete
. Is it possible to eliminate the redundant line break? I do not know why it happens.– manooooh
54 mins ago
1
1
You can replace
\
by {}
. Perhaps you can mention that the blue boxes only appear on certain viewers.– marmot
33 mins ago
You can replace
\
by {}
. Perhaps you can mention that the blue boxes only appear on certain viewers.– marmot
33 mins ago
add a comment |
1 Answer
1
active
oldest
votes
I really have no clue how these forms work, but the TikZ part seems not too difficult.
documentclass{article}
usepackage[english]{babel}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{hyperref}
usepackage{tikz}
usetikzlibrary{shapes.multipart}
tikzset{pics/fillable subject/.style={code={%
node[text height=1.5ex,align=center,rounded corners] (-TF)
{TextField[name=day,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1
1}]~/~TextField[name=month,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1
1}]~/~TextField[name=year,width=2em,charsize=7pt,maxlen=4,bordercolor={1 1
1}]{}};
node[text height=1.5ex,text depth=0.3em,anchor=south,text width=11em,align=center,font=sffamily] (-Title)
at ([yshift=0.4em]-TF.north) {#1};
draw[rounded corners] (-TF.south west) |- (-Title.south west)
|- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
-- cycle;
draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
}},
pics/nonfillable subject/.style={code={%
node[text height=1.5ex,align=center,rounded corners] (-TF)
{hspace{1em}~/~hspace{1em}~/~hspace{1em}{}};
node[text height=1.5ex,text depth=0.3em,anchor=south,text width=11em,align=center,font=sffamily] (-Title)
at ([yshift=0.4em]-TF.north) {#1};
draw[rounded corners] (-TF.south west) |- (-Title.south west)
|- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
-- cycle;
draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
}},
}
begin{document}
begin{Form}
begin{tikzpicture}
path (0,0) pic (Geo) {fillable subject={Geography}}
(5,0) pic (Whatever) {nonfillable subject={Whatever}}
(10,0) pic[draw=red] (Math) {fillable subject={Math}};
draw[-latex] (Geo-Title) -- (Whatever-Title);
draw[-latex] (Whatever-Title) -- (Math-Title);
end{tikzpicture}
end{Form}
end{document}
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478341%2fhow-to-draw-multiple-fillable-pdf-forms-inside-a-rectangle-using-tikzpicture-e%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I really have no clue how these forms work, but the TikZ part seems not too difficult.
documentclass{article}
usepackage[english]{babel}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{hyperref}
usepackage{tikz}
usetikzlibrary{shapes.multipart}
tikzset{pics/fillable subject/.style={code={%
node[text height=1.5ex,align=center,rounded corners] (-TF)
{TextField[name=day,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1
1}]~/~TextField[name=month,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1
1}]~/~TextField[name=year,width=2em,charsize=7pt,maxlen=4,bordercolor={1 1
1}]{}};
node[text height=1.5ex,text depth=0.3em,anchor=south,text width=11em,align=center,font=sffamily] (-Title)
at ([yshift=0.4em]-TF.north) {#1};
draw[rounded corners] (-TF.south west) |- (-Title.south west)
|- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
-- cycle;
draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
}},
pics/nonfillable subject/.style={code={%
node[text height=1.5ex,align=center,rounded corners] (-TF)
{hspace{1em}~/~hspace{1em}~/~hspace{1em}{}};
node[text height=1.5ex,text depth=0.3em,anchor=south,text width=11em,align=center,font=sffamily] (-Title)
at ([yshift=0.4em]-TF.north) {#1};
draw[rounded corners] (-TF.south west) |- (-Title.south west)
|- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
-- cycle;
draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
}},
}
begin{document}
begin{Form}
begin{tikzpicture}
path (0,0) pic (Geo) {fillable subject={Geography}}
(5,0) pic (Whatever) {nonfillable subject={Whatever}}
(10,0) pic[draw=red] (Math) {fillable subject={Math}};
draw[-latex] (Geo-Title) -- (Whatever-Title);
draw[-latex] (Whatever-Title) -- (Math-Title);
end{tikzpicture}
end{Form}
end{document}
add a comment |
I really have no clue how these forms work, but the TikZ part seems not too difficult.
documentclass{article}
usepackage[english]{babel}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{hyperref}
usepackage{tikz}
usetikzlibrary{shapes.multipart}
tikzset{pics/fillable subject/.style={code={%
node[text height=1.5ex,align=center,rounded corners] (-TF)
{TextField[name=day,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1
1}]~/~TextField[name=month,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1
1}]~/~TextField[name=year,width=2em,charsize=7pt,maxlen=4,bordercolor={1 1
1}]{}};
node[text height=1.5ex,text depth=0.3em,anchor=south,text width=11em,align=center,font=sffamily] (-Title)
at ([yshift=0.4em]-TF.north) {#1};
draw[rounded corners] (-TF.south west) |- (-Title.south west)
|- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
-- cycle;
draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
}},
pics/nonfillable subject/.style={code={%
node[text height=1.5ex,align=center,rounded corners] (-TF)
{hspace{1em}~/~hspace{1em}~/~hspace{1em}{}};
node[text height=1.5ex,text depth=0.3em,anchor=south,text width=11em,align=center,font=sffamily] (-Title)
at ([yshift=0.4em]-TF.north) {#1};
draw[rounded corners] (-TF.south west) |- (-Title.south west)
|- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
-- cycle;
draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
}},
}
begin{document}
begin{Form}
begin{tikzpicture}
path (0,0) pic (Geo) {fillable subject={Geography}}
(5,0) pic (Whatever) {nonfillable subject={Whatever}}
(10,0) pic[draw=red] (Math) {fillable subject={Math}};
draw[-latex] (Geo-Title) -- (Whatever-Title);
draw[-latex] (Whatever-Title) -- (Math-Title);
end{tikzpicture}
end{Form}
end{document}
add a comment |
I really have no clue how these forms work, but the TikZ part seems not too difficult.
documentclass{article}
usepackage[english]{babel}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{hyperref}
usepackage{tikz}
usetikzlibrary{shapes.multipart}
tikzset{pics/fillable subject/.style={code={%
node[text height=1.5ex,align=center,rounded corners] (-TF)
{TextField[name=day,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1
1}]~/~TextField[name=month,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1
1}]~/~TextField[name=year,width=2em,charsize=7pt,maxlen=4,bordercolor={1 1
1}]{}};
node[text height=1.5ex,text depth=0.3em,anchor=south,text width=11em,align=center,font=sffamily] (-Title)
at ([yshift=0.4em]-TF.north) {#1};
draw[rounded corners] (-TF.south west) |- (-Title.south west)
|- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
-- cycle;
draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
}},
pics/nonfillable subject/.style={code={%
node[text height=1.5ex,align=center,rounded corners] (-TF)
{hspace{1em}~/~hspace{1em}~/~hspace{1em}{}};
node[text height=1.5ex,text depth=0.3em,anchor=south,text width=11em,align=center,font=sffamily] (-Title)
at ([yshift=0.4em]-TF.north) {#1};
draw[rounded corners] (-TF.south west) |- (-Title.south west)
|- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
-- cycle;
draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
}},
}
begin{document}
begin{Form}
begin{tikzpicture}
path (0,0) pic (Geo) {fillable subject={Geography}}
(5,0) pic (Whatever) {nonfillable subject={Whatever}}
(10,0) pic[draw=red] (Math) {fillable subject={Math}};
draw[-latex] (Geo-Title) -- (Whatever-Title);
draw[-latex] (Whatever-Title) -- (Math-Title);
end{tikzpicture}
end{Form}
end{document}
I really have no clue how these forms work, but the TikZ part seems not too difficult.
documentclass{article}
usepackage[english]{babel}
usepackage[utf8]{inputenc}
usepackage[T1]{fontenc}
usepackage{hyperref}
usepackage{tikz}
usetikzlibrary{shapes.multipart}
tikzset{pics/fillable subject/.style={code={%
node[text height=1.5ex,align=center,rounded corners] (-TF)
{TextField[name=day,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1
1}]~/~TextField[name=month,width=1em,charsize=7pt,maxlen=2,bordercolor={1 1
1}]~/~TextField[name=year,width=2em,charsize=7pt,maxlen=4,bordercolor={1 1
1}]{}};
node[text height=1.5ex,text depth=0.3em,anchor=south,text width=11em,align=center,font=sffamily] (-Title)
at ([yshift=0.4em]-TF.north) {#1};
draw[rounded corners] (-TF.south west) |- (-Title.south west)
|- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
-- cycle;
draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
}},
pics/nonfillable subject/.style={code={%
node[text height=1.5ex,align=center,rounded corners] (-TF)
{hspace{1em}~/~hspace{1em}~/~hspace{1em}{}};
node[text height=1.5ex,text depth=0.3em,anchor=south,text width=11em,align=center,font=sffamily] (-Title)
at ([yshift=0.4em]-TF.north) {#1};
draw[rounded corners] (-TF.south west) |- (-Title.south west)
|- (-Title.north east) -- (-Title.south east) -| (-TF.south east)
-- cycle;
draw ([xshift=4pt]-Title.south west) -- ([xshift=-4pt]-Title.south east);
}},
}
begin{document}
begin{Form}
begin{tikzpicture}
path (0,0) pic (Geo) {fillable subject={Geography}}
(5,0) pic (Whatever) {nonfillable subject={Whatever}}
(10,0) pic[draw=red] (Math) {fillable subject={Math}};
draw[-latex] (Geo-Title) -- (Whatever-Title);
draw[-latex] (Whatever-Title) -- (Math-Title);
end{tikzpicture}
end{Form}
end{document}
answered 8 mins ago
marmotmarmot
106k5129243
106k5129243
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478341%2fhow-to-draw-multiple-fillable-pdf-forms-inside-a-rectangle-using-tikzpicture-e%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
P.S. When I delete
\
inside the argument ofsubject/.style
I get! Paragraph ended before @TextField was complete
. Is it possible to eliminate the redundant line break? I do not know why it happens.– manooooh
54 mins ago
1
You can replace
\
by{}
. Perhaps you can mention that the blue boxes only appear on certain viewers.– marmot
33 mins ago