Import Latex code with verbatim

2009-02-27 Thread BcBob

Matlab has a feature called publish to latex that runs code and packages the
code and the output into a latex file. I would like to use it to put
examples into my book but I am having trouble importing the latex code into
Lyx.

The problem is that comments get mangled in with code during the import into
Lyx. The latex code works fine; I am able to create a dvi file from it that
is OK.

I am including an example of the latex code and the Lyx file created by
importing it.

Any ideas of how to fix/workaround?

Bob


---latex code:--
% This LaTeX was auto-generated from an M-file by MATLAB.
% To make changes, update the M-file and republish this document.

\documentclass{article}
\usepackage{graphicx}
\usepackage{color}

\sloppy
\definecolor{lightgray}{gray}{0.5}
\setlength{\parindent}{0pt}

\begin{document}



\subsection*{Contents}

\begin{itemize}
\setlength{\itemsep}{-1ex}
   \item make a plot
\end{itemize}
\begin{verbatim}
% matlab2lyx.m
% Sample file to convert to Lyx input
\end{verbatim}


\subsection*{make a plot}

\begin{verbatim}
xs = linspace(0,2*pi);
ys = []; % initialize
for x = xs % a comment
  ys(end+1) = sin(x); % another comment
end
plot(xs,ys,'.k');
\end{verbatim}

\includegraphics [width=4in]{matlab2lyx_01.eps}



\end{document}
--
Lyx file---
#LyX file created by tex2lyx 1.5.5
\lyxformat 247
\begin_document
\begin_header
\textclass article
\begin_preamble

% This LaTeX was auto-generated from an M-file by MATLAB.
% To make changes, update the M-file and republish this document.



\...@ifundefined{definecolor}
 {\usepackage{color}}{}


\sloppy
\definecolor{lightgray}{gray}{0.5}



\end_preamble
\language english
\inputencoding auto
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\paperfontsize default
\spacing single
\papersize default
\use_geometry false
\use_amsmath 0
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation skip
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\end_header

\begin_body

\begin_layout Subsection*

Contents
\end_layout

\begin_deeper
\begin_layout Standard


\begin_inset ERT
status collapsed

\begin_layout Standard


\backslash
setlength{
\backslash
itemsep}{-1ex}
\end_layout

\end_inset

 
\end_layout

\end_deeper
\begin_layout Itemize

make a plot 
\end_layout

\begin_layout Standard


\begin_inset ERT
status collapsed

\begin_layout Standard


\backslash
begin{verbatim}
\end_layout

\end_inset

 
\begin_inset ERT
status collapsed

\begin_layout Standard

% matlab2lyx.m
\end_layout

\begin_layout Standard


\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Standard

% Sample file to convert to Lyx input
\end_layout

\begin_layout Standard


\end_layout

\end_inset


\begin_inset ERT
status collapsed

\begin_layout Standard


\backslash
end{verbatim}
\end_layout

\end_inset


\end_layout

\begin_layout Subsection*

make a plot
\end_layout

\begin_layout Standard


\begin_inset ERT
status collapsed

\begin_layout Standard


\backslash
begin{verbatim}
\end_layout

\end_inset

 xs = linspace(0,2*pi); ys = []; 
\begin_inset ERT
status collapsed

\begin_layout Standard

% initialize
\end_layout

\begin_layout Standard


\end_layout

\end_inset

for x = xs 
\begin_inset ERT
status collapsed

\begin_layout Standard

% a comment
\end_layout

\begin_layout Standard


\end_layout

\end_inset

 ys(end+1) = sin(x); 
\begin_inset ERT
status collapsed

\begin_layout Standard

% another comment
\end_layout

\begin_layout Standard


\end_layout

\end_inset

end plot(xs,ys,'.k'); 
\begin_inset ERT
status collapsed

\begin_layout Standard


\backslash
end{verbatim}
\end_layout

\end_inset


\end_layout

\begin_layout Standard


\begin_inset Graphics 
filename matlab2lyx_01.eps
width 4in

\end_inset


\end_layout

\end_body
\end_document




-- 
View this message in context: 
http://n2.nabble.com/Import-Latex-code-with-verbatim-tp2399787p2399787.html
Sent from the LyX - Users mailing list archive at Nabble.com.



Re: new line in a title

2009-02-27 Thread Waluyo Adi Siswanto
On Fri, 2009-02-27 at 18:43 -0500, Ehud Kaplan wrote:
> I agree with you-- I SHOULD be able to see the second line as part of
> the title, and I do, as my message said.  The sad part is that I do
> NOT see the first line, the one that came BEFORE the Cntrl-Return.
> EK
> 
I have never encountered that problem. Usually the pdf will show all the
lines. Attached an example, and all lines (three) are shown in pdf,
including the one that came before Ctrl-Return.
Maybe the experts in this community may explain this.
---
was


