Graphics, Figures & TablesText occurring before table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Rahul
Posts: 29
Joined: Wed Jul 24, 2013 10:07 am

Text occurring before table

Post by Rahul »

hi,

Code: Select all

\documentclass[12pt,journal,compsoc]{IEEEtran}
\usepackage{alltt}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{array}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{float}
\usepackage{lipsum}

\begin{document}


\subsection{Related Work}

Fractal encoding can be done in spatial domain[10][11] and frequency domain[12]. Paul Darvin[13] suggested a fractal method that uses the information of range and domain region as key. Joan Paute and Fred Jordan[14] used key to generate coordinates of range blocks. Patrick Bas and Jean-Marc Chassery[15][16] used fractal scheme for watermarking. They find the transformation such that for each block D and R, a new range block $\hat R$ is calculated as\\

$\hat R = \frac{\delta*S*D}{max(D)}+\bar R$\\

where S determines the magnitude of the watermark, $\bar R$ is the mean of R and

\[ \delta = \left\{ 
  \begin{array}{l l}
    & \quad \text{+1 if the embedded bit=1}\\
    & \quad \text{ -1 if the embedded bit=0}
  \end{array} \right.
\]

\subsection{Implementation}
Implementation of the algorithm is based on the following assumptions:

\begin{table}[ht]
\centering % used for centering table
\begin{tabular}{l} % centered columns (1 columns)
\hline % inserts single horizontal line
\\
\noindent
$\bullet$ Append data with the label END OF DATA.\\
$\bullet$ XOR data with key.\\
$\bullet$ Subsample domain blocks D so that they have same number of pixels \\
           as range blocks.\\
$\bullet$ Classify all domain blocks.\\
$\bullet$ While there are bits to be stored \\
\{\\
$\bullet$ Take a range block $R_i$ from R. \\ 
$\bullet$ Classify $R_i$. \\
$\bullet$ If current bit bi is 0 \\
$\bullet$ Consider domain blocks from $D^0$ that are of same class as of $R_i$. \\
$\bullet$ else \\
$\bullet$ Consider domain blocks from $D^1$ that are of same class as of $R_i$. \\
$\bullet$ Calculate scale $s_i$, offset $o_i$ and rms distance $d_{rms}$ between $R_i$ and all \\
•$D_j$s in the selected quadrant. \\
$\bullet$ Select domain block $D_min$ with least $d_{rms}$ and corresponding $s_i$ and \\
• $o_i$.\\
$\bullet$ Multiply each pixel of $D_min$ by $s_i$ and add $o_i$ and overwrite the \\
•corresponding range pixel by the result. \\
\}\\
\\
\hline %inserts single line
\end{tabular}
\label{table:nonlin} % is used to refer this table in the text
\caption{Pseudo-code for hiding steganographic data.} % title of Table
\end{table}


\begin{table}[ht]
\centering % used for centering table
\begin{tabular}{l} % centered columns (1 columns)

\hline % inserts single horizontal line
\\
$\bullet$ While not END OF DATA \\
\{\\
$\bullet$ Take a range block $R_i$ from R.\\
$\bullet$ Calculate scale $s_i$, offset $o_i$ and rms distance drms between $R_i$ and all\\
\'Djs in D.\\
$\bullet$ Select domain block $D_{min}$ with least $d_{rms}$ and corresponding $s_i$ \\
and $o_i$.\\
$\bullet$  If Dj is in $D^0$. \\ 
$\bullet$ Data bit bi is 0. \\
$\bullet$ else \\
$\bullet$ Data bit bi is 1 \\
\}\\
$\bullet$ XOR this bit stream with key to get original data.\\
\\
\hline %inserts single line
\end{tabular}
\label{table:nonlin} % is used to refer this table in the text
\caption{Pseudo-code for retrieving steganographic data.} % title of Table
\end{table}

\noindent
$\bullet$  It is assumed that the input image is of equal length and breadth.\\
$\bullet$  Image is grey scale and in the sun-raster format.\\
$\bullet$  Size of image header is 800 bytes.\\
$\bullet$  Each byte in the image data represents a pixel whose level of grey is from 0 to 255.\\

The hiding algorithm takes image I
\end{document}

\end{document}



After 2 tables the bullet-ed lines must come.But it is not acting so. 







Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Text occurring before table

Post by Johannes_B »

I'm not sure i understand your problem. Can you make it more clear? Floating environments like table are supposed to float around to find the best location.
Do you know about minimal working examples?

But some remarks on your code: Do you now the listings and/or algorithm-package? If you don't want to use those packages, you can still use an itemize-list for automatical bulleting. A look at the enumitem-package might be useful.
Additionally, tables usually have captions above the tabular material.
When clicking on Open in writelatex (that's the little button just above your code) i see, that your table one is sticking into the right column, you should fix that.
Do you know about the \cdot-command? This gives you a centered multiplication dot. This might be useful for your equations.
The package biblatex helps you with automatic referencing.

EDIT: just noticed this now. A double backslash \\ should never be used in text! See l2tabu for more information.


I fixed some of the important errors, have a look.

Code: Select all

\documentclass[12pt,journal,compsoc]{IEEEtran}
\usepackage{mathtools}
\usepackage{algorithmic}
\usepackage{tabularx}

\begin{document}
\subsection{Related Work}

Fractal encoding can be done in spatial domain[10][11] and 
frequency domain[12]. Paul Darvin[13] suggested a fractal 
method that uses the information of range and domain region
as key. Joan Paute and Fred Jordan[14] used key to generate 
coordinates of range blocks. Patrick Bas and Jean-Marc 
Chassery[15][16] used fractal scheme for watermarking. 
They find the transformation such that for each block D and
R, a new range block $\hat R$ is calculated as
\[\hat R = \frac{\delta \cdot S*D}{max(D)}+\bar R\]

where S determines the magnitude of the watermark, $\bar R$ 
is the mean of R and

%\[ \delta = \left\{ 
  %\begin{array}{l l}
    %& \quad \text{+1 if the embedded bit=1}\\
%    & \quad \text{ -1 if the embedded bit=0}
  %\end{array} \right.
%\]

\[\delta=\begin{cases}
+1 & \text{if the embedded bit} =1\\
-1 & \text{if the embedded bit} =0
\end{cases}
\]

\subsection{Implementation}
Implementation of the algorithm is based on the following 
assumptions:

\begin{table}
\caption{Pseudo-code for hiding steganographic data.}
\label{table:nonlin} 
\begin{tabularx}{\linewidth}{X} 
\hline % inserts single horizontal line
\\
\noindent
$\bullet$ Append data with the label END OF DATA.\\
$\bullet$ XOR data with key.\\
$\bullet$ Subsample domain blocks D so that they have same 
number of pixels \\
           as range blocks.\\
$\bullet$ Classify all domain blocks.\\
$\bullet$ While there are bits to be stored \\
\{\\
$\bullet$ Take a range block $R_i$ from R. \\ 
$\bullet$ Classify $R_i$. \\
$\bullet$ If current bit bi is 0 \\
$\bullet$ Consider domain blocks from $D^0$ that are of 
same class as of $R_i$. \\
$\bullet$ else \\
$\bullet$ Consider domain blocks from $D^1$ that are of 
same class as of $R_i$. \\
$\bullet$ Calculate scale $s_i$, offset $o_i$ and rms 
distance $d_{rms}$ between $R_i$ and all \\
•$D_j$s in the selected quadrant. \\
$\bullet$ Select domain block $D_min$ with least $d_{rms}$ 
and corresponding $s_i$ and \\
• $o_i$.\\
$\bullet$ Multiply each pixel of $D_min$ by $s_i$ and 
add $o_i$ and overwrite the \\
•corresponding range pixel by the result. \\
\}\\
\\
\hline %inserts single line
\end{tabularx}
\end{table}


\begin{table}
\caption{Pseudo-code for retrieving steganographic data.}
\label{table:nonlin}
\begin{tabularx}{\linewidth}{X} 

\hline % inserts single horizontal line
\\
$\bullet$ While not END OF DATA \\
\{\\
$\bullet$ Take a range block $R_i$ from R.\\
$\bullet$ Calculate scale $s_i$, offset $o_i$ and rms 
distance drms between $R_i$ and all\\
\'Djs in D.\\
$\bullet$ Select domain block $D_{min}$ with least $d_{rms}$ 
and corresponding $s_i$ \\
and $o_i$.\\
$\bullet$  If Dj is in $D^0$. \\ 
$\bullet$ Data bit bi is 0. \\
$\bullet$ else \\
$\bullet$ Data bit bi is 1 \\
\}\\
$\bullet$ XOR this bit stream with key to get original 
data.\\
\\
\hline %inserts single line
\end{tabularx}
\end{table}

\begin{itemize}
\item It is assumed that the input image is of equal 
length and breadth.
\item Image is grey scale and in the sun-raster format.
\item Size of image header is 800 bytes.
\item  Each byte in the image data represents a pixel 
whose level of grey is from 0 to 255.
\end{itemize}

The hiding algorithm takes image I
\end{document}

Code: Select all

\documentclass{article}
\usepackage{algorithmic}
\begin{document}
\begin{algorithmic}
\WHILE{not END OF DATA}
\STATE Take a range block $R_i$ from R.
\STATE Calculate scale $s_i$, offset $o_i$ and rms distance drms between $R_i$ and all
\IF{Dj is in $D^0$.}
	\STATE Data bit bi is 0.
\ELSE
	\STATE Data bit bi is 1
\ENDIF
\ENDWHILE
\end{algorithmic}
\end{document}
Last edited by Johannes_B on Thu Aug 08, 2013 12:36 pm, edited 1 time in total.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Rahul
Posts: 29
Joined: Wed Jul 24, 2013 10:07 am

Re: Text occurring before table

Post by Rahul »

This is not I want.I want the list of items and text "The hiding algorithm takes image I" to occur after the tables.I am using Mitex 2.9 texworks.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Text occurring before table

Post by Johannes_B »

As already mentioned here and there: If you do not want to have your tables and figures float, do not use floating environments. Use capt-of to place captions.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply