4

I try to align the captions in the LOT and LOF flush left. I had to add a word before the table and figure numbers. After I added these I could not make it flush left as you can see here LOT-LOF on the pictures. You can also find my MWE below. I tried some solutions given on this website like Table of contents: section titles ragged right . More specifically, I want to align the 2 row entry in LOT (asal) to "Costas". How can I make it?

Here is the MWE:

\documentclass[a4paper,12pt,twoside,openright]{report}
\usepackage[turkish,english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[a4paper,left=2.75cm,right=2.75cm,top=2.8cm,bottom=2.9cm]{geometry}

\usepackage{titlesec}

\usepackage{graphics}
\usepackage{float}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage[export]{adjustbox}
\usepackage{mathtools}
\usepackage{setspace}
\addto\captionsturkish{\renewcommand{\tablename}{Çizelge} }

\usepackage{amssymb}
\onehalfspacing
\setlength{\parskip}{\baselineskip}%paragraflar arasında bir boş satır bırakma
\setlength{\parindent}{0pt}
\setlength{\belowcaptionskip}{0pt} %Şekil açıklamalarının altındaki boşluk
\setlength{\abovecaptionskip}{12pt} %Şekil açıklamalarının üstndeki boşluk
\usepackage{mathptmx}
\usepackage{times}

\usepackage{tocloft}
\setlength\cfttabindent{0pt} %tablo listesini sola hizalama
\setlength\cftfigindent{0pt} %şekil listesini sola hizalama

\renewcommand\cftchapfont{\normalfont\mdseries}
\renewcommand\cftchappagefont{\mdseries}

\usepackage{chngpage}

\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % for chapters

\usepackage{setspace}

\usepackage[format=hang]{caption}
\usepackage[font=singlespacing]{caption} 

\renewcommand\cftchapafterpnum{\vskip\baselineskip}
\setlength{\cftbeforechapskip}{0pt}
\renewcommand\cftsecafterpnum{\vskip\baselineskip}
\setlength{\cftbeforesecskip}{0pt}
\renewcommand\cftsubsecafterpnum{\vskip\baselineskip}
\setlength{\cftbeforesubsecskip}{0pt}

\renewcommand\cfttabafterpnum{\vskip\baselineskip}
\renewcommand\cftfigafterpnum{\vskip\baselineskip}

%LOT için Çizelge 1.1 ve LOF için Şekil 1.1 yapma
\renewcommand{\cftfigfont}{Şekil }
\renewcommand{\cfttabfont}{Çizelge }
\usepackage[justification=raggedright]{caption}

\usepackage{blindtext}

\begin{document}

\newpage
\singlespacing

\renewcommand\contentsname{\hfill\hfill\bfseries\normalsize İÇİNDEKİLER\hfill}
\renewcommand\listfigurename{\hfill\bfseries\normalsize ŞEKİLLERİN LİSTESİ \hfill}
\renewcommand\listtablename{\hfill\bfseries\normalsize ÇİZELGELERİN LİSTESİ \hfill}
\renewcommand{\cftaftertoctitle}{\hfill}

\addcontentsline{toc}{chapter}{İÇİNDEKİLER} %İçindekiler satırı

\tableofcontents %İçindekiler

\addtocontents{lof}{\textbf{Şekil}~\hfill\textbf{Sayfa}\par}
\addtocontents{lot}{\textbf{Çizelge}~\hfill\textbf{Sayfa}\par}

\newpage

\addcontentsline{toc}{chapter}{ÇİZELGELERİN LİSTESİ}
\listoftables %Çizelge Listesi

\newpage

\addcontentsline{toc}{chapter}{ŞEKİLLERİN LİSTESİ}
\listoffigures %Şekil Listesi
\newpage

\chapter{INTRODUCTION}
\blindtext
\begin{table}[h]
    \begin{minipage}{0.30\textwidth}
        \caption{Barker kodları}    
        \begin{tabular}[h]{|l|l|}

        \end{tabular}       
    \end{minipage}
    \hfill
\end{table}

\chapter{METHOD}
\blindtext

\begin{table}[h]
    \begin{minipage}{0.68\textwidth}
        \caption{Costas dizilerinin temel oluşturulma yöntemlerinin karşılaştırılması (p asal sayı ve k $\geq$ 1 olmak üzere tamsayıdır.)}\bigskip
        \begin{tabular}{c| c c c c c c c c c}

        \end{tabular}

    \end{minipage}
    \hfill
\end{table} 

\chapter{CONCLUSION}
\blindtext
\end{document}
  • 1
    Hi, it is not really clear what you want to do. Please explain your "flugh left". Do you want the last row of your left image to be flushed left or aligned to "costas"? You code is far away from 'minimal' Please reduce it as much as you can. We need just too ToC entries which show this effect. Thanks. – LaRiFaRi Dec 2 '14 at 9:29
  • There is no difference wheter the words are there or not. – Johannes_B Dec 2 '14 at 9:30
  • @LaRiFaRi Yes, I want to flush left the caption entries in LOT and LOF which are for more than one row. According to picture I want to align the second row to "Costas". I actually know hat this MWE is long but I put all the preamble because something in there may affect the solution. – silent_man Dec 2 '14 at 10:07
  • @FatihGÜLEÇ It may effect it. You are right. So delete every line until you find the culprit part. In best case, you will see the error and fix it by your self. And if not, you will post some 10 lines code and we will help you rapidly. – LaRiFaRi Dec 2 '14 at 10:26
3

The problem is that you were abusing \cftfigfont and \cfttabfont to add the strings Şekil and Çizelge, respectively to the lists; to get the proper alignment, you need to do something like

\renewcommand\cfttabpresnum{Çizelge }
\newlength\mytablen
\settowidth\mytablen{\cfttabpresnum\cfttabaftersnum}
\addtolength\cfttabnumwidth{\mytablen}

\renewcommand\cftfigpresnum{Şekil }
\newlength\myfiglen
\settowidth\myfiglen{\cftfigpresnum\cftfigaftersnum}
\addtolength\cftfignumwidth{\myfiglen}

A complete example:

\documentclass[a4paper,12pt,twoside,openright]{report}
\usepackage[turkish,english]{babel}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[a4paper,left=2.75cm,right=2.75cm,top=2.8cm,bottom=2.9cm]{geometry}

\usepackage{titlesec}

\usepackage{graphics}
\usepackage{float}
\usepackage{graphicx}
\usepackage{epstopdf}
\usepackage[export]{adjustbox}
\usepackage{mathtools}
\usepackage{setspace}
\addto\captionsturkish{\renewcommand{\tablename}{Çizelge} }

\usepackage{amssymb}
\onehalfspacing
\setlength{\parskip}{\baselineskip}%paragraflar arasında bir boş satır bırakma
\setlength{\parindent}{0pt}
\setlength{\belowcaptionskip}{0pt} %Şekil açıklamalarının altındaki boşluk
\setlength{\abovecaptionskip}{12pt} %Şekil açıklamalarının üstndeki boşluk
\usepackage{mathptmx}
\usepackage{times}

\usepackage{tocloft}
\setlength\cfttabindent{0pt} %tablo listesini sola hizalama
\setlength\cftfigindent{0pt} %şekil listesini sola hizalama

\renewcommand\cftchapfont{\normalfont\mdseries}
\renewcommand\cftchappagefont{\mdseries}

\usepackage{chngpage}

\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}} % for chapters