title.lyx
Description: application/lyx


Re: new line in a title

2009-02-27 Thread Ehud Kaplan
I agree with you-- I SHOULD be able to see the second line as part of 
the title, and I do, as my message said.  The sad part is that I do NOT 
see the first line, the one that came BEFORE the Cntrl-Return.

EK

Waluyo Adi Siswanto wrote:

On Fri, 2009-02-27 at 16:41 -0500, Ehud Kaplan wrote:
  
When I insert a carriage return (or shift return or control return) in a 
/title,/ I do not see in the pdf

output the portion of the title that preceded the carriage return.
What do I do?
Thanks



If the line is in Title environment and in the end of the line, Ctrl
+Return, then the next line will be in Title environment. You should see
this additional title in this new line. 
---

was

  


--
Ehud Kaplan, Ph.D.
Jules and Doris Stein Research to Prevent Blindness Professor
Director, The laboratory of Visual Neuroscience
Departments of Neuroscience, Ophthalmology, Structural & Chemical Biology,
The Mount Sinai School of Medicine
One Gustave Levy Place
NY, NY, 10029 



Re: Showing trimming cross lines

2009-02-27 Thread Waluyo Adi Siswanto
> 
> \usepackage[cam,center]{crop}
> 
> Jürgen

Thank you for the info.. but adding it in the preamble and see the pdf.
It doesn't create anything.. Is it dependent on another package to make
it work.



Re: Lyx and R some help appreciated : not Sweave

2009-02-27 Thread Graham Smith

Christian



Considerung your problem -- if it isn't solved yet --, have you tried 
to put the R verbatim text into a minipage? You would do Insert --> 
Box (Minipage) and paste your code there. Might be worth a shot.


I did think of that, but the problem is more manually re-organising the 
text alignment than anything else. Maybe I just have to accept a lot of 
manual re-formatting, and, as you suggest, look to getting to grips with 
Sweave.


Thanks,

Graham


new line in a title

2009-02-27 Thread Ehud Kaplan
When I insert a carriage return (or shift return or control return) in a 
/title,/ I do not see in the pdf

output the portion of the title that preceded the carriage return.
What do I do?
Thanks

--
Ehud Kaplan, Ph.D.
Jules and Doris Stein Research to Prevent Blindness Professor
Director, The laboratory of Visual Neuroscience
Departments of Neuroscience, Ophthalmology, Structural & Chemical Biology,
The Mount Sinai School of Medicine
One Gustave Levy Place
NY, NY, 10029 



Re: Lyx and R some help appreciated : not Sweave

2009-02-27 Thread Christian Liesen

Graham,

thanks for your reply. I have to admit that I was first sceptical  
about Sweave, too. But it really works fine.


Considerung your problem -- if it isn't solved yet --, have you tried  
to put the R verbatim text into a minipage? You would do Insert -->  
Box (Minipage) and paste your code there. Might be worth a shot.


Best,
Christian


Am 27.02.2009 um 19:36 schrieb Graham Smith:


Christian,

Thanks for the reply.

At the moment I don't really have any method of working with Lyx and  
R.

It just so happens that I have a half written document that I want to
move to Lyx.

I have briefly looked at Sweave in the past and have completely failed
to grasp the concept, so left it as something to come back to later,
which I intend doing

The reason for saying I wasn't interested in Sweave at the moment was
because the document I am working with and all the R code is already  
in

Word.

I shall have a look at the links you have sent and see if it makes  
more

sense to me than it did before.

Graham


Christian Liesen wrote:
> Hi,
>
> I use LyX and R with Sweave and it works fine.
>
> If I get you correctly what you do is produce some output in R, then
> copy it from Word to LyX and convert it to verbatim? So the question
> then would really be how to prevent verbatim text from running of  
the

> page / aligning it.
>
> IMHO, your best option would be to use Sweave. If you're a
> Windows-User, there are excellent instructions provided by Murat
> Yildizoglu at
> http://yildizoglu.blogspot.com/2009/02/lyx-and-sweave-under-windows-xp.htmlIf
> you're on a Mac, the hardest part is to find the directory with
> sweave.sty and copy it to your ~/Library/texmf/tex/latex Folder, add
> some layout files to your Application Support/LyX-xx and then run
> texhash, reconfigure and you should be good to go. This stuff is
> around, as is explained in e.g.
> http://www.r-project.org/doc/Rnews/Rnews_2008-1.pdf, but I think  
I'll

> put it on the wiki.
>
> Okay, okay, you said you're not interested in Sweave at the moment.
> But who knows.
>
> -- Christian
>
>
> Am 27.02.2009 um 16:18 schrieb Graham Smith:
>
>> I am trying to put together some instructions/handouts for R using
>> Lyx 1.6.1, and the output from R is giving some grief.
>>
>> The two key issues are:
>>
>> 1. output running off the right hand edge of the page e.g a list of
>> values for a variable
>> 2. Alignment of output so column headings are aligned with the  
column

