1

I need merging several research papers compiled using CAS-DC Elsevier template in single .pdf file with bibliography in each research paper and consecutive page numbering across the whole .pdf document.

I tried confproc, combine, pdfpages and subfiles packages. I stayed at subfiles package.

While compiling I see next mistake: ! LaTeX Error: Control sequence \sep: already defined.

In compiled main document I see repetition of Title, Authors, Affilations etc. For instance: In main file in second research paper there are Title, Authors, Affilations, e-mails ORCID etc. from first research paper.


Main document:

\documentclass[a4paper,fleqn,twoside]{cas-dc}
\usepackage{subfiles}

\usepackage[numbers]{natbib}

\usepackage[T1,T2A]{fontenc} \usepackage[utf8,]{inputenc} %\usepackage{tempora} %\usepackage{XCharter} \usepackage{textcomp} \usepackage[russian,ukrainian,romanian,english]{babel} %\usepackage[dvipsnames,x11names]{xcolor} \renewcommand{\rmdefault}{ftm} \usepackage{yfonts} \usepackage{multicol}

\usepackage{lineno,hyperref} %\modulolinenumbers[5] \usepackage{amsmath,amsfonts,amssymb,amsthm,mathtools,enumerate,float}

\sloppy

\makeatletter \def\ps@first{% \let@oddhead@empty \let@evenhead@empty \def@oddfoot{} \let@evenfoot@oddfoot }

\usepackage{wrapfig} \usepackage{graphicx} \renewcommand{\rmdefault}{cmr} \renewcommand{\sfdefault}{cmss} \renewcommand{\ttdefault}{cmtt} %\renewcommand{\rmdefault}{cmss} \renewcommand{\ttdefault}{cmss}

%\DeclareFontSubstitution{T2A}{cmr}{m}{n} %\DeclareSymbolFont{T2Aletters}{T2A}{cmr}{m}{it} \usepackage{geometry} \renewcommand{\theenumi}{\arabic{enumi}}% Меняем везде перечисления на цифра.цифра \renewcommand{\labelenumi}{\arabic{enumi}}% Меняем везде перечисления на цифра.цифра \renewcommand{\theenumii}{.\arabic{enumii}}% Меняем везде перечисления на цифра.цифра \renewcommand{\labelenumii}{\arabic{enumi}.\arabic{enumii}.}% Меняем везде перечисления на цифра.цифра \renewcommand{\theenumiii}{.\arabic{enumiii}}% Меняем везде перечисления на цифра.цифра \renewcommand{\labelenumiii}{\arabic{enumi}.\arabic{enumii}.\arabic{enumiii}.}% Меняем везде перечисления на цифра.цифра

\usepackage{fancyhdr} \pagestyle{fancy} \fancyhead{} \fancyhead[LE,RO]{\thepage} \fancyhead[CO]{ } %\fancyhead[LO] {} \fancyhead[CE]{ } %\fancyhead[RE] { } \renewcommand{\headrulewidth}{0.5pt} \renewcommand{\footrulewidth}{0.5pt}

\fancyfoot[C]{}}}

{ \fancyfootoffset[R]{-12cm} \fancyfoot[L]{} \fancyfoot[C]{} \fancyfoot[R]{} \renewcommand{\footrulewidth}{0.3 mm} \renewcommand{\headrulewidth}{0.3 mm} } \setlength{\voffset}{-10mm} \setlength{\topmargin}{0mm} \setlength{\headheight}{5mm} \setlength{\headsep}{5mm} \setlength{\footskip}{6mm}

