Align subcaption to its subtable












2















I am trying to create a table with tree subtables in it. To do so I have written the following code:



documentclass[twoside]{article} 
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{sidecap}
usepackage{fancyhdr}
usepackage{lastpage}
usepackage{extramarks}
usepackage{graphicx}
usepackage{mathpazo}
usepackage{amsmath}
usepackage{float}
usepackage{wrapfig}
usepackage{multicol}
usepackage[toc,page]{appendix}
usepackage{subcaption}

begin{document} % <---
begin{table}[h]
begin{subtable}[b]{0.5textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81
\
Amonio & 4,77 & Htextsubscript{2}O & 29,18
\
Fosfato & 3,21 & Htextsuperscript{+} & 17,53
\
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.1}
end{subtable}
begin{subtable}[b]{0.5textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.2}
end{subtable}
begin{subtable}{0.5textwidth}
vspace{15pt}hspace{0.5linewidth}begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular} caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.3}
end{subtable}
caption{Resultados de las distintas simulaciones}
end{table}
end{document}% <---


The problem is that the third subtable is not aligned with its caption:



enter image description here



Is there any easy solution to align them?










share|improve this question

























  • Yes. See the subcaption manual for options. Set alignment for all sub-figures or just sub-tables, as you wish. Never use h alone as a float specifier. Where is LaTeX meant to put it if it doesn't fit? h means 'here, if it fits'. Please make your code compilable.

    – cfr
    Dec 10 '17 at 2:32













  • remove vspace{15pt}hspace{0.5linewidth} from third subtable. however each of your table is wider than 0.5textwidth (in page layout as is in your code example), so equation overlap (if i test your code) or tables are in one column if test your code after considering aforementioned suggestion. also i take liberty and make your code compilable.

    – Zarko
    Dec 10 '17 at 8:27
















2















I am trying to create a table with tree subtables in it. To do so I have written the following code:



documentclass[twoside]{article} 
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{sidecap}
usepackage{fancyhdr}
usepackage{lastpage}
usepackage{extramarks}
usepackage{graphicx}
usepackage{mathpazo}
usepackage{amsmath}
usepackage{float}
usepackage{wrapfig}
usepackage{multicol}
usepackage[toc,page]{appendix}
usepackage{subcaption}

begin{document} % <---
begin{table}[h]
begin{subtable}[b]{0.5textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81
\
Amonio & 4,77 & Htextsubscript{2}O & 29,18
\
Fosfato & 3,21 & Htextsuperscript{+} & 17,53
\
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.1}
end{subtable}
begin{subtable}[b]{0.5textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.2}
end{subtable}
begin{subtable}{0.5textwidth}
vspace{15pt}hspace{0.5linewidth}begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular} caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.3}
end{subtable}
caption{Resultados de las distintas simulaciones}
end{table}
end{document}% <---


The problem is that the third subtable is not aligned with its caption:



enter image description here



Is there any easy solution to align them?










share|improve this question

























  • Yes. See the subcaption manual for options. Set alignment for all sub-figures or just sub-tables, as you wish. Never use h alone as a float specifier. Where is LaTeX meant to put it if it doesn't fit? h means 'here, if it fits'. Please make your code compilable.

    – cfr
    Dec 10 '17 at 2:32













  • remove vspace{15pt}hspace{0.5linewidth} from third subtable. however each of your table is wider than 0.5textwidth (in page layout as is in your code example), so equation overlap (if i test your code) or tables are in one column if test your code after considering aforementioned suggestion. also i take liberty and make your code compilable.

    – Zarko
    Dec 10 '17 at 8:27














2












2








2


0






I am trying to create a table with tree subtables in it. To do so I have written the following code:



documentclass[twoside]{article} 
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{sidecap}
usepackage{fancyhdr}
usepackage{lastpage}
usepackage{extramarks}
usepackage{graphicx}
usepackage{mathpazo}
usepackage{amsmath}
usepackage{float}
usepackage{wrapfig}
usepackage{multicol}
usepackage[toc,page]{appendix}
usepackage{subcaption}