>> of values
>>
>> With Word , this can be done with tabs and a hard return.
>>
>> I thought that by highlighting the output in Lyx and then turning  
it
>> into verbatim text by clicking on the TEX icon, I could then  
manually

>> align and break lines of text. But I can't.
>>
>> Do I need to use Latex commands in the TEX box I have just created
>> (which seems fair enough, I just need to find out what they are) or
>> is there a better way of doing this.
>>
>> I don't really want to go down the road of trying to learn Sweave  
at

>> the moment, and indeed at the moment all the R output has been
>> imported from Word.
>>
>> Can anyone give some pointers on best practice for this, or point  
me

>> towards an FAQ.
>>
>> Many thanks,
>>
>> Graham
>>
>> --
>> Graham M Smith
>>
>>
>>
>

--
Graham M Smith
graham.sm...@myotis.co.uk

Station Cottage, Station Road
Binegar, Somerset
BA3 4UQ







Re: Lyx configuration on a Mac: problems

2009-02-27 Thread Jason Waskiewicz
I'll confess that I've been using LyX on my Mac with no trouble, but 
something in your description struck me as similar to a difficulty I had 
a short time ago on my Linux box.


The specific symptoms you cited were an inability to reconfigure and an 
inability to make PDF and DVI files. I saw these exact symptoms on my 
Linux box and someone on this mailing list suggested that one of my 
layout files was the problem. I found the problematic file, removed it, 
and have had no trouble since.


You might look for this. You might also check the permissions on the 
layout files. If none of this seems to fix the problem, let us know what 
error messages it gives.


--Jason Waskiewicz
 Bowman County Schools


Including LaTeX code produced by Sweave in a LyX document

2009-02-27 Thread christiaan pauw
Hi Everybody
I started using R with LyX (through Sweave) recently (earlier today
actually) and can see from here that it has great potential.

R has functions can generate latex tables which is highly cusomizable. When
these functions are run using sweave in LyX the do exactly what they are
supposed to do and generate Latex code. LyX then typesets the verbatim code
perfectly as in the pdf document. What I want is obviously the table and not
the latex code that produces the table. When I paste that code into ERT it
generate the table perfectly. I now want sweave to generate its output
inside something like ERT

Is there a way to say to LyX "what follows here is LaTeX and it must be
handled like you include ERT"   latex code generated by sweave comes
here  "close ERT-like environment"

regrads
Christiaan


Re: Is Lyx free for all?

2009-02-27 Thread Steve Litt
On Friday 27 February 2009 11:21:22 am Nils Friedrich wrote:
> Is Lyx without costs, even if companies use it?

Man, I hope so, because my company's been using LyX to write books for 8 years 
now.

Seriously, yes it's free to companies. It's licensed with the GPL license, so 
if you download it, you can use it free of charge.

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US



Re: Is Lyx free for all?

2009-02-27 Thread Abdelrazak Younes

Paul Smith wrote:

On Fri, Feb 27, 2009 at 4:21 PM, Nils Friedrich  wrote:

Is Lyx without costs, even if companies use it?


Yes, absolutely.


You mean, even on Windows???

Such a polished, powerful, performant application... Unbelievable!

:-)

Abdel.



Re: Is Lyx free for all?

2009-02-27 Thread Richard Heck

Nils Friedrich wrote:

Is Lyx without costs, even if companies use it?

  
LyX is licensed under the GPL and can be used in accord with those 
terms. So yes, you can use it as you wish, without charge, though if you 
or your company finds it useful, we'd absolutely appreciate a donation. 
Donations of code would be even better. If you want to modify the LyX 
code and/or distribute it, then there are rules that have to be 
followed, but that's a different matter from just using LyX.


Richard



Re: Is Lyx free for all?

2009-02-27 Thread Rich Shepard

On Fri, 27 Feb 2009, Nils Friedrich wrote:


Is Lyx without costs, even if companies use it?


  Yup. You may even modify the code to adapt it to company-specific
requirements if you wish to do so. Here's a link to the GNU Public License
(GPL): .

  LyX, like all Open Source Software, is free as in beer. Give it away. Use
it freely. Ask questions on the list here and become happily productive.

Rich

--
Richard B. Shepard, Ph.D.   |  IntegrityCredibility
Applied Ecosystem Services, Inc.|Innovation
 Voice: 503-667-4517  Fax: 503-667-8863


Re: Is Lyx free for all?

2009-02-27 Thread Paul Smith
On Fri, Feb 27, 2009 at 4:21 PM, Nils Friedrich  wrote:
> Is Lyx without costs, even if companies use it?

