0

I have posted a similar question elsewhere

but the answer there has a serious drawback, it must be manually inserted the section names, while my dream was that it should be fully automatically generated from the R0.pdf files which are present in the same CWD. And everything should be in XeLaTeX

Here I just restate my original question:

I have a pdf generated as below. Now I would like to create the index which should be a page listing all the names of papers included, i.e. the names of sections, one row should be dedicated for each paper from the entire pdf. How could I achieve this ? Preferably in XeTeX.

\documentclass[landscape,a4paper]{article}
\usepackage{pdfpages}
\usepackage{pgfmath}
%\usepackage[margin=1cm,showframe]{geometry}% MWE only

\pgfmathsetmacro{\scale}{(\paperheight-2cm)/(\paperwidth-3cm)}% 1cm margin \pgfmathsetlengthmacro{\delta}{\paperwidth-2cm-2\scale(\paperheight-3cm)-4mm}% 4mm fudge factor

\usepackage[footwidth=paper]{scrlayer-scrpage} \pagestyle{plain}

\usepackage{polyglossia} \usepackage{fontspec} \setotherlanguage{hebrew} \newfontfamily\hebrewfont{Arial}

\robustify{\thepage} \renewcommand{\thepage}{\arabic{page} \ \roman{page}\ \texthebrew{\hebrewnumeral{\value{page}}}}

\newcommand\gettitle[1]{% \directlua{% local filename = kpse.find_file("#1", 'graphic/figure') doc = pdfe.open(filename) info = pdfe.getinfo(doc) title = info['Title'] tex.print(title) }}

\begin{document}

% \includepdf[scale=1.02, nup=2x1,pages=1-8,trim=2.5cm 2.5cm 5.5cm 7.0cmB]{sh1.pdf}

%pagecommand={\thispagestyle{plain}}

\includepdf[scale=\scale,noautoscale,nup=2x1,pages=1-,delta={\delta} 0pt,offset=0pt -3mm,% offset in reverse order trim=2.5cm 2.5cm 5.5cm 7.0cm,picturecommand={\put(.15\paperwidth,3.3cm){\thepage}}]{example-image-a4-numbered.pdf}

\includepdf[scale=\scale,noautoscale,nup=2x1,pages=1-,delta={\delta} 0pt,offset=0pt -3mm,% offset in reverse order trim=2.5cm 2.5cm 5.5cm 7.0cm,picturecommand={\put(.15\paperwidth,3.3cm){\thepage}}]{example-image-a4-numbered.pdf}

\includepdf[scale=\scale,noautoscale,nup=2x1,pages=1-,delta={\delta} 0pt,offset=0pt -3mm,% offset in reverse order trim=2.5cm 2.5cm 5.5cm 7.0cm,picturecommand={\put(.15\paperwidth,3.3cm){\thepage}}]{example-image-a4-numbered.pdf} \end{document}

user2925716
  • 1,940
  • 1
    Were the included pdfs generated by Xe(La)TeX? Do you have the .toc file for them? – Teepeemm Feb 27 '23 at 17:19
  • No I don't have any files beyond something like this https://arxiv.org/pdf/2012.11202.pdf and they were downloaded mostly from ArXive.org. Can I create these necessary .toc somehow ? – user2925716 Feb 27 '23 at 17:22
  • You can get the source of what was uploaded from https://arxiv.org/format/2012.11202. That likely has the tex file, which would create the toc file. Are you able to get tex source files for all of your pdfs? – Teepeemm Feb 27 '23 at 17:36
  • Your link download source just downloads some unknown file which has 85Kb and cannot be opened. – user2925716 Feb 27 '23 at 17:40
  • 1
    @user2925716, the downloaded source is just a text file, .tex extension should be added. – Andrey L. Mar 02 '23 at 10:50

0 Answers0