unwanted blank page inserted before tabular
up vote
4
down vote
favorite
i have a document that consists of a single multi-page table. Unfortunately it gets a blank page inserted as the first page, I absolutely don't want this (it screws with page numbering, etc). If I remove rows, so the table can fit on a single page, then the blank page is not inserted.
Here is a minimal working example, the error is the blank page as the first page:
documentclass[a4paper,11pt]{article}
usepackage[utf8]{inputenc}
usepackage{supertabular}
usepackage{array}
usepackage{booktabs}
begin{document}
pagestyle{empty}
tabletail{bottomrule}
tablelasttail{hline}
tablehead {
toprule
multicolumn{2}{c}{
textbf{huge "Head row"}
}
\ midrule
}
begin{supertabular}{@{}p{7cm}@{extracolsep{fill}}p{7cm}@{}}
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
end{supertabular}
end{document}
If you remove some rows from that table so it fits on a single page, you will see that the blank page is not inserted.
What causes this? Thanks.
tables blank-page supertabular
|
show 2 more comments
up vote
4
down vote
favorite
i have a document that consists of a single multi-page table. Unfortunately it gets a blank page inserted as the first page, I absolutely don't want this (it screws with page numbering, etc). If I remove rows, so the table can fit on a single page, then the blank page is not inserted.
Here is a minimal working example, the error is the blank page as the first page:
documentclass[a4paper,11pt]{article}
usepackage[utf8]{inputenc}
usepackage{supertabular}
usepackage{array}
usepackage{booktabs}
begin{document}
pagestyle{empty}
tabletail{bottomrule}
tablelasttail{hline}
tablehead {
toprule
multicolumn{2}{c}{
textbf{huge "Head row"}
}
\ midrule
}
begin{supertabular}{@{}p{7cm}@{extracolsep{fill}}p{7cm}@{}}
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
end{supertabular}
end{document}
If you remove some rows from that table so it fits on a single page, you will see that the blank page is not inserted.
What causes this? Thanks.
tables blank-page supertabular
1
Welcome to tex.SX! I've inserted the example code into your question, I hope you don't mind.
– Jake
Mar 14 '11 at 22:12
Of course I don't, thank you.
– JDoe
Mar 14 '11 at 22:20
@JDoe: Welcome to TeX.SX. If you add@followed by the username to your comments the user gets notified. This only works for the first mentioned user. The author of the commented question or answer is always notified.
– Martin Scharrer♦
Mar 14 '11 at 22:28
@JDoe: I had a look on your file and it seems related to the table rules (toprule,midrule, etc.). After removing them the page break is gone. I will post an answer if and when I find how to fix this without removing the rules.
– Martin Scharrer♦
Mar 14 '11 at 22:30
2
@Martin: FYI, Jake did get a notification of JDoe's comment.
– Hendrik Vogt
Mar 15 '11 at 8:02
|
show 2 more comments
up vote
4
down vote
favorite
up vote
4
down vote
favorite
i have a document that consists of a single multi-page table. Unfortunately it gets a blank page inserted as the first page, I absolutely don't want this (it screws with page numbering, etc). If I remove rows, so the table can fit on a single page, then the blank page is not inserted.
Here is a minimal working example, the error is the blank page as the first page:
documentclass[a4paper,11pt]{article}
usepackage[utf8]{inputenc}
usepackage{supertabular}
usepackage{array}
usepackage{booktabs}
begin{document}
pagestyle{empty}
tabletail{bottomrule}
tablelasttail{hline}
tablehead {
toprule
multicolumn{2}{c}{
textbf{huge "Head row"}
}
\ midrule
}
begin{supertabular}{@{}p{7cm}@{extracolsep{fill}}p{7cm}@{}}
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
end{supertabular}
end{document}
If you remove some rows from that table so it fits on a single page, you will see that the blank page is not inserted.
What causes this? Thanks.
tables blank-page supertabular
i have a document that consists of a single multi-page table. Unfortunately it gets a blank page inserted as the first page, I absolutely don't want this (it screws with page numbering, etc). If I remove rows, so the table can fit on a single page, then the blank page is not inserted.
Here is a minimal working example, the error is the blank page as the first page:
documentclass[a4paper,11pt]{article}
usepackage[utf8]{inputenc}
usepackage{supertabular}
usepackage{array}
usepackage{booktabs}
begin{document}
pagestyle{empty}
tabletail{bottomrule}
tablelasttail{hline}
tablehead {
toprule
multicolumn{2}{c}{
textbf{huge "Head row"}
}
\ midrule
}
begin{supertabular}{@{}p{7cm}@{extracolsep{fill}}p{7cm}@{}}
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
end{supertabular}
end{document}
If you remove some rows from that table so it fits on a single page, you will see that the blank page is not inserted.
What causes this? Thanks.
tables blank-page supertabular
tables blank-page supertabular
edited Mar 15 '11 at 7:18
lockstep
189k52585719
189k52585719
asked Mar 14 '11 at 22:05
JDoe
1155
1155
1
Welcome to tex.SX! I've inserted the example code into your question, I hope you don't mind.
– Jake
Mar 14 '11 at 22:12
Of course I don't, thank you.
– JDoe
Mar 14 '11 at 22:20
@JDoe: Welcome to TeX.SX. If you add@followed by the username to your comments the user gets notified. This only works for the first mentioned user. The author of the commented question or answer is always notified.
– Martin Scharrer♦
Mar 14 '11 at 22:28
@JDoe: I had a look on your file and it seems related to the table rules (toprule,midrule, etc.). After removing them the page break is gone. I will post an answer if and when I find how to fix this without removing the rules.
– Martin Scharrer♦
Mar 14 '11 at 22:30
2
@Martin: FYI, Jake did get a notification of JDoe's comment.
– Hendrik Vogt
Mar 15 '11 at 8:02
|
show 2 more comments
1
Welcome to tex.SX! I've inserted the example code into your question, I hope you don't mind.
– Jake
Mar 14 '11 at 22:12
Of course I don't, thank you.
– JDoe
Mar 14 '11 at 22:20
@JDoe: Welcome to TeX.SX. If you add@followed by the username to your comments the user gets notified. This only works for the first mentioned user. The author of the commented question or answer is always notified.
– Martin Scharrer♦
Mar 14 '11 at 22:28
@JDoe: I had a look on your file and it seems related to the table rules (toprule,midrule, etc.). After removing them the page break is gone. I will post an answer if and when I find how to fix this without removing the rules.
– Martin Scharrer♦
Mar 14 '11 at 22:30
2
@Martin: FYI, Jake did get a notification of JDoe's comment.
– Hendrik Vogt
Mar 15 '11 at 8:02
1
1
Welcome to tex.SX! I've inserted the example code into your question, I hope you don't mind.
– Jake
Mar 14 '11 at 22:12
Welcome to tex.SX! I've inserted the example code into your question, I hope you don't mind.
– Jake
Mar 14 '11 at 22:12
Of course I don't, thank you.
– JDoe
Mar 14 '11 at 22:20
Of course I don't, thank you.
– JDoe
Mar 14 '11 at 22:20
@JDoe: Welcome to TeX.SX. If you add
@ followed by the username to your comments the user gets notified. This only works for the first mentioned user. The author of the commented question or answer is always notified.– Martin Scharrer♦
Mar 14 '11 at 22:28
@JDoe: Welcome to TeX.SX. If you add
@ followed by the username to your comments the user gets notified. This only works for the first mentioned user. The author of the commented question or answer is always notified.– Martin Scharrer♦
Mar 14 '11 at 22:28
@JDoe: I had a look on your file and it seems related to the table rules (
toprule, midrule, etc.). After removing them the page break is gone. I will post an answer if and when I find how to fix this without removing the rules.– Martin Scharrer♦
Mar 14 '11 at 22:30
@JDoe: I had a look on your file and it seems related to the table rules (
toprule, midrule, etc.). After removing them the page break is gone. I will post an answer if and when I find how to fix this without removing the rules.– Martin Scharrer♦
Mar 14 '11 at 22:30
2
2
@Martin: FYI, Jake did get a notification of JDoe's comment.
– Hendrik Vogt
Mar 15 '11 at 8:02
@Martin: FYI, Jake did get a notification of JDoe's comment.
– Hendrik Vogt
Mar 15 '11 at 8:02
|
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
As Martin points out, this is related to the booktabs rules. There really shouldn't be a midrule between every line, but if you want to do it anyway, here's one way to fix the problem.
documentclass[a4paper,11pt]{article}
usepackage[utf8]{inputenc}
usepackage{supertabular}
usepackage{array}
usepackage{booktabs}
usepackage{geometry}
usepackage{etoolbox}
tabletail{bottomrule}
tablelasttail{bottomrule}
tablehead{%
toprule
multicolumn{2}{c}{textbf{huge ``Head row''}}%
\ midrule
}
pagestyle{empty}%
overfullrule5pt
makeatletter
apptoestimate@lineht{%
globaladvanceST@lineht byaboverulesep
globaladvanceST@lineht bybelowrulesep
}
makeatother
begin{document}
begin{supertabular}{@{}p{7cm}@{extracolsep{fill}}p{7cm}@{}}
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
end{supertabular}
end{document}
The geometry package is just because your table was too wide and it was giving overfull rules. Changing the margins fixes that. The real fix here has to do with how supertabular estimates the height of each line. It uses estimate@lineht to compute the height of a stretched line. Since you are using midrule between every line, we can simply increase the estimate of the line height by incrementing ST@lineht by aboverulesep + belowrulesep.
The real fix is to omit the midrules. It makes the table look much better.
thanks, but this solution doesn't work when i have multi-line rows. For example change all foo and bar to some longer text, the blank page gets inserted yet again. Is it possible to solve this? I need the midrules, or maybe I just use LaTeX the wrong way here.
– JDoe
Mar 15 '11 at 13:54
1
@JDoe: The documentation says, "When the last p-arg on a page gets more than 4 lines (probably even more than 3 lines) it will result in an overfullvbox. Also some combinations ofbaselinestretcharraystretchand a large font may lead to one line too much." Maybe you're hitting that? It suggests that "[a] quick but not very elegant solution: shrink the allowed height of the table with the commandshrinkheight{...pt}after the first \ of the supertabular."
– TH.
Mar 15 '11 at 17:56
shrinkheight{} indeed did help, thanks! Finding an optimal pt value may be a problem later (as I generate these docs programatically), but for now I will use a sufficiently big value and hope for the best.
– JDoe
Mar 15 '11 at 21:16
I tested the shrinkheight{} command more thoroughly, it gives excellent results, problem solved, thanks again.
– JDoe
Mar 16 '11 at 14:27
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
As Martin points out, this is related to the booktabs rules. There really shouldn't be a midrule between every line, but if you want to do it anyway, here's one way to fix the problem.
documentclass[a4paper,11pt]{article}
usepackage[utf8]{inputenc}
usepackage{supertabular}
usepackage{array}
usepackage{booktabs}
usepackage{geometry}
usepackage{etoolbox}
tabletail{bottomrule}
tablelasttail{bottomrule}
tablehead{%
toprule
multicolumn{2}{c}{textbf{huge ``Head row''}}%
\ midrule
}
pagestyle{empty}%
overfullrule5pt
makeatletter
apptoestimate@lineht{%
globaladvanceST@lineht byaboverulesep
globaladvanceST@lineht bybelowrulesep
}
makeatother
begin{document}
begin{supertabular}{@{}p{7cm}@{extracolsep{fill}}p{7cm}@{}}
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
end{supertabular}
end{document}
The geometry package is just because your table was too wide and it was giving overfull rules. Changing the margins fixes that. The real fix here has to do with how supertabular estimates the height of each line. It uses estimate@lineht to compute the height of a stretched line. Since you are using midrule between every line, we can simply increase the estimate of the line height by incrementing ST@lineht by aboverulesep + belowrulesep.
The real fix is to omit the midrules. It makes the table look much better.
thanks, but this solution doesn't work when i have multi-line rows. For example change all foo and bar to some longer text, the blank page gets inserted yet again. Is it possible to solve this? I need the midrules, or maybe I just use LaTeX the wrong way here.
– JDoe
Mar 15 '11 at 13:54
1
@JDoe: The documentation says, "When the last p-arg on a page gets more than 4 lines (probably even more than 3 lines) it will result in an overfullvbox. Also some combinations ofbaselinestretcharraystretchand a large font may lead to one line too much." Maybe you're hitting that? It suggests that "[a] quick but not very elegant solution: shrink the allowed height of the table with the commandshrinkheight{...pt}after the first \ of the supertabular."
– TH.
Mar 15 '11 at 17:56
shrinkheight{} indeed did help, thanks! Finding an optimal pt value may be a problem later (as I generate these docs programatically), but for now I will use a sufficiently big value and hope for the best.
– JDoe
Mar 15 '11 at 21:16
I tested the shrinkheight{} command more thoroughly, it gives excellent results, problem solved, thanks again.
– JDoe
Mar 16 '11 at 14:27
add a comment |
up vote
3
down vote
accepted
As Martin points out, this is related to the booktabs rules. There really shouldn't be a midrule between every line, but if you want to do it anyway, here's one way to fix the problem.
documentclass[a4paper,11pt]{article}
usepackage[utf8]{inputenc}
usepackage{supertabular}
usepackage{array}
usepackage{booktabs}
usepackage{geometry}
usepackage{etoolbox}
tabletail{bottomrule}
tablelasttail{bottomrule}
tablehead{%
toprule
multicolumn{2}{c}{textbf{huge ``Head row''}}%
\ midrule
}
pagestyle{empty}%
overfullrule5pt
makeatletter
apptoestimate@lineht{%
globaladvanceST@lineht byaboverulesep
globaladvanceST@lineht bybelowrulesep
}
makeatother
begin{document}
begin{supertabular}{@{}p{7cm}@{extracolsep{fill}}p{7cm}@{}}
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
end{supertabular}
end{document}
The geometry package is just because your table was too wide and it was giving overfull rules. Changing the margins fixes that. The real fix here has to do with how supertabular estimates the height of each line. It uses estimate@lineht to compute the height of a stretched line. Since you are using midrule between every line, we can simply increase the estimate of the line height by incrementing ST@lineht by aboverulesep + belowrulesep.
The real fix is to omit the midrules. It makes the table look much better.
thanks, but this solution doesn't work when i have multi-line rows. For example change all foo and bar to some longer text, the blank page gets inserted yet again. Is it possible to solve this? I need the midrules, or maybe I just use LaTeX the wrong way here.
– JDoe
Mar 15 '11 at 13:54
1
@JDoe: The documentation says, "When the last p-arg on a page gets more than 4 lines (probably even more than 3 lines) it will result in an overfullvbox. Also some combinations ofbaselinestretcharraystretchand a large font may lead to one line too much." Maybe you're hitting that? It suggests that "[a] quick but not very elegant solution: shrink the allowed height of the table with the commandshrinkheight{...pt}after the first \ of the supertabular."
– TH.
Mar 15 '11 at 17:56
shrinkheight{} indeed did help, thanks! Finding an optimal pt value may be a problem later (as I generate these docs programatically), but for now I will use a sufficiently big value and hope for the best.
– JDoe
Mar 15 '11 at 21:16
I tested the shrinkheight{} command more thoroughly, it gives excellent results, problem solved, thanks again.
– JDoe
Mar 16 '11 at 14:27
add a comment |
up vote
3
down vote
accepted
up vote
3
down vote
accepted
As Martin points out, this is related to the booktabs rules. There really shouldn't be a midrule between every line, but if you want to do it anyway, here's one way to fix the problem.
documentclass[a4paper,11pt]{article}
usepackage[utf8]{inputenc}
usepackage{supertabular}
usepackage{array}
usepackage{booktabs}
usepackage{geometry}
usepackage{etoolbox}
tabletail{bottomrule}
tablelasttail{bottomrule}
tablehead{%
toprule
multicolumn{2}{c}{textbf{huge ``Head row''}}%
\ midrule
}
pagestyle{empty}%
overfullrule5pt
makeatletter
apptoestimate@lineht{%
globaladvanceST@lineht byaboverulesep
globaladvanceST@lineht bybelowrulesep
}
makeatother
begin{document}
begin{supertabular}{@{}p{7cm}@{extracolsep{fill}}p{7cm}@{}}
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
end{supertabular}
end{document}
The geometry package is just because your table was too wide and it was giving overfull rules. Changing the margins fixes that. The real fix here has to do with how supertabular estimates the height of each line. It uses estimate@lineht to compute the height of a stretched line. Since you are using midrule between every line, we can simply increase the estimate of the line height by incrementing ST@lineht by aboverulesep + belowrulesep.
The real fix is to omit the midrules. It makes the table look much better.
As Martin points out, this is related to the booktabs rules. There really shouldn't be a midrule between every line, but if you want to do it anyway, here's one way to fix the problem.
documentclass[a4paper,11pt]{article}
usepackage[utf8]{inputenc}
usepackage{supertabular}
usepackage{array}
usepackage{booktabs}
usepackage{geometry}
usepackage{etoolbox}
tabletail{bottomrule}
tablelasttail{bottomrule}
tablehead{%
toprule
multicolumn{2}{c}{textbf{huge ``Head row''}}%
\ midrule
}
pagestyle{empty}%
overfullrule5pt
makeatletter
apptoestimate@lineht{%
globaladvanceST@lineht byaboverulesep
globaladvanceST@lineht bybelowrulesep
}
makeatother
begin{document}
begin{supertabular}{@{}p{7cm}@{extracolsep{fill}}p{7cm}@{}}
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
foo & bar \ midrule
end{supertabular}
end{document}
The geometry package is just because your table was too wide and it was giving overfull rules. Changing the margins fixes that. The real fix here has to do with how supertabular estimates the height of each line. It uses estimate@lineht to compute the height of a stretched line. Since you are using midrule between every line, we can simply increase the estimate of the line height by incrementing ST@lineht by aboverulesep + belowrulesep.
The real fix is to omit the midrules. It makes the table look much better.
answered Mar 15 '11 at 11:36
TH.
47k10128195
47k10128195
thanks, but this solution doesn't work when i have multi-line rows. For example change all foo and bar to some longer text, the blank page gets inserted yet again. Is it possible to solve this? I need the midrules, or maybe I just use LaTeX the wrong way here.
– JDoe
Mar 15 '11 at 13:54
1
@JDoe: The documentation says, "When the last p-arg on a page gets more than 4 lines (probably even more than 3 lines) it will result in an overfullvbox. Also some combinations ofbaselinestretcharraystretchand a large font may lead to one line too much." Maybe you're hitting that? It suggests that "[a] quick but not very elegant solution: shrink the allowed height of the table with the commandshrinkheight{...pt}after the first \ of the supertabular."
– TH.
Mar 15 '11 at 17:56
shrinkheight{} indeed did help, thanks! Finding an optimal pt value may be a problem later (as I generate these docs programatically), but for now I will use a sufficiently big value and hope for the best.
– JDoe
Mar 15 '11 at 21:16
I tested the shrinkheight{} command more thoroughly, it gives excellent results, problem solved, thanks again.
– JDoe
Mar 16 '11 at 14:27
add a comment |
thanks, but this solution doesn't work when i have multi-line rows. For example change all foo and bar to some longer text, the blank page gets inserted yet again. Is it possible to solve this? I need the midrules, or maybe I just use LaTeX the wrong way here.
– JDoe
Mar 15 '11 at 13:54
1
@JDoe: The documentation says, "When the last p-arg on a page gets more than 4 lines (probably even more than 3 lines) it will result in an overfullvbox. Also some combinations ofbaselinestretcharraystretchand a large font may lead to one line too much." Maybe you're hitting that? It suggests that "[a] quick but not very elegant solution: shrink the allowed height of the table with the commandshrinkheight{...pt}after the first \ of the supertabular."
– TH.
Mar 15 '11 at 17:56
shrinkheight{} indeed did help, thanks! Finding an optimal pt value may be a problem later (as I generate these docs programatically), but for now I will use a sufficiently big value and hope for the best.
– JDoe
Mar 15 '11 at 21:16
I tested the shrinkheight{} command more thoroughly, it gives excellent results, problem solved, thanks again.
– JDoe
Mar 16 '11 at 14:27
thanks, but this solution doesn't work when i have multi-line rows. For example change all foo and bar to some longer text, the blank page gets inserted yet again. Is it possible to solve this? I need the midrules, or maybe I just use LaTeX the wrong way here.
– JDoe
Mar 15 '11 at 13:54
thanks, but this solution doesn't work when i have multi-line rows. For example change all foo and bar to some longer text, the blank page gets inserted yet again. Is it possible to solve this? I need the midrules, or maybe I just use LaTeX the wrong way here.
– JDoe
Mar 15 '11 at 13:54
1
1
@JDoe: The documentation says, "When the last p-arg on a page gets more than 4 lines (probably even more than 3 lines) it will result in an overfull
vbox. Also some combinations of baselinestretch arraystretch and a large font may lead to one line too much." Maybe you're hitting that? It suggests that "[a] quick but not very elegant solution: shrink the allowed height of the table with the command shrinkheight{...pt} after the first \ of the supertabular."– TH.
Mar 15 '11 at 17:56
@JDoe: The documentation says, "When the last p-arg on a page gets more than 4 lines (probably even more than 3 lines) it will result in an overfull
vbox. Also some combinations of baselinestretch arraystretch and a large font may lead to one line too much." Maybe you're hitting that? It suggests that "[a] quick but not very elegant solution: shrink the allowed height of the table with the command shrinkheight{...pt} after the first \ of the supertabular."– TH.
Mar 15 '11 at 17:56
shrinkheight{} indeed did help, thanks! Finding an optimal pt value may be a problem later (as I generate these docs programatically), but for now I will use a sufficiently big value and hope for the best.
– JDoe
Mar 15 '11 at 21:16
shrinkheight{} indeed did help, thanks! Finding an optimal pt value may be a problem later (as I generate these docs programatically), but for now I will use a sufficiently big value and hope for the best.
– JDoe
Mar 15 '11 at 21:16
I tested the shrinkheight{} command more thoroughly, it gives excellent results, problem solved, thanks again.
– JDoe
Mar 16 '11 at 14:27
I tested the shrinkheight{} command more thoroughly, it gives excellent results, problem solved, thanks again.
– JDoe
Mar 16 '11 at 14:27
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f13456%2funwanted-blank-page-inserted-before-tabular%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
1
Welcome to tex.SX! I've inserted the example code into your question, I hope you don't mind.
– Jake
Mar 14 '11 at 22:12
Of course I don't, thank you.
– JDoe
Mar 14 '11 at 22:20
@JDoe: Welcome to TeX.SX. If you add
@followed by the username to your comments the user gets notified. This only works for the first mentioned user. The author of the commented question or answer is always notified.– Martin Scharrer♦
Mar 14 '11 at 22:28
@JDoe: I had a look on your file and it seems related to the table rules (
toprule,midrule, etc.). After removing them the page break is gone. I will post an answer if and when I find how to fix this without removing the rules.– Martin Scharrer♦
Mar 14 '11 at 22:30
2
@Martin: FYI, Jake did get a notification of JDoe's comment.
– Hendrik Vogt
Mar 15 '11 at 8:02