begin{document} % <---
begin{table}[h]
begin{subtable}[b]{0.5textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81
\
Amonio & 4,77 & Htextsubscript{2}O & 29,18
\
Fosfato & 3,21 & Htextsuperscript{+} & 17,53
\
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.1}
end{subtable}
begin{subtable}[b]{0.5textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.2}
end{subtable}
begin{subtable}{0.5textwidth}
vspace{15pt}hspace{0.5linewidth}begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular} caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.3}
end{subtable}
caption{Resultados de las distintas simulaciones}
end{table}
end{document}% <---


The problem is that the third subtable is not aligned with its caption:



enter image description here



Is there any easy solution to align them?










share|improve this question
















I am trying to create a table with tree subtables in it. To do so I have written the following code:



documentclass[twoside]{article} 
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{sidecap}
usepackage{fancyhdr}
usepackage{lastpage}
usepackage{extramarks}
usepackage{graphicx}
usepackage{mathpazo}
usepackage{amsmath}
usepackage{float}
usepackage{wrapfig}
usepackage{multicol}
usepackage[toc,page]{appendix}
usepackage{subcaption}

begin{document} % <---
begin{table}[h]
begin{subtable}[b]{0.5textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81
\
Amonio & 4,77 & Htextsubscript{2}O & 29,18
\
Fosfato & 3,21 & Htextsuperscript{+} & 17,53
\
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.1}
end{subtable}
begin{subtable}[b]{0.5textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.2}
end{subtable}
begin{subtable}{0.5textwidth}
vspace{15pt}hspace{0.5linewidth}begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular} caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.3}
end{subtable}
caption{Resultados de las distintas simulaciones}
end{table}
end{document}% <---


The problem is that the third subtable is not aligned with its caption:



enter image description here



Is there any easy solution to align them?







horizontal-alignment subfloats subcaption






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 10 '17 at 8:28









Zarko

123k865161




123k865161










asked Dec 10 '17 at 2:24









RjoseRRjoseR

133




133













  • Yes. See the subcaption manual for options. Set alignment for all sub-figures or just sub-tables, as you wish. Never use h alone as a float specifier. Where is LaTeX meant to put it if it doesn't fit? h means 'here, if it fits'. Please make your code compilable.

    – cfr
    Dec 10 '17 at 2:32













  • remove vspace{15pt}hspace{0.5linewidth} from third subtable. however each of your table is wider than 0.5textwidth (in page layout as is in your code example), so equation overlap (if i test your code) or tables are in one column if test your code after considering aforementioned suggestion. also i take liberty and make your code compilable.

    – Zarko
    Dec 10 '17 at 8:27



















  • Yes. See the subcaption manual for options. Set alignment for all sub-figures or just sub-tables, as you wish. Never use h alone as a float specifier. Where is LaTeX meant to put it if it doesn't fit? h means 'here, if it fits'. Please make your code compilable.

    – cfr
    Dec 10 '17 at 2:32













  • remove vspace{15pt}hspace{0.5linewidth} from third subtable. however each of your table is wider than 0.5textwidth (in page layout as is in your code example), so equation overlap (if i test your code) or tables are in one column if test your code after considering aforementioned suggestion. also i take liberty and make your code compilable.

    – Zarko
    Dec 10 '17 at 8:27

















Yes. See the subcaption manual for options. Set alignment for all sub-figures or just sub-tables, as you wish. Never use h alone as a float specifier. Where is LaTeX meant to put it if it doesn't fit? h means 'here, if it fits'. Please make your code compilable.

– cfr
Dec 10 '17 at 2:32







Yes. See the subcaption manual for options. Set alignment for all sub-figures or just sub-tables, as you wish. Never use h alone as a float specifier. Where is LaTeX meant to put it if it doesn't fit? h means 'here, if it fits'. Please make your code compilable.

– cfr
Dec 10 '17 at 2:32















remove vspace{15pt}hspace{0.5linewidth} from third subtable. however each of your table is wider than 0.5textwidth (in page layout as is in your code example), so equation overlap (if i test your code) or tables are in one column if test your code after considering aforementioned suggestion. also i take liberty and make your code compilable.

– Zarko
Dec 10 '17 at 8:27





