Georg Baum wrote:
Helge Hafting wrote:


Do you need a test document with these problems?


Yes, please.

Seems that the xfig external inset is fixed in 1.4 already. Here's a set of files that fail with the listings package.

This (and probably other latex constructs dealing
with files) fails because they have no way to know about the
document directory, and lyx have no way to know that the ERT
uses a file.

Support for listings in the form of insets may happen, but there may be other packages which will get the same problem.

Now if lyx added something like this:
\newcommand{\lyxdocumentdir}{/home/helge/example/}
to the latex preamble, then I could simply use
this \lyxdocumentdir whenever I write latex code that
do its own file handling.  This would solve the problem for me.

Of course, if you get this to work, make sure it _also_
works when that lyx file is included/inputted  from
a master document residing in some other directory.
I.e. each latex file may need its own \lyxdocumentdir.

Helge Hafting
#LyX 1.3 created this file. For more info see http://www.lyx.org/
\lyxformat 221
\textclass scrbook
\begin_preamble
\usepackage{listings}
\end_preamble
\language norsk
\inputencoding auto
\fontscheme default
\graphics default
\float_placement htb
\paperfontsize 12
\spacing single 
\papersize Default
\paperpackage a4
\use_geometry 1
\use_amsmath 0
\use_natbib 0
\use_numerical_citations 0
\paperorientation portrait
\paperwidth 17cm
\paperheight 24cm
\secnumdepth 2
\tocdepth 3
\paragraph_separation skip
\defskip medskip
\quotes_language french
\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle fancy

\layout Standard

A linear function implemented in C:
\layout Standard


\begin_inset ERT
status Collapsed

\layout Standard

\backslash 
lstinputlisting{test.c}
\end_inset 


\the_end
int test(int x) {
  return x+2;
}

Reply via email to