I defined a table in LaTeX : \begin{tabular}....\end{tabular}
.
Now i want to export that table to an image (PNG or something}.
It is possible? How can i do that?
pngtables
I defined a table in LaTeX : \begin{tabular}....\end{tabular}
.
Now i want to export that table to an image (PNG or something}.
It is possible? How can i do that?
As far as I understand, a number for you is not
3.14159265358979323846264338327950288419716939
9375105820974944592307816406286208998628034825
3421170679821480865132823066470938446095505822
3172535940812848111745028410270193852110555964
4622948954930381964428810975665933446128475648
2337867831652712019091456485669234603486104543
266482133936072602491412737245870066063,
but rather 1, 2, 3, ...
Then one of solutions is a pifont
package, where circled numbers are obtained by \ding{172}--\ding{181}
, \ding{182}--\ding{191}
, \ding{192}--\ding{201}
, and \ding{202}--\ding{211}
.
Here's one option using the powerful tcolorbox
package in combination with the also powerful tabularx
. Using a style you can specify the table preamble, the image and possibly other attributes:
\documentclass{report}
\usepackage[table,dvipsnames]{xcolor}
\usepackage[most]{tcolorbox}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{lipsum}
\tcbset{
bgtable/.style={
enhanced,
colframe=red!50!black,
colbacktitle=Salmon!30,
coltitle=black,
center title,
fonttitle=\bfseries\sffamily,
watermark graphics=#1,
watermark opacity=0.3,
nobeforeafter}
}
\begin{document}
\noindent\begin{tcolorbox}[bgtable=mushrooms.jpg,tabularx*={}{XXXXX},title=My table,watermark stretch=1.00]
One & Two & Three & Four & Five\\
\midrule
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
\end{tcolorbox}
\noindent\begin{tcolorbox}[bgtable=ctanlion.png,tabularx*={}{XXXXX},title=My table,watermark stretch=1.00,width=8cm,watermark opacity=0.3]
One & Two & Three \\
\midrule
1000.00 & 2000.00 & 3000.00 \\
1000.00 & 2000.00 & 3000.00 \\
1000.00 & 2000.00 & 3000.00 \\
1000.00 & 2000.00 & 3000.00 \\
1000.00 & 2000.00 & 3000.00 \\
1000.00 & 2000.00 & 3000.00 \\
1000.00 & 2000.00 & 3000.00 \\
1000.00 & 2000.00 & 3000.00 \\
1000.00 & 2000.00 & 3000.00 \\
\end{tcolorbox}
\end{document}
Or, if you prefer a more sober style:
\documentclass{report}
\usepackage[table,dvipsnames]{xcolor}
\usepackage[most]{tcolorbox}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{lipsum}
\tcbset{
bgtable/.style={
freelance,
frame code={\draw[ultra thick] (interior.north west) -- (interior.north east);}
center title,
fonttitle=\bfseries\sffamily,
watermark graphics=#1,
watermark stretch=1.00,
watermark opacity=0.3,
arc=0pt,
outer arc=0pt,
nobeforeafter}
}
\begin{document}
\noindent\begin{tcolorbox}[bgtable=papiro.png,tabularx*={}{XXXXX},watermark opacity=0.6]
One & Two & Three & Four & Five\\
\midrule
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
\bottomrule
\end{tcolorbox}
\noindent\begin{tcolorbox}[bgtable=papiro.png,tabularx*={}{XXXXX},title=My table,watermark stretch=1.00,width=8cm,watermark opacity=0.6]
One & Two & Three \\
\midrule
1000.00 & 2000.00 & 3000.00 \\
1000.00 & 2000.00 & 3000.00 \\
1000.00 & 2000.00 & 3000.00 \\
1000.00 & 2000.00 & 3000.00 \\
1000.00 & 2000.00 & 3000.00 \\
1000.00 & 2000.00 & 3000.00 \\
1000.00 & 2000.00 & 3000.00 \\
1000.00 & 2000.00 & 3000.00 \\
1000.00 & 2000.00 & 3000.00 \\
\bottomrule
\end{tcolorbox}
\end{document}
A third example:
\documentclass{report}
\usepackage[table,dvipsnames]{xcolor}
\usepackage[most]{tcolorbox}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{lipsum}
\tcbset{
bgtable/.style={
freelance,
frame code={}
center title,
fonttitle=\bfseries\sffamily,
fontupper=\bfseries\sffamily,
watermark graphics=#1,
watermark stretch=1.00,
watermark opacity=1,
arc=0pt,
outer arc=0pt,
nobeforeafter,
coltext=white}
}
\begin{document}
\noindent\begin{tcolorbox}[bgtable=drops.jpeg,tabularx*={\arrayrulecolor{white}}{XXXXX}]
One & Two & Three & Four & Five\\
\midrule
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
1000.00 & 2000.00 & 3000.00 & 4000.00 & 5000.00 \\
\end{tcolorbox}
\end{document}
CTAN lion drawing by Duane Bibby.
Best Answer
The easiest way to do that would be to enclose your tabular in a document, with the standalone class.
Then compile it with dvipng or use ImageMagick to convert the div into a png.
The credits go to Martin Scharrer.