remove vspace{15pt}hspace{0.5linewidth} from third subtable. however each of your table is wider than 0.5textwidth (in page layout as is in your code example), so equation overlap (if i test your code) or tables are in one column if test your code after considering aforementioned suggestion. also i take liberty and make your code compilable.

– Zarko
Dec 10 '17 at 8:27










2 Answers
2






active

oldest

votes


















2















  • your tables are wider than width of subtable, consequently your table using your mwe as is (after adding missing parts of code, see my comment above) overlaps (red lines on iomage below indicate your page layout):


enter image description here




  • considering my suggestion in comment above, you will obtain:


enter image description here




  • if i increase text width with use of package geometry (and use its default page layout settings) than i obtain after some small tweak of your subtable size, i obtain:


enter image description here



code for the last case is:



documentclass[twoside]{article}
usepackage{geometry} % <---
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{sidecap}
usepackage{fancyhdr}
usepackage{lastpage}
usepackage{extramarks}
usepackage{graphicx}
usepackage{mathpazo}
usepackage{amsmath}
usepackage{float}
usepackage{wrapfig}
usepackage{multicol}
usepackage[toc,page]{appendix}
usepackage{subcaption}

%-------------------------------- show page layout, only for test
usepackage{showframe}
renewcommandShowFrameLinethickness{0.15pt}
renewcommand*ShowFrameColor{color{red}}
%---------------------------------------------------------------%

begin{document}
begin{table}[ht]
renewcommandarraystretch{1.2}
centering
begin{subtable}{0.48textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81
\
Amonio & 4,77 & Htextsubscript{2}O & 29,18
\
Fosfato & 3,21 & Htextsuperscript{+} & 17,53
\
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.1}
end{subtable}
hfil
begin{subtable}{0.48textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.2}
end{subtable}

medskip
begin{subtable}{0.48textwidth}
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.3}
end{subtable}
caption{Resultados de las distintas simulaciones}
end{table}
end{document}





share|improve this answer


























  • Almost synchronized! The answers are a bit different, so I can leave mine :):):)

    – CarLaTeX
    Dec 10 '17 at 8:51



















2














Putting an empty line before the last subtable and adding a centering would do the trick.



Your MWE isn't complete, if I only add begin{document} ... end{document} the subtables overlap, I can't reproduce your output, and I get overfull hbox. Hence I changed it a bit:




  1. I've used the font footnotesize

  2. I've removed the vertical space before the first column and after the last one

  3. I've used booktabs package for horizontal lines

  4. and dcolumn for the alignment of the numbers.


Here is the result:



enter image description here



And here is the code:



documentclass[twoside]{article} 
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{array}
usepackage{booktabs}
usepackage{dcolumn}
newcolumntype{d}[1]{D{,}{,}{#1}}
usepackage{subcaption}
captionsetup[sub]{font=footnotesize,labelfont={footnotesize}}

begin{document}
begin{table}[ht!]footnotesizecentering
begin{subtable}{0.48textwidth}
centering
begin{tabular}{@{}ld{2}ld{4}@{}}
toprule
multicolumn{2}{@{}c}{Consumo} & multicolumn{2}{c@{}}{Producción}\
cmidrule(r){1-2} cmidrule(l){3-4}
Metabolito & multicolumn{1}{l}{Valor} & Metabolito & multicolumn{1}{l@{}}{Valor} \
cmidrule(r){1-2} cmidrule(l){3-4}
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81\
Amonio & 4,77 & Htextsubscript{2}O & 29,18\
Fosfato & 3,21 & Htextsuperscript{+}& 17,53\
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \
bottomrule
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.1}
end{subtable}
hfill
begin{subtable}{0.48textwidth}
centering
begin{tabular}{@{}ld{2}ld{4}@{}}
toprule
multicolumn{2}{@{}c}{Consumo} & multicolumn{2}{c@{}}{Producción} \
cmidrule(r){1-2} cmidrule(l){3-4}
Metabolito & multicolumn{1}{l}{Valor} & Metabolito & multicolumn{1}{l@{}}{Valor} \
cmidrule(r){1-2} cmidrule(l){3-4}
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \
bottomrule
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.2}
end{subtable}

