Adjusting the space between the caption below a figureHorizontal line below figure captionHow can I modify...
It took me a lot of time to make this, pls like. (YouTube Comments #1)
Logistics of a hovering watercraft in a fantasy setting
Whom do I have to contact for a ticket refund in case of denied boarding (in the EU)?
A "strange" unit radio astronomy
How to avoid being sexist when trying to employ someone to function in a very sexist environment?
CBP Reminds Travelers to Allow 72 Hours for ESTA. Why?
If a druid in Wild Shape swallows a creature whole, then turns back to her normal form, what happens?
How can I handle a player who pre-plans arguments about my rulings on RAW?
Replacement ford fiesta radiator has extra hose
What's the purpose of these copper coils with resistors inside them in A Yamaha RX-V396RDS amplifier?
How to count occurrences of Friday 13th
What is this waxed root vegetable?
Understanding Kramnik's play in game 1 of Candidates 2018
Sometimes a banana is just a banana
Hacker Rank: Array left rotation
If nine coins are tossed, what is the probability that the number of heads is even?
When should a commit not be version tagged?
How to properly claim credit for peer review?
Which aircraft had such a luxurious-looking navigator's station?
What type of postprocessing gives the effect of people standing out
How would we write a misogynistic character without offending people?
Pure Functions: Does "No Side Effects" Imply "Always Same Output, Given Same Input"?
Is there a frame of reference in which I was born before I was conceived?
What to do when being responsible for data protection in your lab, yet advice is ignored?
Adjusting the space between the caption below a figure
Horizontal line below figure captionHow can I modify vertical space between figure and caption?Caption without text below "Figure''Reducing vertical space between figure and captionHow to fix the space between “Figure” and “5” in “Figure 5:” in figure caption?Space between caption and bottomruleAdjusting space between paragraphsCaption alignment below figureAdjusting the figure captionSpace between figure caption and bottom margin
I have the following:
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle. Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1;; (mod;n)\
frac{1}{2} & text{if } y=x-1;; (mod;n)\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the $n$-cycle. The sates can be visualised as equally spaced nodes arranged in a circle(see figure 1.1)
end{example}
begin{figure}[htbp]
centering
begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}
end{figure}
end{document}
now I want to adjust the spacing in the caption in the sense that i want to "push it into the middle", but I don't know how to proceed.
EDIT: similar question as above but the caption looks awful in this case, any fixes to stretch it out:
begin{example} Consider the graph $G$ following shown in figure 1.2. The transition matrix of a simple random walk $G$ is
begin{equation*}
P =
begin{bmatrix}[1.25]
0 & frac{1}{3} & frac{1}{3} & frac{1}{3} & 0 & 0 \
frac{1}{4} & 0 & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} \
frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} & 0 \
frac{1}{3} & 0 & frac{1}{3} & 0 & frac{1}{3} & 0 \
0 & frac{1}{4} & frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} \
0 & frac{1}{2} & 0 & 0 & frac{1}{2} & 0 \
end{bmatrix}
end{equation*}
begin{figure}[htbp]
centering
ffigbox[1.1FBwidth]{%
caption{An example of a vertex set $V = lbrace 1, 2, 3, 4, 5, 6rbrace$ with $10$ edges.}
label{my:figure}}%
{begin{tikzpicture}[bn/.style={circle,fill,draw,text=white,font=sffamily,minimum
size=1mm},every node/.append style={bn}]
path node (1) {1} -- ++ (50:2.5) node (2) {2} -- ++(-95:1.75) node (3) {3}
-- ++(-85:1.75) node (4) {4} -- ++(40:2.75) node (5) {5}
-- ++ (0,1.75) node (6) {6} ;
draw[thick] (1)--(2)--(6)--(5)--(4)--(1)--(3)--(5)--(2)--(3)--(4);
end{tikzpicture}}%
end{figure}
end{example}
is there a way to stretch this out into 2 lines at most?
spacing captions
New contributor
add a comment |
I have the following:
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle. Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1;; (mod;n)\
frac{1}{2} & text{if } y=x-1;; (mod;n)\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the $n$-cycle. The sates can be visualised as equally spaced nodes arranged in a circle(see figure 1.1)
end{example}
begin{figure}[htbp]
centering
begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}
end{figure}
end{document}
now I want to adjust the spacing in the caption in the sense that i want to "push it into the middle", but I don't know how to proceed.
EDIT: similar question as above but the caption looks awful in this case, any fixes to stretch it out:
begin{example} Consider the graph $G$ following shown in figure 1.2. The transition matrix of a simple random walk $G$ is
begin{equation*}
P =
begin{bmatrix}[1.25]
0 & frac{1}{3} & frac{1}{3} & frac{1}{3} & 0 & 0 \
frac{1}{4} & 0 & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} \
frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} & 0 \
frac{1}{3} & 0 & frac{1}{3} & 0 & frac{1}{3} & 0 \
0 & frac{1}{4} & frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} \
0 & frac{1}{2} & 0 & 0 & frac{1}{2} & 0 \
end{bmatrix}
end{equation*}
begin{figure}[htbp]
centering
ffigbox[1.1FBwidth]{%
caption{An example of a vertex set $V = lbrace 1, 2, 3, 4, 5, 6rbrace$ with $10$ edges.}
label{my:figure}}%
{begin{tikzpicture}[bn/.style={circle,fill,draw,text=white,font=sffamily,minimum
size=1mm},every node/.append style={bn}]
path node (1) {1} -- ++ (50:2.5) node (2) {2} -- ++(-95:1.75) node (3) {3}
-- ++(-85:1.75) node (4) {4} -- ++(40:2.75) node (5) {5}
-- ++ (0,1.75) node (6) {6} ;
draw[thick] (1)--(2)--(6)--(5)--(4)--(1)--(3)--(5)--(2)--(3)--(4);
end{tikzpicture}}%
end{figure}
end{example}
is there a way to stretch this out into 2 lines at most?
spacing captions
New contributor
the code is not compileable
– AndréC
Feb 27 at 16:22
@AndréC it should work now.
– Math
Feb 27 at 16:29
Your last sentence and the question title don't seem to match. Do you want more vertical space between the figure and the caption, or do you want to adjust the horizontal spacing of the caption?
– Alan Munn
Feb 27 at 17:13
add a comment |
I have the following:
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle. Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1;; (mod;n)\
frac{1}{2} & text{if } y=x-1;; (mod;n)\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the $n$-cycle. The sates can be visualised as equally spaced nodes arranged in a circle(see figure 1.1)
end{example}
begin{figure}[htbp]
centering
begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}
end{figure}
end{document}
now I want to adjust the spacing in the caption in the sense that i want to "push it into the middle", but I don't know how to proceed.
EDIT: similar question as above but the caption looks awful in this case, any fixes to stretch it out:
begin{example} Consider the graph $G$ following shown in figure 1.2. The transition matrix of a simple random walk $G$ is
begin{equation*}
P =
begin{bmatrix}[1.25]
0 & frac{1}{3} & frac{1}{3} & frac{1}{3} & 0 & 0 \
frac{1}{4} & 0 & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} \
frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} & 0 \
frac{1}{3} & 0 & frac{1}{3} & 0 & frac{1}{3} & 0 \
0 & frac{1}{4} & frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} \
0 & frac{1}{2} & 0 & 0 & frac{1}{2} & 0 \
end{bmatrix}
end{equation*}
begin{figure}[htbp]
centering
ffigbox[1.1FBwidth]{%
caption{An example of a vertex set $V = lbrace 1, 2, 3, 4, 5, 6rbrace$ with $10$ edges.}
label{my:figure}}%
{begin{tikzpicture}[bn/.style={circle,fill,draw,text=white,font=sffamily,minimum
size=1mm},every node/.append style={bn}]
path node (1) {1} -- ++ (50:2.5) node (2) {2} -- ++(-95:1.75) node (3) {3}
-- ++(-85:1.75) node (4) {4} -- ++(40:2.75) node (5) {5}
-- ++ (0,1.75) node (6) {6} ;
draw[thick] (1)--(2)--(6)--(5)--(4)--(1)--(3)--(5)--(2)--(3)--(4);
end{tikzpicture}}%
end{figure}
end{example}
is there a way to stretch this out into 2 lines at most?
spacing captions
New contributor
I have the following:
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle. Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1;; (mod;n)\
frac{1}{2} & text{if } y=x-1;; (mod;n)\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the $n$-cycle. The sates can be visualised as equally spaced nodes arranged in a circle(see figure 1.1)
end{example}
begin{figure}[htbp]
centering
begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}
end{figure}
end{document}
now I want to adjust the spacing in the caption in the sense that i want to "push it into the middle", but I don't know how to proceed.
EDIT: similar question as above but the caption looks awful in this case, any fixes to stretch it out:
begin{example} Consider the graph $G$ following shown in figure 1.2. The transition matrix of a simple random walk $G$ is
begin{equation*}
P =
begin{bmatrix}[1.25]
0 & frac{1}{3} & frac{1}{3} & frac{1}{3} & 0 & 0 \
frac{1}{4} & 0 & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} \
frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} & 0 \
frac{1}{3} & 0 & frac{1}{3} & 0 & frac{1}{3} & 0 \
0 & frac{1}{4} & frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} \
0 & frac{1}{2} & 0 & 0 & frac{1}{2} & 0 \
end{bmatrix}
end{equation*}
begin{figure}[htbp]
centering
ffigbox[1.1FBwidth]{%
caption{An example of a vertex set $V = lbrace 1, 2, 3, 4, 5, 6rbrace$ with $10$ edges.}
label{my:figure}}%
{begin{tikzpicture}[bn/.style={circle,fill,draw,text=white,font=sffamily,minimum
size=1mm},every node/.append style={bn}]
path node (1) {1} -- ++ (50:2.5) node (2) {2} -- ++(-95:1.75) node (3) {3}
-- ++(-85:1.75) node (4) {4} -- ++(40:2.75) node (5) {5}
-- ++ (0,1.75) node (6) {6} ;
draw[thick] (1)--(2)--(6)--(5)--(4)--(1)--(3)--(5)--(2)--(3)--(4);
end{tikzpicture}}%
end{figure}
end{example}
is there a way to stretch this out into 2 lines at most?
spacing captions
spacing captions
New contributor
New contributor
edited Mar 1 at 16:50
Math
New contributor
asked Feb 27 at 16:01
MathMath
416
416
New contributor
New contributor
the code is not compileable
– AndréC
Feb 27 at 16:22
@AndréC it should work now.
– Math
Feb 27 at 16:29
Your last sentence and the question title don't seem to match. Do you want more vertical space between the figure and the caption, or do you want to adjust the horizontal spacing of the caption?
– Alan Munn
Feb 27 at 17:13
add a comment |
the code is not compileable
– AndréC
Feb 27 at 16:22
@AndréC it should work now.
– Math
Feb 27 at 16:29
Your last sentence and the question title don't seem to match. Do you want more vertical space between the figure and the caption, or do you want to adjust the horizontal spacing of the caption?
– Alan Munn
Feb 27 at 17:13
the code is not compileable
– AndréC
Feb 27 at 16:22
the code is not compileable
– AndréC
Feb 27 at 16:22
@AndréC it should work now.
– Math
Feb 27 at 16:29
@AndréC it should work now.
– Math
Feb 27 at 16:29
Your last sentence and the question title don't seem to match. Do you want more vertical space between the figure and the caption, or do you want to adjust the horizontal spacing of the caption?
– Alan Munn
Feb 27 at 17:13
Your last sentence and the question title don't seem to match. Do you want more vertical space between the figure and the caption, or do you want to adjust the horizontal spacing of the caption?
– Alan Munn
Feb 27 at 17:13
add a comment |
2 Answers
2
active
oldest
votes
If I understand you right, you can use the following two lines in your preamble
usepackage{caption} % <================================================
captionsetup{width=0.8textwidth} % <==================================
to let the caption use only 80% of textwidth. See the documentation of package caption
for more possibilitys to manipulate the layout of captions with typing texdoc caption
on ypur console/terminal.
The complete code
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
usepackage{caption} % <================================================
captionsetup{width=0.8textwidth} % <==================================
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle.
Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be
the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1;; (mod;n)\
frac{1}{2} & text{if } y=x-1;; (mod;n)\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the
$n$-cycle. The sates can be visualised as equally spaced nodes arranged
in a circle (see figure~ref{my:figure}). % <==========================
end{example}
begin{figure}[htbp]
centering
begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}
end{figure}
Text after the figure.
end{document}
gives you the result:
EDIT:
With your second example (after commenting ffigbox
, see markings <======
in code)
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
usepackage{floatrow}
usepackage{caption} % <================================================
captionsetup{width=0.8textwidth} % <==================================
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle.
Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be
the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1;; (mod;n)\
frac{1}{2} & text{if } y=x-1;; (mod;n)\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the
$n$-cycle. The sates can be visualised as equally spaced nodes arranged
in a circle (see figure~ref{my:figure}).
end{example}
begin{figure}[htbp]
centering
begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}
end{figure}
Text after the figure.
clearpage
begin{example} Consider the graph $G$ following shown in figure 1.2. The transition matrix of a simple random walk $G$ is
begin{equation*}
P =
begin{bmatrix}[1.25]
0 & frac{1}{3} & frac{1}{3} & frac{1}{3} & 0 & 0 \
frac{1}{4} & 0 & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} \
frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} & 0 \
frac{1}{3} & 0 & frac{1}{3} & 0 & frac{1}{3} & 0 \
0 & frac{1}{4} & frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} \
0 & frac{1}{2} & 0 & 0 & frac{1}{2} & 0 \
end{bmatrix}
end{equation*}
begin{figure}[htbp]
centering
%ffigbox[1.1FBwidth]{% <==============================================
caption{An example of a vertex set $V = lbrace 1, 2, 3, 4, 5, 6rbrace$ with $10$ edges.}
label{my:figure}%
%}% <===================================================================
{begin{tikzpicture}[bn/.style={circle,fill,draw,text=white,font=sffamily,minimum
size=1mm},every node/.append style={bn}]
path node (1) {1} -- ++ (50:2.5) node (2) {2} -- ++(-95:1.75) node (3) {3}
-- ++(-85:1.75) node (4) {4} -- ++(40:2.75) node (5) {5}
-- ++ (0,1.75) node (6) {6} ;
draw[thick] (1)--(2)--(6)--(5)--(4)--(1)--(3)--(5)--(2)--(3)--(4);
end{tikzpicture}}%
end{figure}
end{example}
end{document}
you get the resulting second figure/page:
thanks, precisely what I wanted.
– Math
Mar 1 at 11:52
@Math You are welcome!
– Kurt
Mar 1 at 17:05
please check my edited question, there is another problem similar to this
– Math
Mar 1 at 17:06
@Math you mean the caption of figure withffigbox
? Commentffigbox
and the closing}
. That looks much better I guess?
– Kurt
Mar 1 at 17:19
sorry I wasn't available on the weakened. Yes, could you edit your answer adding the extra part, it will be very helpful :)
– Math
16 hours ago
add a comment |
If I've well understood what you want, this is easy with the ffigbox
command from floatrow
, which gives full control on the caption width:
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
usepackage{floatrow}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle. Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1 pmod n\
frac{1}{2} & text{if } y=x-1pmod n\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the $n$-cycle. The states can be visualised as equally spaced nodes arranged in a circle(see figure 1.1)
end{example}
begin{figure}[htbp]
centering
ffigbox[1.1FBwidth]{%
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}}%
{begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}}%
end{figure}
end{document}
+1 for another solution however Kurt beat you to it!
– Math
Mar 1 at 11:57
I'm not competing :o). The advantage with the solution withffigbox
, from my point of view, is that the caption width can be automatically calculated in function of the figure natural width.
– Bernard
Mar 1 at 12:07
I understand. the reason I liked Kurt's answer is because for this particular problem I will only need to adjust one number to get my desired output however the drawback is, with another figure, if it doesn't have the same dimensions as the figure above, the caption will be off
– Math
Mar 1 at 12:13
that's where your solution comes in handy I believe.
– Math
Mar 1 at 12:13
To clarify, will your method work for all figures?
– Math
Mar 1 at 12:17
|
show 2 more comments
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
});
}
});
Math 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%2f476981%2fadjusting-the-space-between-the-caption-below-a-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
If I understand you right, you can use the following two lines in your preamble
usepackage{caption} % <================================================
captionsetup{width=0.8textwidth} % <==================================
to let the caption use only 80% of textwidth. See the documentation of package caption
for more possibilitys to manipulate the layout of captions with typing texdoc caption
on ypur console/terminal.
The complete code
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
usepackage{caption} % <================================================
captionsetup{width=0.8textwidth} % <==================================
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle.
Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be
the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1;; (mod;n)\
frac{1}{2} & text{if } y=x-1;; (mod;n)\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the
$n$-cycle. The sates can be visualised as equally spaced nodes arranged
in a circle (see figure~ref{my:figure}). % <==========================
end{example}
begin{figure}[htbp]
centering
begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}
end{figure}
Text after the figure.
end{document}
gives you the result:
EDIT:
With your second example (after commenting ffigbox
, see markings <======
in code)
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
usepackage{floatrow}
usepackage{caption} % <================================================
captionsetup{width=0.8textwidth} % <==================================
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle.
Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be
the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1;; (mod;n)\
frac{1}{2} & text{if } y=x-1;; (mod;n)\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the
$n$-cycle. The sates can be visualised as equally spaced nodes arranged
in a circle (see figure~ref{my:figure}).
end{example}
begin{figure}[htbp]
centering
begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}
end{figure}
Text after the figure.
clearpage
begin{example} Consider the graph $G$ following shown in figure 1.2. The transition matrix of a simple random walk $G$ is
begin{equation*}
P =
begin{bmatrix}[1.25]
0 & frac{1}{3} & frac{1}{3} & frac{1}{3} & 0 & 0 \
frac{1}{4} & 0 & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} \
frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} & 0 \
frac{1}{3} & 0 & frac{1}{3} & 0 & frac{1}{3} & 0 \
0 & frac{1}{4} & frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} \
0 & frac{1}{2} & 0 & 0 & frac{1}{2} & 0 \
end{bmatrix}
end{equation*}
begin{figure}[htbp]
centering
%ffigbox[1.1FBwidth]{% <==============================================
caption{An example of a vertex set $V = lbrace 1, 2, 3, 4, 5, 6rbrace$ with $10$ edges.}
label{my:figure}%
%}% <===================================================================
{begin{tikzpicture}[bn/.style={circle,fill,draw,text=white,font=sffamily,minimum
size=1mm},every node/.append style={bn}]
path node (1) {1} -- ++ (50:2.5) node (2) {2} -- ++(-95:1.75) node (3) {3}
-- ++(-85:1.75) node (4) {4} -- ++(40:2.75) node (5) {5}
-- ++ (0,1.75) node (6) {6} ;
draw[thick] (1)--(2)--(6)--(5)--(4)--(1)--(3)--(5)--(2)--(3)--(4);
end{tikzpicture}}%
end{figure}
end{example}
end{document}
you get the resulting second figure/page:
thanks, precisely what I wanted.
– Math
Mar 1 at 11:52
@Math You are welcome!
– Kurt
Mar 1 at 17:05
please check my edited question, there is another problem similar to this
– Math
Mar 1 at 17:06
@Math you mean the caption of figure withffigbox
? Commentffigbox
and the closing}
. That looks much better I guess?
– Kurt
Mar 1 at 17:19
sorry I wasn't available on the weakened. Yes, could you edit your answer adding the extra part, it will be very helpful :)
– Math
16 hours ago
add a comment |
If I understand you right, you can use the following two lines in your preamble
usepackage{caption} % <================================================
captionsetup{width=0.8textwidth} % <==================================
to let the caption use only 80% of textwidth. See the documentation of package caption
for more possibilitys to manipulate the layout of captions with typing texdoc caption
on ypur console/terminal.
The complete code
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
usepackage{caption} % <================================================
captionsetup{width=0.8textwidth} % <==================================
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle.
Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be
the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1;; (mod;n)\
frac{1}{2} & text{if } y=x-1;; (mod;n)\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the
$n$-cycle. The sates can be visualised as equally spaced nodes arranged
in a circle (see figure~ref{my:figure}). % <==========================
end{example}
begin{figure}[htbp]
centering
begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}
end{figure}
Text after the figure.
end{document}
gives you the result:
EDIT:
With your second example (after commenting ffigbox
, see markings <======
in code)
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
usepackage{floatrow}
usepackage{caption} % <================================================
captionsetup{width=0.8textwidth} % <==================================
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle.
Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be
the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1;; (mod;n)\
frac{1}{2} & text{if } y=x-1;; (mod;n)\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the
$n$-cycle. The sates can be visualised as equally spaced nodes arranged
in a circle (see figure~ref{my:figure}).
end{example}
begin{figure}[htbp]
centering
begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}
end{figure}
Text after the figure.
clearpage
begin{example} Consider the graph $G$ following shown in figure 1.2. The transition matrix of a simple random walk $G$ is
begin{equation*}
P =
begin{bmatrix}[1.25]
0 & frac{1}{3} & frac{1}{3} & frac{1}{3} & 0 & 0 \
frac{1}{4} & 0 & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} \
frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} & 0 \
frac{1}{3} & 0 & frac{1}{3} & 0 & frac{1}{3} & 0 \
0 & frac{1}{4} & frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} \
0 & frac{1}{2} & 0 & 0 & frac{1}{2} & 0 \
end{bmatrix}
end{equation*}
begin{figure}[htbp]
centering
%ffigbox[1.1FBwidth]{% <==============================================
caption{An example of a vertex set $V = lbrace 1, 2, 3, 4, 5, 6rbrace$ with $10$ edges.}
label{my:figure}%
%}% <===================================================================
{begin{tikzpicture}[bn/.style={circle,fill,draw,text=white,font=sffamily,minimum
size=1mm},every node/.append style={bn}]
path node (1) {1} -- ++ (50:2.5) node (2) {2} -- ++(-95:1.75) node (3) {3}
-- ++(-85:1.75) node (4) {4} -- ++(40:2.75) node (5) {5}
-- ++ (0,1.75) node (6) {6} ;
draw[thick] (1)--(2)--(6)--(5)--(4)--(1)--(3)--(5)--(2)--(3)--(4);
end{tikzpicture}}%
end{figure}
end{example}
end{document}
you get the resulting second figure/page:
thanks, precisely what I wanted.
– Math
Mar 1 at 11:52
@Math You are welcome!
– Kurt
Mar 1 at 17:05
please check my edited question, there is another problem similar to this
– Math
Mar 1 at 17:06
@Math you mean the caption of figure withffigbox
? Commentffigbox
and the closing}
. That looks much better I guess?
– Kurt
Mar 1 at 17:19
sorry I wasn't available on the weakened. Yes, could you edit your answer adding the extra part, it will be very helpful :)
– Math
16 hours ago
add a comment |
If I understand you right, you can use the following two lines in your preamble
usepackage{caption} % <================================================
captionsetup{width=0.8textwidth} % <==================================
to let the caption use only 80% of textwidth. See the documentation of package caption
for more possibilitys to manipulate the layout of captions with typing texdoc caption
on ypur console/terminal.
The complete code
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
usepackage{caption} % <================================================
captionsetup{width=0.8textwidth} % <==================================
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle.
Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be
the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1;; (mod;n)\
frac{1}{2} & text{if } y=x-1;; (mod;n)\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the
$n$-cycle. The sates can be visualised as equally spaced nodes arranged
in a circle (see figure~ref{my:figure}). % <==========================
end{example}
begin{figure}[htbp]
centering
begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}
end{figure}
Text after the figure.
end{document}
gives you the result:
EDIT:
With your second example (after commenting ffigbox
, see markings <======
in code)
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
usepackage{floatrow}
usepackage{caption} % <================================================
captionsetup{width=0.8textwidth} % <==================================
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle.
Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be
the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1;; (mod;n)\
frac{1}{2} & text{if } y=x-1;; (mod;n)\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the
$n$-cycle. The sates can be visualised as equally spaced nodes arranged
in a circle (see figure~ref{my:figure}).
end{example}
begin{figure}[htbp]
centering
begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}
end{figure}
Text after the figure.
clearpage
begin{example} Consider the graph $G$ following shown in figure 1.2. The transition matrix of a simple random walk $G$ is
begin{equation*}
P =
begin{bmatrix}[1.25]
0 & frac{1}{3} & frac{1}{3} & frac{1}{3} & 0 & 0 \
frac{1}{4} & 0 & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} \
frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} & 0 \
frac{1}{3} & 0 & frac{1}{3} & 0 & frac{1}{3} & 0 \
0 & frac{1}{4} & frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} \
0 & frac{1}{2} & 0 & 0 & frac{1}{2} & 0 \
end{bmatrix}
end{equation*}
begin{figure}[htbp]
centering
%ffigbox[1.1FBwidth]{% <==============================================
caption{An example of a vertex set $V = lbrace 1, 2, 3, 4, 5, 6rbrace$ with $10$ edges.}
label{my:figure}%
%}% <===================================================================
{begin{tikzpicture}[bn/.style={circle,fill,draw,text=white,font=sffamily,minimum
size=1mm},every node/.append style={bn}]
path node (1) {1} -- ++ (50:2.5) node (2) {2} -- ++(-95:1.75) node (3) {3}
-- ++(-85:1.75) node (4) {4} -- ++(40:2.75) node (5) {5}
-- ++ (0,1.75) node (6) {6} ;
draw[thick] (1)--(2)--(6)--(5)--(4)--(1)--(3)--(5)--(2)--(3)--(4);
end{tikzpicture}}%
end{figure}
end{example}
end{document}
you get the resulting second figure/page:
If I understand you right, you can use the following two lines in your preamble
usepackage{caption} % <================================================
captionsetup{width=0.8textwidth} % <==================================
to let the caption use only 80% of textwidth. See the documentation of package caption
for more possibilitys to manipulate the layout of captions with typing texdoc caption
on ypur console/terminal.
The complete code
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
usepackage{caption} % <================================================
captionsetup{width=0.8textwidth} % <==================================
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle.
Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be
the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1;; (mod;n)\
frac{1}{2} & text{if } y=x-1;; (mod;n)\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the
$n$-cycle. The sates can be visualised as equally spaced nodes arranged
in a circle (see figure~ref{my:figure}). % <==========================
end{example}
begin{figure}[htbp]
centering
begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}
end{figure}
Text after the figure.
end{document}
gives you the result:
EDIT:
With your second example (after commenting ffigbox
, see markings <======
in code)
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{amsfonts, graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
usepackage{floatrow}
usepackage{caption} % <================================================
captionsetup{width=0.8textwidth} % <==================================
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle.
Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be
the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1;; (mod;n)\
frac{1}{2} & text{if } y=x-1;; (mod;n)\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the
$n$-cycle. The sates can be visualised as equally spaced nodes arranged
in a circle (see figure~ref{my:figure}).
end{example}
begin{figure}[htbp]
centering
begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}
end{figure}
Text after the figure.
clearpage
begin{example} Consider the graph $G$ following shown in figure 1.2. The transition matrix of a simple random walk $G$ is
begin{equation*}
P =
begin{bmatrix}[1.25]
0 & frac{1}{3} & frac{1}{3} & frac{1}{3} & 0 & 0 \
frac{1}{4} & 0 & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} \
frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} & frac{1}{4} & 0 \
frac{1}{3} & 0 & frac{1}{3} & 0 & frac{1}{3} & 0 \
0 & frac{1}{4} & frac{1}{4} & frac{1}{4} & 0 & frac{1}{4} \
0 & frac{1}{2} & 0 & 0 & frac{1}{2} & 0 \
end{bmatrix}
end{equation*}
begin{figure}[htbp]
centering
%ffigbox[1.1FBwidth]{% <==============================================
caption{An example of a vertex set $V = lbrace 1, 2, 3, 4, 5, 6rbrace$ with $10$ edges.}
label{my:figure}%
%}% <===================================================================
{begin{tikzpicture}[bn/.style={circle,fill,draw,text=white,font=sffamily,minimum
size=1mm},every node/.append style={bn}]
path node (1) {1} -- ++ (50:2.5) node (2) {2} -- ++(-95:1.75) node (3) {3}
-- ++(-85:1.75) node (4) {4} -- ++(40:2.75) node (5) {5}
-- ++ (0,1.75) node (6) {6} ;
draw[thick] (1)--(2)--(6)--(5)--(4)--(1)--(3)--(5)--(2)--(3)--(4);
end{tikzpicture}}%
end{figure}
end{example}
end{document}
you get the resulting second figure/page:
edited 16 hours ago
answered Feb 27 at 17:30
KurtKurt
38.5k848162
38.5k848162
thanks, precisely what I wanted.
– Math
Mar 1 at 11:52
@Math You are welcome!
– Kurt
Mar 1 at 17:05
please check my edited question, there is another problem similar to this
– Math
Mar 1 at 17:06
@Math you mean the caption of figure withffigbox
? Commentffigbox
and the closing}
. That looks much better I guess?
– Kurt
Mar 1 at 17:19
sorry I wasn't available on the weakened. Yes, could you edit your answer adding the extra part, it will be very helpful :)
– Math
16 hours ago
add a comment |
thanks, precisely what I wanted.
– Math
Mar 1 at 11:52
@Math You are welcome!
– Kurt
Mar 1 at 17:05
please check my edited question, there is another problem similar to this
– Math
Mar 1 at 17:06
@Math you mean the caption of figure withffigbox
? Commentffigbox
and the closing}
. That looks much better I guess?
– Kurt
Mar 1 at 17:19
sorry I wasn't available on the weakened. Yes, could you edit your answer adding the extra part, it will be very helpful :)
– Math
16 hours ago
thanks, precisely what I wanted.
– Math
Mar 1 at 11:52
thanks, precisely what I wanted.
– Math
Mar 1 at 11:52
@Math You are welcome!
– Kurt
Mar 1 at 17:05
@Math You are welcome!
– Kurt
Mar 1 at 17:05
please check my edited question, there is another problem similar to this
– Math
Mar 1 at 17:06
please check my edited question, there is another problem similar to this
– Math
Mar 1 at 17:06
@Math you mean the caption of figure with
ffigbox
? Comment ffigbox
and the closing }
. That looks much better I guess?– Kurt
Mar 1 at 17:19
@Math you mean the caption of figure with
ffigbox
? Comment ffigbox
and the closing }
. That looks much better I guess?– Kurt
Mar 1 at 17:19
sorry I wasn't available on the weakened. Yes, could you edit your answer adding the extra part, it will be very helpful :)
– Math
16 hours ago
sorry I wasn't available on the weakened. Yes, could you edit your answer adding the extra part, it will be very helpful :)
– Math
16 hours ago
add a comment |
If I've well understood what you want, this is easy with the ffigbox
command from floatrow
, which gives full control on the caption width:
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
usepackage{floatrow}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle. Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1 pmod n\
frac{1}{2} & text{if } y=x-1pmod n\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the $n$-cycle. The states can be visualised as equally spaced nodes arranged in a circle(see figure 1.1)
end{example}
begin{figure}[htbp]
centering
ffigbox[1.1FBwidth]{%
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}}%
{begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}}%
end{figure}
end{document}
+1 for another solution however Kurt beat you to it!
– Math
Mar 1 at 11:57
I'm not competing :o). The advantage with the solution withffigbox
, from my point of view, is that the caption width can be automatically calculated in function of the figure natural width.
– Bernard
Mar 1 at 12:07
I understand. the reason I liked Kurt's answer is because for this particular problem I will only need to adjust one number to get my desired output however the drawback is, with another figure, if it doesn't have the same dimensions as the figure above, the caption will be off
– Math
Mar 1 at 12:13
that's where your solution comes in handy I believe.
– Math
Mar 1 at 12:13
To clarify, will your method work for all figures?
– Math
Mar 1 at 12:17
|
show 2 more comments
If I've well understood what you want, this is easy with the ffigbox
command from floatrow
, which gives full control on the caption width:
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
usepackage{floatrow}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle. Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1 pmod n\
frac{1}{2} & text{if } y=x-1pmod n\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the $n$-cycle. The states can be visualised as equally spaced nodes arranged in a circle(see figure 1.1)
end{example}
begin{figure}[htbp]
centering
ffigbox[1.1FBwidth]{%
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}}%
{begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}}%
end{figure}
end{document}
+1 for another solution however Kurt beat you to it!
– Math
Mar 1 at 11:57
I'm not competing :o). The advantage with the solution withffigbox
, from my point of view, is that the caption width can be automatically calculated in function of the figure natural width.
– Bernard
Mar 1 at 12:07
I understand. the reason I liked Kurt's answer is because for this particular problem I will only need to adjust one number to get my desired output however the drawback is, with another figure, if it doesn't have the same dimensions as the figure above, the caption will be off
– Math
Mar 1 at 12:13
that's where your solution comes in handy I believe.
– Math
Mar 1 at 12:13
To clarify, will your method work for all figures?
– Math
Mar 1 at 12:17
|
show 2 more comments
If I've well understood what you want, this is easy with the ffigbox
command from floatrow
, which gives full control on the caption width:
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
usepackage{floatrow}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle. Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1 pmod n\
frac{1}{2} & text{if } y=x-1pmod n\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the $n$-cycle. The states can be visualised as equally spaced nodes arranged in a circle(see figure 1.1)
end{example}
begin{figure}[htbp]
centering
ffigbox[1.1FBwidth]{%
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}}%
{begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}}%
end{figure}
end{document}
If I've well understood what you want, this is easy with the ffigbox
command from floatrow
, which gives full control on the caption width:
documentclass[11pt, a4paper]{report}
usepackage{bm}
usepackage{graphicx, verbatim, amsmath,amssymb, amsthm}
usepackage{color}
usepackage{array}
usepackage{setspace}% if you must (for double spacing thesis)
usepackage{fancyhdr}
usepackage{enumitem}
usepackage{tikz}
usepackage{parskip}
usepackage{lipsum}
newtheorem{theorem}{Theorem}[section]
newtheorem{example}[theorem]{Example}
usepackage{floatrow}
begin{document}
begin{example}
Consider a random walk on the $n$-cycle. Let $Omega = mathbb{Z}_n = lbrace 0, 1, 2, cdots, n-1 rbrace$ be the set of remainders modulo $n$. Also consider the transition matrix:
[
P(x,y) =
begin{cases}
frac{1}{2} & text{if } y=x+1 pmod n\
frac{1}{2} & text{if } y=x-1pmod n\
0 & text{otherwise}
end{cases}
]
The associated Markov chain $X_t$ is called a random walk on the $n$-cycle. The states can be visualised as equally spaced nodes arranged in a circle(see figure 1.1)
end{example}
begin{figure}[htbp]
centering
ffigbox[1.1FBwidth]{%
caption{Random walk on $mathbb{Z}_10$ is periodic, since every step
goes from an even state to an odd state, or vice-versa. Random
walk on $mathbb{Z}_9$ is aperiodic.}
label{my:figure}}%
{begin{tikzpicture}
foreach i in {90,54,...,-234} {
draw[ultra thick] (i:2)--({i-36}:2);
}
foreach i in {90,18,...,-198} {
draw[fill=black] (i:2) circle (1.25mm);
}
foreach i in {54,-18,...,-234} {
draw[fill=white] (i:2) circle (1.25mm);
}
begin{scope}[xshift=5cm]
foreach i in {90,50,...,-230} {
draw[ultra thick] (i:2)--({i-40}:2);
draw[fill=black] (i:2) circle (1.25mm);
}
end{scope}
end{tikzpicture}}%
end{figure}
end{document}
answered Feb 27 at 17:21
BernardBernard
172k776204
172k776204
+1 for another solution however Kurt beat you to it!
– Math
Mar 1 at 11:57
I'm not competing :o). The advantage with the solution withffigbox
, from my point of view, is that the caption width can be automatically calculated in function of the figure natural width.
– Bernard
Mar 1 at 12:07
I understand. the reason I liked Kurt's answer is because for this particular problem I will only need to adjust one number to get my desired output however the drawback is, with another figure, if it doesn't have the same dimensions as the figure above, the caption will be off
– Math
Mar 1 at 12:13
that's where your solution comes in handy I believe.
– Math
Mar 1 at 12:13
To clarify, will your method work for all figures?
– Math
Mar 1 at 12:17
|
show 2 more comments
+1 for another solution however Kurt beat you to it!
– Math
Mar 1 at 11:57
I'm not competing :o). The advantage with the solution withffigbox
, from my point of view, is that the caption width can be automatically calculated in function of the figure natural width.
– Bernard
Mar 1 at 12:07
I understand. the reason I liked Kurt's answer is because for this particular problem I will only need to adjust one number to get my desired output however the drawback is, with another figure, if it doesn't have the same dimensions as the figure above, the caption will be off
– Math
Mar 1 at 12:13
that's where your solution comes in handy I believe.
– Math
Mar 1 at 12:13
To clarify, will your method work for all figures?
– Math
Mar 1 at 12:17
+1 for another solution however Kurt beat you to it!
– Math
Mar 1 at 11:57
+1 for another solution however Kurt beat you to it!
– Math
Mar 1 at 11:57
I'm not competing :o). The advantage with the solution with
ffigbox
, from my point of view, is that the caption width can be automatically calculated in function of the figure natural width.– Bernard
Mar 1 at 12:07
I'm not competing :o). The advantage with the solution with
ffigbox
, from my point of view, is that the caption width can be automatically calculated in function of the figure natural width.– Bernard
Mar 1 at 12:07
I understand. the reason I liked Kurt's answer is because for this particular problem I will only need to adjust one number to get my desired output however the drawback is, with another figure, if it doesn't have the same dimensions as the figure above, the caption will be off
– Math
Mar 1 at 12:13
I understand. the reason I liked Kurt's answer is because for this particular problem I will only need to adjust one number to get my desired output however the drawback is, with another figure, if it doesn't have the same dimensions as the figure above, the caption will be off
– Math
Mar 1 at 12:13
that's where your solution comes in handy I believe.
– Math
Mar 1 at 12:13
that's where your solution comes in handy I believe.
– Math
Mar 1 at 12:13
To clarify, will your method work for all figures?
– Math
Mar 1 at 12:17
To clarify, will your method work for all figures?
– Math
Mar 1 at 12:17
|
show 2 more comments
Math is a new contributor. Be nice, and check out our Code of Conduct.
Math is a new contributor. Be nice, and check out our Code of Conduct.
Math is a new contributor. Be nice, and check out our Code of Conduct.
Math 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%2f476981%2fadjusting-the-space-between-the-caption-below-a-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
the code is not compileable
– AndréC
Feb 27 at 16:22
@AndréC it should work now.
– Math
Feb 27 at 16:29
Your last sentence and the question title don't seem to match. Do you want more vertical space between the figure and the caption, or do you want to adjust the horizontal spacing of the caption?
– Alan Munn
Feb 27 at 17:13