2

I have a long table in the middle of twocolumn article.
If the table is not long enough, it is appeared in a place relative to the place I need it to be. But when the table long and fixed in one page, it moved to the very end of document. My question is this: How to make the table stay in the middle of document, not in the end of document?

\documentclass[twoside,twocolumn,12pt,a4paper]{article}  
\usepackage{microtype}   
\usepackage[bahasa]{babel}   
\usepackage[left=3.00cm, right=2.00cm, top=2.50cm,   bottom=2.50cm,columnsep=0.5cm]{geometry}  
\usepackage[hang,small,labelfont=bf,up,textfont=it,up]{caption}   
\hyphenation{ber-da-sar-kan peng-a-mat-an spon-tan di-se-but-kan  
    mau-pun mem-per-li-hat-kan di-mak-sud-kan me-wa-kil-i me-nun-juk-kan   pe-ra-ga  
    di-tam-bah-kan me-nga-ta-kan}  
\usepackage{booktabs}   
\usepackage{multirow}  
\usepackage{amssymb}  
\usepackage{amsmath}  
\usepackage{graphicx}  
\usepackage{makeidx}  
\usepackage{microtype}  
\usepackage{hyperref}  
\usepackage{sectsty}  
\usepackage{abstract}  
\usepackage{tabularx}  
\usepackage{makecell}  
\usepackage{float}  
\usepackage{titlesec}  
\usepackage{xpatch}  
\usepackage{hyphenat}  
\usepackage{lipsum}  
\usepackage{etoolbox}  
\begin{document}  
    \lipsum  
    \begin{table*}[!htbp]  
        %{table*}[h!]  
        \caption{Persepsi Guru Mengenai Penyebab Epistemologis.}  
        \begin{tabularx}{\linewidth}{XX}  
            \toprule %  
            \thead{Sub Kategori} & \thead{Jawaban Guru}\\  
            \cmidrule[\lightrulewidth](lr){1-2} 
            \begin{enumerate}   
                \item Sifat abstrak konsep matematika   
                \item Kehirarkian Konsep Matematika  
            \end{enumerate} & \begin{itemize}%  
                \item Matematika itu merupakan mata pelajaran yang sangat membingungkan buat mereka  
                \item Materi trigonometri merupakan materi baru bagi siswa, sehingga sulit untuk memahami konsepnya   
                \item Trigonometri merupakan materi yang sulit  
                \item Terlalu banyak rumus-rumus dan materi trigonometri   yang terlalu luas  
                \item Materi trigonometri memang materi yang susah  
                \item Trigonometri merupakan pelajaran yang asing bagi siswa  
            \end{itemize}\\  
            \bottomrule  
        \end{tabularx}  
    \end{table*}  
    \lipsum  
    \begin{table*}[ht]  
        \caption{Persepsi Guru Mengenai Penyebab Epistemologis}  
        \begin{tabularx}{\textwidth}{XX}  
            \toprule %  
            \thead{Sub Kategori} & \thead{Jawaban Guru}\\%  
            \cmidrule[\lightrulewidth](lr){1-2}  
            %>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
            \vspace{-1.7em}  
            \begin{itemize}  
                \item Pengetahuan awal  
            \end{itemize} &   

            \vspace{-1.7em}  
            \begin{enumerate}%  
                \item Kurang pengetahuan dasar tentang Trigonometri  
                \item Pengetahuan awal yang kurang (SD dan SMP)  
                \item Pengetahuan tentang ilmu ukur sudut kurang  
                \item Siswa tidak bisa/lupa dengan rumus Phytagoras yang   menjadi dasar
                \item Dasar matematika sangat kurang   
                \item Pengetahuan awalnya tidak ada  
            \end{enumerate}\\%  

            \vspace{-2.5em}% edit: inserted missing }

            \begin{itemize}   
                \item Sikap negatif terhadap pelajaran matematika  
            \end{itemize} &   
            \vspace{-2.5em}  
            \begin{enumerate}%  
                \item Matematika dianggap sebagai momok   
                \item Siswa sudah menganggap trigonometri susah    
            \end{enumerate}\\%   
            %\hline  
            \vspace{-2.5em}  

            \begin{itemize}  
                \item Rendahnya minat dan motivasi  
            \end{itemize} &   
            \vspace{-2.5em}  
            \begin{enumerate}%  
                \item Minat belajar terhadap mata pelajaran matematika kurang  
                \item Malas Belajar  
                \item Siswa tidak mengetahui apa tujuan belajar trigonometri  
            \end{enumerate}\\%  

            \vspace{-2.5em}  
            \begin{itemize}  
                \item Kurangnya kecerdasan   
            \end{itemize} &   
            \vspace{-2.5em}  
            \begin{enumerate}%  
                \item Siswa tidak menguasai materi-materi penting dalam trigonometri  
                \item Sangat lamban pada operasi hitung   
            \end{enumerate}\\%   
            \vspace{-2.5em}  
            \begin{itemize}  
                \item Kurangnya percaya diri  
            \end{itemize} &   
            \vspace{-2.5em}  
            \begin{enumerate}%  
                \item -  
            \end{enumerate}\\%  
            \vspace{-2.5em}  
            \begin{itemize}  
                \item Tidak menyukai matematika atau topiknya  
            \end{itemize} &  
            \vspace{-2.5em}  
            \begin{enumerate}%  
                \item -  
            \end{enumerate}\\%   
            \bottomrule  

        \end{tabularx}  
    \end{table*}  

    \begin{table*}[ht]  
        \caption{Persepsi Guru Mengenai Penyebab Epistemologis}  
        \begin{tabularx}{\linewidth}{XX}  
            \toprule %  
            \thead{Sub Kategori} & \thead{Jawaban Guru}\\%  
            \cmidrule[\lightrulewidth](lr){1-2}  
            \vspace{-1.7em}  
            \begin{itemize}  
                \item Kurangnya pemahaman konsep  
            \end{itemize} &  
            \vspace{-1.7em}  
            \begin{enumerate}%  
                \item Siswa bingung membedakan rumus yang digunakan untuk mencari perbandingan pada trigonometri (mencari sinus, kosinus, dll)  
                \item Kurangnya pemahaman siswa tentang materi yang berkaitan dengan trigonometri  
                \item Siswa bingung menerapkan konsep trigonometri di kehidupan sehari-hari  
                \item Siswa hanya tahu mengerjakan soal Phytagoras sesuai dengan rumus umum   
            \end{enumerate}\\%  
            \vspace{-2.5em}  
            \begin{itemize}  
                \item Kurangnnya usaha  
            \end{itemize} &  
            \vspace{-2.5em}  
            \begin{enumerate}%  
                \item -  

            \end{enumerate}\\  
            \bottomrule  

        \end{tabularx}  
    \end{table*}  
    \lipsum  