Yes, absolutely.

Paul


Re: Lyx and R some help appreciated : not Sweave

2009-02-27 Thread Graham Smith

Paul
I thought that by highlighting the output in Lyx and then turning it 
into verbatim text by clicking on the TEX icon, I could then manually 
align and break lines of text. But I can't.
Do I need to use Latex commands in the TEX box I have just created 
(which seems fair enough, I just need to find out what they are) or 
is there a better way of doing this.




I typically use the LyX-code environment for monospaced output from 
another program.  Does that work for you?

Thanks,

Just tried that, which looks a possibility, but are stuck with aligning 
columns using the space bar, or is there something clever?


Graham




Is Lyx free for all?

2009-02-27 Thread Nils Friedrich
Is Lyx without costs, even if companies use it?
-- 
Computer Bild Tarifsieger! GMX FreeDSL - Telefonanschluss + DSL
für nur 17,95 ¿/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a


Re: Endnotes - two questions

2009-02-27 Thread Richard Heck

Doug Laidlaw wrote:

On Saturday 28 February 2009 1:53:59 am Doug Laidlaw wrote:
  

On Friday 27 February 2009 11:35:30 pm rgheck wrote:


You need to put "\theendnotes" in ERT where you want them to appear.

rh
  

I noticed that in the docs.  It simply writes the total number of notes.
Nothing more.  It sounds like a configuration problem at my end.

Doug.



I didn't get that quite right.  If I use "Insert Latex Code" I get a syntax 
error "undefined control sequence."  There is however a macro under Documents Settings > Modules.  If I use that, all footnotes are numbered consecutively, but  I get a printout only of the total number of notes used.


  
The error is presumably because you haven't done: \usepackage{endnotes}, 
in the preamble. But I have no idea what could be causing the other 
error. Some package incompatibility, I'd guess.


rh



Re: Lyx and R some help appreciated : not Sweave

2009-02-27 Thread Paul A. Rubin

Graham Smith wrote:




I thought that by highlighting the output in Lyx and then turning it 
into verbatim text by clicking on the TEX icon, I could then manually 
align and break lines of text. But I can't.


Do I need to use Latex commands in the TEX box I have just created 
(which seems fair enough, I just need to find out what they are) or is 
there a better way of doing this.




I typically use the LyX-code environment for monospaced output from 
another program.  Does that work for you?


/Paul



Re: LyX 1.6.1 crash when pasting a branch inset

2009-02-27 Thread Jürgen Spitzmüller
Guenter Milde wrote:
> Strange:
>
> * I use a released version (LyX 1.6.1 from Debian/unstable)

OK, then it's a real crash, _next_ to the assertion (Richard's backtrace also 
indicates a crash).

