Caption does not fill the whole columnHow to justify the text in the caption for AIP revtex4-1?Caption...
Languages that we cannot (dis)prove to be Context-Free
How can bays and straits be determined in a procedurally generated map?
Roll the carpet
Can a Cauchy sequence converge for one metric while not converging for another?
Convert two switches to a dual stack, and add outlet - possible here?
What does the "remote control" for a QF-4 look like?
Why can't I see bouncing of a switch on an oscilloscope?
"You are your self first supporter", a more proper way to say it
How is it possible to have an ability score that is less than 3?
What typically incentivizes a professor to change jobs to a lower ranking university?
How does quantile regression compare to logistic regression with the variable split at the quantile?
Why doesn't H₄O²⁺ exist?
Do I have a twin with permutated remainders?
Does detail obscure or enhance action?
Is it unprofessional to ask if a job posting on GlassDoor is real?
Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?
Why are electrically insulating heatsinks so rare? Is it just cost?
Revoked SSL certificate
LaTeX: Why are digits allowed in environments, but forbidden in commands?
Why doesn't Newton's third law mean a person bounces back to where they started when they hit the ground?
infared filters v nd
Can I make popcorn with any corn?
What does "Puller Prush Person" mean?
Rock identification in KY
Caption does not fill the whole column
How to justify the text in the caption for AIP revtex4-1?Caption centering does not workcaption* does not work properlyChange formatting of date from '(Dated: today)' to 'today' in revtex4-1Caption not working while subcaptions are presentifthenelse within caption, listoftables does not workThe caption of tables is not uppercaseCaption-package: caption* does not work?Subcaption: subfigure's caption align to the rightCapitalize the caption in IEEEeqnarraybox environmentCaption does not work with pspicture
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