add two horizontal lines between a figure and a table
up vote
0
down vote
favorite
I want to add two horizontal lines between each figure and each table but I have to add this command everytime : rule[0.6ex]{textwidth}{0.3mm}
And how can I reduce the red space between the caption and the figure ? Is there a way to put the figure and table in the center without adding begin{center} ... end{center}
? If I can do that, I won't have the red space anymore I guess.
MWE :
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{graphicx}
usepackage{hyperref}
usepackage{caption}
captionsetup{labelfont=bf,textfont=bf,justification=raggedright,singlelinecheck=false,format=hang}
begin{document}
begin{figure}
caption{Figure-Example.}
begin{center}
rule[0.6ex]{textwidth}{0.3mm}
includegraphics[scale=0.25]{logo.png}
rule[0.6ex]{textwidth}{0.3mm}
end{center}
textit{Source :} href{google.com}{https://google.com}
end{figure}
%Table :
begin{table}
caption{Table-Example.}
begin{center}
rule[0.6ex]{textwidth}{0.3mm}
begin{tabular}{c|c}
hline
A & B \
C & D \
hline
end{tabular}
rule[0.6ex]{textwidth}{0.3mm}
end{center}
textit{Source :} href{google.com}{https://google.com}
label{tab:my_label}
end{table}
end{document}
The result :
floats captions
bumped to the homepage by Community♦ 2 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
|
show 1 more comment
up vote
0
down vote
favorite
I want to add two horizontal lines between each figure and each table but I have to add this command everytime : rule[0.6ex]{textwidth}{0.3mm}
And how can I reduce the red space between the caption and the figure ? Is there a way to put the figure and table in the center without adding begin{center} ... end{center}
? If I can do that, I won't have the red space anymore I guess.
MWE :
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{graphicx}
usepackage{hyperref}
usepackage{caption}
captionsetup{labelfont=bf,textfont=bf,justification=raggedright,singlelinecheck=false,format=hang}
begin{document}
begin{figure}
caption{Figure-Example.}
begin{center}
rule[0.6ex]{textwidth}{0.3mm}
includegraphics[scale=0.25]{logo.png}
rule[0.6ex]{textwidth}{0.3mm}
end{center}
textit{Source :} href{google.com}{https://google.com}
end{figure}
%Table :
begin{table}
caption{Table-Example.}
begin{center}
rule[0.6ex]{textwidth}{0.3mm}
begin{tabular}{c|c}
hline
A & B \
C & D \
hline
end{tabular}
rule[0.6ex]{textwidth}{0.3mm}
end{center}
textit{Source :} href{google.com}{https://google.com}
label{tab:my_label}
end{table}
end{document}
The result :
floats captions
bumped to the homepage by Community♦ 2 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
1
Do not use thecenter
environment within a figure: it adds unwanted vertical spacing. Usecentering
instead.
– Bernard
May 28 at 8:48
But if i usecentering
I will have mytextit{Source :} href{google.com}{https://google.com}
at the center as well.
– Red One
May 28 at 8:54
For that you can make a group. Captions are centred by default – how do you manage it?
– Bernard
May 28 at 9:00
Well i just tried something like thiscaption*{textit{Source} : href{google.com}{https://google.com}}
withcentering
and it's not bad at all, so now I have to figure out how to add 2 lines without addingrule[0.6ex]{textwidth}{0.3mm}
everytime.
– Red One
May 28 at 9:04
1
You should take a look at the documentation of thefloat
package: it defines aruled
float style. You might define aruledfigure
and aruledtable
environments.
– Bernard
May 28 at 10:02
|
show 1 more comment
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to add two horizontal lines between each figure and each table but I have to add this command everytime : rule[0.6ex]{textwidth}{0.3mm}
And how can I reduce the red space between the caption and the figure ? Is there a way to put the figure and table in the center without adding begin{center} ... end{center}
? If I can do that, I won't have the red space anymore I guess.
MWE :
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{graphicx}
usepackage{hyperref}
usepackage{caption}
captionsetup{labelfont=bf,textfont=bf,justification=raggedright,singlelinecheck=false,format=hang}
begin{document}
begin{figure}
caption{Figure-Example.}
begin{center}
rule[0.6ex]{textwidth}{0.3mm}
includegraphics[scale=0.25]{logo.png}
rule[0.6ex]{textwidth}{0.3mm}
end{center}
textit{Source :} href{google.com}{https://google.com}
end{figure}
%Table :
begin{table}
caption{Table-Example.}
begin{center}
rule[0.6ex]{textwidth}{0.3mm}
begin{tabular}{c|c}
hline
A & B \
C & D \
hline
end{tabular}
rule[0.6ex]{textwidth}{0.3mm}
end{center}
textit{Source :} href{google.com}{https://google.com}
label{tab:my_label}
end{table}
end{document}
The result :
floats captions
I want to add two horizontal lines between each figure and each table but I have to add this command everytime : rule[0.6ex]{textwidth}{0.3mm}
And how can I reduce the red space between the caption and the figure ? Is there a way to put the figure and table in the center without adding begin{center} ... end{center}
? If I can do that, I won't have the red space anymore I guess.
MWE :
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{graphicx}
usepackage{hyperref}
usepackage{caption}
captionsetup{labelfont=bf,textfont=bf,justification=raggedright,singlelinecheck=false,format=hang}
begin{document}
begin{figure}
caption{Figure-Example.}
begin{center}
rule[0.6ex]{textwidth}{0.3mm}
includegraphics[scale=0.25]{logo.png}
rule[0.6ex]{textwidth}{0.3mm}
end{center}
textit{Source :} href{google.com}{https://google.com}
end{figure}
%Table :
begin{table}
caption{Table-Example.}
begin{center}
rule[0.6ex]{textwidth}{0.3mm}
begin{tabular}{c|c}
hline
A & B \
C & D \
hline
end{tabular}
rule[0.6ex]{textwidth}{0.3mm}
end{center}
textit{Source :} href{google.com}{https://google.com}
label{tab:my_label}
end{table}
end{document}
The result :
floats captions
floats captions
asked May 28 at 8:46
Red One
31619
31619
bumped to the homepage by Community♦ 2 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 2 hours ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
1
Do not use thecenter
environment within a figure: it adds unwanted vertical spacing. Usecentering
instead.
– Bernard
May 28 at 8:48
But if i usecentering
I will have mytextit{Source :} href{google.com}{https://google.com}
at the center as well.
– Red One
May 28 at 8:54
For that you can make a group. Captions are centred by default – how do you manage it?
– Bernard
May 28 at 9:00
Well i just tried something like thiscaption*{textit{Source} : href{google.com}{https://google.com}}
withcentering
and it's not bad at all, so now I have to figure out how to add 2 lines without addingrule[0.6ex]{textwidth}{0.3mm}
everytime.
– Red One
May 28 at 9:04
1
You should take a look at the documentation of thefloat
package: it defines aruled
float style. You might define aruledfigure
and aruledtable
environments.
– Bernard
May 28 at 10:02
|
show 1 more comment
1
Do not use thecenter
environment within a figure: it adds unwanted vertical spacing. Usecentering
instead.
– Bernard
May 28 at 8:48
But if i usecentering
I will have mytextit{Source :} href{google.com}{https://google.com}
at the center as well.
– Red One
May 28 at 8:54
For that you can make a group. Captions are centred by default – how do you manage it?
– Bernard
May 28 at 9:00
Well i just tried something like thiscaption*{textit{Source} : href{google.com}{https://google.com}}
withcentering
and it's not bad at all, so now I have to figure out how to add 2 lines without addingrule[0.6ex]{textwidth}{0.3mm}
everytime.
– Red One
May 28 at 9:04
1
You should take a look at the documentation of thefloat
package: it defines aruled
float style. You might define aruledfigure
and aruledtable
environments.
– Bernard
May 28 at 10:02
1
1
Do not use the
center
environment within a figure: it adds unwanted vertical spacing. Use centering
instead.– Bernard
May 28 at 8:48
Do not use the
center
environment within a figure: it adds unwanted vertical spacing. Use centering
instead.– Bernard
May 28 at 8:48
But if i use
centering
I will have my textit{Source :} href{google.com}{https://google.com}
at the center as well.– Red One
May 28 at 8:54
But if i use
centering
I will have my textit{Source :} href{google.com}{https://google.com}
at the center as well.– Red One
May 28 at 8:54
For that you can make a group. Captions are centred by default – how do you manage it?
– Bernard
May 28 at 9:00
For that you can make a group. Captions are centred by default – how do you manage it?
– Bernard
May 28 at 9:00
Well i just tried something like this
caption*{textit{Source} : href{google.com}{https://google.com}}
with centering
and it's not bad at all, so now I have to figure out how to add 2 lines without adding rule[0.6ex]{textwidth}{0.3mm}
everytime.– Red One
May 28 at 9:04
Well i just tried something like this
caption*{textit{Source} : href{google.com}{https://google.com}}
with centering
and it's not bad at all, so now I have to figure out how to add 2 lines without adding rule[0.6ex]{textwidth}{0.3mm}
everytime.– Red One
May 28 at 9:04
1
1
You should take a look at the documentation of the
float
package: it defines a ruled
float style. You might define a ruledfigure
and a ruledtable
environments.– Bernard
May 28 at 10:02
You should take a look at the documentation of the
float
package: it defines a ruled
float style. You might define a ruledfigure
and a ruledtable
environments.– Bernard
May 28 at 10:02
|
show 1 more comment
1 Answer
1
active
oldest
votes
up vote
0
down vote
With newenvironment{name}{begin}{end}, it can be done:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{graphicx}
usepackage{hyperref}
usepackage{caption}
captionsetup{labelfont=bf,textfont=bf,justification=raggedright,singlelinecheck=false,format=hang}
newenvironment{tablewithrule}[2]{begin{table} caption{#1} centering rule[0.6ex]{textwidth}{0.3mm} caption*{textit{Source}: #2} }{vspace{1mm}rule[0.6ex]{textwidth}{0.3mm} end{table}}
begin{document}
begin{tablewithrule}{Table Example}{url{www.google.com}}
begin{tabular}{c|c}
hline
A & B \
C & D \
hline
end{tabular}
end{tablewithrule}
end{document}
However, it is not possible to have an argument in the end-part of the order. You've therefore to add it in the begin-part (if you want to have this automatic...).
The distance to the rules can be changed by vspace{}
, where you can also enter a negative value, e.g. vspace{-0.4cm}
Edit: you could also work with renewenvironment
instead of newenvironment
. I however prefer not to meddle with the basic definitions but do new commands based on existing ones.
Hello, sorry for the late answer. I tried it but it didn't work I don't get the lines between my figure/table when I addnewenvironment{tablewithrule}[2]{begin{table} caption{#1} centering rule[0.6ex]{textwidth}{0.3mm} caption*{textit{Source}: #2} }{vspace{1mm}rule[0.6ex]{textwidth}{0.3mm} end{table}}
– Red One
May 28 at 22:56
Working fine with me. You've to change thebegin{table}
tobegin{tablewithrule}
, same withend{table}
. If you don't want that, you've to userenewenvironment
– Shade
May 29 at 7:44
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
With newenvironment{name}{begin}{end}, it can be done:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{graphicx}
usepackage{hyperref}
usepackage{caption}
captionsetup{labelfont=bf,textfont=bf,justification=raggedright,singlelinecheck=false,format=hang}
newenvironment{tablewithrule}[2]{begin{table} caption{#1} centering rule[0.6ex]{textwidth}{0.3mm} caption*{textit{Source}: #2} }{vspace{1mm}rule[0.6ex]{textwidth}{0.3mm} end{table}}
begin{document}
begin{tablewithrule}{Table Example}{url{www.google.com}}
begin{tabular}{c|c}
hline
A & B \
C & D \
hline
end{tabular}
end{tablewithrule}
end{document}
However, it is not possible to have an argument in the end-part of the order. You've therefore to add it in the begin-part (if you want to have this automatic...).
The distance to the rules can be changed by vspace{}
, where you can also enter a negative value, e.g. vspace{-0.4cm}
Edit: you could also work with renewenvironment
instead of newenvironment
. I however prefer not to meddle with the basic definitions but do new commands based on existing ones.
Hello, sorry for the late answer. I tried it but it didn't work I don't get the lines between my figure/table when I addnewenvironment{tablewithrule}[2]{begin{table} caption{#1} centering rule[0.6ex]{textwidth}{0.3mm} caption*{textit{Source}: #2} }{vspace{1mm}rule[0.6ex]{textwidth}{0.3mm} end{table}}
– Red One
May 28 at 22:56
Working fine with me. You've to change thebegin{table}
tobegin{tablewithrule}
, same withend{table}
. If you don't want that, you've to userenewenvironment
– Shade
May 29 at 7:44
add a comment |
up vote
0
down vote
With newenvironment{name}{begin}{end}, it can be done:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{graphicx}
usepackage{hyperref}
usepackage{caption}
captionsetup{labelfont=bf,textfont=bf,justification=raggedright,singlelinecheck=false,format=hang}
newenvironment{tablewithrule}[2]{begin{table} caption{#1} centering rule[0.6ex]{textwidth}{0.3mm} caption*{textit{Source}: #2} }{vspace{1mm}rule[0.6ex]{textwidth}{0.3mm} end{table}}
begin{document}
begin{tablewithrule}{Table Example}{url{www.google.com}}
begin{tabular}{c|c}
hline
A & B \
C & D \
hline
end{tabular}
end{tablewithrule}
end{document}
However, it is not possible to have an argument in the end-part of the order. You've therefore to add it in the begin-part (if you want to have this automatic...).
The distance to the rules can be changed by vspace{}
, where you can also enter a negative value, e.g. vspace{-0.4cm}
Edit: you could also work with renewenvironment
instead of newenvironment
. I however prefer not to meddle with the basic definitions but do new commands based on existing ones.
Hello, sorry for the late answer. I tried it but it didn't work I don't get the lines between my figure/table when I addnewenvironment{tablewithrule}[2]{begin{table} caption{#1} centering rule[0.6ex]{textwidth}{0.3mm} caption*{textit{Source}: #2} }{vspace{1mm}rule[0.6ex]{textwidth}{0.3mm} end{table}}
– Red One
May 28 at 22:56
Working fine with me. You've to change thebegin{table}
tobegin{tablewithrule}
, same withend{table}
. If you don't want that, you've to userenewenvironment
– Shade
May 29 at 7:44
add a comment |
up vote
0
down vote
up vote
0
down vote
With newenvironment{name}{begin}{end}, it can be done:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{graphicx}
usepackage{hyperref}
usepackage{caption}
captionsetup{labelfont=bf,textfont=bf,justification=raggedright,singlelinecheck=false,format=hang}
newenvironment{tablewithrule}[2]{begin{table} caption{#1} centering rule[0.6ex]{textwidth}{0.3mm} caption*{textit{Source}: #2} }{vspace{1mm}rule[0.6ex]{textwidth}{0.3mm} end{table}}
begin{document}
begin{tablewithrule}{Table Example}{url{www.google.com}}
begin{tabular}{c|c}
hline
A & B \
C & D \
hline
end{tabular}
end{tablewithrule}
end{document}
However, it is not possible to have an argument in the end-part of the order. You've therefore to add it in the begin-part (if you want to have this automatic...).
The distance to the rules can be changed by vspace{}
, where you can also enter a negative value, e.g. vspace{-0.4cm}
Edit: you could also work with renewenvironment
instead of newenvironment
. I however prefer not to meddle with the basic definitions but do new commands based on existing ones.
With newenvironment{name}{begin}{end}, it can be done:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{graphicx}
usepackage{hyperref}
usepackage{caption}
captionsetup{labelfont=bf,textfont=bf,justification=raggedright,singlelinecheck=false,format=hang}
newenvironment{tablewithrule}[2]{begin{table} caption{#1} centering rule[0.6ex]{textwidth}{0.3mm} caption*{textit{Source}: #2} }{vspace{1mm}rule[0.6ex]{textwidth}{0.3mm} end{table}}
begin{document}
begin{tablewithrule}{Table Example}{url{www.google.com}}
begin{tabular}{c|c}
hline
A & B \
C & D \
hline
end{tabular}
end{tablewithrule}
end{document}
However, it is not possible to have an argument in the end-part of the order. You've therefore to add it in the begin-part (if you want to have this automatic...).
The distance to the rules can be changed by vspace{}
, where you can also enter a negative value, e.g. vspace{-0.4cm}
Edit: you could also work with renewenvironment
instead of newenvironment
. I however prefer not to meddle with the basic definitions but do new commands based on existing ones.
answered May 28 at 10:05
Shade
3039
3039
Hello, sorry for the late answer. I tried it but it didn't work I don't get the lines between my figure/table when I addnewenvironment{tablewithrule}[2]{begin{table} caption{#1} centering rule[0.6ex]{textwidth}{0.3mm} caption*{textit{Source}: #2} }{vspace{1mm}rule[0.6ex]{textwidth}{0.3mm} end{table}}
– Red One
May 28 at 22:56
Working fine with me. You've to change thebegin{table}
tobegin{tablewithrule}
, same withend{table}
. If you don't want that, you've to userenewenvironment
– Shade
May 29 at 7:44
add a comment |
Hello, sorry for the late answer. I tried it but it didn't work I don't get the lines between my figure/table when I addnewenvironment{tablewithrule}[2]{begin{table} caption{#1} centering rule[0.6ex]{textwidth}{0.3mm} caption*{textit{Source}: #2} }{vspace{1mm}rule[0.6ex]{textwidth}{0.3mm} end{table}}
– Red One
May 28 at 22:56
Working fine with me. You've to change thebegin{table}
tobegin{tablewithrule}
, same withend{table}
. If you don't want that, you've to userenewenvironment
– Shade
May 29 at 7:44
Hello, sorry for the late answer. I tried it but it didn't work I don't get the lines between my figure/table when I add
newenvironment{tablewithrule}[2]{begin{table} caption{#1} centering rule[0.6ex]{textwidth}{0.3mm} caption*{textit{Source}: #2} }{vspace{1mm}rule[0.6ex]{textwidth}{0.3mm} end{table}}
– Red One
May 28 at 22:56
Hello, sorry for the late answer. I tried it but it didn't work I don't get the lines between my figure/table when I add
newenvironment{tablewithrule}[2]{begin{table} caption{#1} centering rule[0.6ex]{textwidth}{0.3mm} caption*{textit{Source}: #2} }{vspace{1mm}rule[0.6ex]{textwidth}{0.3mm} end{table}}
– Red One
May 28 at 22:56
Working fine with me. You've to change the
begin{table}
to begin{tablewithrule}
, same with end{table}
. If you don't want that, you've to use renewenvironment
– Shade
May 29 at 7:44
Working fine with me. You've to change the
begin{table}
to begin{tablewithrule}
, same with end{table}
. If you don't want that, you've to use renewenvironment
– Shade
May 29 at 7:44
add a comment |
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%2f433763%2fadd-two-horizontal-lines-between-a-figure-and-a-table%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Do not use the
center
environment within a figure: it adds unwanted vertical spacing. Usecentering
instead.– Bernard
May 28 at 8:48
But if i use
centering
I will have mytextit{Source :} href{google.com}{https://google.com}
at the center as well.– Red One
May 28 at 8:54
For that you can make a group. Captions are centred by default – how do you manage it?
– Bernard
May 28 at 9:00
Well i just tried something like this
caption*{textit{Source} : href{google.com}{https://google.com}}
withcentering
and it's not bad at all, so now I have to figure out how to add 2 lines without addingrule[0.6ex]{textwidth}{0.3mm}
everytime.– Red One
May 28 at 9:04
1
You should take a look at the documentation of the
float
package: it defines aruled
float style. You might define aruledfigure
and aruledtable
environments.– Bernard
May 28 at 10:02