> * LyX closed down suddenly,
>
>   with *.lyx.emergency savings that sometimes where corrupt, :-(

I know. It hit me as well now. We'll fix this for 1.6.2.

Jürgen


Re: Showing trimming cross lines

2009-02-27 Thread Jürgen Spitzmüller
Waluyo Adi Siswanto wrote:
> Is that possible in LyX...

\usepackage[cam,center]{crop}

Jürgen


Re: LyX 1.6.1 crash when pasting a branch inset

2009-02-27 Thread Guenter Milde
On 2009-02-27, Jürgen Spitzmüller wrote:
> Guenter Milde wrote:
>> Is this a known bug that will be fixed in 1.6.2 ?

> BTW note that you faced an assertion, not a crash. In release mode,
> assertions do not shut down LyX.

Strange:

* I use a released version (LyX 1.6.1 from Debian/unstable)

* LyX closed down suddenly, 

  with *.lyx.emergency savings that sometimes where corrupt, :-(

  without saving changed GUI configuration,
  
  without updating the "last opened files" list.
  
No crash?
  
Günter



Re: xy-pic oddities

2009-02-27 Thread Abdelrazak Younes

Pol wrote:



Paul A. Rubin wrote:
 

FWIW, I pasted your three arrow code into a new document in LyX (with
\usepackage[all]{xy} in the preamble), and instant preview displayed it
with three arrow heads but only one arrow (the middle one).  I also
threw in another math inset with an integral, and instant preview did
not display the integral sign.



Now evrything works, thank you
It seems that sometimes displaying xy-pic pictures takes a very long time;
but i cannot reproduce. (by the way, i am still using 1.4.5 on linux)


FYI 1.5 brought a lot of performance improvement related to graphics in 
general and xy-pic in particular.


Abdel.



Lyx and R some help appreciated : not Sweave

2009-02-27 Thread Graham Smith
I am trying to put together some instructions/handouts for R using Lyx 
1.6.1, and the output from R is giving some grief.


The two key issues are:

1. output running off the right hand edge of the page e.g a list of 
values for a variable
2. Alignment of output so column headings are aligned with the column of 
values


With Word , this can be done with tabs and a hard return.

I thought that by highlighting the output in Lyx and then turning it 
into verbatim text by clicking on the TEX icon, I could then manually 
align and break lines of text. But I can't.


Do I need to use Latex commands in the TEX box I have just created 
(which seems fair enough, I just need to find out what they are) or is 
there a better way of doing this.


I don't really want to go down the road of trying to learn Sweave at the 
moment, and indeed at the moment all the R output has been imported from 
Word.


Can anyone give some pointers on best practice for this, or point me 
towards an FAQ.


Many thanks,

Graham

--
Graham M Smith





Showing trimming cross lines

2009-02-27 Thread Waluyo Adi Siswanto
Dear LyX Users

I am just wondering about showing a trimming cross lines at the corner
of the paper to show the cutting off. 
For example the paper size is A4, but the book manuscript is prepared in
Koma-script, DIV8. If the title page, the trimming cross lines are shown
below than it gives the exact cutting off the paper.
Is that possible in LyX...

  
 __|  |__



 Title page




 ____
   |  |

Thank you in advance
---
was




Re: xy-pic oddities

2009-02-27 Thread Pol


Paul A. Rubin wrote:
 
> FWIW, I pasted your three arrow code into a new document in LyX (with
> \usepackage[all]{xy} in the preamble), and instant preview displayed it
> with three arrow heads but only one arrow (the middle one).  I also
> threw in another math inset with an integral, and instant preview did
> not display the integral sign.


Now evrything works, thank you
It seems that sometimes displaying xy-pic pictures takes a very long time;
but i cannot reproduce. (by the way, i am still using 1.4.5 on linux)

--P  



Re: Endnotes - two questions

2009-02-27 Thread Doug Laidlaw
On Saturday 28 February 2009 1:53:59 am Doug Laidlaw wrote:
> On Friday 27 February 2009 11:35:30 pm rgheck wrote:
> > You need to put "\theendnotes" in ERT where you want them to appear.
> >
> > rh
>
> I noticed that in the docs.  It simply writes the total number of notes.
> Nothing more.  It sounds like a configuration problem at my end.
>
> Doug.

I didn't get that quite right.  If I use "Insert Latex Code" I get a syntax 
error "undefined control sequence."  There is however a macro under Documents 
> Settings > Modules.  If I use that, all footnotes are numbered 
consecutively, but  I get a printout only of the total number of notes used.

Doug.




Re: Endnotes - two questions

2009-02-27 Thread Doug Laidlaw
On Friday 27 February 2009 11:35:30 pm rgheck wrote:
> You need to put "\theendnotes" in ERT where you want them to appear.
>
> rh
I noticed that in the docs.  It simply writes the total number of notes.  
Nothing more.  It sounds like a configuration problem at my end.

Doug.




SOLVED: LyX and R: Unable to import data

2009-02-27 Thread christiaan pauw
The answer was that it was a operator (me) problem. The library that enables
get.csv is Hmisc and should have been loaded. thus:

<>=
library(Hmisc)
x=csv.get(file="/Users/christiaanpauw/tmp/x.csv")
mean(x)
@

2009/2/27 christiaan pauw 

> Hi Everybody
> I use R2.8.0 on Mac OS X. I set up LyX 1.6.1 to use Sweave today following
> the instructions on the LyX wiki. It seems to work fine. I can compile the
> test file I found on CRAN (http://cran.r-project.org/contrib/extra/lyx/)
> without a problem and the output looks very nice. In the test file the
> following R code is used.
>
> <>=
> xObs <- 100; xMean <- 10; xVar <- 9
> x <- rnorm(n=xObs, mean=xMean, sd=sqrt(xVar))
> mean(x)
> @
>
> My problem is that I want to import data to use in my report. In the R
> source I currently use to analyse my data I import it through csv.get(). I
> have found that I cannot use csv.get() or write.csv() from within LyX. I
> don't seem to be able to use load() to get a .rda file in either. So now I
> am stuck because no data equals no report.
>
> Is this issue related to LyX, LaTeX or R?
>
> Thanks in advance
> Christiaan
>
>


LyX and R: Unable to import data

2009-02-27 Thread christiaan pauw
Hi Everybody
I use R2.8.0 on Mac OS X. I set up LyX 1.6.1 to use Sweave today following
the instructions on the LyX wiki. It seems to work fine. I can compile the
test file I found on CRAN (http://cran.r-project.org/contrib/extra/lyx/)
without a problem and the output looks very nice. In the test file the
following R code is used.

<>=
xObs <- 100; xMean <- 10; xVar <- 9
x <- rnorm(n=xObs, mean=xMean, sd=sqrt(xVar))
mean(x)
@

that should be the same as:

xObs <- 100
xMean <- 10
xVar <- 9
x <- rnorm(n=xObs, mean=xMean, sd=sqrt(xVar))
mean(x)

in the R console.

My problem is that I want to import data to use in my report. In the R
source I currently use to analyse my data I import it through csv.get(). I
have found that I cannot use csv.get() or write.csv() from within LyX. I
don't seem to be able to use load() to get a .rda file in either. So now I
am stuck because no data equals no report.

Is this issue related to LyX, LaTeX or R?

Thanks in advance
Christiaan


Re: LyX 1.6.1 crash when pasting a branch inset

2009-02-27 Thread rgheck

Vincent van Ravesteijn - TNW wrote:

As Guenter mentioned, he has a master with childs. Doing a cut and paste
in a child document does crash LyX 1.6.1. I have no current branch or
svn to test with.

  

OK, now I have it. Note that you get an infinite loop through
emergencyWriteAll() when this happens, so you need to set a breakpoint
there to get anything useful.

I think this must be related to the FIXME at line 300 of
CutAndPaste.cpp. The call to updateLabels() sends us to loadIfNeeded
eventually because we're in a child, and we end up calling
InsetBranch::buffer() before the buffer is actually set, which I think
happens later in updateLabels().

rh

=

gdb /cvs/lyx-devel/trunk/src/lyx --interpreter=mi2 -quiet
Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) bt
bt
#0 lyx::BufferList::emergencyWrite (this=0x3076878, buf=0x36c2920) at
BufferList.cpp:236
#1 0x004eab89 in
std::for_each<__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator

__gnu_norm::vector > >,
__gnu_debug_def::vector > >,
boost::_bi::bind_t,
std::allocator >, boost::_mfi::mf1, std::allocator >, lyx::BufferList,
lyx::Buffer*>, boost::_bi::list2,
boost::arg<1> > > > (__fir...@0x7fff78ea63d0, __la...@0x7fff78ea63a0,
__f={f_ = {f_ = &lyx::BufferList::emergencyWrite(lyx::Buffer*)}, l_ =
{,boost::arg<1>
= { >> = 

{a1_ = {t_ = 0x3076878}}, }, }}) at
../boost/boost/bind/mem_fn_template.hpp:162
#2 0x004e49fb in lyx::BufferList::emergencyWriteAll
(this=0x3076878) at BufferList.cpp:223
#3 0x0061aaa7 in lyx::emergencyCleanup () at LyX.cpp:799
#4 0x0061adc5 in lyx::lyx_exit (exit_code=2028626656) at LyX.cpp:196
#5 0x00470b3e in boost::assertion_failed (expr=0xe68068 "false",
function=0xfc5340 "void lyx::doAssert(const char*, const char*, long
int)", file=0xfc5308 "lassert.cpp", line=23) at boost.cpp:47
#6 0x00dea51f in lyx::doAssert (expr=0xe68068 "false",
file=0xee11a6 "insets/Inset.cpp", line=138) at lassert.cpp:23
#7 0x0095a47e in lyx::Inset::buffer (this=)
at insets/Inset.cpp:138
#8 0x009580f0 in lyx::Inset::buffer (this=0x7fff78ea62e0) at
insets/Inset.cpp:148
#9 0x00980532 in lyx::InsetBranch::isBranchSelected
(this=0x7fff78ea62e0) at insets/InsetBranch.cpp:199
#10 0x0098057b in lyx::InsetBranch::isMacroScope
(this=0x7fff78ea62e0) at insets/InsetBranch.cpp:252
#11 0x00481b1a in lyx::Buffer::updateMacros (this=0x36b7250,
i...@0x7fff78ea70a0, sco...@0x7fff78ea7050) at Buffer.cpp:1934
#12 0x00484184 in lyx::Buffer::updateMacros (this=0x36b7250) at
Buffer.cpp:2017
#13 0x004846cf in lyx::Buffer::setParent (this=0x7fff78ea62e0,
buffer=0x3076878) at Buffer.cpp:1707
#14 0x009d99ad in lyx::InsetInclude::loadIfNeeded
(this=0x36cb520, pare...@0x36c2920) at insets/InsetInclude.cpp:417
#15 0x00481c7f in lyx::Buffer::updateMacros (this=0x36c2920,
i...@0x7fff78ea7bb0, scope=) at Buffer.cpp:1953
#16 0x00484184 in lyx::Buffer::updateMacros (this=0x36c2920) at
Buffer.cpp:2017
#17 0x0048460c in lyx::Buffer::updateLabels (this=0x36c2920,
childonly=false) at Buffer.cpp:2748
#18 0x00484411 in lyx::Buffer::updateLabels (this=0x36b7250,
childonly=false) at Buffer.cpp:2727
#19 0x007e7d98 in lyx::cap::pasteParagraphList (c...@0x3789cd8,
parli...@0x3792188, docclass=0x36c88b0, errorli...@0x138d0a0) at
CutAndPaste.cpp:840
#20 0x007e7f55 in lyx::cap::pasteFromStack (c...@0x3789cd8,
errorli...@0x138d0a0, sel_index=0) at CutAndPaste.cpp:858
#21 0x0070db5d in lyx::Text::dispatch (this=0x372b010,
c...@0x3789cd8, c...@0x7fff78eae840) at Text3.cpp:1025
#22 0x00a9fe34 in lyx::InsetText::doDispatch (this=0x372aff0,
c...@0x3789cd8, c...@0x7fff78eae840) at insets/InsetText.cpp:254
#23 0x0095887e in lyx::Inset::dispatch (this=0x372aff0,
c...@0x3789cd8, c...@0x7fff78eae840) at insets/Inset.cpp:216
#24 0x007de9a3 in lyx::Cursor::dispatch (this=0x3789cd8,
cm...@0x7fff78eb01d0) at Cursor.cpp:315
#25 0x0064e204 in lyx::LyXFunc::dispatch (this=0x3076740,
c...@0x7fff78eb01d0) at LyXFunc.cpp:1712
#26 0x0064fb85 in lyx::LyXFunc::processKeySym (this=0x3076740,
keys...@0x7fff78eb0330, state=lyx::ControlModifier) at LyXFunc.cpp:389
#27 0x00b33304 in lyx::frontend::GuiWorkArea::processKeySym
(this=, k...@0x7fff78eb0330,
mod=lyx::ControlModifier) at GuiWorkArea.cpp:462
#28 0x00b385bc in lyx::frontend::GuiWorkArea::keyPressEvent
(this=0x3781280, ev=0x7fff78eb0b90) at GuiWorkArea.cpp:919
#29 0x003ae35d5f15 in QWidget::event () from /usr/lib64/libQtGui.so.4
#30 0x003ae38cdd86 in QFrame::event () from /usr/lib64/libQtGui.so.4
#31 0x003ae39538ad in QAbstractScrollArea::event () from
/usr/lib64/libQtGui.so.4
#32 0x00b36d94 in lyx::frontend::GuiWorkArea::event
(this=0x3781280, e=0x3076878) at GuiWorkArea.cpp:667
#33 0x003ae3584c3f in QApplicationPrivate::notify_helper () from
/usr/lib64/libQtGui.so.4
#34 0x003ae3589e64 in QApplicatio