vspace{baselineskip}
begin{subtable}{0.48textwidth}
begin{tabular}{@{}ld{2}ld{4}@{}}
toprule
multicolumn{2}{@{}c}{Consumo} & multicolumn{2}{c@{}}{Producción} \
cmidrule(r){1-2} cmidrule(l){3-4}
Metabolito & multicolumn{1}{l}{Valor} & Metabolito & multicolumn{1}{l@{}}{Valor} \
cmidrule(r){1-2} cmidrule(l){3-4}
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \
bottomrule
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.3}
end{subtable}
caption{Resultados de las distintas simulaciones}
end{table}
end{document}





share|improve this answer





















  • 1





    nice answer (+1)! and distinct different from mine :-)

    – Zarko
    Dec 10 '17 at 9:05











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f405386%2falign-subcaption-to-its-subtable%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









2















  • your tables are wider than width of subtable, consequently your table using your mwe as is (after adding missing parts of code, see my comment above) overlaps (red lines on iomage below indicate your page layout):


enter image description here




  • considering my suggestion in comment above, you will obtain:


enter image description here




  • if i increase text width with use of package geometry (and use its default page layout settings) than i obtain after some small tweak of your subtable size, i obtain:


enter image description here



code for the last case is:



documentclass[twoside]{article}
usepackage{geometry} % <---
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{sidecap}
usepackage{fancyhdr}
usepackage{lastpage}
usepackage{extramarks}
usepackage{graphicx}
usepackage{mathpazo}
usepackage{amsmath}
usepackage{float}
usepackage{wrapfig}
usepackage{multicol}
usepackage[toc,page]{appendix}
usepackage{subcaption}

%-------------------------------- show page layout, only for test
usepackage{showframe}
renewcommandShowFrameLinethickness{0.15pt}
renewcommand*ShowFrameColor{color{red}}
%---------------------------------------------------------------%

begin{document}
begin{table}[ht]
renewcommandarraystretch{1.2}
centering
begin{subtable}{0.48textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81
\
Amonio & 4,77 & Htextsubscript{2}O & 29,18
\
Fosfato & 3,21 & Htextsuperscript{+} & 17,53
\
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.1}
end{subtable}
hfil
begin{subtable}{0.48textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.2}
end{subtable}

medskip
begin{subtable}{0.48textwidth}
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.3}
end{subtable}
caption{Resultados de las distintas simulaciones}
end{table}
end{document}





share|improve this answer


























  • Almost synchronized! The answers are a bit different, so I can leave mine :):):)

    – CarLaTeX
    Dec 10 '17 at 8:51
















2















  • your tables are wider than width of subtable, consequently your table using your mwe as is (after adding missing parts of code, see my comment above) overlaps (red lines on iomage below indicate your page layout):


enter image description here




  • considering my suggestion in comment above, you will obtain:


enter image description here




  • if i increase text width with use of package geometry (and use its default page layout settings) than i obtain after some small tweak of your subtable size, i obtain:


enter image description here



code for the last case is:



documentclass[twoside]{article}
usepackage{geometry} % <---
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{sidecap}
usepackage{fancyhdr}
usepackage{lastpage}
usepackage{extramarks}
usepackage{graphicx}
usepackage{mathpazo}
usepackage{amsmath}
usepackage{float}
usepackage{wrapfig}
usepackage{multicol}
usepackage[toc,page]{appendix}
usepackage{subcaption}

%-------------------------------- show page layout, only for test
usepackage{showframe}
renewcommandShowFrameLinethickness{0.15pt}
renewcommand*ShowFrameColor{color{red}}
%---------------------------------------------------------------%

begin{document}
begin{table}[ht]
renewcommandarraystretch{1.2}
centering
begin{subtable}{0.48textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81
\
Amonio & 4,77 & Htextsubscript{2}O & 29,18
\
Fosfato & 3,21 & Htextsuperscript{+} & 17,53
\
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.1}
end{subtable}
hfil
begin{subtable}{0.48textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.2}
end{subtable}

medskip
begin{subtable}{0.48textwidth}
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.3}
end{subtable}
caption{Resultados de las distintas simulaciones}
end{table}
end{document}





