Re: Finding the cause of a failed lyx->pdf conversion

2017-03-08 Thread Alexandru Băluț
On Wed, Mar 8, 2017 at 6:59 AM Scott Kostyshak  wrote:

> On Tue, Mar 07, 2017 at 10:05:50PM +0200, Dr Eberhard Lisse wrote:
> > It is hardly a Minimal Working Example, and the file test.pdf is missing.
>
> +1
>
> For tips on a minimal example, please read carefully the following wiki
> page:
>
>   https://wiki.lyx.org/FAQ/MinimalExample


I did forget to clean up the preamble. Sorry about that, I'm new to Lyx. I
filed http://www.lyx.org/trac/ticket/10588

Thanks,
Alex


Re: Finding the cause of a failed lyx->pdf conversion

2017-03-07 Thread Scott Kostyshak
On Tue, Mar 07, 2017 at 02:37:22PM +0100, Alexandru Băluț wrote:
> On Mon, 06 Mar 2017 17:13:25 -0800, Scott Kostyshak wrote:
> > On Mon, Mar 06, 2017 at 03:59:53PM +, Alexandru Băluț wrote:
> > > I'm converting a LYX file to PDF from the command line and the conversion
> > > apparently fails, the exit code of the process is 1:
> > > $ lyx -e pdf2 docs/myfile.lyx -dbg latex
> 
> 
> > > I kept removing stuff and I got to a point where I have a section 2.2.3
> > > containing some simple text and if I remove its text leaving the section
> > > empty (only the title), exporting to PDF succeeds with no errors, whereas
> > > before it failed. I don't see how I could minimize the lyx file to be able
> > > to report the bug.
> > I don't understand. Why not?
> 
> Because the document is not public.

I see.

> I ended up replacing all text manually with "t".

Good strategy.

> To my surprise, the
> common double-click to select a word and drag to select further entire
> words does not work in lyx. It would be nice if it is the same as in
> other editors.

This issue is covered by

  http://www.lyx.org/trac/ticket/7890

and

  http://www.lyx.org/trac/ticket/9160