Re: Endnotes - two questions

2009-02-27 Thread rgheck

Doug Laidlaw wrote:

I am writing a book.

1.  Can I have endnotes for each chapter?  That seems to have been 
recommended.  IMO, endnotes make the book more readable.  In my case, that is 
important.  For a true reference work, I would certainly opt for footnotes, 
because they are closer to the referring text.


  
There's probably some LaTeX package that does this, and maybe it can 
even be done with endnote. I don't know for sure, but you should look at 
the documentation for the package.


2.  When I try to use endnotes, the "endnote" is just a number, the total of 
the endnotes in existence.  The notes themselves are not listed.


  

You need to put "\theendnotes" in ERT where you want them to appear.

rh



Re: LyX 1.6.1 crash when pasting a branch inset

2009-02-27 Thread Jürgen Spitzmüller
Vincent van Ravesteijn - TNW wrote:
> Confirmed.

The assert or the fix?

Jürgen


Re: LyX 1.6.1 crash when pasting a branch inset

2009-02-27 Thread rgheck

Vincent van Ravesteijn - TNW wrote:
 

  

Whenever I copy/kill and past a branch inset LyX dies with the error message

../../../src/support/lassert.cpp(21): ASSERTION false VIOLATED
IN ../../src/insets/Inset.cpp:137 terminate called after throwing
an instance of 'lyx::support::ExceptionMessage'
 what():  Inset::buffer_ member not initialized!