share|improve this answer


























  • Almost synchronized! The answers are a bit different, so I can leave mine :):):)

    – CarLaTeX
    Dec 10 '17 at 8:51














2












2








2








  • your tables are wider than width of subtable, consequently your table using your mwe as is (after adding missing parts of code, see my comment above) overlaps (red lines on iomage below indicate your page layout):


enter image description here




  • considering my suggestion in comment above, you will obtain:


enter image description here




  • if i increase text width with use of package geometry (and use its default page layout settings) than i obtain after some small tweak of your subtable size, i obtain:


enter image description here



code for the last case is:



documentclass[twoside]{article}
usepackage{geometry} % <---
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{sidecap}
usepackage{fancyhdr}
usepackage{lastpage}
usepackage{extramarks}
usepackage{graphicx}
usepackage{mathpazo}
usepackage{amsmath}
usepackage{float}
usepackage{wrapfig}
usepackage{multicol}
usepackage[toc,page]{appendix}
usepackage{subcaption}

%-------------------------------- show page layout, only for test
usepackage{showframe}
renewcommandShowFrameLinethickness{0.15pt}
renewcommand*ShowFrameColor{color{red}}
%---------------------------------------------------------------%

begin{document}
begin{table}[ht]
renewcommandarraystretch{1.2}
centering
begin{subtable}{0.48textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81
\
Amonio & 4,77 & Htextsubscript{2}O & 29,18
\
Fosfato & 3,21 & Htextsuperscript{+} & 17,53
\
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.1}
end{subtable}
hfil
begin{subtable}{0.48textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.2}
end{subtable}

medskip
begin{subtable}{0.48textwidth}
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.3}
end{subtable}
caption{Resultados de las distintas simulaciones}
end{table}
end{document}





share|improve this answer
















  • your tables are wider than width of subtable, consequently your table using your mwe as is (after adding missing parts of code, see my comment above) overlaps (red lines on iomage below indicate your page layout):


enter image description here




  • considering my suggestion in comment above, you will obtain:


enter image description here




  • if i increase text width with use of package geometry (and use its default page layout settings) than i obtain after some small tweak of your subtable size, i obtain:


enter image description here



code for the last case is:



documentclass[twoside]{article}
usepackage{geometry} % <---
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{sidecap}
usepackage{fancyhdr}
usepackage{lastpage}
usepackage{extramarks}
usepackage{graphicx}
usepackage{mathpazo}
usepackage{amsmath}
usepackage{float}
usepackage{wrapfig}
usepackage{multicol}
usepackage[toc,page]{appendix}
usepackage{subcaption}

%-------------------------------- show page layout, only for test
usepackage{showframe}
renewcommandShowFrameLinethickness{0.15pt}
renewcommand*ShowFrameColor{color{red}}
%---------------------------------------------------------------%

begin{document}
begin{table}[ht]
renewcommandarraystretch{1.2}
centering
begin{subtable}{0.48textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81
\
Amonio & 4,77 & Htextsubscript{2}O & 29,18
\
Fosfato & 3,21 & Htextsuperscript{+} & 17,53
\
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.1}
end{subtable}
hfil
begin{subtable}{0.48textwidth}
centering
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.2}
end{subtable}

medskip
begin{subtable}{0.48textwidth}
begin{tabular}{ll|ll}
multicolumn{2}{c|}{Consumo} & multicolumn{2}{c}{Producción} \ hline
Metabolito & Valor & Metabolito & Valor \ hline
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \ hline
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.3}
end{subtable}
caption{Resultados de las distintas simulaciones}
end{table}
end{document}






share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 10 '17 at 9:02

























answered Dec 10 '17 at 8:45









ZarkoZarko

123k865161




123k865161













  • Almost synchronized! The answers are a bit different, so I can leave mine :):):)

    – CarLaTeX
    Dec 10 '17 at 8:51



















  • Almost synchronized! The answers are a bit different, so I can leave mine :):):)

    – CarLaTeX
    Dec 10 '17 at 8:51

















Almost synchronized! The answers are a bit different, so I can leave mine :):):)

– CarLaTeX
Dec 10 '17 at 8:51





Almost synchronized! The answers are a bit different, so I can leave mine :):):)