\end{document}  
  • 2
    (i) your example is far to be minimal (ii) it contain error and can't be compiled (iii) floats figure* always appear on the top of the next page (iv) package hyperref had to be loaded last in the preamble, (v) for writing of tables see tex.stackexchange.com/questions/368523/… if can help you. – Zarko May 9 '17 at 8:18
  • and (vi) figure* cannot be split between two or more pages. – Zarko May 9 '17 at 8:25
  • 2
    table* only supports t and p so your first ` \begin{table*}[!htbp]` is the same as \begin{table*}[!tp] and your second table with \begin{table*}[ht] is the same as \begin{table*}[t] which makes going to the end very likely as you have stopped it using p and going to a float page. – David Carlisle May 9 '17 at 8:26
2

As I mentioned in my comments:

  • your example is far to be minimal
  • it contain error and can't be compiled
  • floats figure* always appear on the top of the next page, and as David Carlisle emphasize in his comment table* only supports t and p so your first \begin{table*}[!htbp] is the same as \begin{table*}[!tp] and your second table with \begin{table*}[ht] is the same as \begin{table*}[t] which makes going to the end very likely as you have stopped it using p and going to a float page
  • figure* cannot be split between two or more pages
  • package hyperref had to be loaded last in the preamble,
  • for writing of tables see answers if can help you

Edit: With use of package stfloats is floats' option b available. With this option the image can appear on the same page where is inserted (if there is enough space). Also a use both of sectsty and titlesec is fragile. You need to reconsider if you really need one them. In MWE below I both comment out. Similarly is with package float and his float's placement option H. Avoid to use them! Instead it in the revised MWE I use stfloat (as suggested Bernard in his comment below).

Considering aforementioned, the your MWE become:

