1

I am trying to turn off the dotted line under subsection headings of an appendix. But can't seem to find a way to do this. Here is my code:

    `% Remove page numbering of appendix figure and tables in the list of table and list of figures.
\let\svaddcontentsline\addcontentsline
\renewcommand\addcontentsline[3]{%
  \ifthenelse{\equal{#1}{lof}}{}%
  {\ifthenelse{\equal{#1}{lot}}{}{\svaddcontentsline{#1}{#2}{#3}}}}

\appendix
    \addcontentsline{toc}{section}{Appendix}

    %Disable appendix page numbers in Table of Contents
    %\addtocontents{toc}{\cftpagenumbersoff{section}}
    %Disable appendix page numbers in Table of Contents
    %\addtocontents{toc}{\cftpagenumbersoff{section}}
    % Disable appendix subsection page numbers in ToC
    %\addtocontents{toc}{\cftpagenumbersoff{subsection}}

    \pagenumbering{gobble}
    %\pagestyle{plain}
    %\pagenumbering{roman}
    %\setcounter{page}{1}
    \section*{Appendix}`

What this does is it removed the page numbers of figures in my appendix. However I am having trouble removing the dotted line from the table of contents: enter image description here

The above code seemed to be able to remove page numbers in the table of contents only but failed to remove the dotted line associated with it. I am wondering how to set it up to remove the dotted lines as well?

Here is the code for my table of contents setup:

    \newpage
\tableofcontents
\cleardoublepage


\setcounter{tocdepth}{1}
\listoffigures
\listoftables


\clearpage





\pagenumbering{arabic}
\setcounter{page}{1} 
\raggedright
\section{Introduction}

The full code that is able to be compiled is provided here:

\documentclass[10pt]{article}
\usepackage[left=2.54cm,top=2.54cm,right=2.54cm,bottom=2.54cm]{geometry}
\usepackage{fancyhdr}
\usepackage[table]{xcolor}
\usepackage{url}
\usepackage{float}
\usepackage{afterpage}
\usepackage{caption}
\usepackage{setspace}
\usepackage{pdfpages}
\usepackage{booktabs}
\usepackage{bibspacing}
\usepackage{tikz}
\usepackage{helvet}
\usepackage{array}
\usepackage{listings}
\usepackage{adjustbox}
\usepackage{color}   %May be necessary if you want to color links
\usepackage{hyperref}
\hypersetup{
    colorlinks=true, %set true if you want colored links
    linktoc=all,     %set to all if you want both sections and subsections linked
    linkcolor=black,  %choose some color if you want links to stand out
}

\singlespacing