– CarLaTeX
Dec 10 '17 at 8:51











2














Putting an empty line before the last subtable and adding a centering would do the trick.



Your MWE isn't complete, if I only add begin{document} ... end{document} the subtables overlap, I can't reproduce your output, and I get overfull hbox. Hence I changed it a bit:




  1. I've used the font footnotesize

  2. I've removed the vertical space before the first column and after the last one

  3. I've used booktabs package for horizontal lines

  4. and dcolumn for the alignment of the numbers.


Here is the result:



enter image description here



And here is the code:



documentclass[twoside]{article} 
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{array}
usepackage{booktabs}
usepackage{dcolumn}
newcolumntype{d}[1]{D{,}{,}{#1}}
usepackage{subcaption}
captionsetup[sub]{font=footnotesize,labelfont={footnotesize}}

begin{document}
begin{table}[ht!]footnotesizecentering
begin{subtable}{0.48textwidth}
centering
begin{tabular}{@{}ld{2}ld{4}@{}}
toprule
multicolumn{2}{@{}c}{Consumo} & multicolumn{2}{c@{}}{Producción}\
cmidrule(r){1-2} cmidrule(l){3-4}
Metabolito & multicolumn{1}{l}{Valor} & Metabolito & multicolumn{1}{l@{}}{Valor} \
cmidrule(r){1-2} cmidrule(l){3-4}
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81\
Amonio & 4,77 & Htextsubscript{2}O & 29,18\
Fosfato & 3,21 & Htextsuperscript{+}& 17,53\
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \
bottomrule
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.1}
end{subtable}
hfill
begin{subtable}{0.48textwidth}
centering
begin{tabular}{@{}ld{2}ld{4}@{}}
toprule
multicolumn{2}{@{}c}{Consumo} & multicolumn{2}{c@{}}{Producción} \
cmidrule(r){1-2} cmidrule(l){3-4}
Metabolito & multicolumn{1}{l}{Valor} & Metabolito & multicolumn{1}{l@{}}{Valor} \
cmidrule(r){1-2} cmidrule(l){3-4}
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \
bottomrule
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.2}
end{subtable}

vspace{baselineskip}
begin{subtable}{0.48textwidth}
begin{tabular}{@{}ld{2}ld{4}@{}}
toprule
multicolumn{2}{@{}c}{Consumo} & multicolumn{2}{c@{}}{Producción} \
cmidrule(r){1-2} cmidrule(l){3-4}
Metabolito & multicolumn{1}{l}{Valor} & Metabolito & multicolumn{1}{l@{}}{Valor} \
cmidrule(r){1-2} cmidrule(l){3-4}
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \
bottomrule
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.3}
end{subtable}
caption{Resultados de las distintas simulaciones}
end{table}
end{document}





share|improve this answer





















  • 1





    nice answer (+1)! and distinct different from mine :-)

    – Zarko
    Dec 10 '17 at 9:05
















2














Putting an empty line before the last subtable and adding a centering would do the trick.



Your MWE isn't complete, if I only add begin{document} ... end{document} the subtables overlap, I can't reproduce your output, and I get overfull hbox. Hence I changed it a bit:




  1. I've used the font footnotesize

  2. I've removed the vertical space before the first column and after the last one

  3. I've used booktabs package for horizontal lines

  4. and dcolumn for the alignment of the numbers.


Here is the result:



enter image description here



And here is the code:



documentclass[twoside]{article} 
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{array}
usepackage{booktabs}
usepackage{dcolumn}
newcolumntype{d}[1]{D{,}{,}{#1}}
usepackage{subcaption}
captionsetup[sub]{font=footnotesize,labelfont={footnotesize}}

begin{document}
begin{table}[ht!]footnotesizecentering
begin{subtable}{0.48textwidth}
centering
begin{tabular}{@{}ld{2}ld{4}@{}}
toprule
multicolumn{2}{@{}c}{Consumo} & multicolumn{2}{c@{}}{Producción}\
cmidrule(r){1-2} cmidrule(l){3-4}
Metabolito & multicolumn{1}{l}{Valor} & Metabolito & multicolumn{1}{l@{}}{Valor} \
cmidrule(r){1-2} cmidrule(l){3-4}
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81\
Amonio & 4,77 & Htextsubscript{2}O & 29,18\
Fosfato & 3,21 & Htextsuperscript{+}& 17,53\
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \
bottomrule
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.1}
end{subtable}
hfill
begin{subtable}{0.48textwidth}
centering
begin{tabular}{@{}ld{2}ld{4}@{}}
toprule
multicolumn{2}{@{}c}{Consumo} & multicolumn{2}{c@{}}{Producción} \
cmidrule(r){1-2} cmidrule(l){3-4}
Metabolito & multicolumn{1}{l}{Valor} & Metabolito & multicolumn{1}{l@{}}{Valor} \
cmidrule(r){1-2} cmidrule(l){3-4}
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \
bottomrule
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.2}
end{subtable}