\documentclass[twoside,twocolumn,12pt,a4paper]{article}
\usepackage{microtype}
\usepackage[bahasa]{babel}
\usepackage[left=3.0cm, right=2.0cm, top=2.5cm, bottom=2.5cm, columnsep=0.5cm]{geometry}
\usepackage{hyphenat}
\hyphenation{ber-da-sar-kan peng-a-mat-an spon-tan di-se-but-kan
    mau-pun mem-per-li-hat-kan di-mak-sud-kan me-wa-kil-i me-nun-juk-kan   pe-ra-ga
    di-tam-bah-kan me-nga-ta-kan}

\usepackage{amsmath, amssymb}

\usepackage[hang,small,labelfont=bf,up,textfont=it,up]{caption}
\usepackage{graphicx}
\usepackage{stfloats} % <-- changed from `float`

\usepackage{makeidx}
\usepackage{microtype}

\usepackage{abstract}
%\usepackage{sectsty}
%\usepackage{titlesec}

\usepackage{xpatch}
\usepackage{lipsum}
\usepackage{etoolbox}

\usepackage{booktabs, makecell, multirow, tabularx}
\usepackage{ragged2e}               % new, for better formatting of columns contents
\newcolumntype{L}{>{\RaggedRight}X} % new columns style
\usepackage{enumitem}          % for nice lists in tables
\newlist{tabitem}{itemize}{1}  % <-- defined new itemize list
\setlist[tabitem]{nosep,       % <-- new list setup
                 topsep     = 0pt       ,
                 partopsep  = 0pt       ,
                 leftmargin = *         ,
                 label      = $\bullet$ ,
                 before     = \vspace{-0.5\baselineskip},
                 after      = \vspace{-\baselineskip}
                 }
\newlist{tabenum}{enumerate}{1}% <-- defined new enumerate list
\setlist[tabenum]{nosep,       % <-- new list setup
                 topsep     = 0pt    ,
                 partopsep  = 0pt    ,
                 leftmargin = *      ,
                 label*     =\arabic*.,
                 before     = \vspace{-0.5\baselineskip},
                 after      = \vspace{-\baselineskip}
                 }
\usepackage{hyperref}

\begin{document}
    \lipsum[1-5]
    \begin{table*}[b] % this table is at bottom of the same page now
        \caption{Persepsi Guru Mengenai Penyebab Epistemologis.}
        \begin{tabularx}{\linewidth}{@{} LL @{}}
            \toprule %
            \thead{Sub Kategori} & \thead{Jawaban Guru}\\
            \midrule
            \begin{tabenum}
                \item Sifat abstrak konsep matematika
                \item Kehirarkian Konsep Matematika
            \end{tabenum} & \begin{tabitem}%
                \item Matematika itu merupakan mata pelajaran yang sangat membingungkan buat mereka
                \item Materi trigonometri merupakan materi baru bagi siswa, sehingga sulit untuk memahami konsepnya
                \item Trigonometri merupakan materi yang sulit
                \item Terlalu banyak rumus-rumus dan materi trigonometri   yang terlalu luas
                \item Materi trigonometri memang materi yang susah
                \item Trigonometri merupakan pelajaran yang asing bagi siswa
            \end{tabitem}\\
            \bottomrule
        \end{tabularx}
    \end{table*}
    \lipsum
    \begin{table*}
        \caption{Persepsi Guru Mengenai Penyebab Epistemologis}
        \begin{tabularx}{\textwidth}{@{} LL @{}}
            \toprule %
            \thead{Sub Kategori} & \thead{Jawaban Guru}\\%
            \midrule
            \begin{tabitem}
                \item Pengetahuan awal
            \end{tabitem} &
            \begin{tabenum}%
                \item Kurang pengetahuan dasar tentang Trigonometri
                \item Pengetahuan awal yang kurang (SD dan SMP)
                \item Pengetahuan tentang ilmu ukur sudut kurang
                \item Siswa tidak bisa/lupa dengan rumus Phytagoras yang   menjadi dasar
                \item Dasar matematika sangat kurang
                \item Pengetahuan awalnya tidak ada
            \end{tabenum}\\%
            \begin{tabitem}
                \item Sikap negatif terhadap pelajaran matematika
            \end{tabitem} &
            \begin{tabenum}%
                \item Matematika dianggap sebagai momok
                \item Siswa sudah menganggap trigonometri susah
            \end{tabenum}\\%
            \begin{tabitem}
                \item Rendahnya minat dan motivasi
            \end{tabitem} &
            \begin{tabenum}%
                \item Minat belajar terhadap mata pelajaran matematika kurang
                \item Malas Belajar
                \item Siswa tidak mengetahui apa tujuan belajar trigonometri
            \end{tabenum}\\%
            \begin{tabitem}
                \item Kurangnya kecerdasan
            \end{tabitem} &
            \begin{tabenum}%
                \item Siswa tidak menguasai materi-materi penting dalam trigonometri
                \item Sangat lamban pada operasi hitung
            \end{tabenum}\\%
            \begin{tabitem}
                \item Kurangnya percaya diri
            \end{tabitem} &
            \begin{tabenum}%
                \item -
            \end{tabenum}\\%            
            \begin{tabitem}
                \item Tidak menyukai matematika atau topiknya
            \end{tabitem} &
            \begin{tabenum}%
                \item -
            \end{tabenum}\\%
            \bottomrule
        \end{tabularx}
    \end{table*}

    \begin{table*}
        \caption{Persepsi Guru Mengenai Penyebab Epistemologis}
        \begin{tabularx}{\linewidth}{@{} LL @{}}
            \toprule %
            \thead{Sub Kategori} & \thead{Jawaban Guru}\\%
            \midrule
            \begin{tabitem}
                \item Kurangnya pemahaman konsep
            \end{tabitem} &
            \begin{tabenum}%
                \item Siswa bingung membedakan rumus yang digunakan untuk mencari perbandingan pada trigonometri (mencari sinus, kosinus, dll)
                \item Kurangnya pemahaman siswa tentang materi yang berkaitan dengan trigonometri
                \item Siswa bingung menerapkan konsep trigonometri di kehidupan sehari-hari
                \item Siswa hanya tahu mengerjakan soal Phytagoras sesuai dengan rumus umum
            \end{tabenum}\\%
            \begin{tabitem}
                \item Kurangnnya usaha
            \end{tabitem} &
            \begin{tabenum}%
                \item -
            \end{tabenum}\\
            \bottomrule

        \end{tabularx}
    \end{table*}
    \lipsum
\end{document}

Edit (2): As you can see, in above MWE is not used itemize and enumerate environments for lists in table. Also are removed all \vspace{...} in them which has no affect in your table and consequently are surplus. All are replaced with two new lists: tabitem and tabenum respectively which are based on package enumitem and defined in preamble as:

\usepackage{enumitem}          % for nice lists in tables
\newlist{tabitem}{itemize}{1}  % <-- defined new itemize list
\setlist[tabitem]{nosep,       % <-- new list setup
                 topsep     = 0pt       ,
                 partopsep  = 0pt       ,
                 leftmargin = *         ,
                 label      = $\bullet$ ,
                 before     = \vspace{-0.5\baselineskip},
                 after      = \vspace{-\baselineskip}
                 }
\newlist{tabenum}{enumerate}{1}% <-- defined new enumerate list
\setlist[tabenum]{nosep,       % <-- new list setup
                 topsep     = 0pt    ,
                 partopsep  = 0pt    ,
                 leftmargin = *      ,
                 label*     =\arabic*.,
                 before     = \vspace{-0.5\baselineskip},
                 after      = \vspace{-\baselineskip}
                 }

Both above lists have reduced vertical space before and after list and also between items in list. With this tables become more compact and occupy less space on a page.

enter image description here enter image description here enter image description here

  • With the stfloats package, you also can use b. – Bernard May 9 '17 at 9:05
  • @Bernard, i had problems with use of this package (it cause error "file eneded while scaning us of \tmp@reseved@a), so didn't mentioned it. I need first figured out, what is going wrong (in OP preamble) – Zarko May 9 '17 at 9:22
  • I see. I thought you had forgotten. Unrelated, but do you know if it's safe to load both sectsty and titlesec? – Bernard May 9 '17 at 9:42
  • Meanwhile I managed stfloats, I had some mismatch in my MikTeX installation ... now it works. It is longtime ago when I use titlesec, so I'm not experienced with those packages. Since no one of them is used in MWE, I will comment them. Thank you for points. – Zarko May 9 '17 at 9:51
  • @Zarco, I don't know what is the different between: \usepackage{enumitem} \setlist[itemize]{noitemsep} \setlist[enumerate]{noitemsep} and the code of [tabitem] and [tabenum]. I confused which one is better to choose. – Enos Lolang May 9 '17 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.