\usepackage{setspace}

\usepackage[format=hang]{caption}
\usepackage[font=singlespacing]{caption} 

\renewcommand\cftchapafterpnum{\vskip\baselineskip}
\setlength{\cftbeforechapskip}{0pt}
\renewcommand\cftsecafterpnum{\vskip\baselineskip}
\setlength{\cftbeforesecskip}{0pt}
\renewcommand\cftsubsecafterpnum{\vskip\baselineskip}
\setlength{\cftbeforesubsecskip}{0pt}

\renewcommand\cfttabafterpnum{\vskip\baselineskip}
\renewcommand\cftfigafterpnum{\vskip\baselineskip}

%LOT için Çizelge 1.1 ve LOF için Şekil 1.1 yapma
\renewcommand\cfttabpresnum{Çizelge }
\newlength\mytablen
\settowidth\mytablen{\cfttabpresnum\cfttabaftersnum}
\addtolength\cfttabnumwidth{\mytablen}

\renewcommand\cftfigpresnum{Şekil }
\newlength\myfiglen
\settowidth\myfiglen{\cftfigpresnum\cftfigaftersnum}
\addtolength\cftfignumwidth{\myfiglen}

\usepackage[justification=raggedright]{caption}

\usepackage{blindtext}

\begin{document}

\newpage
\singlespacing

\renewcommand\contentsname{\hfill\hfill\bfseries\normalsize İÇİNDEKİLER\hfill}
\renewcommand\listfigurename{\hfill\bfseries\normalsize ŞEKİLLERİN LİSTESİ \hfill}
\renewcommand\listtablename{\hfill\bfseries\normalsize ÇİZELGELERİN LİSTESİ \hfill}
\renewcommand{\cftaftertoctitle}{\hfill}

\addcontentsline{toc}{chapter}{İÇİNDEKİLER} %İçindekiler satırı

\tableofcontents %İçindekiler

\addtocontents{lof}{\textbf{Şekil}~\hfill\textbf{Sayfa}\par}
\addtocontents{lot}{\textbf{Çizelge}~\hfill\textbf{Sayfa}\par}

\newpage

\addcontentsline{toc}{chapter}{ÇİZELGELERİN LİSTESİ}
\listoftables %Çizelge Listesi

\newpage

\addcontentsline{toc}{chapter}{ŞEKİLLERİN LİSTESİ}
\listoffigures %Şekil Listesi
\newpage

\chapter{INTRODUCTION}
\blindtext
\begin{table}[h]
    \begin{minipage}{0.30\textwidth}
        \caption{Barker kodları}    
        \begin{tabular}[h]{|l|l|}

        \end{tabular}       
    \end{minipage}
    \hfill
\end{table}

\chapter{METHOD}
\blindtext

\begin{table}[h]
    \begin{minipage}{0.68\textwidth}
        \caption{Costas dizilerinin temel oluşturulma yöntemlerinin karşılaştırılması (p asal sayı ve k $\geq$ 1 olmak üzere tamsayıdır.)}\bigskip
        \begin{tabular}{c| c c c c c c c c c}

        \end{tabular}

    \end{minipage}
    \hfill
\end{table} 

\chapter{CONCLUSION}
\blindtext
\end{document}

Some images of the resulting list:

enter image description here

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.