Featured Book

LaTeX Beginners Guide

Who is online

In total there are 30 users online :: 0 registered, 0 hidden and 30 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: No registered users and 30 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

Equation Numbering and Table Font Size

Add tags LaTeX specific issues not fitting into one of the other forums of this category.

Equation Numbering and Table Font Size

Postby Joao on Sat Jun 18th, 2011

Hi folks

My University doesn't offer a template for thesis in laTeX, so I'm writing code in LaTeX to create my own.
I've used a template by another guy, based on book.cls, and modified it according to my University rules. But I run into two problems:

1. The rules specify that the equations should be centered and the equation number will come immediately at the end of equation (so, would be centered with the equation). I'm using the amsmath package, which only offers the options of putting the equation number on the right or on the left of the page, is there any hack I can make at my class to make my template according to the rules, or another package similar to amsmath that has that option?

2. The rules say that text has to be 10pt, but tables should be 9pt. I've tried to hack the class file to accomplish this, but wasn't successful (it worked fine for the font of the chapters and sections), can you provide me another solution which is not place in each table \footnotesize after the begin tag, which would be necessary to place in each table?

Second problem is not important, but the first one is.

Thanks for the help :-)
Last edited by Joao on Sun Jun 19th, 2011, edited 1 time in total.
Joao
 
Posts: 11
Joined: Sat Jun 18th, 2011

Re: Equation Numbering and Table Font Size

Postby Stefan_K on Sat Jun 18th, 2011

These rules are strange. Equations are numbered for referencing and look-up. Let's say, I look for equation 5.4, I just scan the border for the number. If the equation tags are scattered all over the text, from the center to the right, the numbers are hard to find. Numbers aren't just for decoration.

Since you write a thesis, you work with many scientific books. Can you tell me, any book of those uses such a style? With this in mind, you could speak about improvement of the rules.

Stefan
LaTeX Community Administrator
User avatar
Stefan_K
Site Admin
 
Posts: 6411
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Re: Equation Numbering and Table Font Size

Postby Joao on Sun Jun 19th, 2011

Hi.

Yes I know, and I totally agree with you, it's stupid because the equation number is "mixed" with the equation itself. I can only found the explanation for this as the people who approved the rule are used to Word, you know Word is crap regarding equations, I see my friends having to insert an invisible table to get the equation number aligned left, so I guess they approved that rule to make life easier for Word users.

But unfortunately that is the rule approved by the Rector, and I have to follow it, or my thesis will be rejected. :cry:

Edit: the books I know all use the equation number aligned to the right of the page (to make them more visible). I guess nobody uses that rule (except this University)
Joao
 
Posts: 11
Joined: Sat Jun 18th, 2011

Re: Equation Numbering and Table Font Size

Postby Stefan_K on Sun Jun 19th, 2011

Hi Joao,

fortunately, LaTeX makes it easy to follow also such rules by modifying the document style in a consistent way. Of course I will help you, so I will return to that topic later today when I've got some time.

Stefan
LaTeX Community Administrator
User avatar
Stefan_K
Site Admin
 
Posts: 6411
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Re: Equation Numbering and Table Font Size

Postby Joao on Sun Jun 19th, 2011

Stefan_K wrote:Hi Joao,

fortunately, LaTeX makes it easy to follow also such rules by modifying the document style in a consistent way. Of course I will help you, so I will return to that topic later today when I've got some time.

Stefan

Thank you Stefan 8-)
Joao
 
Posts: 11
Joined: Sat Jun 18th, 2011

Re: Equation Numbering and Table Font Size

Postby Stefan_K on Sun Jun 19th, 2011

Hi Joao,

here's the solution for smaller font size in all table environments, in a compilable example:

Code: Select all  •  Open in writeLaTeX
\documentclass[10pt]{book}
\makeatletter
\renewenvironment{table
}{%
  \renewcommand* {\@floatboxreset}{%
    \reset@font\@setminipage}
  \small\@float{table}}
  {\end@float}
\makeatother
\begin{document}
Text in 10pt

\begin{table}[!htbp]
\begin{tabular}{l}
Text in 9pt
\end{tabular}
\end{table}

Text in 10pt
\end{document
}


  • I redefined the table environment for inserting our font command
  • I chose \small which means 9pt in a document with 10pt base font size
  • I redefined \@floatboxreset because originally it contains \normalsize, which would override our \small
  • I used \makeatletter ... \makeatother around the redefinition because macros with @ in their name were used.

For reference, here are the original macros:

Code: Select all  •  Open in writeLaTeX
% From book.cls:
\newenvironment{table}
               {\@float{table}}
               {\end@float
}
% From ltfloat.ltx:
\def \@floatboxreset {%
        \reset@font
        \normalsize
        \@setminipage
}


Stefan
LaTeX Community Administrator
User avatar
Stefan_K
Site Admin
 
Posts: 6411
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Re: Equation Numbering and Table Font Size

Postby Joao on Sun Jun 19th, 2011

Thanks for the code.

It does work on another document, but I was unable to get it working in my template.
Placed the code in my formatanddef.tex file (which is where I place this type of code), no change.
Placed the code without the "\make..." tags in the end of my book.cls, no change.
Placed the code right before a table, no change.

But it works if I write:
Code: Select all  •  Open in writeLaTeX
\begin{table}[h]\small
\caption{Current consumption of the IRIS mote components}
        \centering
                \begin{tabular}{|c|c|}
                \hline
                        \textbf{Component} & \textbf{Current drain} \cr
                        \hline
                        Controller (full speed) & 8mA \cr
                        \hline
                        Controller (sleep mode) & 8$\mu$A \cr
                        \hline
                        Radio (receiving) & 16mA \cr
                        \hline
                        Radio (transmitting) & 17mA@3dBm \cr
                        \hline
                        Radio (sleep mode) & <1$\mu$A \cr
                        \hline
                \end{tabular}
        \label{cap01:tabela-consumo}
\end{table
}

I run out of ideas on why this isn't working, do you have any idea on what might be wrong?

Thanks for your time
Joao
 
Posts: 11
Joined: Sat Jun 18th, 2011

Re: Equation Numbering and Table Font Size

Postby Stefan_K on Sun Jun 19th, 2011

So post your version book.cls or your template, respectively, as attachment here. It should be easy to customize it to work with your code, if I know your code.

Stefan
LaTeX Community Administrator
User avatar
Stefan_K
Site Admin
 
Posts: 6411
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Re: Equation Numbering and Table Font Size

Postby Joao on Sun Jun 19th, 2011

Thank you, I've zipped all the files, Thesis.tex is the main file, than you have formatacaoUBI.tex which defines the formats, and the class file. ;)
Attachments
template-latex.zip
My template files
(96.09 KiB) Downloaded 32 times
Joao
 
Posts: 11
Joined: Sat Jun 18th, 2011

Re: Equation Numbering and Table Font Size

Postby Stefan_K on Sun Jun 19th, 2011

I would return to your question regarding the tags. However, two topics would be mixed in one thread. I suggest you create a new question in the math sub-forum, copying that part of the question there.

Stefan
LaTeX Community Administrator
User avatar
Stefan_K
Site Admin
 
Posts: 6411
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Next

Return to General

Who is online

Users browsing this forum: No registered users and 30 guests