LyX Code: 36 name: Branch

in ~/.xsession-errors.

I use LyX 1.6.1 on Debian with a set of documents organised as
master with childs for each chapter (there are some branch
oddities in this setup but this might be unrelated).

Is this a known bug that will be fixed in 1.6.2 ?




Confirmed.

  
What were you confirming? Just doing the obvious sort of thing, I can't 
reproduce under svn.


rh



RE: LyX 1.6.1 crash when pasting a branch inset

2009-02-27 Thread Vincent van Ravesteijn - TNW
 

> Whenever I copy/kill and past a branch inset LyX dies with the error message
>
>../../../src/support/lassert.cpp(21): ASSERTION false VIOLATED
>IN ../../src/insets/Inset.cpp:137 terminate called after throwing
>an instance of 'lyx::support::ExceptionMessage'
>  what():  Inset::buffer_ member not initialized!
>LyX Code: 36 name: Branch
>
>in ~/.xsession-errors.
>
>I use LyX 1.6.1 on Debian with a set of documents organised as
>master with childs for each chapter (there are some branch
>oddities in this setup but this might be unrelated).
>
>Is this a known bug that will be fixed in 1.6.2 ?
>

Confirmed.

Vincent


Re: LyX 1.6.1 crash when pasting a branch inset

2009-02-27 Thread Jürgen Spitzmüller
Guenter Milde wrote:
> Is this a known bug that will be fixed in 1.6.2 ?