%%%% YOU CAN PUT YOUR OWN DEFINITIONS HERE
\newfont{\toto}{msbm10 at 12 pt}
\newfont{\ithd}{cmr9}
\newcommand{\equa}[1]{(\ref{eq:#1})}
\newcommand{\laeq}[1]{\label{eq:#1}}
\newcommand{\figu}[1]{\ref{fig:#1}}
\newcommand{\lafi}[1]{\label{fig:#1}}
\newcommand{\fmo}{\tilde{U}}
\newcommand{\fve}{\tilde{u}}
\newcommand{\Dt}{\Delta t}

\newcommand{\AoAInt}{$2.5^{\circ}$}
\newcommand{\dY}{$\Delta Y$}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\si}[1]{\rm\scriptscriptstyle{#1}}
%%%% END OF YOUR DEFINITIONS 

\pagestyle{fancyplain}
\renewcommand{\headrulewidth}{0pt}
    \newcommand{\HRule}{\rule{\linewidth}{1mm}} % Defines a new command for horizontal lines, change thickness here
\usepackage{amsmath,amsthm,amsfonts,amssymb}
\usepackage[pdftex]{graphicx}
\usepackage[T1]{fontenc}

%%%% CONFERENCE HEADER. REPLACE xxxx WITH 4-DIGIT PAPER NUMBER ASSIGNED BY CONFERENCE COMMITTEE.

\rhead{}
\lhead{}
\title{
\raggedleft {\large \today}
\begin{tikzpicture}[remember picture,overlay]
    \node[anchor=north west,yshift=20pt,xshift=10pt]%
        at (current page.north west)
        {};
    \end{tikzpicture}
    \HRule \\
    \vspace{0.5cm}
\centering    
{\Huge \bf Major Project Report } \\
\vspace{0.5cm}
{\Large \bf Comparison of Different Locations of Step on NACA 2412 Airfoil Aerodynamic Performance}
}
\author{
\textit{Author: 
}}
\date{}
% Change the name from contents to table of contents
\renewcommand{\contentsname}{Table of Contents}

\begin{document}
%%%% TITLE
\maketitle
\afterpage{\fancyhead{}}
\HRule

\pagenumbering{gobble}

%%%% ABSTRACT AND KEYWORDS
\vskip

\vskip 0.5cm

\newpage
\centering
\textbf{EXECUTIVE SUMMARY} \\\\
\vspace{1cm}
This report aims to evaluate the performance of NACA 2412 in both high Reynolds number flow where many airliners operate in and low Reynolds number flow for RC airplane models. Four different types turbulent models are compared in high Reynolds number flow, $k-\omega$ SST model shows the best performance in aspect of accuracy and computational cost. And this report also finds that all turbulent models has its own applicable conditions, and can not fully describe the turbulent flow over the airfoil. In order to the get the accurate estimation of drag coefficient from simulation, the grid size is small enough to ensure the first grid located in the viscous sub-layer region of boundary layer. From the simulation results, the airfoil with step located in the upper plane degrade the lift to drag ratio by $56.14\%$ and $59.78\%$ for high Re number flow and low Re number flow respectively, and down step case shows a $27.43\%$ and $29.52\%$ reduction for the lift to drag ratio. So, both case of stepped airfoil could not provide a better performance for airliners and RC models.\\
\vspace{1cm}
{\it Keywords:} Kline-Fogelman Airfoil, Computational Fluid Dynamics, Turbulence Model, Lift-Drag Ratio.

%%%% MAIN PART
\newpage
\centering
\textbf{\Large ABBREVIATIONS} \\\\
\raggedright
\textbf{RC:} Remote Control\\
\textbf{Re:} Reynolds Number \\
\textbf{AoA:} Angle of Attack \\
%------------------------------------------
\newpage
\tableofcontents
\cleardoublepage

\setcounter{tocdepth}{1}
\listoffigures
\newpage
\listoftables

\clearpage

\pagenumbering{arabic}
\setcounter{page}{1} 

\raggedright
\section{Introduction}

\vspace{-0.4cm}
\section{Problem Statement}

\vspace{-0.3cm}
\section{Setup and Methodology}
\subsection{Geometry Definitions}

\subsection{Calculation of $\Delta Y$}

\subsection{Meshing Methodology for Incompressible Flow}

\subsection{Meshing Methodology for Compressible Flow}

\subsection{Boundary Conditions}


\subsection{Turbulence Models Comparison}
\label{section: Turbulence Model Comparison}

\subsubsection{Spalart-Allmaras (S-A model)}

\subsubsection{$k-\omega$ SST model}

\subsubsection{RNG $k-\epsilon$ model}

\subsubsection{$\gamma-Re_{\theta}$ SST (Transition SST) model}
\section{Results and Discussion}

\subsection{Results of different Turbulence Models}


\subsection{Residual and Order of Accuracy Analysis}

\subsection{Streamline comparison}

\subsection{Contour plots comparison}

\subsubsection{Different step positions for the same Reynolds number}

\subsubsection{Different Reynolds numbers for the same step position}

\subsection{Comparison between Pressure-based and Density-based Solvers}


\subsection{Comparison of different lift to drag ratios at AoA$=$\AoAInt at different Operating Conditions}


\section{Future Work}

\section{Conclusion}

\newpage
%%%% BIBLIOGRAPHY
\bibspacing=\dimen 100
\bibliographystyle{unsrt}
\bibliography{biblio}


%%%% APPENDIX section
% Remove page numbering of appendix figure and tables in the list of table and list of figures.
\let\svaddcontentsline\addcontentsline
\renewcommand\addcontentsline[3]{%
  \ifthenelse{\equal{#1}{lof}}{}%
  {\ifthenelse{\equal{#1}{lot}}{}{\svaddcontentsline{#1}{#2}{#3}}}}



\clearpage
\newpage
\thispagestyle{empty}


\appendix
\addcontentsline{toc}{section}{Appendix}

%Disable appendix page numbers in Table of Contents
%\addtocontents{toc}{\cftpagenumbersoff{section}}
%Disable appendix page numbers in Table of Contents
%\addtocontents{toc}{\cftpagenumbersoff{section}}
% Disable appendix subsection page numbers in ToC
%\addtocontents{toc}{\cftpagenumbersoff{subsection}}

\pagenumbering{gobble}
%\pagestyle{plain}
%\pagenumbering{roman}
%\setcounter{page}{1}
\section*{Appendix}
\section{Matlab Code for Calculating Coordinates of NACA 2412 Airfoil}


\newpage
\section{Matlab Code for Calculating $\Delta Y$, Order of Accuracy, and Residual Analysis}

\newpage


\section{Adapted 3 Times Model Comparison Residual Analysis}


\newpage

\section{Turbulence Model Comparison  Simulation Settings}

\subsection{General Settings}

\subsection{S-A Model Simulation Settings}


\newpage
\subsection{$\gamma-Re_{\theta}$ SST Settings}


\subsection{$k-\omega$ SST Model Settings}

\subsection{$RNG \ k-\epsilon$ Model}

\newpage
\section{Simulation Setting for High Reynolds Pressure-Based and Density Based Solvers}

\subsection{General Settings}


\newpage
\subsection{Model Settings}


\newpage
\subsection{Density Setting}


\newpage

\subsection{Far-field Boundary Condition Settings}

\newpage
\subsection{Reference Value Settings}


\newpage
\subsection{Solution Methods Settings}


\newpage
\subsection{Initialisation Settings}


\newpage
\section{Residual Test for Density-based Simulation}

\subsection{Boundary Condition Settings}

\subsection{Reference Value Settings}

\subsection{Solution Method Settings}

\newpage
\section{Streamlines for low-Reynolds number flows}
\newpage
\section{Contour plots for low-Reynolds number flows around no-step and bottom-step airfoils}

\end{document}
`
Ted
  • 25
  • 2
    Welcome to TeX.SX! Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for TeX.SX users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – Stefan Pinnow Jun 05 '19 at 04:53
  • @StefanPinnow Thanks for your reply and apologies for getting back to you a bit late. I have attached a fully compilable code. It would be greatly appreciated some guidance can be provided. Thanks. – Ted Jun 16 '19 at 03:33

1 Answers1

0

It would be easier with a MWE (minimal working example) to give you an accurate solution, see the comment from Stefan Pinnow.

If you are using KOMA-Script you can add \renewcommand\TOCLineLeaderFill[1][]{\hfill} to your preamble.

If you are using the tocloft package, you can add \renewcommand{\cftsubsecleader}{\hfill} for the \subsection or \renewcommand{\cftsecleader}{\hfill} for the \section to your preamble.

Or do you want to remove not all but only the dotted lines from appendix subsections?

EDIT

I guess you want to delete the dotted lines only from the appendix subsections and not from the rest ones of your content.

Therefore, you can add the tocloft package and then use the macros \cftlocalchange{〈file〉}{〈pnumwidth〉}{〈tocrmarg〉 and \cftnodots(see pp. 16 and 8, respectively) before \appendix. The first one reset the global parameters and the second one is a separation value that is ‘too large’ for example 10000, see p.5.

\cftlocalchange{toc}{\cftnodots}{0cm}% change settings to suppress dotted lines

Take into consideration the author´s recommendation, if needed: The command should be called again after any special entry to reset the parameters back to their usual values.

Code (I have just commented some lines \usepackage{bibspacing}, \bibspacing=\dimen 100 or \vspace because I do not have the package or I had compilation problems):

\documentclass[10pt]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath,amsthm,amsfonts,amssymb}
\usepackage[left=2.54cm,top=2.54cm,right=2.54cm,bottom=2.54cm]{geometry}
\usepackage{fancyhdr}
\usepackage[table]{xcolor}
\usepackage{url}
\usepackage{float}
\usepackage{afterpage}
\usepackage{caption}
\usepackage{setspace}
\usepackage{pdfpages}
\usepackage{booktabs}
%\usepackage{bibspacing}
\usepackage{tikz}
\usepackage{helvet}
\usepackage{array}
\usepackage{listings}
\usepackage{adjustbox}
\usepackage{color}   %May be necessary if you want to color links
\usepackage{hyperref}
\hypersetup{
    colorlinks=true, %set true if you want colored links
    linktoc=all,     %set to all if you want both sections and subsections linked
    linkcolor=black,  %choose some color if you want links to stand out
}
\usepackage{graphicx}
\usepackage{tocloft} %--> added


\singlespacing

%%%% YOU CAN PUT YOUR OWN DEFINITIONS HERE
\newfont{\toto}{msbm10 at 12 pt}
\newfont{\ithd}{cmr9}
\newcommand{\equa}[1]{(\ref{eq:#1})}
\newcommand{\laeq}[1]{\label{eq:#1}}
\newcommand{\figu}[1]{\ref{fig:#1}}
\newcommand{\lafi}[1]{\label{fig:#1}}
\newcommand{\fmo}{\tilde{U}}
\newcommand{\fve}{\tilde{u}}
\newcommand{\Dt}{\Delta t}

\newcommand{\AoAInt}{$2.5^{\circ}$}
\newcommand{\dY}{$\Delta Y$}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\si}[1]{\rm\scriptscriptstyle{#1}}

%%%% END OF YOUR DEFINITIONS 

\pagestyle{fancyplain}
\renewcommand{\headrulewidth}{0pt}
    \newcommand{\HRule}{\rule{\linewidth}{1mm}} % Defines a new command for horizontal lines, change thickness here


%%%% CONFERENCE HEADER. REPLACE xxxx WITH 4-DIGIT PAPER NUMBER ASSIGNED BY CONFERENCE COMMITTEE.

\rhead{}
\lhead{}
\title{
\raggedleft {\large \today}
\begin{tikzpicture}[remember picture,overlay]
    \node[anchor=north west,yshift=20pt,xshift=10pt]%
        at (current page.north west)
        {};
    \end{tikzpicture}
    \HRule \\
    \vspace{0.5cm}
\centering    
{\Huge \bf Major Project Report } \\
\vspace{0.5cm}
{\Large \bf Comparison of Different Locations of Step on NACA 2412 Airfoil Aerodynamic Performance}
}
\author{
\textit{Author: 
}}
\date{}
% Change the name from contents to table of contents
\renewcommand{\contentsname}{Table of Contents}

\begin{document}
%%%% TITLE
\maketitle
\afterpage{\fancyhead{}}
\HRule

\pagenumbering{gobble}

%%%% ABSTRACT AND KEYWORDS
%\vskip
%
%\vskip 0.5cm
%
\newpage
\centering
\textbf{EXECUTIVE SUMMARY} \\
\vspace{1cm}
This report aims to evaluate the performance of NACA 2412 in both high Reynolds number flow where many airliners operate in and low Reynolds number flow for RC airplane models. Four different types turbulent models are compared in high Reynolds number flow, $k-\omega$ SST model shows the best performance in aspect of accuracy and computational cost. And this report also finds that all turbulent models has its own applicable conditions, and can not fully describe the turbulent flow over the airfoil. In order to the get the accurate estimation of drag coefficient from simulation, the grid size is small enough to ensure the first grid located in the viscous sub-layer region of boundary layer. From the simulation results, the airfoil with step located in the upper plane degrade the lift to drag ratio by $56.14\%$ and $59.78\%$ for high Re number flow and low Re number flow respectively, and down step case shows a $27.43\%$ and $29.52\%$ reduction for the lift to drag ratio. So, both case of stepped airfoil could not provide a better performance for airliners and RC models.\\
\vspace{1cm}
{\it Keywords:} Kline-Fogelman Airfoil, Computational Fluid Dynamics, Turbulence Model, Lift-Drag Ratio.

%%%% MAIN PART
\newpage
\centering
\textbf{\Large ABBREVIATIONS} \\
\raggedright
\textbf{RC:} Remote Control\\
\textbf{Re:} Reynolds Number \\
\textbf{AoA:} Angle of Attack \\
%------------------------------------------
\newpage
\tableofcontents
\cleardoublepage

\setcounter{tocdepth}{1}
\listoffigures
\newpage
\listoftables

\clearpage

\pagenumbering{arabic}
\setcounter{page}{1} 

\raggedright
\section{Introduction}

\vspace{-0.4cm}
\section{Problem Statement}

\vspace{-0.3cm}
\section{Setup and Methodology}
\subsection{Geometry Definitions}

\subsection{Calculation of $\Delta Y$}

\subsection{Meshing Methodology for Incompressible Flow}

\subsection{Meshing Methodology for Compressible Flow}

\subsection{Boundary Conditions}


\subsection{Turbulence Models Comparison}
\label{section: Turbulence Model Comparison}

\subsubsection{Spalart-Allmaras (S-A model)}

\subsubsection{$k-\omega$ SST model}

\subsubsection{RNG $k-\epsilon$ model}

\subsubsection{$\gamma-Re_{\theta}$ SST (Transition SST) model}
\section{Results and Discussion}

\subsection{Results of different Turbulence Models}


\subsection{Residual and Order of Accuracy Analysis}

\subsection{Streamline comparison}

\subsection{Contour plots comparison}

\subsubsection{Different step positions for the same Reynolds number}

\subsubsection{Different Reynolds numbers for the same step position}

\subsection{Comparison between Pressure-based and Density-based Solvers}


\subsection{Comparison of different lift to drag ratios at AoA$=$\AoAInt at different Operating Conditions}


\section{Future Work}

\section{Conclusion}

\newpage
%%%% BIBLIOGRAPHY
%\bibspacing=\dimen 100
\bibliographystyle{unsrt}
\bibliography{biblio}


%%%% APPENDIX section
% Remove page numbering of appendix figure and tables in the list of table and list of figures.
\let\svaddcontentsline\addcontentsline
\renewcommand\addcontentsline[3]{%
  \ifthenelse{\equal{#1}{lof}}{}%
  {\ifthenelse{\equal{#1}{lot}}{}{\svaddcontentsline{#1}{#2}{#3}}}}


\clearpage
\newpage
\thispagestyle{empty}

\cftlocalchange{toc}{\cftnodots}{0cm}% change settings to suppress dotted lines

 \appendix
\addcontentsline{toc}{section}{Appendix}

%Disable appendix page numbers in Table of Contents
%\addtocontents{toc}{\cftpagenumbersoff{section}}
%Disable appendix page numbers in Table of Contents
%\addtocontents{toc}{\cftpagenumbersoff{section}}
% Disable appendix subsection page numbers in ToC
%\addtocontents{toc}{\cftpagenumbersoff{subsection}}

\pagenumbering{gobble}
%\pagestyle{plain}
%\pagenumbering{roman}
%\setcounter{page}{1}
\section*{Appendix}
\section{Matlab Code for Calculating Coordinates of NACA 2412 Airfoil}


\newpage
\section{Matlab Code for Calculating $\Delta Y$, Order of Accuracy, and Residual Analysis}

\newpage


\section{Adapted 3 Times Model Comparison Residual Analysis}


\newpage

\section*{Turbulence Model Comparison  Simulation Settings}

\subsection*{General Settings}

\subsection{S-A Model Simulation Settings}


\newpage
\subsection{$\gamma-Re_{\theta}$ SST Settings}


\subsection{$k-\omega$ SST Model Settings}

\subsection{$RNG \ k-\epsilon$ Model}

\newpage
\section{Simulation Setting for High Reynolds Pressure-Based and Density Based Solvers}

\subsection{General Settings}


\newpage
\subsection{Model Settings}


\newpage
\subsection{Density Setting}


\newpage

\subsection{Far-field Boundary Condition Settings}

\newpage
\subsection{Reference Value Settings}


\newpage
\subsection{Solution Methods Settings}


\newpage
\subsection{Initialisation Settings}


\newpage
\section{Residual Test for Density-based Simulation}

\subsection{Boundary Condition Settings}

\subsection{Reference Value Settings}

\subsection{Solution Method Settings}

\newpage
\section{Streamlines for low-Reynolds number flows}
\newpage
\section{Contour plots for low-Reynolds number flows around no-step and bottom-step airfoils}

\end{document}

Output:

enter image description here

Ñako
  • 3,626
  • Thanks Nako for your reply, I am not sure about what kOMA -script is. I have attached a full compilable code that demonstrates my problem. It would be greatly appreciated if you could provide some guidance. Thank you. – Ted Jun 16 '19 at 03:35
  • Thanks Nako, your solution worked brilliant. – Ted Jun 17 '19 at 13:16