vspace{baselineskip}
begin{subtable}{0.48textwidth}
begin{tabular}{@{}ld{2}ld{4}@{}}
toprule
multicolumn{2}{@{}c}{Consumo} & multicolumn{2}{c@{}}{Producción} \
cmidrule(r){1-2} cmidrule(l){3-4}
Metabolito & multicolumn{1}{l}{Valor} & Metabolito & multicolumn{1}{l@{}}{Valor} \
cmidrule(r){1-2} cmidrule(l){3-4}
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \
bottomrule
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.3}
end{subtable}
caption{Resultados de las distintas simulaciones}
end{table}
end{document}





share|improve this answer





















  • 1





    nice answer (+1)! and distinct different from mine :-)

    – Zarko
    Dec 10 '17 at 9:05














2












2








2







Putting an empty line before the last subtable and adding a centering would do the trick.



Your MWE isn't complete, if I only add begin{document} ... end{document} the subtables overlap, I can't reproduce your output, and I get overfull hbox. Hence I changed it a bit:




  1. I've used the font footnotesize

  2. I've removed the vertical space before the first column and after the last one

  3. I've used booktabs package for horizontal lines

  4. and dcolumn for the alignment of the numbers.


Here is the result:



enter image description here



And here is the code:



documentclass[twoside]{article} 
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{array}
usepackage{booktabs}
usepackage{dcolumn}
newcolumntype{d}[1]{D{,}{,}{#1}}
usepackage{subcaption}
captionsetup[sub]{font=footnotesize,labelfont={footnotesize}}

begin{document}
begin{table}[ht!]footnotesizecentering
begin{subtable}{0.48textwidth}
centering
begin{tabular}{@{}ld{2}ld{4}@{}}
toprule
multicolumn{2}{@{}c}{Consumo} & multicolumn{2}{c@{}}{Producción}\
cmidrule(r){1-2} cmidrule(l){3-4}
Metabolito & multicolumn{1}{l}{Valor} & Metabolito & multicolumn{1}{l@{}}{Valor} \
cmidrule(r){1-2} cmidrule(l){3-4}
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81\
Amonio & 4,77 & Htextsubscript{2}O & 29,18\
Fosfato & 3,21 & Htextsuperscript{+}& 17,53\
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \
bottomrule
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.1}
end{subtable}
hfill
begin{subtable}{0.48textwidth}
centering
begin{tabular}{@{}ld{2}ld{4}@{}}
toprule
multicolumn{2}{@{}c}{Consumo} & multicolumn{2}{c@{}}{Producción} \
cmidrule(r){1-2} cmidrule(l){3-4}
Metabolito & multicolumn{1}{l}{Valor} & Metabolito & multicolumn{1}{l@{}}{Valor} \
cmidrule(r){1-2} cmidrule(l){3-4}
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \
bottomrule
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.2}
end{subtable}

vspace{baselineskip}
begin{subtable}{0.48textwidth}
begin{tabular}{@{}ld{2}ld{4}@{}}
toprule
multicolumn{2}{@{}c}{Consumo} & multicolumn{2}{c@{}}{Producción} \
cmidrule(r){1-2} cmidrule(l){3-4}
Metabolito & multicolumn{1}{l}{Valor} & Metabolito & multicolumn{1}{l@{}}{Valor} \
cmidrule(r){1-2} cmidrule(l){3-4}
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \
bottomrule
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.3}
end{subtable}
caption{Resultados de las distintas simulaciones}
end{table}
end{document}





