GeneralCustom section counter in LNCS format

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

Custom section counter in LNCS format

Post by bomberb17 »

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!

Recommended reading 2024:

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

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

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

Custom section counter in LNCS format

Post by Johannes_B »

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: 12
Joined: Sun Feb 10, 2019 8:52 pm

Custom section counter in LNCS format

Post by bomberb17 »

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: 640
Joined: Mon Dec 24, 2018 10:12 am

Custom section counter in LNCS format

Post by Ijon Tichy »

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.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
bomberb17
Posts: 12
Joined: Sun Feb 10, 2019 8:52 pm

Custom section counter in LNCS format

Post by bomberb17 »

Here's a MWE

Code: Select all

\documentclass{llncs}

\begin{document}
\title{My document}

\maketitle             

\noindent\Large\textbf{Section A}
\normalsize
\section{This should be section A1}

blah blah blah 
\section{This should be section A2}
\subsection{This should be subsection A2.1}

\noindent\Large\textbf{Section B}
\normalsize
\setcounter{section}{0}
\section{This should be section B1}

blah blah blah 
\section{This should be section B2}
\subsection{This should be subsection B2.1}

\end{document}
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Custom section counter in LNCS format

Post by Johannes_B »

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.

Code: Select all

\documentclass{llncs}
 
\begin{document}
\title{My document}
 
\newcounter{Section}
\renewcommand{\theSection}{\Alph{Section}}
\renewcommand{\thesection}{\theSection\arabic{section}}
\newcommand{\Section}{\refstepcounter{Section}\setcounter{section}{0}\bigskip\noindent\Large\textbf{Section~\theSection}\par\normalsize}
\maketitle             
 
\Section
\section{This should be section A1}
 
blah blah blah 
\section{This should be section A2}
\subsection{This should be subsection A2.1}
 
\Section
\section{This should be section B1}
 
blah blah blah 
\section{This should be section B2}
\subsection{This should be subsection B2.1}
 
\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.
Post Reply