0

Can somebody please help me with an example of a LaTeX table template for minimum fontsize of 8 point?

For example, I want to make a table like the following, but I am not sure how to make it of fontsize of 9 point. If I need to insert some command, can you kindly help me?

\documentclass[a4paper,11pt]{article}

\begin{document} \begin{table}[h!] \begin{center} \caption{Your first table.} \label{tab:table1} \begin{tabular}{l|c|r} % <-- Alignments: 1st column left, 2nd middle and 3rd right, with vertical lines in between \textbf{Value 1} & \textbf{Value 2} & \textbf{Value 3}\ $\alpha$ & $\beta$ & $\gamma$ \ \hline 1 & 1110.1 & a\ 2 & 10.1 & b\ 3 & 23.113231 & c\ \end{tabular} \end{center} \end{table}

\end{document}

Thanking you.

Mathlover
  • 165
  • 2
    your question isn't clear at all , in the default classes \footnotesize is 8pt so you just need \footnotesize\begin{tabular}....\end{tabular} If you tried something and got an error show what input you made, and what error you got. – David Carlisle Aug 21 '20 at 09:51
  • Thank you. Actually I want to make a table with minimum fontsize of 8 point. I want to know the exact sample of such latex template which produces the above type of table. – Mathlover Aug 21 '20 at 10:00
  • 1
    I have no idea what you mean by minimum fontsize. In latex you specify a fontsize and that's the size you get so what do you mean by "minimum". Also latex doesn't have anything called a "template" I assume you mean an example document, but you should add such an example document to your question, then describe how you want the output altering. – David Carlisle Aug 21 '20 at 10:07
  • Please see the updated question. Yes, I want an example. – Mathlover Aug 21 '20 at 10:16
  • 1
    Your example is just a fragment, not anything anyone can run, but as I say in my first comment just put \footnotesize (8pt) or \small (9pt) before the table if you want a different font size. That is unrelated to tables, it is just how to select fonts in latex. – David Carlisle Aug 21 '20 at 10:28
  • I have used this command at the beginning of the document (will it produce 8 pt fontsize of the table?): \renewcommand{\footnotesize}{\fontsize{8bp}{1em}\selectfont – Mathlover Aug 21 '20 at 10:38
  • 1
    that is why your example should always be a complete document, you are asking about things unrelated to tables and not in the example in your question. That definition is rather odd as you redefine \footnotesize to make 8bp fonts on a baselineskip which is 1em in the font existing at the point in the document where you make the switch. Better to specify the baselineskip explictly in the second argument. But yes then obviously if you use \footnotesize you will get that size. Did you try it? what is your question? – David Carlisle Aug 21 '20 at 10:44
  • Please see the updated question. – Mathlover Aug 21 '20 at 11:17
  • 1
    same answer: put \small before \begin{tabular} – David Carlisle Aug 21 '20 at 11:21

1 Answers1

0

since you have used the 11pt option, 9pt (which you ask for in the question, despite it saying 8pt in the title) is \footnotesize so simply add that before the table.

\documentclass[a4paper,11pt]{article}

\begin{document}

\begin{table}[htp] % don't use [h!] it usually generates a warning. % better to use \centering than center in a float as table already adds space. \centering \caption{Your first table.} \label{tab:table1} \footnotesize %^^^^^^^^^^^^% \begin{tabular}{l|c|r} % <-- Alignments: 1st column left, 2nd middle and 3rd right, with vertical lines in between \textbf{Value 1} & \textbf{Value 2} & \textbf{Value 3}\ $\alpha$ & $\beta$ & $\gamma$ \ \hline 1 & 1110.1 & a\ 2 & 10.1 & b\ 3 & 23.113231 & c\ \end{tabular} \end{table}

\end{document}

David Carlisle
  • 757,742
  • it does not help to edit questions after an answer has been posted, it just makes it hard for future readers to understand the post. your edited question completely ignores my answer. \footnotesize(9pt) sets the text (9pt) at footnotesize and as you have it outside the table it has no effect at all on the tabular which will be set at \normalsize. If you use the code in my answer, text before the \begin{table} will be at 119pt \normalsize (10.95pt) and the text of the tabular will be 9pt. @Mathlover – David Carlisle Aug 22 '20 at 20:05
  • I removed the edit and made as it was before so that it can be understood in the furure. Thaank you very much for the help. @David Carlisle – Mathlover Aug 22 '20 at 20:17
  • have posted a question to make a gantt chart with 36 months with fontsize 9 point on A4 paper size in the link: https://tex.stackexchange.com/posts/559519/revisions – Mathlover Aug 22 '20 at 20:18
  • I tried with the above command, but it goes beyond the paper. Do you think it is possible? @David Carlisle – Mathlover Aug 22 '20 at 20:19
  • @Mathlover then you need to make your table smaller, re-arrange the table or use a smaller font such as \tiny – David Carlisle Aug 22 '20 at 20:35
  • But I want minimum fontsize 8 point. \tiny is smaller fontsize I just checked it is 5 pt. – Mathlover Aug 22 '20 at 20:37
  • @Mathlover there is no special thing, if you fix the font size and the page size is fixed, you just need to arrange your table data to fit, nothing special about latex there, it would be the same if you used a word processor or pencil and paper. see https://tex.stackexchange.com/questions/332902/my-table-doesnt-fit-what-are-my-options – David Carlisle Aug 22 '20 at 20:41
  • Now I tried with this, ut the table does not come after compile. \ documentclass[a4paper,11pt]{article} \usepackage{amssymb} \usepackage{amsmath} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{eurosym} \usepackage{xspace} \usepackage[margin=16mm,includehead,includefoot]{geometry} \usepackage{pgfgantt}\begin{document}\begin{table}\footnotesize\begin{tabular}{|m{12cm}|m{2cm}|b{2.5cm}|} \hline \textbf{WP 1} & {\textbf{Start Month-End Month}}\ \hline WP 1.1: Discussion & 1-8 \\hline \end{tabular}\end{table}\end{document} – Mathlover Aug 22 '20 at 21:03
  • Can you kindly tell does the command: {\fontsize{8bp}{1em}\selectfont after \begin{table} mean 8 pt fontsize? Thanks. @ David Carlisle – Mathlover Aug 22 '20 at 21:14
  • @Mathlover as I exaplained in a comment yesterday, It is wrong, it gives 8bp (not pt) font size but a baselineskip based on the font that was previously in use (whatever that is) do not use em, If you want 8pt use \scriptsize instead of \footnotesize but this is going in circles. I stop here. – David Carlisle Aug 22 '20 at 21:20
  • Thank you very much. @David Carlisle – Mathlover Aug 22 '20 at 21:24