Generaldouble dots in section problem

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
pallav
Posts: 170
Joined: Wed Nov 12, 2008 5:53 pm

double dots in section problem

Post by pallav »

I am getting double dots after section title. How to solve the problem.

Also, I am not getting line no of to each line. how to solve it.

Code: Select all

 \documentclass[final,3p,times]{elsarticle}
 \usepackage{graphics}
\usepackage{epsfig}
\usepackage{amssymb,amsfonts,amsmath,amsthm}
\usepackage{hypcap}
 \usepackage{lineno}
%*******************************************************************
%NECESSARY TO OBTAIN THE SECTIONS, SUBSECTIONS, ETC. DEFINED AS 1.1., 2.1.3. FOR INSTANCE
%*******************************************************************
\renewcommand\thesection{\arabic{section}.}
    \renewcommand\thesubsection{\thesection\arabic{subsection}.}
       \renewcommand\thesubsubsection{\thesubsection\arabic{subsubsection}.}
       \renewcommand\theequation{\thesection\arabic{equation}}
 \biboptions{comma,square,sort&compress}
\begin{document}
 \linenumbers
\section{Introduction}
\label{intro_a} 
 \noindent Study 
\begin{align}
	a=b+c
\end{align}
\section{abs}
Let
\begin{align}
	c=d+r
\end{align}
\end{document}
Attachments
untitled.JPG
untitled.JPG (5.05 KiB) Viewed 11936 times
elsarticle.cls
(25.48 KiB) Downloaded 541 times
Last edited by cgnieder on Sun May 05, 2013 9:54 pm, edited 1 time in total.

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10347
Joined: Mon Mar 10, 2008 9:44 pm

double dots in section problem

Post by Stefan Kottwitz »

Generally please open a separate topic for each problem, even if the same document is meant, to avoid mixing issues.

Nice MWE btw.
  • Just don't add the dot in your redefinition of the counter representation:

    Code: Select all

    \renewcommand\thesection{\arabic{section}}
    \renewcommand\thesubsection{\thesection\arabic{subsection}}
    \renewcommand\thesubsubsection{\thesubsection\arabic{subsubsection}}
  • End the paragraph, i.e. insert an empty line. However, that's not good before displayed math formulas, because it may affect the spacing around a bit. Using an environment for such cases would fix it as a workaround:

    Code: Select all

    \begin{linenumbers}
    \noindent Study
    \end{linenumbers}
  • Load the hyperref package before hypcap.
Stefan
LaTeX.org admin
pallav
Posts: 170
Joined: Wed Nov 12, 2008 5:53 pm

double dots in section problem

Post by pallav »

Thanks a lot. Now I am using

Code: Select all

\renewcommand\thesection{\arabic{section}}
\renewcommand\thesubsection{\thesection\arabic{subsection}}
\renewcommand\thesubsubsection{\thesubsection\arabic{subsubsection}}
The full code is

Code: Select all

 \documentclass[final,3p,times]{elsarticle}
 \usepackage{graphics}
\usepackage{epsfig}
\usepackage{amssymb,amsfonts,amsmath,amsthm}
\usepackage{hyperref}
\hypersetup{colorlinks = true,linkcolor = blue, anchorcolor = blue, citecolor = blue, pdfstartpage=1, filecolor = red,urlcolor = red}
\usepackage{hypcap}
 \usepackage{lineno}
%*******************************************************************
%NECESSARY TO OBTAIN THE SECTIONS, SUBSECTIONS, ETC. DEFINED AS 1.1., 2.1.3. FOR INSTANCE
%*******************************************************************
\renewcommand\thesection{\arabic{section}}
    \renewcommand\thesubsection{\thesection\arabic{subsection}}
       \renewcommand\thesubsubsection{\thesubsection\arabic{subsubsection}}
       \renewcommand\theequation{\thesection\arabic{equation}}
 \biboptions{comma,square,sort&compress}
\begin{document}
 %\linenumbers
\section{Introduction}
\label{intro_a} 
\begin{linenumbers}
 \noindent Study 
\begin{align}
        a=b+c
\end{align}
\section{abs}
Let
\begin{align}
        c=d+r
\end{align}
\end{linenumbers}
\end{document}
The problem related to section is solved but the problem occurred for the equation number. Also the problem of line no is not solved.
Attachments
22.JPG
22.JPG (5.64 KiB) Viewed 11936 times
Last edited by cgnieder on Sun May 05, 2013 9:57 pm, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10347
Joined: Mon Mar 10, 2008 9:44 pm

double dots in section problem

Post by Stefan Kottwitz »

Place the dot in the equation number definition:

Code: Select all

\renewcommand\theequation{\thesection.\arabic{equation}}
You can keep \linenumbers at the beginning. Just use a linenumbers environment at each place where you miss the number because of a following displayed math environment, which obviously doesn't work together with the paragraph handling of lineno.

Btw. it would be good to post smaller images. Such wide images can cause problems in displaying. This zoom level hier is not required.

Stefan
LaTeX.org admin
pallav
Posts: 170
Joined: Wed Nov 12, 2008 5:53 pm

double dots in section problem

Post by pallav »

Thank you very much. Problem solved for section & equation number. Only the equation number of section is coming from 2.2 instead of from 2.1. Also line number problem persists.

Code: Select all

 \documentclass[final,3p,times]{elsarticle}
 \usepackage{graphics}
\usepackage{epsfig}
\usepackage{amssymb,amsfonts,amsmath,amsthm}
\usepackage{hyperref}
\hypersetup{colorlinks = true,linkcolor = blue, anchorcolor = blue, citecolor = blue, pdfstartpage=1, filecolor = red,urlcolor = red}
\usepackage{hypcap}
 \usepackage{lineno}
%*******************************************************************
%NECESSARY TO OBTAIN THE SECTIONS, SUBSECTIONS, ETC. DEFINED AS 1.1., 2.1.3. FOR INSTANCE
%*******************************************************************
\renewcommand\thesection{\arabic{section}}
    \renewcommand\theequation{\thesection.\arabic{equation}}
       \renewcommand\thesubsubsection{\thesubsection.\arabic{subsubsection}}
       \renewcommand\theequation{\thesection.\arabic{equation}}
 \biboptions{comma,square,sort&compress}
\begin{document}
 \linenumbers
\section{Introduction}
\label{intro_a} 
\begin{linenumbers}
 \noindent Study 
\begin{align}
        a=b+c
\end{align}
\end{linenumbers}
\section{abs}
\begin{linenumbers}
Let
\begin{align}
        c=d+r
\end{align}
\end{linenumbers}
\end{document}
Last edited by pallav on Sun May 05, 2013 5:17 pm, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10347
Joined: Mon Mar 10, 2008 9:44 pm

double dots in section problem

Post by Stefan Kottwitz »

As I wrote in my example above, use \end{linenumbers} before the align environment.

Stefan
LaTeX.org admin
pallav
Posts: 170
Joined: Wed Nov 12, 2008 5:53 pm

double dots in section problem

Post by pallav »

Thank you vry much. It works fine. Only I have used \setcounter{equation}{0} and every thing are fine now.
Post Reply