I also wish the feature were implemented. I made an attempt at a patch
(documented on #7890) but couldn't figure it out.

> I filed a bug: http://www.lyx.org/trac/ticket/10586

I took a look.

Scott


signature.asc
Description: PGP signature


Re: Finding the cause of a failed lyx->pdf conversion

2017-03-07 Thread Scott Kostyshak
On Tue, Mar 07, 2017 at 10:05:50PM +0200, Dr Eberhard Lisse wrote:
> It is hardly a Minimal Working Example, and the file test.pdf is missing.

+1

For tips on a minimal example, please read carefully the following wiki
page:

  https://wiki.lyx.org/FAQ/MinimalExample

Scott


signature.asc
Description: PGP signature


Re: Finding the cause of a failed lyx->pdf conversion

2017-03-07 Thread Dr Eberhard Lisse
It is hardly a Minimal Working Example, and the file test.pdf is missing.

el

On 2017-03-07 15:37 , Alexandru Băluț wrote:
[...]
> I tried this and it still errors out, but it prints a different error
> related to a separate pdf used as an image in the document.
> 
>> If all fails, remove EVERYTHING (text before and after, formatting and
>> loaded packages) step by step, until the error goes away. then generate
>> a very small file (Minimal Working Example) that produces the error and
>> post this here.
> 
> I attached the lyx file to the bug I filed, I removed as much as I
> could: http://www.lyx.org/trac/ticket/10586
> 
> 
> Thanks,
> Alex
> 



Re: Finding the cause of a failed lyx->pdf conversion

2017-03-07 Thread Alexandru Băluț
On Mon, 06 Mar 2017 17:13:25 -0800, Scott Kostyshak wrote:
> On Mon, Mar 06, 2017 at 03:59:53PM +, Alexandru Băluț wrote:
> > I'm converting a LYX file to PDF from the command line and the conversion
> > apparently fails, the exit code of the process is 1:
> > $ lyx -e pdf2 docs/myfile.lyx -dbg latex


> > I kept removing stuff and I got to a point where I have a section 2.2.3
> > containing some simple text and if I remove its text leaving the section
> > empty (only the title), exporting to PDF succeeds with no errors, whereas
> > before it failed. I don't see how I could minimize the lyx file to be able
> > to report the bug.
> I don't understand. Why not?

Because the document is not public.

I ended up replacing all text manually with "t". To my surprise, the
common double-click to select a word and drag to select further entire
words does not work in lyx. It would be nice if it is the same as in
other editors.

I filed a bug: http://www.lyx.org/trac/ticket/10586


On Tue, 07 Mar 2017 01:37:43 -0800, Dr Eberhard Lisse wrote:
> It runs PDFLaTeX repeatedly hence the repeated error messages.
>
> What I do in these cases is
>
> lyx -f -e pdflatex file.lyx
>
> Then run
>
> pdflatex file.tex
>
> (preferably from TexTmate2 on the Mac with Command-R) and go to the
> lines generating the error messages.

I tried this and it still errors out, but it prints a different error
related to a separate pdf used as an image in the document.

> If all fails, remove EVERYTHING (text before and after, formatting and
> loaded packages) step by step, until the error goes away. then generate
> a very small file (Minimal Working Example) that produces the error and
> post this here.

I attached the lyx file to the bug I filed, I removed as much as I
could: http://www.lyx.org/trac/ticket/10586


Thanks,
Alex


Re: Finding the cause of a failed lyx->pdf conversion

2017-03-07 Thread Dr Eberhard Lisse
It runs PDFLaTeX repeatedly hence the repeated error messages.

What I do in these cases is

lyx -f -e pdflatex file.lyx

Then run

pdflatex file.tex

(preferably from TexTmate2 on the Mac with Command-R) and go to the
lines generating the error messages.

If I can figure out how to make it compile without error I try to
figure out how to fix this in LyX.

If all fails, remove EVERYTHING (text before and after, formatting and
loaded packages) step by step, until the error goes away. then generate
a very small file (Minimal Working Example) that produces the error and
post this here.


el


On 07/03/2017 03:12, Scott Kostyshak wrote:
> On Mon, Mar 06, 2017 at 03:59:53PM +, Alexandru Băluț wrote:
>
>> I'm converting a LYX file to PDF from the command line and the
>> conversion apparently fails, the exit code of the process is 1: $ lyx
>> -e pdf2 docs/myfile.lyx -dbg latex
>>
>> The process reports failure even though it did actually create a PDF
>> file which seems to be complete and usable. Is it safe to ignore the
>> exit code in case it managed to create the PDF?
>
> No you should never ignore the exit code from any command. A non-zero
> exit code means an error.
>
>> When I do the export to PDF from the UI, I get the errors
>> below. Why do they appear twice?  LaTeX Error: \begin{document}
>> ended by \end{thenomenclature}.  Extra \endgroup.  LaTeX Error:
>> \begin{document} ended by \end{thenomenclature}.  Extra \endgroup.
>
> I think the general advice is only to pay attention to the first LaTeX
> error.
>
>> I kept removing stuff and I got to a point where I have a section
>> 2.2.3 containing some simple text and if I remove its text leaving
>> the section empty (only the title), exporting to PDF succeeds with no
>> errors, whereas before it failed. I don't see how I could minimize
>> the lyx file to be able to report the bug.
>
> I don't understand. Why not? If there is a word in section 2.2.3 and
> LyX exports with error with it and with no error without it, then
> the MWE would include the word and in your description you would
> state "when I remove the word abc, the error goes away". For more
> information, see:
>
> https://wiki.lyx.org/FAQ/MinimalExample
>
>> Side question: Removing paragraphs led to broken refs: "BROKEN: Ref:
>> ...". To me these seem important, one would not want the final
>> document to contain them, but maybe I'm missing something. Why
>> are these errors ignored when exporting to PDF? Is there a way to
>> validate a lyx file from the command line, and in such a way that
>> these errors are not ignored? I searched for "compile lyx file" but
>> did not find much.
>
> I think there is a LaTeX package. Alternatively, in LyX in the outline
> you can view labels and references. just filter for "BROKEN" and you
> will see the current ones that are broken.
>
> Scott
> 




Re: Finding the cause of a failed lyx->pdf conversion

2017-03-06 Thread Scott Kostyshak
On Mon, Mar 06, 2017 at 03:59:53PM +, Alexandru Băluț wrote:
> I'm converting a LYX file to PDF from the command line and the conversion
> apparently fails, the exit code of the process is 1:
> $ lyx -e pdf2 docs/myfile.lyx -dbg latex
> 
> The process reports failure even though it did actually create a PDF file
> which seems to be complete and usable. Is it safe to ignore the exit code
> in case it managed to create the PDF?

No you should never ignore the exit code from any command. A non-zero
exit code means an error.

> When I do the export to PDF from the UI, I get the errors below. Why do
> they appear twice?
> LaTeX Error: \begin{document} ended by \end{thenomenclature}.
> Extra \endgroup.
> LaTeX Error: \begin{document} ended by \end{thenomenclature}.
> Extra \endgroup.

I think the general advice is only to pay attention to the first LaTeX
error.

> I kept removing stuff and I got to a point where I have a section 2.2.3
> containing some simple text and if I remove its text leaving the section
> empty (only the title), exporting to PDF succeeds with no errors, whereas
> before it failed. I don't see how I could minimize the lyx file to be able
> to report the bug.

I don't understand. Why not? If there is a word in section 2.2.3 and LyX
exports with error with it and with no error without it, then the MWE
would include the word and in your description you would state "when I
remove the word abc, the error goes away". For more information, see:

https://wiki.lyx.org/FAQ/MinimalExample

> Side question: Removing paragraphs led to broken refs: "BROKEN: Ref: ...".
> To me these seem important, one would not want the final document to
> contain them, but maybe I'm missing something. Why are these errors ignored
> when exporting to PDF? Is there a way to validate a lyx file from the
> command line, and in such a way that these errors are not ignored? I
> searched for "compile lyx file" but did not find much.

I think there is a LaTeX package. Alternatively, in LyX in the outline
you can view labels and references. just filter for "BROKEN" and you
will see the current ones that are broken.

Scott


signature.asc
Description: PGP signature


Finding the cause of a failed lyx->pdf conversion

2017-03-06 Thread Alexandru Băluț
I'm converting a LYX file to PDF from the command line and the conversion
apparently fails, the exit code of the process is 1:
$ lyx -e pdf2 docs/myfile.lyx -dbg latex

The process reports failure even though it did actually create a PDF file
which seems to be complete and usable. Is it safe to ignore the exit code
in case it managed to create the PDF?

When I do the export to PDF from the UI, I get the errors below. Why do
they appear twice?
LaTeX Error: \begin{document} ended by \end{thenomenclature}.
Extra \endgroup.
LaTeX Error: \begin{document} ended by \end{thenomenclature}.
Extra \endgroup.

The same errors appear like this when starting the conversion in the
console:
LaTeX.cpp (658): Log line: [3] (./myfile.nls
LaTeX.cpp (658): Log line:
LaTeX.cpp (658): Log line: ! LaTeX Error: \begin{document} ended by
\end{thenomenclature}.
LaTeX.cpp (848): line: 8
Desc: LaTeX Error: \begin{document} ended by \end{thenomenclature}.
Text:  \end{thenomenclature}

Your command was ignored.
Type  Ito replace it with another command,
orto continue without it.

LaTeX.cpp (658): Log line: ! Extra \endgroup.
LaTeX.cpp (848): line: 8
Desc: Extra \endgroup.
Text:  \end{thenomenclature}

Things are pretty mixed up, but I think the worst is over.

LaTeX.cpp (658): Log line: ) [4]

Since the usage of the nomenclature elements in the document is pretty
straight-forward, meaning I have no idea how to change or fix the document
to fix this error, I tried to manually remove parts of the lyx document to
get to a minimal example.lyx which has this problem, to report a bug.

I kept removing stuff and I got to a point where I have a section 2.2.3
containing some simple text and if I remove its text leaving the section
empty (only the title), exporting to PDF succeeds with no errors, whereas
before it failed. I don't see how I could minimize the lyx file to be able
to report the bug. Any suggestions?

Side question: Removing paragraphs led to broken refs: "BROKEN: Ref: ...".
To me these seem important, one would not want the final document to
contain them, but maybe I'm missing something. Why are these errors ignored
when exporting to PDF? Is there a way to validate a lyx file from the
command line, and in such a way that these errors are not ignored? I
searched for "compile lyx file" but did not find much.

Thanks,
Alex