LyXNumerating PDF Links

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
Edulis
Posts: 16
Joined: Thu May 26, 2011 10:38 pm

Numerating PDF Links

Post by Edulis »

Hi,

I have a problem with several chapters of my document.
In these chapters I have introduced several scientific articles via pdf-link.
The pdf-document generated is OK, pdf articles are displayed correctly, but they are not numbered.
As I have several articles introduced over the document, the numbering is a mess.

How could I paginate the overall document including articles-pdf?
Last edited by Edulis on Sun Jun 05, 2011 7:54 pm, edited 1 time in total.

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Numerating PDF Links

Post by Stefan Kottwitz »

Hi,

with LaTeX I would use the pdfpages package and its command \includepdf, there I can set a pagecommand option I can use for page numbering or adding a page style. However, I did not use that in LyX.

Stefan
LaTeX.org admin
Edulis
Posts: 16
Joined: Thu May 26, 2011 10:38 pm

Numerating PDF Links

Post by Edulis »

I have downloaded and activated this pdfpages package.

I have no very clear where to place the codes that you tell me.
In the preamble, I have inserted:
\usepackage{pdfpages}

and in the text, what is the code that you suggest me, Stefan_K? I am too beginner, so I have not enaught clear how I have to insert the \pdfpage and pagecommand option. I have insert this one:
lyx.png
lyx.png (140.82 KiB) Viewed 6802 times
error.png
error.png (95.7 KiB) Viewed 6802 times
Last edited by Stefan Kottwitz on Sun May 29, 2011 11:14 am, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Re: Numerating PDF Links

Post by Stefan Kottwitz »

I took your images from imageshack (they annoy with advertising) and put it as attachment to your post, placing it inline. We prefer forum post attachments over external hosting, since external pictures might go away later.

Though the text in your images is hard to read. Perhaps add the error message as text or post a clear cut-out of such a screenshot.

Stefan
LaTeX.org admin
Edulis
Posts: 16
Joined: Thu May 26, 2011 10:38 pm

Numerating PDF Links

Post by Edulis »

Sorry, I did not know how I had to insert the images.

I transcribe the Latex error:

Code: Select all

Package pdfpages Error: Cannot find file `.'.
Undefined control sequence.
Missing number, treated as zero.
Package pdfpages Error: page 1 of `\AM@currentdocname'does not exist.
Package pdftex.def Error: File `\AM@currentdocname'.png'not found.
and the description, for the first error is:

Code: Select all

\includepdf\includepdf
                       [pages=-,scale=0.9]
{159C_Documents_and_Settings...
This error message was generated by an \ermessage command, so I can't give you any explicit help.
Pretend that you're Hercule Poirot: Examine all clues, and deduce the truth by oredr and method.
for the second one:

Code: Select all

 \includepdf\includepdf
                            [pages=-,scale=0.9]{159C__Documents_and_Settings...
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
For the third error:

Code: Select all

 \includepdf\includepdf
                            [pages=-,scale=0.9]{159C__Documents_and_Settings...
A number should have been here; I inserted `0'.
(If you can't figure out why I needed to see a number,
look up `weird error' in the index to The TeXbook.)
and the fourth and the fith explanations are the same:

Code: Select all

 \includepdf\includepdf
                            [pages=-,scale=0.9]
{159C__Documents_and_Settings...
Otherwise, I can attach the lyx-document...
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Re: Numerating PDF Links

Post by Stefan Kottwitz »

It just looks like to command \includepdf has been used twice. It may be a strange error output, though you might check the code if it happened somehow.

Of course you can also attach the LyX document. Perhaps somebody with LyX can test it. Maybe I'm installing LyX today on another computer, where I plan to install the pretest version of TeX Live 2011, which I expect to be released today.

Stefan
LaTeX.org admin
Edulis
Posts: 16
Joined: Thu May 26, 2011 10:38 pm

Re: Numerating PDF Links

Post by Edulis »

I have used the command \usepackage{pdfpages} once at the preamble, and once too the command \includepdf.
I do not understand why the error notes \includepdf\includepdf.

I attach the Lyx document.
Attachments
Chapter3.rar
LyX document
(78.12 KiB) Downloaded 222 times
Edulis
Posts: 16
Joined: Thu May 26, 2011 10:38 pm

Numerating PDF Links

Post by Edulis »

I have solved the problem.


In LyX, when you introduce the external material (pdf document in this case), the program executes directly the command \includepdf.
Before the pdf link, as well as I was entering the same command, the Latex error indicated that there were two \includepdf\includepdf.

I thought that the source of the error was any mistake related to any brackets or any other order that I ignored. It was more simple than that.

In LyX, when you insert the external material (pdf document in this case), in a second tab, there are some Latex and Lyx options. Is here where I have introduced this command:

pages=-, scale=1.1, pagecommand={\thispagestyle{fancy}}

Now, LyX paginates correctly the pdf document.
But here, one other problem arises: How to insert in the TOC all the sections and subsections that the pdf document has, indicating correctly the page where they appear.

P.D. I do not know if I should open a new subject, or follow with this one.

Stefan_K, I greatly appreciate your help
Post Reply