Table mislabeled as figure
I have an image and a table and they need to appear in the same page. The way I'm doing that right now is by wrapping them both in a figure. The problem I'm having is I'm trying to reference the table and LaTex keeps on labeling it as a figure.
documentclass[12pt]{article}
usepackage[margin=1in]{geometry}
usepackage[colorlinks]{hyperref}
usepackage[singlelinecheck=false]{caption}
usepackage{booktabs}
usepackage{threeparttable}
usepackage{graphicx}
graphicspath{ {./images/} }
begin{document}
stuff stuff autoref{table:nmr_nitro} blah blah.
begin{figure}
includegraphics[scale=0.4]{3-nitrobenzonitrile.png}
captionof{figure}{3-Nitrobenzonitrile with hydrogens assignments}
label{figure:nmr_fig_nitro}
begin{threeparttable}
addtocounter{footnote}{1}
captionof{table}{NMR of 3-nitrobenzonitrile}
label{table:nmr_nitro}
begin{tabular}{ c c }
toprule
textbf{Some Data} & textbf{Assignment} \
midrule
8.542; 2.0 (2H); m; & A, B \
7.960; 2.1 (2H); m; & C, D \
bottomrule
end{tabular}
end{threeparttable}
end{figure}
end{document}
I found two solutions-ish to this problem. The first is to use manual instead of autoref and just manually label all my links. The other is to put captionsetup{type=table}
above my table caption but this seems like a hack. Is there any builtin, smooth way to do this?
tables hyperref captions ref autoref
New contributor
add a comment |
I have an image and a table and they need to appear in the same page. The way I'm doing that right now is by wrapping them both in a figure. The problem I'm having is I'm trying to reference the table and LaTex keeps on labeling it as a figure.
documentclass[12pt]{article}
usepackage[margin=1in]{geometry}
usepackage[colorlinks]{hyperref}
usepackage[singlelinecheck=false]{caption}
usepackage{booktabs}
usepackage{threeparttable}
usepackage{graphicx}
graphicspath{ {./images/} }
begin{document}
stuff stuff autoref{table:nmr_nitro} blah blah.
begin{figure}
includegraphics[scale=0.4]{3-nitrobenzonitrile.png}
captionof{figure}{3-Nitrobenzonitrile with hydrogens assignments}
label{figure:nmr_fig_nitro}
begin{threeparttable}
addtocounter{footnote}{1}
captionof{table}{NMR of 3-nitrobenzonitrile}
label{table:nmr_nitro}
begin{tabular}{ c c }
toprule
textbf{Some Data} & textbf{Assignment} \
midrule
8.542; 2.0 (2H); m; & A, B \
7.960; 2.1 (2H); m; & C, D \
bottomrule
end{tabular}
end{threeparttable}
end{figure}
end{document}
I found two solutions-ish to this problem. The first is to use manual instead of autoref and just manually label all my links. The other is to put captionsetup{type=table}
above my table caption but this seems like a hack. Is there any builtin, smooth way to do this?
tables hyperref captions ref autoref
New contributor
add a comment |
I have an image and a table and they need to appear in the same page. The way I'm doing that right now is by wrapping them both in a figure. The problem I'm having is I'm trying to reference the table and LaTex keeps on labeling it as a figure.
documentclass[12pt]{article}
usepackage[margin=1in]{geometry}
usepackage[colorlinks]{hyperref}
usepackage[singlelinecheck=false]{caption}
usepackage{booktabs}
usepackage{threeparttable}
usepackage{graphicx}
graphicspath{ {./images/} }
begin{document}
stuff stuff autoref{table:nmr_nitro} blah blah.
begin{figure}
includegraphics[scale=0.4]{3-nitrobenzonitrile.png}
captionof{figure}{3-Nitrobenzonitrile with hydrogens assignments}
label{figure:nmr_fig_nitro}
begin{threeparttable}
addtocounter{footnote}{1}
captionof{table}{NMR of 3-nitrobenzonitrile}
label{table:nmr_nitro}
begin{tabular}{ c c }
toprule
textbf{Some Data} & textbf{Assignment} \
midrule
8.542; 2.0 (2H); m; & A, B \
7.960; 2.1 (2H); m; & C, D \
bottomrule
end{tabular}
end{threeparttable}
end{figure}
end{document}
I found two solutions-ish to this problem. The first is to use manual instead of autoref and just manually label all my links. The other is to put captionsetup{type=table}
above my table caption but this seems like a hack. Is there any builtin, smooth way to do this?
tables hyperref captions ref autoref
New contributor
I have an image and a table and they need to appear in the same page. The way I'm doing that right now is by wrapping them both in a figure. The problem I'm having is I'm trying to reference the table and LaTex keeps on labeling it as a figure.
documentclass[12pt]{article}
usepackage[margin=1in]{geometry}
usepackage[colorlinks]{hyperref}
usepackage[singlelinecheck=false]{caption}
usepackage{booktabs}
usepackage{threeparttable}
usepackage{graphicx}
graphicspath{ {./images/} }
begin{document}
stuff stuff autoref{table:nmr_nitro} blah blah.
begin{figure}
includegraphics[scale=0.4]{3-nitrobenzonitrile.png}
captionof{figure}{3-Nitrobenzonitrile with hydrogens assignments}
label{figure:nmr_fig_nitro}
begin{threeparttable}
addtocounter{footnote}{1}
captionof{table}{NMR of 3-nitrobenzonitrile}
label{table:nmr_nitro}
begin{tabular}{ c c }
toprule
textbf{Some Data} & textbf{Assignment} \
midrule
8.542; 2.0 (2H); m; & A, B \
7.960; 2.1 (2H); m; & C, D \
bottomrule
end{tabular}
end{threeparttable}
end{figure}
end{document}
I found two solutions-ish to this problem. The first is to use manual instead of autoref and just manually label all my links. The other is to put captionsetup{type=table}
above my table caption but this seems like a hack. Is there any builtin, smooth way to do this?
tables hyperref captions ref autoref
tables hyperref captions ref autoref
New contributor
New contributor
New contributor
asked 2 hours ago
FailureGodFailureGod
252
252
New contributor
New contributor
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
I think an easier solution would be to change caption
to capt-of
:
From:
usepackage[singlelinecheck=false]{caption}
To:
usepackage{capt-of}
add a comment |
This is because you put the table in a figure
environment. Since you are already using the caption
package, you may e.g. do
documentclass[12pt]{article}
usepackage[margin=1in]{geometry}
usepackage[colorlinks]{hyperref}
usepackage[singlelinecheck=false]{caption}
usepackage{booktabs}
usepackage{threeparttable}
usepackage{graphicx}
graphicspath{ {./images/} }
begin{document}
stuff stuff autoref{table:nmr_nitro} blah blah.
noindent
begin{minipage}{textwidth}
centering
includegraphics[scale=0.4]{example-image-a}
captionof{figure}{3-Nitrobenzonitrile with hydrogens assignments}
label{figure:nmr_fig_nitro}
addtocounter{footnote}{1}
captionof{table}{NMR of 3-nitrobenzonitrile}
label{table:nmr_nitro}
begin{threeparttable}
begin{tabular}{ c c }
toprule
textbf{Some Data} & textbf{Assignment} \
midrule
8.542; 2.0 (2H); m; & A, B \
7.960; 2.1 (2H); m; & C, D \
bottomrule
end{tabular}
end{threeparttable}
end{minipage}
end{document}
This doesnt work because I need the image and the table to be guaranteed to be on the same page.
– FailureGod
1 hour ago
@FailureGod You can certainly make them appear on one side. The question is if you want them to float or be fixed at a given page.
– marmot
1 hour ago
@FailureGod The you could for instance wrap them in aminipage
or in atabular
, depending on your layout preferences.
– marmot
1 hour ago
I need them to appear at a specific place in text. Like ''' Some text <image and figure> more text ''' where the image and the figure are not broken by a pagebreak.
– FailureGod
1 hour ago
@FailureGod I added something of that sort.
– marmot
1 hour ago
|
show 1 more 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
});
}
});
FailureGod is a new contributor. Be nice, and check out our Code of Conduct.
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%2f483087%2ftable-mislabeled-as-figure%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I think an easier solution would be to change caption
to capt-of
:
From:
usepackage[singlelinecheck=false]{caption}
To:
usepackage{capt-of}
add a comment |
I think an easier solution would be to change caption
to capt-of
:
From:
usepackage[singlelinecheck=false]{caption}
To:
usepackage{capt-of}
add a comment |
I think an easier solution would be to change caption
to capt-of
:
From:
usepackage[singlelinecheck=false]{caption}
To:
usepackage{capt-of}
I think an easier solution would be to change caption
to capt-of
:
From:
usepackage[singlelinecheck=false]{caption}
To:
usepackage{capt-of}
answered 2 hours ago
Guilherme SilvaGuilherme Silva
184
184
add a comment |
add a comment |
This is because you put the table in a figure
environment. Since you are already using the caption
package, you may e.g. do
documentclass[12pt]{article}
usepackage[margin=1in]{geometry}
usepackage[colorlinks]{hyperref}
usepackage[singlelinecheck=false]{caption}
usepackage{booktabs}
usepackage{threeparttable}
usepackage{graphicx}
graphicspath{ {./images/} }
begin{document}
stuff stuff autoref{table:nmr_nitro} blah blah.
noindent
begin{minipage}{textwidth}
centering
includegraphics[scale=0.4]{example-image-a}
captionof{figure}{3-Nitrobenzonitrile with hydrogens assignments}
label{figure:nmr_fig_nitro}
addtocounter{footnote}{1}
captionof{table}{NMR of 3-nitrobenzonitrile}
label{table:nmr_nitro}
begin{threeparttable}
begin{tabular}{ c c }
toprule
textbf{Some Data} & textbf{Assignment} \
midrule
8.542; 2.0 (2H); m; & A, B \
7.960; 2.1 (2H); m; & C, D \
bottomrule
end{tabular}
end{threeparttable}
end{minipage}
end{document}
This doesnt work because I need the image and the table to be guaranteed to be on the same page.
– FailureGod
1 hour ago
@FailureGod You can certainly make them appear on one side. The question is if you want them to float or be fixed at a given page.
– marmot
1 hour ago
@FailureGod The you could for instance wrap them in aminipage
or in atabular
, depending on your layout preferences.
– marmot
1 hour ago
I need them to appear at a specific place in text. Like ''' Some text <image and figure> more text ''' where the image and the figure are not broken by a pagebreak.
– FailureGod
1 hour ago
@FailureGod I added something of that sort.
– marmot
1 hour ago
|
show 1 more comment
This is because you put the table in a figure
environment. Since you are already using the caption
package, you may e.g. do
documentclass[12pt]{article}
usepackage[margin=1in]{geometry}
usepackage[colorlinks]{hyperref}
usepackage[singlelinecheck=false]{caption}
usepackage{booktabs}
usepackage{threeparttable}
usepackage{graphicx}
graphicspath{ {./images/} }
begin{document}
stuff stuff autoref{table:nmr_nitro} blah blah.
noindent
begin{minipage}{textwidth}
centering
includegraphics[scale=0.4]{example-image-a}
captionof{figure}{3-Nitrobenzonitrile with hydrogens assignments}
label{figure:nmr_fig_nitro}
addtocounter{footnote}{1}
captionof{table}{NMR of 3-nitrobenzonitrile}
label{table:nmr_nitro}
begin{threeparttable}
begin{tabular}{ c c }
toprule
textbf{Some Data} & textbf{Assignment} \
midrule
8.542; 2.0 (2H); m; & A, B \
7.960; 2.1 (2H); m; & C, D \
bottomrule
end{tabular}
end{threeparttable}
end{minipage}
end{document}
This doesnt work because I need the image and the table to be guaranteed to be on the same page.
– FailureGod
1 hour ago
@FailureGod You can certainly make them appear on one side. The question is if you want them to float or be fixed at a given page.
– marmot
1 hour ago
@FailureGod The you could for instance wrap them in aminipage
or in atabular
, depending on your layout preferences.
– marmot
1 hour ago
I need them to appear at a specific place in text. Like ''' Some text <image and figure> more text ''' where the image and the figure are not broken by a pagebreak.
– FailureGod
1 hour ago
@FailureGod I added something of that sort.
– marmot
1 hour ago
|
show 1 more comment
This is because you put the table in a figure
environment. Since you are already using the caption
package, you may e.g. do
documentclass[12pt]{article}
usepackage[margin=1in]{geometry}
usepackage[colorlinks]{hyperref}
usepackage[singlelinecheck=false]{caption}
usepackage{booktabs}
usepackage{threeparttable}
usepackage{graphicx}
graphicspath{ {./images/} }
begin{document}
stuff stuff autoref{table:nmr_nitro} blah blah.
noindent
begin{minipage}{textwidth}
centering
includegraphics[scale=0.4]{example-image-a}
captionof{figure}{3-Nitrobenzonitrile with hydrogens assignments}
label{figure:nmr_fig_nitro}
addtocounter{footnote}{1}
captionof{table}{NMR of 3-nitrobenzonitrile}
label{table:nmr_nitro}
begin{threeparttable}
begin{tabular}{ c c }
toprule
textbf{Some Data} & textbf{Assignment} \
midrule
8.542; 2.0 (2H); m; & A, B \
7.960; 2.1 (2H); m; & C, D \
bottomrule
end{tabular}
end{threeparttable}
end{minipage}
end{document}
This is because you put the table in a figure
environment. Since you are already using the caption
package, you may e.g. do
documentclass[12pt]{article}
usepackage[margin=1in]{geometry}
usepackage[colorlinks]{hyperref}
usepackage[singlelinecheck=false]{caption}
usepackage{booktabs}
usepackage{threeparttable}
usepackage{graphicx}
graphicspath{ {./images/} }
begin{document}
stuff stuff autoref{table:nmr_nitro} blah blah.
noindent
begin{minipage}{textwidth}
centering
includegraphics[scale=0.4]{example-image-a}
captionof{figure}{3-Nitrobenzonitrile with hydrogens assignments}
label{figure:nmr_fig_nitro}
addtocounter{footnote}{1}
captionof{table}{NMR of 3-nitrobenzonitrile}
label{table:nmr_nitro}
begin{threeparttable}
begin{tabular}{ c c }
toprule
textbf{Some Data} & textbf{Assignment} \
midrule
8.542; 2.0 (2H); m; & A, B \
7.960; 2.1 (2H); m; & C, D \
bottomrule
end{tabular}
end{threeparttable}
end{minipage}
end{document}
edited 1 hour ago
answered 2 hours ago
marmotmarmot
114k5145276
114k5145276
This doesnt work because I need the image and the table to be guaranteed to be on the same page.
– FailureGod
1 hour ago
@FailureGod You can certainly make them appear on one side. The question is if you want them to float or be fixed at a given page.
– marmot
1 hour ago
@FailureGod The you could for instance wrap them in aminipage
or in atabular
, depending on your layout preferences.
– marmot
1 hour ago
I need them to appear at a specific place in text. Like ''' Some text <image and figure> more text ''' where the image and the figure are not broken by a pagebreak.
– FailureGod
1 hour ago
@FailureGod I added something of that sort.
– marmot
1 hour ago
|
show 1 more comment
This doesnt work because I need the image and the table to be guaranteed to be on the same page.
– FailureGod
1 hour ago
@FailureGod You can certainly make them appear on one side. The question is if you want them to float or be fixed at a given page.
– marmot
1 hour ago
@FailureGod The you could for instance wrap them in aminipage
or in atabular
, depending on your layout preferences.
– marmot
1 hour ago
I need them to appear at a specific place in text. Like ''' Some text <image and figure> more text ''' where the image and the figure are not broken by a pagebreak.
– FailureGod
1 hour ago
@FailureGod I added something of that sort.
– marmot
1 hour ago
This doesnt work because I need the image and the table to be guaranteed to be on the same page.
– FailureGod
1 hour ago
This doesnt work because I need the image and the table to be guaranteed to be on the same page.
– FailureGod
1 hour ago
@FailureGod You can certainly make them appear on one side. The question is if you want them to float or be fixed at a given page.
– marmot
1 hour ago
@FailureGod You can certainly make them appear on one side. The question is if you want them to float or be fixed at a given page.
– marmot
1 hour ago
@FailureGod The you could for instance wrap them in a
minipage
or in a tabular
, depending on your layout preferences.– marmot
1 hour ago
@FailureGod The you could for instance wrap them in a
minipage
or in a tabular
, depending on your layout preferences.– marmot
1 hour ago
I need them to appear at a specific place in text. Like ''' Some text <image and figure> more text ''' where the image and the figure are not broken by a pagebreak.
– FailureGod
1 hour ago
I need them to appear at a specific place in text. Like ''' Some text <image and figure> more text ''' where the image and the figure are not broken by a pagebreak.
– FailureGod
1 hour ago
@FailureGod I added something of that sort.
– marmot
1 hour ago
@FailureGod I added something of that sort.
– marmot
1 hour ago
|
show 1 more comment
FailureGod is a new contributor. Be nice, and check out our Code of Conduct.
FailureGod is a new contributor. Be nice, and check out our Code of Conduct.
FailureGod is a new contributor. Be nice, and check out our Code of Conduct.
FailureGod is a new contributor. Be nice, and check out our Code of Conduct.
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%2f483087%2ftable-mislabeled-as-figure%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