Saving table as PNG
I'd like to save the following table as png. I've tried this and using the Linux program convert, but both saved the whole page instead of just the table. I want to save just the table as png.
How can I do this?
documentclass[11pt]{article}
usepackage[table]{xcolor}
definecolor{myblue}{RGB}{78, 126, 222}
usepackage{multirow}
usepackage{geometry}
usepackage{tabularx}
usepackage{booktabs}
usepackage{ragged2e}
begin{document}
begin{table}[ht]
centeringsetlength{extrarowheight}{3pt}
rowcolors{1}{myblue}{}
begin{tabularx}{textwidth}{>{cellcolor{white}} c >{cellcolor{white}}c>{RaggedRightarraybackslash}X>{RaggedRightarraybackslash}X}
toprule
& Inner index 1.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 1} & Inner index 1.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule
& Inner index 2.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 2} & Inner index 2.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule& Inner index 3.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
&Inner index 3.2 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.3 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
multirow{-2}{*}{Outer index 3}&Inner index 3.4 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.5 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.6 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
bottomrule
end{tabularx}
end{table}
end{document}
png
|
show 1 more comment
I'd like to save the following table as png. I've tried this and using the Linux program convert, but both saved the whole page instead of just the table. I want to save just the table as png.
How can I do this?
documentclass[11pt]{article}
usepackage[table]{xcolor}
definecolor{myblue}{RGB}{78, 126, 222}
usepackage{multirow}
usepackage{geometry}
usepackage{tabularx}
usepackage{booktabs}
usepackage{ragged2e}
begin{document}
begin{table}[ht]
centeringsetlength{extrarowheight}{3pt}
rowcolors{1}{myblue}{}
begin{tabularx}{textwidth}{>{cellcolor{white}} c >{cellcolor{white}}c>{RaggedRightarraybackslash}X>{RaggedRightarraybackslash}X}
toprule
& Inner index 1.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 1} & Inner index 1.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule
& Inner index 2.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 2} & Inner index 2.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule& Inner index 3.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
&Inner index 3.2 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.3 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
multirow{-2}{*}{Outer index 3}&Inner index 3.4 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.5 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.6 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
bottomrule
end{tabularx}
end{table}
end{document}
png
Produce the PDF, open it with Photoshop and then save it as the format of PNG.
– Kuttens
Mar 21 at 1:02
Even if I took your suggestion seriously, it doesn't address the issue of it saving the whole page. @Kuttens
– whoami
Mar 21 at 1:08
remove thetableenvironment and just have the tabular, and usestandaloneclass notarticleand the page will be resized to the table, the class has options to auto-generate the image formats as well
– David Carlisle
Mar 21 at 1:14
@DavidCarlisle Close! That made me loose the bottom line of the table. Otherwise, if you were to answer with that, I would accept it. Can you find a solution to this and answer, please?
– whoami
Mar 21 at 1:18
too late to check now but I think you will find the class has some options to add a bit of white space padding before it clips, too late to check now, feel free to self answer if you get something working
– David Carlisle
Mar 21 at 1:19
|
show 1 more comment
I'd like to save the following table as png. I've tried this and using the Linux program convert, but both saved the whole page instead of just the table. I want to save just the table as png.
How can I do this?
documentclass[11pt]{article}
usepackage[table]{xcolor}
definecolor{myblue}{RGB}{78, 126, 222}
usepackage{multirow}
usepackage{geometry}
usepackage{tabularx}
usepackage{booktabs}
usepackage{ragged2e}
begin{document}
begin{table}[ht]
centeringsetlength{extrarowheight}{3pt}
rowcolors{1}{myblue}{}
begin{tabularx}{textwidth}{>{cellcolor{white}} c >{cellcolor{white}}c>{RaggedRightarraybackslash}X>{RaggedRightarraybackslash}X}
toprule
& Inner index 1.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 1} & Inner index 1.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule
& Inner index 2.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 2} & Inner index 2.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule& Inner index 3.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
&Inner index 3.2 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.3 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
multirow{-2}{*}{Outer index 3}&Inner index 3.4 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.5 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.6 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
bottomrule
end{tabularx}
end{table}
end{document}
png
I'd like to save the following table as png. I've tried this and using the Linux program convert, but both saved the whole page instead of just the table. I want to save just the table as png.
How can I do this?
documentclass[11pt]{article}
usepackage[table]{xcolor}
definecolor{myblue}{RGB}{78, 126, 222}
usepackage{multirow}
usepackage{geometry}
usepackage{tabularx}
usepackage{booktabs}
usepackage{ragged2e}
begin{document}
begin{table}[ht]
centeringsetlength{extrarowheight}{3pt}
rowcolors{1}{myblue}{}
begin{tabularx}{textwidth}{>{cellcolor{white}} c >{cellcolor{white}}c>{RaggedRightarraybackslash}X>{RaggedRightarraybackslash}X}
toprule
& Inner index 1.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 1} & Inner index 1.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule
& Inner index 2.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 2} & Inner index 2.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule& Inner index 3.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
&Inner index 3.2 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.3 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
multirow{-2}{*}{Outer index 3}&Inner index 3.4 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.5 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.6 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
bottomrule
end{tabularx}
end{table}
end{document}
png
png
asked Mar 21 at 0:22
whoamiwhoami
344
344
Produce the PDF, open it with Photoshop and then save it as the format of PNG.
– Kuttens
Mar 21 at 1:02
Even if I took your suggestion seriously, it doesn't address the issue of it saving the whole page. @Kuttens
– whoami
Mar 21 at 1:08
remove thetableenvironment and just have the tabular, and usestandaloneclass notarticleand the page will be resized to the table, the class has options to auto-generate the image formats as well
– David Carlisle
Mar 21 at 1:14
@DavidCarlisle Close! That made me loose the bottom line of the table. Otherwise, if you were to answer with that, I would accept it. Can you find a solution to this and answer, please?
– whoami
Mar 21 at 1:18
too late to check now but I think you will find the class has some options to add a bit of white space padding before it clips, too late to check now, feel free to self answer if you get something working
– David Carlisle
Mar 21 at 1:19
|
show 1 more comment
Produce the PDF, open it with Photoshop and then save it as the format of PNG.
– Kuttens
Mar 21 at 1:02
Even if I took your suggestion seriously, it doesn't address the issue of it saving the whole page. @Kuttens
– whoami
Mar 21 at 1:08
remove thetableenvironment and just have the tabular, and usestandaloneclass notarticleand the page will be resized to the table, the class has options to auto-generate the image formats as well
– David Carlisle
Mar 21 at 1:14
@DavidCarlisle Close! That made me loose the bottom line of the table. Otherwise, if you were to answer with that, I would accept it. Can you find a solution to this and answer, please?
– whoami
Mar 21 at 1:18
too late to check now but I think you will find the class has some options to add a bit of white space padding before it clips, too late to check now, feel free to self answer if you get something working
– David Carlisle
Mar 21 at 1:19
Produce the PDF, open it with Photoshop and then save it as the format of PNG.
– Kuttens
Mar 21 at 1:02
Produce the PDF, open it with Photoshop and then save it as the format of PNG.
– Kuttens
Mar 21 at 1:02
Even if I took your suggestion seriously, it doesn't address the issue of it saving the whole page. @Kuttens
– whoami
Mar 21 at 1:08
Even if I took your suggestion seriously, it doesn't address the issue of it saving the whole page. @Kuttens
– whoami
Mar 21 at 1:08
remove the
table environment and just have the tabular, and use standalone class not article and the page will be resized to the table, the class has options to auto-generate the image formats as well– David Carlisle
Mar 21 at 1:14
remove the
table environment and just have the tabular, and use standalone class not article and the page will be resized to the table, the class has options to auto-generate the image formats as well– David Carlisle
Mar 21 at 1:14
@DavidCarlisle Close! That made me loose the bottom line of the table. Otherwise, if you were to answer with that, I would accept it. Can you find a solution to this and answer, please?
– whoami
Mar 21 at 1:18
@DavidCarlisle Close! That made me loose the bottom line of the table. Otherwise, if you were to answer with that, I would accept it. Can you find a solution to this and answer, please?
– whoami
Mar 21 at 1:18
too late to check now but I think you will find the class has some options to add a bit of white space padding before it clips, too late to check now, feel free to self answer if you get something working
– David Carlisle
Mar 21 at 1:19
too late to check now but I think you will find the class has some options to add a bit of white space padding before it clips, too late to check now, feel free to self answer if you get something working
– David Carlisle
Mar 21 at 1:19
|
show 1 more comment
1 Answer
1
active
oldest
votes
You can get a page sized to the content using the standalone class something like
documentclass[border={0pt 40pt 40pt 0pt}]{standalone}
usepackage[table]{xcolor}
definecolor{myblue}{RGB}{78, 126, 222}
usepackage{multirow}
usepackage{geometry}
usepackage{tabularx}
usepackage{booktabs}
usepackage{ragged2e}
begin{document}
begin{tabularx}{textwidth}{>{cellcolor{white}} c >{cellcolor{white}}c>{RaggedRightarraybackslash}X>{RaggedRightarraybackslash}X}
toprule
& Inner index 1.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 1} & Inner index 1.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule
& Inner index 2.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 2} & Inner index 2.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule& Inner index 3.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
&Inner index 3.2 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.3 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
multirow{-2}{*}{Outer index 3}&Inner index 3.4 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.5 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.6 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
bottomrule
end{tabularx}
end{document}
If you add png:
documentclass[border={0pt 40pt 40pt 0pt},png]{standalone}
and run pdflatex with --shell-escape then it will automatically use imagemagic convert in the background and directly produce a PNG image rather than PDF outpuput.
add a comment |
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480602%2fsaving-table-as-png%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can get a page sized to the content using the standalone class something like
documentclass[border={0pt 40pt 40pt 0pt}]{standalone}
usepackage[table]{xcolor}
definecolor{myblue}{RGB}{78, 126, 222}
usepackage{multirow}
usepackage{geometry}
usepackage{tabularx}
usepackage{booktabs}
usepackage{ragged2e}
begin{document}
begin{tabularx}{textwidth}{>{cellcolor{white}} c >{cellcolor{white}}c>{RaggedRightarraybackslash}X>{RaggedRightarraybackslash}X}
toprule
& Inner index 1.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 1} & Inner index 1.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule
& Inner index 2.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 2} & Inner index 2.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule& Inner index 3.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
&Inner index 3.2 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.3 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
multirow{-2}{*}{Outer index 3}&Inner index 3.4 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.5 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.6 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
bottomrule
end{tabularx}
end{document}
If you add png:
documentclass[border={0pt 40pt 40pt 0pt},png]{standalone}
and run pdflatex with --shell-escape then it will automatically use imagemagic convert in the background and directly produce a PNG image rather than PDF outpuput.
add a comment |
You can get a page sized to the content using the standalone class something like
documentclass[border={0pt 40pt 40pt 0pt}]{standalone}
usepackage[table]{xcolor}
definecolor{myblue}{RGB}{78, 126, 222}
usepackage{multirow}
usepackage{geometry}
usepackage{tabularx}
usepackage{booktabs}
usepackage{ragged2e}
begin{document}
begin{tabularx}{textwidth}{>{cellcolor{white}} c >{cellcolor{white}}c>{RaggedRightarraybackslash}X>{RaggedRightarraybackslash}X}
toprule
& Inner index 1.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 1} & Inner index 1.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule
& Inner index 2.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 2} & Inner index 2.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule& Inner index 3.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
&Inner index 3.2 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.3 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
multirow{-2}{*}{Outer index 3}&Inner index 3.4 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.5 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.6 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
bottomrule
end{tabularx}
end{document}
If you add png:
documentclass[border={0pt 40pt 40pt 0pt},png]{standalone}
and run pdflatex with --shell-escape then it will automatically use imagemagic convert in the background and directly produce a PNG image rather than PDF outpuput.
add a comment |
You can get a page sized to the content using the standalone class something like
documentclass[border={0pt 40pt 40pt 0pt}]{standalone}
usepackage[table]{xcolor}
definecolor{myblue}{RGB}{78, 126, 222}
usepackage{multirow}
usepackage{geometry}
usepackage{tabularx}
usepackage{booktabs}
usepackage{ragged2e}
begin{document}
begin{tabularx}{textwidth}{>{cellcolor{white}} c >{cellcolor{white}}c>{RaggedRightarraybackslash}X>{RaggedRightarraybackslash}X}
toprule
& Inner index 1.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 1} & Inner index 1.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule
& Inner index 2.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 2} & Inner index 2.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule& Inner index 3.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
&Inner index 3.2 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.3 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
multirow{-2}{*}{Outer index 3}&Inner index 3.4 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.5 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.6 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
bottomrule
end{tabularx}
end{document}
If you add png:
documentclass[border={0pt 40pt 40pt 0pt},png]{standalone}
and run pdflatex with --shell-escape then it will automatically use imagemagic convert in the background and directly produce a PNG image rather than PDF outpuput.
You can get a page sized to the content using the standalone class something like
documentclass[border={0pt 40pt 40pt 0pt}]{standalone}
usepackage[table]{xcolor}
definecolor{myblue}{RGB}{78, 126, 222}
usepackage{multirow}
usepackage{geometry}
usepackage{tabularx}
usepackage{booktabs}
usepackage{ragged2e}
begin{document}
begin{tabularx}{textwidth}{>{cellcolor{white}} c >{cellcolor{white}}c>{RaggedRightarraybackslash}X>{RaggedRightarraybackslash}X}
toprule
& Inner index 1.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 1} & Inner index 1.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule
& Inner index 2.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
multirow{-2}{*}{Outer index 2} & Inner index 2.2 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
midrule& Inner index 3.1 & Text data placeholder. May be long enough that it needs to be wrapped. & Text data placeholder. May be long enough that it needs to be wrapped.\
&Inner index 3.2 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.3 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
multirow{-2}{*}{Outer index 3}&Inner index 3.4 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.5 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
&Inner index 3.6 & multicolumn{2}{>{hsize=dimexpr2hsize+2tabcolsep+arrayrulewidthrelaxRaggedRightarraybackslash}X}{ Text data placeholder. May be long enough that it needs to be wrapped. Text data placeholder. May be long enough that it needs to be wrapped.}\
bottomrule
end{tabularx}
end{document}
If you add png:
documentclass[border={0pt 40pt 40pt 0pt},png]{standalone}
and run pdflatex with --shell-escape then it will automatically use imagemagic convert in the background and directly produce a PNG image rather than PDF outpuput.
answered Mar 21 at 7:43
David CarlisleDavid Carlisle
497k4111441890
497k4111441890
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f480602%2fsaving-table-as-png%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

Produce the PDF, open it with Photoshop and then save it as the format of PNG.
– Kuttens
Mar 21 at 1:02
Even if I took your suggestion seriously, it doesn't address the issue of it saving the whole page. @Kuttens
– whoami
Mar 21 at 1:08
remove the
tableenvironment and just have the tabular, and usestandaloneclass notarticleand the page will be resized to the table, the class has options to auto-generate the image formats as well– David Carlisle
Mar 21 at 1:14
@DavidCarlisle Close! That made me loose the bottom line of the table. Otherwise, if you were to answer with that, I would accept it. Can you find a solution to this and answer, please?
– whoami
Mar 21 at 1:18
too late to check now but I think you will find the class has some options to add a bit of white space padding before it clips, too late to check now, feel free to self answer if you get something working
– David Carlisle
Mar 21 at 1:19