%\newcommand{\l@abcd}[2]{\hbox to\textwidth{#1\dotfill #2}}

\usepackage{etoolbox} \makeatletter \patchcmd{\BR@backref}{\newblock}{\newblock(page~}{}{} \patchcmd{\BR@backref}{\par}{)\par}{}{} \makeatother

\usepackage[]{notes2bib} \usepackage[nottoc]{tocbibind}

\usepackage[colorlinks]{hyperref} %\hypersetup{pdffitwindow=true,linkcolor=LightSkyBlue,citecolor=Sienna,urlcolor=Navy,menucolor=black} \hypersetup{ colorlinks=true, linkcolor=magenta, filecolor=blue, urlcolor=blue, citecolor=green, anchorcolor=blue, menucolor=blue, backref=false, backref=page, pdfpagemode=UseNone, pdfstartview=} \RequirePackage[hyperpageref]{backref} \renewcommand{\backref}[1]{}
\renewcommand
{\backrefalt}[4]{ \ifcase #1 No cited. \or Cited on page #2. \else Cited on pages #2. \fi}

\begin{document}

\subfile{ }

\subfile{ }

\end{document}


Subfile:

\documentclass[document]{subfiles}

\begin{document}

\title [mode = title]{ }

\tnotemark[1] \tnotetext[1]{Research Paper} \tnotetext[1]{This document is the result of blood, sweat, tears and taxpayer money.} \nonumnote{This note has no numbers. In this work we demonstrate $a_b$ the formation Y_1 of a new type of polariton on the interface between a cuprous oxide slab and a polystyrene micro-sphere placed on the slab.}

\credit{Conceptualization of this study, Methodology, Software}

\author[2]{ } [orcid=https://orcid.org/] \cormark[2] \fnmark[2] \fntext[fn2]{ }

\ead{13335789@ukr.net} \ead[URL]{www. }%

% Address/affiliation \affiliation[2]{organization={National Scientific Center «Hon. Prof. M. S. Bokarius Forensic Science Institute»}, addressline={ }, city={ }, country={ }} \credit{ }

\begin{abstract} Abstract Text \end{abstract}

\begin{keywords} keywords \vspace*{0.5\baselineskip} \textbf{Article history:}\ Received: 30.09.2021\ Received in revised form: 19.12.2021 \Accepted: 9.01.2022 \Available online: 11.01.2022 \end{keywords}

\maketitle

\section{ } Text

\section{ } text \section{ } Text \section{Conclusions} Text

\section{Conclusions}

Text \subsection{Acknowledgements}

Text

\bio{{figs/image1}} Author biography with author photo. \end{multicols} \end{document}

I have tried Adobe Acrobat and PDF-XChange Editor for resolving this issue. It merges well several PDFs in single PDF. However, It is always problem with consecutive page numbering and headers. I prefer my own headers: page number and URL embedded in the header text. Cited There is a problem with backreference links. If it is good for first include PDF, it is not good for the rest. For example: Cited on page 1 is good only for first included PDF.

So I would like use subfilles package. For subfiles package I have no all these problems, but I have problemswith repetition. For instance: In main file in second research paper there are Title, Authors, Affilations, e-mails ORCID etc. from first included PDF. and problem with cross referencing. I do not see my bibliography.

  • It sounds like concatenating the pdfs is what you want (which would be pdfpages), except that you want the page numbering to continue on and not reset (and any table of contents to refer to the continued numbering). Is that correct? – Teepeemm May 30 '23 at 13:46
  • Thank you. Yes. It is about concatenating pdfs. I have tried pdfpages. But I cannot have continuous page numbering and final pdf always opens .pdf generated from subfile (research paper). I need have all subfiles in single .pdf preserving all internal links (table of contents, URL. Emails, references (bibliography), footnotes, etc.) without opening included PDFs – Andriy Bublikov May 30 '23 at 14:04
  • Did you see this one? https://tex.stackexchange.com/questions/77751/how-to-turn-on-off-page-numbering-when-merging-pdf-files – MS-SPO May 30 '23 at 15:35
  • This one sounds like it might work for you, too: https://tex.stackexchange.com/questions/344223/continuous-page-numbering-across-separate-tex-pdf-files – MS-SPO May 30 '23 at 15:36
  • This seems to be the solution by Adobe: https://community.adobe.com/t5/acrobat-discussions/continuous-pagination-in-combined-pdf-docs/td-p/10013193 – MS-SPO May 30 '23 at 15:37
  • Don't know, if this approach really helps: https://www.courts.ca.gov/documents/Consecutive_Pagination_Across_Multiple_PDF_Files-Adobe_DC.pdf – MS-SPO May 30 '23 at 15:38
  • If you allow online merge, perhaps this one will do: https://www.dochub.com/en/functionalities/merge-pdf-and-add-page-numbers-to-pdf-in-microsoft-edge – MS-SPO May 30 '23 at 15:39
  • 1
    If editing the header/footer of the final pdf is acceptable for you, here are some (overlapping) pdf editors from the open source domain: https://pdf.wondershare.com/pdf-knowledge/open-source-pdf-editor.html, and https://www.swifdoo.com/blog/open-source-pdf-editors . // This one can modify page numbers: https://www.ilovefreesoftware.com/23/windows/free-software-add-header-footer-pdf-files.html – MS-SPO May 30 '23 at 15:48
  • As it was mentioned by Adobe, and if programming is a route for you, this one might be interesting: https://pdf-lib.js.org/ , also available at github: https://github.com/Hopding/pdf-lib // See esp. https://github.com/Hopding/pdf-lib#modify-document – MS-SPO May 30 '23 at 15:52
  • Thank you all for your suggestions

    Concatenating problem resolved using PDF-XChange Editor and Adobe Acrobat DC Pro.

    However I need problem resolution by means of LaTex (MiKTeX, TeXstudio).

    – Andriy Bublikov Oct 31 '23 at 07:26

0 Answers0