1

I have several independent LaTeX files, and i would like to combine them in one scrbook in a consistent way, so that each LaTeX document is a new chapter within the book. Moreover the page numbering should be continous and the index should be consistent as well. Thanks in advance

EDIT: here is the preamble, which is nearly the same for all articles:

% (1) The line below says asks LaTeX to use the ``article'' class for typesetting,

%      with the options being: 11pt font, letterpaper, and double-spacing

\documentclass[11pt, letterpaper,doublespacing]{article}




% (2) This package enables the ``doublespacing'' option in the first line

\usepackage{setspace} 


% (3) Changing format of Section number and formatting of section headers


% The ``makatletter'' command is a special LaTeX switch

%  that changes the meaning of the ``@'' character, so that

%  this character can be used in the commands that follow.

% The ``makeatletter'' switch will be turned off using

%  the ``makeatother'' command below.


\makeatletter   


% (3.1)  Put a period after section number

\renewcommand{\@seccntformat}[1]{\@nameuse{the#1}.~{}}


% Change format of numbers

\renewcommand{\thesection}{\Roman{section}}

\renewcommand{\thesubsection}{\Alph{subsection}}

\renewcommand{\thesubsubsection}{\arabic{subsubsection}}


% (3.2)  Change format of header text

\renewcommand{\section}{\@startsection {section}{1}{\z@}%

                                     {-3.5ex \@plus -1ex \@minus -.2ex}%

                                     {2.3ex \@plus.2ex}%

                                     {\centering\normalfont\large\bfseries}}


\renewcommand{\subsection}{\@startsection{subsection}{2}{\z@}%

                                       {-3.25ex\@plus -1ex \@minus -.2ex}%

                                       {1.5ex \@plus .2ex}%

                                       {\normalfont\large\slshape}}


\renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}%

                                       {-3.25ex\@plus -1ex \@minus -.2ex}%

                                       {1.5ex \@plus .2ex}%

                                       {\centering\normalfont\slshape}}




% (3.3)  The next command turns of the switch that changed the meaning of the “@” character.

\makeatother




%: (4) Changing formatting of theorem-like structures


% The next command loads the ``amstheorem'' package

% to adjust formatting of theorem-like structures

\usepackage{amsthm}


%Define ``plain'' style

\newtheoremstyle{plain}{9pt}{9pt}{\itshape}{0pt}{\scshape}{:}{3pt}{} 


% Load ``plain'' style, so that it will apply to all theorem-style structures

% that are defined after this command

\theoremstyle{plain} 


% Then, for the Assumption, Corollary, Proposition, etc. ``plain'' style is active

% You can add more of these structures to suit your needs

\newtheorem{assumption}{Assumption}

\newtheorem{corollary}{Corollary}

\newtheorem{definition}{Definition}

\newtheorem{lemma}{Lemma} 

\newtheorem{proposition}{Proposition}

\newtheorem{remark}{Remark}

\newtheorem{theorem}{Theorem}



% (5)  Caption headings are bold and small

\usepackage[bf,small,nooneline,normal]{caption2}

\renewcommand*{\captionlabeldelim}{\nobreak}

\renewcommand*\captionlabeldelim{.}

\renewcommand{\captionfont}{\bfseries}



% (6) Table numbers are uppercase roman

\renewcommand{\thetable}{\Roman{table}}



% (7) First paragraphs are indented except the very first (unlabeled) section

\usepackage{indentfirst}



% (8) Change the formatting of the section header for Abstract

\renewcommand{\abstractname}{\bf \small ABSTRACT}



% (9) Change the formatting of the section header for References

\renewcommand{\refname}{\bf \small REFERENCES}



% (10) To move footnotes to the end of the text

\usepackage{endnote}

\renewcommand{\footnote}{\endnote}

\renewcommand{\notesname}{\bf Footnotes}
7
  • Please add more informations. Preamble and contents of each files.
    – touhami
    Jan 20 '16 at 15:40
  • 1
    Welcome! Note that when @touhami says contents of each files, the suggestion is not that you provide the files in their entirety but only enough 'dummy content' to make the problem you want help with clear. kantlipsum, lipsum and blindtext can all help to provide dummy or filler content for this kind of purpose.
    – cfr
    Jan 21 '16 at 3:16
  • standalone and similar packages are also possibilities, but combine would be the first bet.
    – cfr
    Jan 21 '16 at 3:17
  • @touhami: i have taken the preamble from this site (ramanuppal.com/ruppal/JF.html), this is basically the same for each file, with the difference of a few \newcommand. Thanks for your help so far. Jan 21 '16 at 19:59
1

Such tasks tend to be really nasty, because there is a plethora of things that can go wrong.

I suggest to use the search & replace functions of your editor:

If you don't have more than 25 lines inside the preamble, I'd copy all files into one large file. How to do this depends on your OS, but google provides many answers. For Windows e.g. see here: https://superuser.com/a/453806

In your document you now have 25 lines \documentclass.... Probably your editor offers a possibility to replace text. Replace the line and repeat this with all other lines of your preamble. (Yes, only one line per time, otherwise you'll probably need regexp...).

Don't forget to delete \maketitle as well.

Then replace the string \title{ with \chapter{.

Write a new preamble.

Then you have to transfer all the newcommands to the new preamble. I have no idea how to solve this except to do this manually.

Add begin and end of document.

Compile...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.