Graphics, Figures & TablesHow to aline the numbering of my tables to the left

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
kabola
Posts: 2
Joined: Tue Dec 01, 2009 12:50 pm

How to aline the numbering of my tables to the left

Post by kabola »

hello
I'm having a little truble whit my tables, I can't figure out how I aline the numbering of my tables and the tables them self to the left
i have tried the following code but whitout any luck

\begin{flushleft}
\begin{table}[!h]
\renewcommand\thetable{Buffer A}
\caption{}\label{bufa}
\begin{tabular}{|l|l|p{3.5cm}|l|l|}

\end{tabular}
\end{table}
\end{flushleft}

any ideas would be welcome.

Thank you in advance.

Kasper

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to aline the numbering of my tables to the left

Post by localghost »

At first you may declare a new float type »buffer« after loading the caption package. This makes things easier.

Code: Select all

\documentclass[11pt,a4paper,english]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[
  font=small,
  labelfont=bf,
  singlelinecheck=false,
  tableposition=top
]{caption}
\usepackage{blindtext}

\DeclareCaptionType[fileext=lob,placement=htb,within=chapter]{buffer}[Buffer][List of Buffers]

\begin{document}
  \chapter{One}
  \section{One}
  \blindtext

  \begin{buffer}[!ht]
    \rule{6.4cm}{3.6cm}
    \caption{Dummy buffer}\label{buf:dummy}
  \end{buffer}

  \blindtext
\end{document}
The new buffer float environment can contain also a table like in your code snippet. You now can generate a list of your buffers with the new defined \listofbuffers command. The caption manual has the details.


Best regards and welcome to the board
Thorsten
kabola
Posts: 2
Joined: Tue Dec 01, 2009 12:50 pm

Re: How to aline the numbering of my tables to the left

Post by kabola »

thank you very much Thorsten that bit code did the trick but i dont quite understand how the code workes I asume that it is this bit of text:
\DeclareCaptionType[fileext=lob,placement=htb,within=chapter]{buffer}[Buffer]
  • that is responsible fore the change in lay out I have looked at the package pdf on page 27 but due to my restricted knowledge of LaTex I didn't understand the specificks of the code. so if you would be so kind as to tell me what the different tings in the {} and [] means I would be greatfull.
    best regards Kasper
    ps thanks fore the warm welcome.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to aline the numbering of my tables to the left

Post by localghost »

The main part in formatting is done with the loading of the package. For better recognition I added some comments.

Code: Select all

\usepackage[
  font=small,              % Smaller font for the whole caption text
  labelfont=bf,            % The label is bold
  singlelinecheck=false,   % No difference in justification between single-line and multi-line captions
  tableposition=top        % Formatting table captions
]{caption}
The line you cited is only for the declaration of the new float environment, its name, placement and the name of the List it will appear in. The justification of the caption is set by the third option (see above).

For details I recommend to take closer look at the caption manual. Take the time and browse a little bit.

For arguments to (new) commands you can keep the following in mind:
  • mandatory arguments are given in curly braces ({…})
  • optional arguments (shortly called options) are given in brackets ([…])
I think it would be good if you take a look at our special topic for beginners [1]. There is a lot to learn and the learning curve will be steep at the beginning. But the final result is worth to invest some time in reading.

[1] View topic: LaTeX Resources for Beginners
Post Reply