share|improve this answer















Putting an empty line before the last subtable and adding a centering would do the trick.



Your MWE isn't complete, if I only add begin{document} ... end{document} the subtables overlap, I can't reproduce your output, and I get overfull hbox. Hence I changed it a bit:




  1. I've used the font footnotesize

  2. I've removed the vertical space before the first column and after the last one

  3. I've used booktabs package for horizontal lines

  4. and dcolumn for the alignment of the numbers.


Here is the result:



enter image description here



And here is the code:



documentclass[twoside]{article} 
usepackage[utf8]{inputenc}
usepackage[spanish]{babel}
usepackage{array}
usepackage{booktabs}
usepackage{dcolumn}
newcolumntype{d}[1]{D{,}{,}{#1}}
usepackage{subcaption}
captionsetup[sub]{font=footnotesize,labelfont={footnotesize}}

begin{document}
begin{table}[ht!]footnotesizecentering
begin{subtable}{0.48textwidth}
centering
begin{tabular}{@{}ld{2}ld{4}@{}}
toprule
multicolumn{2}{@{}c}{Consumo} & multicolumn{2}{c@{}}{Producción}\
cmidrule(r){1-2} cmidrule(l){3-4}
Metabolito & multicolumn{1}{l}{Valor} & Metabolito & multicolumn{1}{l@{}}{Valor} \
cmidrule(r){1-2} cmidrule(l){3-4}
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81\
Amonio & 4,77 & Htextsubscript{2}O & 29,18\
Fosfato & 3,21 & Htextsuperscript{+}& 17,53\
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \
bottomrule
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.1}
end{subtable}
hfill
begin{subtable}{0.48textwidth}
centering
begin{tabular}{@{}ld{2}ld{4}@{}}
toprule
multicolumn{2}{@{}c}{Consumo} & multicolumn{2}{c@{}}{Producción} \
cmidrule(r){1-2} cmidrule(l){3-4}
Metabolito & multicolumn{1}{l}{Valor} & Metabolito & multicolumn{1}{l@{}}{Valor} \
cmidrule(r){1-2} cmidrule(l){3-4}
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \
bottomrule
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.2}
end{subtable}

vspace{baselineskip}
begin{subtable}{0.48textwidth}
begin{tabular}{@{}ld{2}ld{4}@{}}
toprule
multicolumn{2}{@{}c}{Consumo} & multicolumn{2}{c@{}}{Producción} \
cmidrule(r){1-2} cmidrule(l){3-4}
Metabolito & multicolumn{1}{l}{Valor} & Metabolito & multicolumn{1}{l@{}}{Valor} \
cmidrule(r){1-2} cmidrule(l){3-4}
D-Fructosa & 10,00 & COtextsubscript{2} & 22,81 \
Amonio & 4,77 & Htextsubscript{2}O & 29,18 \
Fosfato & 3,21 & Htextsuperscript{+} & 17,53 \
Otextsubscript{2} & 22,00 & Acetato & 0,0038 \
bottomrule
end{tabular}
caption{textit{E.coli} con fuente de carbono fructosa}label{tabla4.3}
end{subtable}
caption{Resultados de las distintas simulaciones}
end{table}
end{document}






share|improve this answer














share|improve this answer



share|improve this answer








edited 6 mins ago

























answered Dec 10 '17 at 8:48









CarLaTeXCarLaTeX

31k449129




31k449129








  • 1





    nice answer (+1)! and distinct different from mine :-)

    – Zarko
    Dec 10 '17 at 9:05














  • 1





    nice answer (+1)! and distinct different from mine :-)

    – Zarko
    Dec 10 '17 at 9:05








1




1





nice answer (+1)! and distinct different from mine :-)

– Zarko
Dec 10 '17 at 9:05





nice answer (+1)! and distinct different from mine :-)

– Zarko
Dec 10 '17 at 9:05


















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f405386%2falign-subcaption-to-its-subtable%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Accessing regular linux commands in Huawei's Dopra Linux

Can't connect RFCOMM socket: Host is down

Kernel panic - not syncing: Fatal Exception in Interrupt