LaTeX forum ⇒ GeneralCustom section counter in LNCS format

LaTeX specific issues not fitting into one of the other forums of this category.
bomberb17
Posts: 5
Joined: Sun Feb 10, 2019 8:52 pm

Custom section counter in LNCS format

Postby bomberb17 » Fri May 10, 2019 6:45 pm

Hello,
I'm writing my manustript on LCNS format, and I want to divide my document into two parts, the first part would use as section counters A1, A2, etc. and the second part would use section counters B1, B2 etc..
I've searched around but couldn't find a solution.. Any ideas on this? Thanks!

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sat May 11, 2019 12:27 am

Have you checked with Springer? They decide over the layout.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

bomberb17
Posts: 5
Joined: Sun Feb 10, 2019 8:52 pm

Postby bomberb17 » Sat May 11, 2019 1:51 am

This is a bit "unofficial" so I have flexibility. Just want to know how to do this in latex code

User avatar
Ijon Tichy
Posts: 91
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Sat May 11, 2019 4:01 pm

With standard classes this can be done redefining \thesection resp. \thechapter. But I do not know how to do it with the class you are using. Please add a link to the class and a Infominimal working example if it does not work.

bomberb17
Posts: 5
Joined: Sun Feb 10, 2019 8:52 pm

Postby bomberb17 » Sat May 11, 2019 7:56 pm

Here's a MWE

  1. \documentclass{llncs}
  2.  
  3. \begin{document}
  4. \title{My document}
  5.  
  6. \maketitle
  7.  
  8. \noindent\Large\textbf{Section A}
  9. \normalsize
  10. \section{This should be section A1}
  11.  
  12. blah blah blah
  13. \section{This should be section A2}
  14. \subsection{This should be subsection A2.1}
  15.  
  16. \noindent\Large\textbf{Section B}
  17. \normalsize
  18. \setcounter{section}{0}
  19. \section{This should be section B1}
  20.  
  21. blah blah blah
  22. \section{This should be section B2}
  23. \subsection{This should be subsection B2.1}
  24.  
  25. \end{document}

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Sun May 12, 2019 5:28 am

You did not provide a link to the class, so i used some version that was on my hard drive from sometime in the past.

  1. \documentclass{llncs}
  2.  
  3. \begin{document}
  4. \title{My document}
  5.  
  6. \newcounter{Section}
  7. \renewcommand{\theSection}{\Alph{Section}}
  8. \renewcommand{\thesection}{\theSection\arabic{section}}
  9. \newcommand{\Section}{\refstepcounter{Section}\setcounter{section}{0}\bigskip\noindent\Large\textbf{Section~\theSection}\par\normalsize}
  10. \maketitle
  11.  
  12. \Section
  13. \section{This should be section A1}
  14.  
  15. blah blah blah
  16. \section{This should be section A2}
  17. \subsection{This should be subsection A2.1}
  18.  
  19. \Section
  20. \section{This should be section B1}
  21.  
  22. blah blah blah
  23. \section{This should be section B2}
  24. \subsection{This should be subsection B2.1}
  25.  
  26. \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


Return to “General”

Who is online

Users browsing this forum: No registered users and 2 guests