Text Formatting ⇒ Control section numbering between a book & article
Control section numbering between a book & article
I want to work with two wrap files--one for a thesis and the other for an article--that combine some common text. I bring the content into the two wrap files using \include.
My thesis is written with chapters at the top level. My article is written with sections at the top level.
In my thesis, the first chapter is written in chapter_1.tex and its content is structured:
\chapter{Essay on topic 1}
\section{Literature review}
\subsection{Introduction}
\subsection{Literature on A}
\subsection{Literature on B}
I combine all the chapters into thesis_wrap_file.tex using:
\include{chapter_1.tex}
\include{chapter_2.tex}
\include{chapter_3.tex}
Chapter_1.tex uses nested \include commands to bring in content from introduction.tex, lit_on_A.tex, and lit_on_B.tex.
Now, I want to write a paper of my literature review on topic 1 using article class (i.e., no chapters).
I would like to create article_wrap_file.tex and \include in the paper what I have written from:
\subsection{Introduction}
\subsection{Literature on A}
\subsection{Literature on B}
My problem is getting the proper section numbers in my article.
I have managed to bring in the content into my article but it comes in with numbering at the subsection level rather than the section level.
\include{introduction.tex}
\include{lit_on_A.tex}
\include{lit_on_B.tex}
Produces section numbers in my article:
0.1 Introduction
0.2 Literature on A
0.3 Literature on B
I want the section numbering in my article to be:
1 Introduction
2 Literature on A
3 Literature on B
Question: How can combine content files that were written in a document structure with chapters into my article and get the proper section numbering?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Control section numbering between a book & article
You described the structure of files like chapter_1.tex but not those like lit_on_A.tex. If I understand the question properly, it's that the things that are treated as subsections in the thesis ought to be treated as sections in the paper.
If it were me, I'd probably invent some new command name, say, my section, and then define it differently in the "wrappers", e.g.:
In thesis_wrap_file.tex you could have:
Code: Select all
\newcommand{\mysection}[1]{\subsection{#1}}
Code: Select all
\newcommand{\mysection}[1]{\section{#1}}
Code: Select all
\mysection{Literature on A}
There are other ways of handling this, such as just including the contents of the units in the included files, and use \input rather than \include. Then you could use different sectioning commands in the master files before calling them. (Indeed you should consider using \input for (sub)sectional units anyway; \include always puts in page breaks, which would be strange for units lower than \chapter.)
If your article didn't have any subsections, only sections, you could redefine the \subsection command to act as section in article_wrap_file.tex:
Code: Select all
\let\subsection=\section
Finally if you like the way things look now, and just want to remove the "0" at the beginning of the subsection numbers, you could try:
Code: Select all
\renewcommand{\thesubsection}{\arabic{subsection}}