Not that I know (although we have fixed many crashes and asserts, so this one 
might have been resolved en passant).

In any case, I cannot reproduce with 1.6.3svn (but probably I need a more 
detailed recipe).

BTW note that you faced an assertion, not a crash. In release mode, assertions 
do not shut down LyX.

Jürgen


Re: Apostrophe vs. Single quotation mark

2009-02-27 Thread Jürgen Spitzmüller
Doug Laidlaw wrote:
> On a keyboard, they are the same character.

However, not in LyX. "Proper" single quotation marks must be inserted via M-" 
(or whatever the function "quote-insert single" is bound to).

Jürgen


LyX 1.6.1 crash when pasting a branch inset

2009-02-27 Thread Guenter Milde
Whenever I copy/kill and past a branch inset LyX dies with the error message

../../../src/support/lassert.cpp(21): ASSERTION false VIOLATED IN 
../../src/insets/Inset.cpp:137
terminate called after throwing an instance of 'lyx::support::ExceptionMessage'
  what():  Inset::buffer_ member not initialized!
LyX Code: 36 name: Branch

in ~/.xsession-errors.

I use LyX 1.6.1 on Debian with a set of documents organised as master
with childs for each chapter (there are some branch oddities in this setup
but this might be unrelated).

Is this a known bug that will be fixed in 1.6.2 ?



Re: Strategies for Writing Co-operation with Non-LyX Users?

2009-02-27 Thread Guenter Milde
On 2009-02-27, Wolfgang Engelmann wrote:
> Am Thursday 26 February 2009 16:56:57 schrieb Wilfried:
>> Guenter Milde  wrote:

>>> But how about trying to get LyX into TeXLive?

>> There is already a bootable, self-sustained Linux DVD available with LyX
>> integrated:
>> http://www.knoppix.org/
>> The homepage starts in German, for English click on the British flag.
>> One can download either a cdrom iso image or a dvd iso image.
>> According to the file "packages-dvd.txt", the dvd image contains
>> LyX 1.5.3-1 installed, but I haven't tested it yet.

> would be nice to have one with LyX 1.6.x. which has so many valuable new 
> features! Any chance to produce one?

There are custom Knoppix-based live CD/DVD projects and there is support
for customisation of Knoppix (have a look at their knoppix.org) so this is
feasible. (I propose to wait for 1.6.2 with many critical bugs fixed.)

But my original idea was to get LyX (both Unix and Windows binaries) into
the TeXLive DVD, so that Window users could also try it in their "native"
OS.

Another idea would be some kind of integration of the LyX installer into
the TeXLive one, so that a user installing from TeXLive is just a click
away from installing LyX.

Volunteers?

Günter



Re: Strategies for Writing Co-operation with Non-LyX Users?

2009-02-27 Thread Wolfgang Engelmann
Am Thursday 26 February 2009 16:56:57 schrieb Wilfried:
> Guenter Milde  wrote:
> > On 2009-02-07, Christian Ridderström wrote:
> > > On Sat, 7 Feb 2009, Wolfgang Engelmann wrote:
> > >> On Friday 06 February 2009 09:32:12 A B wrote:
> > >>
> > >> perhaps a live CD with a whatever-Lyx would be helpful to demonstrate
> > >> its merrit to those who care
> > >
> > > Actually, a complete installation of LyX, LaTeX and various software on
> > > a CD could be a good idea, assuming it can be run without installing
> > > it. I'm not sure it's feasible though.
> >
> > It is certainly possible with a Linux live system (old Knoppix CDs had
> > LyX/LaTeX, later ones removed it due to limited space, maybe it's back on
> > a Knoppix DVD...)
> >
> > But how about trying to get LyX into TeXLive?
>
> There is already a bootable, self-sustained Linux DVD available with LyX
> integrated:
> http://www.knoppix.org/
> The homepage starts in German, for English click on the British flag.
> One can download either a cdrom iso image or a dvd iso image.
> According to the file "packages-dvd.txt", the dvd image contains
> LyX 1.5.3-1 installed, but I haven't tested it yet.

would be nice to have one with LyX 1.6.x. which has so many valuable new 
features! Any chance to produce one?

Wolfgang