Decrease Font Size for table

3,263 views
Skip to first unread message

Ashish Revar

unread,
Sep 1, 2010, 5:18:45 AM9/1/10
to latexus...@googlegroups.com
Hello everyone,
I am making two column report which is having one table in left side column. But this table content is big so it is exceeding the column partition.
Is there any option to make wraptable like wrapfig?
I've tried one not working, so any solution related to changing the font size?

Please suggest me how to set font size with \newcommand.......

--
Ashish Revar
ashis...@gmail.com
9909298846

Ashish Revar

unread,
Sep 1, 2010, 5:23:27 AM9/1/10
to latexus...@googlegroups.com
I've used tyhis command to deal with this issue,

\newcommand{\tablefont}[1]{\fontsize{2.5mm}{2.5mm}\selectfont}

then

{\tablefont
\begin{table}
\begin{center}
\begin{tabular}{|p{2cm}|p{2.6cm}|p{2.6cm}|}
  \hline
  % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
  US pricing & S3 & Google \\ \hline \hline
  Storage & \$0.055-\$0.150 per GB/month & \$0.17/GB/month \\ \hline
  Upload data & \$0.10/GB/month & \$0.10/GB/month \\ \hline
  Download data & Free-\$0.150 per GB/month & \$0.15/GB/month \\ \hline
  PUT, POST, LIST requests & \$0.01 per 1,000 requests & \$0.01 per 1,000 requests
  \\ \hline
  GET, HEAD & \$0.01 per 10,000 requests & \$0.01 per 10,000 requests
  \\ \hline
\end{tabular}
\end{center}
\caption{Amazon S3 vs. Google Storage}
\end{table}
}

error is \caption outside float.

what goes wrong?

Peter Flynn

unread,
Sep 1, 2010, 6:01:16 AM9/1/10
to latexus...@googlegroups.com
On Wed, Sep 1, 2010 at 10:23 AM, Ashish Revar <ashis...@gmail.com> wrote:
I've used tyhis command to deal with this issue,

\newcommand{\tablefont}[1]{\fontsize{2.5mm}{2.5mm}\selectfont}

then

{\tablefont
\begin{table}
\begin{center}
\begin{tabular}{|p{2cm}|p{2.6cm}|p{2.6cm}|}
  \hline
  % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
  US pricing & S3 & Google \\ \hline \hline
  Storage & \$0.055-\$0.150 per GB/month & \$0.17/GB/month \\ \hline
  Upload data & \$0.10/GB/month & \$0.10/GB/month \\ \hline
  Download data & Free-\$0.150 per GB/month & \$0.15/GB/month \\ \hline
  PUT, POST, LIST requests & \$0.01 per 1,000 requests & \$0.01 per 1,000 requests
  \\ \hline
  GET, HEAD & \$0.01 per 10,000 requests & \$0.01 per 10,000 requests
  \\ \hline
\end{tabular}
\end{center}
\caption{Amazon S3 vs. Google Storage}
\end{table}
}

error is \caption outside float.

what goes wrong?

You have specified one argument for the \tablefont macro but you haven't supplied one, and the macro doesn't use one.

EITHER
\newcommand{\tablefont}{\fontsize{2.5mm}{2.5mm}\selectfont}
 OR
\newcommand{\tablefont}[1]{\fontsize{#1}{#1}\selectfont}
...
{\tablefont{2.5mm}

///Peter

Ashish Revar

unread,
Sep 1, 2010, 6:30:57 AM9/1/10
to latexus...@googlegroups.com
Thanks peter,
but I am having more than one table in the paper,

if I use the command
{\tablefont{2.5mm}

then it will change all the fonts in the all the tables, that is not what I need,

is there any alternative solution through which I can apply different font size to different texts in table.


--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To post to this group, send email to latexus...@googlegroups.com.
To unsubscribe from this group, send email to latexusersgro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.

Peter Flynn

unread,
Sep 1, 2010, 2:13:56 PM9/1/10
to latexus...@googlegroups.com
On Wed, Sep 1, 2010 at 11:30 AM, Ashish Revar <ashis...@gmail.com> wrote:
Thanks peter,
but I am having more than one table in the paper,

if I use the command
{\tablefont{2.5mm}

then it will change all the fonts in the all the tables,

No, exactly the oppositel. The whole purpose of using the argument, and preceding the command with an openbrace is that the value is kept local to the table. An alternative would be

\begin{table}
\tablefont{2.5mm}
...
\end{table}

That also will keep the value local.

///Peter

Ashish Revar

unread,
Sep 2, 2010, 1:00:28 AM9/2/10
to latexus...@googlegroups.com
Thanks a lot peter...
it is really helpful to me...

--
You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
To post to this group, send email to latexus...@googlegroups.com.
To unsubscribe from this group, send email to latexusersgro...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.
Reply all
Reply to author
Forward
0 new messages