Caption does not fill the whole column
I am using the ReVTeX 4.1 template (for AIP journals), and while I was trying to add figures I noticed that the caption does not fill the whole column.
Is there a way to make caption fill the lines (and hence the column) as in the abstract or any other text in the body?
UPDATE:
I found out the problem: For some reason, loading the the subcaption package ruins the formatting of the figures captions in that they become unjustified & do not fill the whole line.
Example:
documentclass[aip,reprint]{revtex4-1}
draft
usepackage{graphicx}
usepackage{epstopdf}
usepackage{gensymb}
usepackage{amsmath}
usepackage{subcaption}
captionsetup{labelsep = period}
usepackage{lipsum}
begin{document}
title{Draft}
author{LaTeX User}
date{today}
begin{abstract}
lipsum[1]
end{abstract}
maketitle
begin{figure}[h!]
centering
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-a}
caption{}vspace{0.3cm}
label{fig:1a}
end{subfigure}
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-b}
caption{}
label{fig:1b}
end{subfigure}
captionsetup{justification = justified,
singlelinecheck = false}
caption{lipsum[1]}
label{fig:1}
end{figure}
end{document}
captions subcaption revtex
add a comment |
I am using the ReVTeX 4.1 template (for AIP journals), and while I was trying to add figures I noticed that the caption does not fill the whole column.
Is there a way to make caption fill the lines (and hence the column) as in the abstract or any other text in the body?
UPDATE:
I found out the problem: For some reason, loading the the subcaption package ruins the formatting of the figures captions in that they become unjustified & do not fill the whole line.
Example:
documentclass[aip,reprint]{revtex4-1}
draft
usepackage{graphicx}
usepackage{epstopdf}
usepackage{gensymb}
usepackage{amsmath}
usepackage{subcaption}
captionsetup{labelsep = period}
usepackage{lipsum}
begin{document}
title{Draft}
author{LaTeX User}
date{today}
begin{abstract}
lipsum[1]
end{abstract}
maketitle
begin{figure}[h!]
centering
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-a}
caption{}vspace{0.3cm}
label{fig:1a}
end{subfigure}
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-b}
caption{}
label{fig:1b}
end{subfigure}
captionsetup{justification = justified,
singlelinecheck = false}
caption{lipsum[1]}
label{fig:1}
end{figure}
end{document}
captions subcaption revtex
If thereprint
document class option is set,revtex4-1
typesets the document in two-column mode by default. Are you trying to use the full width of the textblock, i.e., both columns, for the figures and their caption(s)? If so, you should be using afigure*
environment. Please clarify your typesetting needs.
– Mico
Jul 18 '18 at 6:50
add a comment |
I am using the ReVTeX 4.1 template (for AIP journals), and while I was trying to add figures I noticed that the caption does not fill the whole column.
Is there a way to make caption fill the lines (and hence the column) as in the abstract or any other text in the body?
UPDATE:
I found out the problem: For some reason, loading the the subcaption package ruins the formatting of the figures captions in that they become unjustified & do not fill the whole line.
Example:
documentclass[aip,reprint]{revtex4-1}
draft
usepackage{graphicx}
usepackage{epstopdf}
usepackage{gensymb}
usepackage{amsmath}
usepackage{subcaption}
captionsetup{labelsep = period}
usepackage{lipsum}
begin{document}
title{Draft}
author{LaTeX User}
date{today}
begin{abstract}
lipsum[1]
end{abstract}
maketitle
begin{figure}[h!]
centering
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-a}
caption{}vspace{0.3cm}
label{fig:1a}
end{subfigure}
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-b}
caption{}
label{fig:1b}
end{subfigure}
captionsetup{justification = justified,
singlelinecheck = false}
caption{lipsum[1]}
label{fig:1}
end{figure}
end{document}
captions subcaption revtex
I am using the ReVTeX 4.1 template (for AIP journals), and while I was trying to add figures I noticed that the caption does not fill the whole column.
Is there a way to make caption fill the lines (and hence the column) as in the abstract or any other text in the body?
UPDATE:
I found out the problem: For some reason, loading the the subcaption package ruins the formatting of the figures captions in that they become unjustified & do not fill the whole line.
Example:
documentclass[aip,reprint]{revtex4-1}
draft
usepackage{graphicx}
usepackage{epstopdf}
usepackage{gensymb}
usepackage{amsmath}
usepackage{subcaption}
captionsetup{labelsep = period}
usepackage{lipsum}
begin{document}
title{Draft}
author{LaTeX User}
date{today}
begin{abstract}
lipsum[1]
end{abstract}
maketitle
begin{figure}[h!]
centering
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-a}
caption{}vspace{0.3cm}
label{fig:1a}
end{subfigure}
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-b}
caption{}
label{fig:1b}
end{subfigure}
captionsetup{justification = justified,
singlelinecheck = false}
caption{lipsum[1]}
label{fig:1}
end{figure}
end{document}
captions subcaption revtex
captions subcaption revtex
edited Jul 18 '18 at 17:57
Meshal
asked Jul 17 '18 at 23:40
MeshalMeshal
1494
1494
If thereprint
document class option is set,revtex4-1
typesets the document in two-column mode by default. Are you trying to use the full width of the textblock, i.e., both columns, for the figures and their caption(s)? If so, you should be using afigure*
environment. Please clarify your typesetting needs.
– Mico
Jul 18 '18 at 6:50
add a comment |
If thereprint
document class option is set,revtex4-1
typesets the document in two-column mode by default. Are you trying to use the full width of the textblock, i.e., both columns, for the figures and their caption(s)? If so, you should be using afigure*
environment. Please clarify your typesetting needs.
– Mico
Jul 18 '18 at 6:50
If the
reprint
document class option is set, revtex4-1
typesets the document in two-column mode by default. Are you trying to use the full width of the textblock, i.e., both columns, for the figures and their caption(s)? If so, you should be using a figure*
environment. Please clarify your typesetting needs.– Mico
Jul 18 '18 at 6:50
If the
reprint
document class option is set, revtex4-1
typesets the document in two-column mode by default. Are you trying to use the full width of the textblock, i.e., both columns, for the figures and their caption(s)? If so, you should be using a figure*
environment. Please clarify your typesetting needs.– Mico
Jul 18 '18 at 6:50
add a comment |
1 Answer
1
active
oldest
votes
For some unknown reason, the figure is formatted in onecolumn mode.
BTW, you probably shouldn't do this. Revtex4-1 uses unhbox
for a reason (like deliberately undoing the caption package formatting).
documentclass[aip,reprint]{revtex4-1}
draft
usepackage{graphicx}
usepackage{epstopdf}
usepackage{gensymb}
usepackage{amsmath}
usepackage{caption,subcaption}
captionsetup{labelsep = period}
makeatletter
longdef@makecaption#1#2{%
par
vskipabovecaptionskip
begingroup
smallrmfamily
sbox@tempboxa{%
let\heading@cr
@make@capt@title{#1}{#2}%
}%
@ifdim{wd@tempboxa >hsize}{%
begingroup
samepage
flushing
letfootnote@footnotemark@gobble
@make@capt@title{#1}{#2}par
endgroup
}{%
global @minipagefalse
hb@xt@hsize{hfilunvbox@tempboxahfil}% replaced unhbox with unvbox
}%
endgroup
vskipbelowcaptionskip
}%
makeatother
usepackage{lipsum}
begin{document}
title{Draft}
author{LaTeX User}
date{today}
begin{abstract}
lipsum[1]
end{abstract}
maketitle
begin{figure}[h!]
centering
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-a}
caption{}vspace{0.3cm}
label{fig:1a}
end{subfigure}
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-b}
caption{}
label{fig:1b}
end{subfigure}
caption{lipsum[1]}
label{fig:1}
end{figure}
end{document}
This shows how to put the images and caption side-by-side. I converted the figure into a minipage and moved it inside the abstract. This is slightly more adaptable than an [H] figure using the float package.
documentclass[aip,reprint]{revtex4-1}
draft
usepackage{graphicx}
usepackage{epstopdf}
usepackage{gensymb}
usepackage{amsmath}
usepackage{subcaption}
captionsetup{labelsep = period}
makeatletter
newcommand{setcaptype}[1]{edef@captype{#1}}
longdef@makecaption#1#2{%
par
vskipabovecaptionskip
begingroup
smallrmfamily
sbox@tempboxa{%
let\heading@cr
@make@capt@title{#1}{#2}%
}%
@ifdim{wd@tempboxa >hsize}{%
begingroup
samepage
flushing
letfootnote@footnotemark@gobble
@make@capt@title{#1}{#2}par
endgroup
}{%
global @minipagefalse
hb@xt@hsize{hfilunvbox@tempboxahfil}% replaced unhbox with unvbox
}%
endgroup
vskipbelowcaptionskip
}%
makeatother
usepackage{lipsum}
begin{document}
title{Draft}
author{LaTeX User}
date{today}
begin{abstract}
lipsum[1]
noindentbegin{minipage}{dimexpr textwidth-leftskip-rightskip}
hrule% DEBUG - show widfth of minipage
setcaptype{figure}%
vspace*{intextsep}%
begin{minipage}[b]{0.55textwidth}
begin{subfigure}[b]{textwidth}
centering
includegraphics[width=0.5textwidth]{example-image-a}
caption{}vspace{0.3cm}
label{fig:1a}
end{subfigure}
begin{subfigure}[b]{textwidth}
centering
includegraphics[width=0.5textwidth]{example-image-b}
caption{}
label{fig:1b}
end{subfigure}
end{minipage}hfillbegin{minipage}[b]{0.4textwidth}
caption{lipsum[1]}
label{fig:1}
end{minipage}
vspace*{intextsep}
end{minipage}
end{abstract}
maketitle
lipsum[1]
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%2f442124%2fcaption-does-not-fill-the-whole-column%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
For some unknown reason, the figure is formatted in onecolumn mode.
BTW, you probably shouldn't do this. Revtex4-1 uses unhbox
for a reason (like deliberately undoing the caption package formatting).
documentclass[aip,reprint]{revtex4-1}
draft
usepackage{graphicx}
usepackage{epstopdf}
usepackage{gensymb}
usepackage{amsmath}
usepackage{caption,subcaption}
captionsetup{labelsep = period}
makeatletter
longdef@makecaption#1#2{%
par
vskipabovecaptionskip
begingroup
smallrmfamily
sbox@tempboxa{%
let\heading@cr
@make@capt@title{#1}{#2}%
}%
@ifdim{wd@tempboxa >hsize}{%
begingroup
samepage
flushing
letfootnote@footnotemark@gobble
@make@capt@title{#1}{#2}par
endgroup
}{%
global @minipagefalse
hb@xt@hsize{hfilunvbox@tempboxahfil}% replaced unhbox with unvbox
}%
endgroup
vskipbelowcaptionskip
}%
makeatother
usepackage{lipsum}
begin{document}
title{Draft}
author{LaTeX User}
date{today}
begin{abstract}
lipsum[1]
end{abstract}
maketitle
begin{figure}[h!]
centering
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-a}
caption{}vspace{0.3cm}
label{fig:1a}
end{subfigure}
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-b}
caption{}
label{fig:1b}
end{subfigure}
caption{lipsum[1]}
label{fig:1}
end{figure}
end{document}
This shows how to put the images and caption side-by-side. I converted the figure into a minipage and moved it inside the abstract. This is slightly more adaptable than an [H] figure using the float package.
documentclass[aip,reprint]{revtex4-1}
draft
usepackage{graphicx}
usepackage{epstopdf}
usepackage{gensymb}
usepackage{amsmath}
usepackage{subcaption}
captionsetup{labelsep = period}
makeatletter
newcommand{setcaptype}[1]{edef@captype{#1}}
longdef@makecaption#1#2{%
par
vskipabovecaptionskip
begingroup
smallrmfamily
sbox@tempboxa{%
let\heading@cr
@make@capt@title{#1}{#2}%
}%
@ifdim{wd@tempboxa >hsize}{%
begingroup
samepage
flushing
letfootnote@footnotemark@gobble
@make@capt@title{#1}{#2}par
endgroup
}{%
global @minipagefalse
hb@xt@hsize{hfilunvbox@tempboxahfil}% replaced unhbox with unvbox
}%
endgroup
vskipbelowcaptionskip
}%
makeatother
usepackage{lipsum}
begin{document}
title{Draft}
author{LaTeX User}
date{today}
begin{abstract}
lipsum[1]
noindentbegin{minipage}{dimexpr textwidth-leftskip-rightskip}
hrule% DEBUG - show widfth of minipage
setcaptype{figure}%
vspace*{intextsep}%
begin{minipage}[b]{0.55textwidth}
begin{subfigure}[b]{textwidth}
centering
includegraphics[width=0.5textwidth]{example-image-a}
caption{}vspace{0.3cm}
label{fig:1a}
end{subfigure}
begin{subfigure}[b]{textwidth}
centering
includegraphics[width=0.5textwidth]{example-image-b}
caption{}
label{fig:1b}
end{subfigure}
end{minipage}hfillbegin{minipage}[b]{0.4textwidth}
caption{lipsum[1]}
label{fig:1}
end{minipage}
vspace*{intextsep}
end{minipage}
end{abstract}
maketitle
lipsum[1]
end{document}
add a comment |
For some unknown reason, the figure is formatted in onecolumn mode.
BTW, you probably shouldn't do this. Revtex4-1 uses unhbox
for a reason (like deliberately undoing the caption package formatting).
documentclass[aip,reprint]{revtex4-1}
draft
usepackage{graphicx}
usepackage{epstopdf}
usepackage{gensymb}
usepackage{amsmath}
usepackage{caption,subcaption}
captionsetup{labelsep = period}
makeatletter
longdef@makecaption#1#2{%
par
vskipabovecaptionskip
begingroup
smallrmfamily
sbox@tempboxa{%
let\heading@cr
@make@capt@title{#1}{#2}%
}%
@ifdim{wd@tempboxa >hsize}{%
begingroup
samepage
flushing
letfootnote@footnotemark@gobble
@make@capt@title{#1}{#2}par
endgroup
}{%
global @minipagefalse
hb@xt@hsize{hfilunvbox@tempboxahfil}% replaced unhbox with unvbox
}%
endgroup
vskipbelowcaptionskip
}%
makeatother
usepackage{lipsum}
begin{document}
title{Draft}
author{LaTeX User}
date{today}
begin{abstract}
lipsum[1]
end{abstract}
maketitle
begin{figure}[h!]
centering
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-a}
caption{}vspace{0.3cm}
label{fig:1a}
end{subfigure}
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-b}
caption{}
label{fig:1b}
end{subfigure}
caption{lipsum[1]}
label{fig:1}
end{figure}
end{document}
This shows how to put the images and caption side-by-side. I converted the figure into a minipage and moved it inside the abstract. This is slightly more adaptable than an [H] figure using the float package.
documentclass[aip,reprint]{revtex4-1}
draft
usepackage{graphicx}
usepackage{epstopdf}
usepackage{gensymb}
usepackage{amsmath}
usepackage{subcaption}
captionsetup{labelsep = period}
makeatletter
newcommand{setcaptype}[1]{edef@captype{#1}}
longdef@makecaption#1#2{%
par
vskipabovecaptionskip
begingroup
smallrmfamily
sbox@tempboxa{%
let\heading@cr
@make@capt@title{#1}{#2}%
}%
@ifdim{wd@tempboxa >hsize}{%
begingroup
samepage
flushing
letfootnote@footnotemark@gobble
@make@capt@title{#1}{#2}par
endgroup
}{%
global @minipagefalse
hb@xt@hsize{hfilunvbox@tempboxahfil}% replaced unhbox with unvbox
}%
endgroup
vskipbelowcaptionskip
}%
makeatother
usepackage{lipsum}
begin{document}
title{Draft}
author{LaTeX User}
date{today}
begin{abstract}
lipsum[1]
noindentbegin{minipage}{dimexpr textwidth-leftskip-rightskip}
hrule% DEBUG - show widfth of minipage
setcaptype{figure}%
vspace*{intextsep}%
begin{minipage}[b]{0.55textwidth}
begin{subfigure}[b]{textwidth}
centering
includegraphics[width=0.5textwidth]{example-image-a}
caption{}vspace{0.3cm}
label{fig:1a}
end{subfigure}
begin{subfigure}[b]{textwidth}
centering
includegraphics[width=0.5textwidth]{example-image-b}
caption{}
label{fig:1b}
end{subfigure}
end{minipage}hfillbegin{minipage}[b]{0.4textwidth}
caption{lipsum[1]}
label{fig:1}
end{minipage}
vspace*{intextsep}
end{minipage}
end{abstract}
maketitle
lipsum[1]
end{document}
add a comment |
For some unknown reason, the figure is formatted in onecolumn mode.
BTW, you probably shouldn't do this. Revtex4-1 uses unhbox
for a reason (like deliberately undoing the caption package formatting).
documentclass[aip,reprint]{revtex4-1}
draft
usepackage{graphicx}
usepackage{epstopdf}
usepackage{gensymb}
usepackage{amsmath}
usepackage{caption,subcaption}
captionsetup{labelsep = period}
makeatletter
longdef@makecaption#1#2{%
par
vskipabovecaptionskip
begingroup
smallrmfamily
sbox@tempboxa{%
let\heading@cr
@make@capt@title{#1}{#2}%
}%
@ifdim{wd@tempboxa >hsize}{%
begingroup
samepage
flushing
letfootnote@footnotemark@gobble
@make@capt@title{#1}{#2}par
endgroup
}{%
global @minipagefalse
hb@xt@hsize{hfilunvbox@tempboxahfil}% replaced unhbox with unvbox
}%
endgroup
vskipbelowcaptionskip
}%
makeatother
usepackage{lipsum}
begin{document}
title{Draft}
author{LaTeX User}
date{today}
begin{abstract}
lipsum[1]
end{abstract}
maketitle
begin{figure}[h!]
centering
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-a}
caption{}vspace{0.3cm}
label{fig:1a}
end{subfigure}
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-b}
caption{}
label{fig:1b}
end{subfigure}
caption{lipsum[1]}
label{fig:1}
end{figure}
end{document}
This shows how to put the images and caption side-by-side. I converted the figure into a minipage and moved it inside the abstract. This is slightly more adaptable than an [H] figure using the float package.
documentclass[aip,reprint]{revtex4-1}
draft
usepackage{graphicx}
usepackage{epstopdf}
usepackage{gensymb}
usepackage{amsmath}
usepackage{subcaption}
captionsetup{labelsep = period}
makeatletter
newcommand{setcaptype}[1]{edef@captype{#1}}
longdef@makecaption#1#2{%
par
vskipabovecaptionskip
begingroup
smallrmfamily
sbox@tempboxa{%
let\heading@cr
@make@capt@title{#1}{#2}%
}%
@ifdim{wd@tempboxa >hsize}{%
begingroup
samepage
flushing
letfootnote@footnotemark@gobble
@make@capt@title{#1}{#2}par
endgroup
}{%
global @minipagefalse
hb@xt@hsize{hfilunvbox@tempboxahfil}% replaced unhbox with unvbox
}%
endgroup
vskipbelowcaptionskip
}%
makeatother
usepackage{lipsum}
begin{document}
title{Draft}
author{LaTeX User}
date{today}
begin{abstract}
lipsum[1]
noindentbegin{minipage}{dimexpr textwidth-leftskip-rightskip}
hrule% DEBUG - show widfth of minipage
setcaptype{figure}%
vspace*{intextsep}%
begin{minipage}[b]{0.55textwidth}
begin{subfigure}[b]{textwidth}
centering
includegraphics[width=0.5textwidth]{example-image-a}
caption{}vspace{0.3cm}
label{fig:1a}
end{subfigure}
begin{subfigure}[b]{textwidth}
centering
includegraphics[width=0.5textwidth]{example-image-b}
caption{}
label{fig:1b}
end{subfigure}
end{minipage}hfillbegin{minipage}[b]{0.4textwidth}
caption{lipsum[1]}
label{fig:1}
end{minipage}
vspace*{intextsep}
end{minipage}
end{abstract}
maketitle
lipsum[1]
end{document}
For some unknown reason, the figure is formatted in onecolumn mode.
BTW, you probably shouldn't do this. Revtex4-1 uses unhbox
for a reason (like deliberately undoing the caption package formatting).
documentclass[aip,reprint]{revtex4-1}
draft
usepackage{graphicx}
usepackage{epstopdf}
usepackage{gensymb}
usepackage{amsmath}
usepackage{caption,subcaption}
captionsetup{labelsep = period}
makeatletter
longdef@makecaption#1#2{%
par
vskipabovecaptionskip
begingroup
smallrmfamily
sbox@tempboxa{%
let\heading@cr
@make@capt@title{#1}{#2}%
}%
@ifdim{wd@tempboxa >hsize}{%
begingroup
samepage
flushing
letfootnote@footnotemark@gobble
@make@capt@title{#1}{#2}par
endgroup
}{%
global @minipagefalse
hb@xt@hsize{hfilunvbox@tempboxahfil}% replaced unhbox with unvbox
}%
endgroup
vskipbelowcaptionskip
}%
makeatother
usepackage{lipsum}
begin{document}
title{Draft}
author{LaTeX User}
date{today}
begin{abstract}
lipsum[1]
end{abstract}
maketitle
begin{figure}[h!]
centering
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-a}
caption{}vspace{0.3cm}
label{fig:1a}
end{subfigure}
begin{subfigure}[b]{0.55textwidth}
includegraphics[width=0.5linewidth]{example-image-b}
caption{}
label{fig:1b}
end{subfigure}
caption{lipsum[1]}
label{fig:1}
end{figure}
end{document}
This shows how to put the images and caption side-by-side. I converted the figure into a minipage and moved it inside the abstract. This is slightly more adaptable than an [H] figure using the float package.
documentclass[aip,reprint]{revtex4-1}
draft
usepackage{graphicx}
usepackage{epstopdf}
usepackage{gensymb}
usepackage{amsmath}
usepackage{subcaption}
captionsetup{labelsep = period}
makeatletter
newcommand{setcaptype}[1]{edef@captype{#1}}
longdef@makecaption#1#2{%
par
vskipabovecaptionskip
begingroup
smallrmfamily
sbox@tempboxa{%
let\heading@cr
@make@capt@title{#1}{#2}%
}%
@ifdim{wd@tempboxa >hsize}{%
begingroup
samepage
flushing
letfootnote@footnotemark@gobble
@make@capt@title{#1}{#2}par
endgroup
}{%
global @minipagefalse
hb@xt@hsize{hfilunvbox@tempboxahfil}% replaced unhbox with unvbox
}%
endgroup
vskipbelowcaptionskip
}%
makeatother
usepackage{lipsum}
begin{document}
title{Draft}
author{LaTeX User}
date{today}
begin{abstract}
lipsum[1]
noindentbegin{minipage}{dimexpr textwidth-leftskip-rightskip}
hrule% DEBUG - show widfth of minipage
setcaptype{figure}%
vspace*{intextsep}%
begin{minipage}[b]{0.55textwidth}
begin{subfigure}[b]{textwidth}
centering
includegraphics[width=0.5textwidth]{example-image-a}
caption{}vspace{0.3cm}
label{fig:1a}
end{subfigure}
begin{subfigure}[b]{textwidth}
centering
includegraphics[width=0.5textwidth]{example-image-b}
caption{}
label{fig:1b}
end{subfigure}
end{minipage}hfillbegin{minipage}[b]{0.4textwidth}
caption{lipsum[1]}
label{fig:1}
end{minipage}
vspace*{intextsep}
end{minipage}
end{abstract}
maketitle
lipsum[1]
end{document}
edited Jul 18 '18 at 16:28
answered Jul 18 '18 at 15:16
John KormyloJohn Kormylo
46.5k22672
46.5k22672
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%2f442124%2fcaption-does-not-fill-the-whole-column%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
If the
reprint
document class option is set,revtex4-1
typesets the document in two-column mode by default. Are you trying to use the full width of the textblock, i.e., both columns, for the figures and their caption(s)? If so, you should be using afigure*
environment. Please clarify your typesetting needs.– Mico
Jul 18 '18 at 6:50