Re: how can I input "^"

2010-11-09 Thread Sam Liddicott
Press shift-F5 first

Sam

zhao_yunsong  wrote:

>"SHIFT +^" is binded to the supscript, then how can I input "^"
>
>2010-11-10 
>
>
>
>zhao_yunsong 
>
>No virus found
>   Checked by Hillstone Networks AntiVirus


Using Lyx with Noweb help offered

2009-07-09 Thread Sam Liddicott
I've had a dreadful job getting noweb 2.11b and Lyx 2.6.2 to work
together nicely. My pain does make me if anyone uses Lyx with noweb
recently.

I now have a Lyx 2.6.2 document which talks about how to get it working,
requiring various changes to Lyx's noweave filters, and some awk to
fixup the output of notangle.

Of course this entire document is a Noweb article.

It also contains a way of bootstrapping a makefile out of the Lyx
document, and by treating the Lyx document as a sort of read-only source
archive it automatically keeping the extracted sources up to date so
that you can use Lyx and noweb as part of a regular automake/autoconf
project.

I have this document as the final part to two of my Lyx-noweb projects.

I hope that it will be useful to readers, and I invite comment.

Is it appropriate to post this to this mailing list?

[I will of course attach the notangle fixup as well - it would be hard
to extract the notangle fixup tool without already having the fixup tool]

Sam


Re: Using Lyx with Noweb help offered

2009-07-09 Thread Sam Liddicott

Paul A. Rubin wrote:


Probably better to post it on the wiki 
(http://wiki.lyx.org/pmwiki.php) -- it would be easier to find (and 
keep up to date) there.


Good idea.

The pages are there now, I'll have to upload the files tomorrow.

Sam


Re: Using Lyx with Noweb help offered

2009-07-10 Thread Sam Liddicott
* Paul A. Rubin wrote, On 09/07/09 20:40:
> Probably better to post it on the wiki (http://wiki.lyx.org/pmwiki.php)
> -- it would be easier to find (and keep up to date) there.

I've made a page at http://wiki.lyx.org/Tools/Noweb but I can't upload
the files because I don't have a password or username to login and can't
find out how to register.

I've attached the two files, please could someone upload them.

Sam
#! /usr/bin/awk -f

function emit_buffer() {
  print indent buffer;
  buffer = "";
}

BEGIN {
  buffer = "";
  indent = "";
}

/^ *#line [0-9]/ {
  indent=buffer;
  buffer="";
}

/^  */ {
  if (length(buffer) > 0) gsub("^ *", "");
}

/\\begin_inset Newline newline$/ {
  if (NR > 1) emit_buffer();
}

/^ *\\backslash/ {
  buffer = buffer "\\";
  $0 = "";
}

/\\/ {
  gsub(".*$", "");
}

{
  buffer = buffer $0;
}

END {
  if (length(buffer) > 0) emit_buffer();
}


noweb-lyx.lyx
Description: application/lyx


Re: Using Lyx with Noweb help offered

2009-07-11 Thread Sam Liddicott
>  Fri Jul 10 2009  4:29:44 pm BST BSTfrom  "Paul A. Rubin"
>Subject: Re: Using Lyx with Noweb help offered 
>
>  Sam Liddicott wrote:
> 
>>* Paul A. Rubin wrote, On 09/07/09 20:40:
>> 
>>>Probably better to post it on the wiki (http://wiki.lyx.org/pmwiki.php)
>>> -- it would be easier to find (and keep up to date) there.
>>> 
>>> 

>>I've made a page at http://wiki.lyx.org/Tools/Noweb but I can't upload
>> the files because I don't have a password or username to login and can't
>> find out how to register.
>> 
>> I've attached the two files, please could someone upload them.
>> 
>> Sam
>> 
>> 
>> 

>Done.  You should be able to reference them in the wiki page as 
> uploads:/noweb/.  I left adding the links to the wiki page to 
> you since you know what you're writing about and I don't.
> 
> /Paul
> 
> 
>   
>
> 



  Thanks.

In the mean-time I note that this line:

notangle -filter "/bin/sed '/^...@nl/d;/@text end_/d;/@text begin_inset
Newline newline/s/^.*/@nl/;s/^...@text \\\\backslash/@text /'"
LYXFILENAME.lyx 

(which works at a different document phase with notangle) is better than the
notanglefix I posted.

I'll sort this all out on the wiki on Monday. 

-- 
   Sam Liddicott
s...@liddicott.com

What does lyx munge about the file format to the convertors?

2009-07-14 Thread Sam Liddicott
(I'm using Lyx 1.6.2)
A lyx file of mine has this text (when I look inside the raw lyx file)
*
--8<---**--8<---**--8<---**--8<---**--8<---*
*\begin_layout Section
The ntvfs model
\end_layout

\begin_layout Standard
Many vfs modules may be defined, as types of share backends.

\end_layout

\begin_layout Standard
Each vfs module could be considered to subclass an abstract [[struct
ntvfs_modul
e_context]], and each vfs module should define a struct to define
per-connection
 instance data.
\end_layout*
*--8<---**--8<---**--8<---**--8<---**--8<---*

Apart from the puzzlement of why Lyx breaks the line in the middle of a
word, it all looks fine.

But this is NOT what is fed to the first stage of the Noweb->Lyx noweave
convertor.

If I prefix my convertor with:
cat $$i | tee /tmp/pre
and look inside /tmp/pre, I see this instead:


*--8<---**--8<---**--8<---**--8<---**--8<---
**\section{The ntvfs model}

Many vfs modules may be defined, as types of share backends.

Each vfs module could be considered to subclass an abstract {[}{[}struct
ntvfs\_module\_context{]}{]}, and each vfs module should define a struct
to define per-connection instance data.
**--8<---**--8<---**--8<---**--8<---**--8<---*



Whats going on? Apart from the annoying and bogus quoting of the [ ] and
_ which I'm trying to fix-up, it means that noweave when run from Lyx
will give different answers to noweave when run from the command line -
say a Makefile which tries to generate the pdf.

Sam


Re: What does lyx munge about the file format to the convertors?

2009-07-14 Thread Sam Liddicott
I worked it out, it does a tex export first.

Sam


Re: What does lyx munge about the file format to the convertors?

2009-07-14 Thread Sam Liddicott
* Sam Liddicott wrote, On 14/07/09 15:14:
> I worked it out, it does a tex export first.
> 
> Sam

And I'll bet the only reason I had trouble with notangle is because I
was running on the Lyx document and not on the tex document.

mumble mumble gnash gnash grr grr

Sam


Portable tex export

2009-07-14 Thread Sam Liddicott
Is there a portable way to get Lyx to export the latex document in batch
mode, independent of what converters the user happens to have defined?

Such as might be used by a makefile running in an known environment?

(I'm not too pleased about having lyx as a build dependency, but it can
be used in the "make dist" target).

Sam


server-goto-file-row goes to line 1

2009-07-15 Thread Sam Liddicott
If I type: server-goto-file-row THISFILENAME.lyx 20
into the Lyx command buffer, it always goes to the top of the document.

(I'm using Lyx 1.6.2).

Am I using the command wrongly or are there other known problems that
someone can comment on?

Thanks

Sam


Re: server-goto-file-row goes to line 1

2009-07-15 Thread Sam Liddicott

rgheck wrote:

On 07/15/2009 10:25 AM, Sam Liddicott wrote:

If I type: server-goto-file-row THISFILENAME.lyx 20
into the Lyx command buffer, it always goes to the top of the document.

(I'm using Lyx 1.6.2).

Am I using the command wrongly...?

   

Probably. I suspect you haven't run LaTeX on the file yet.

Here's what the docs say:

LFUN_SERVER_GOTO_FILE_ROW

* Action Sets the cursor position based on the row number of generated 
TeX file.


gah! thats horrific!

I mean it's excellent that it can do the reverse mapping of a tex file

but it means there is no way to navigate the Lyx file - even if the 
specified filename ended in .lyx and not .tex


My C sources aren't generated via the tex files (partly because it's not 
simple to get Lyx to export a tex file from a noweb document without 
running noweb).



I really need to be able to navigate to a line (and column even) in the 
Lyx file.


Sam


Re: server-goto-file-row goes to line 1

2009-07-16 Thread Sam Liddicott
* rgheck wrote, On 15/07/09 21:46:
> On 07/15/2009 03:42 PM, Sam Liddicott wrote:
>> My C sources aren't generated via the tex files (partly because it's
>> not simple to get Lyx to export a tex file from a noweb document
>> without running noweb).
>>
>> I really need to be able to navigate to a line (and column even) in
>> the Lyx file.
>>
> So are you doing this from outside LyX with calls to the lyxserver? If
> so, then use a for loop or something and call LFUN_DOWN repeatedly. Slow
> and stupid, but it'll work.

Thanks for the advice.

I've filed an enhancement request 6087 in trac.

Sam


Re: server-goto-file-row goes to line 1

2009-07-16 Thread Sam Liddicott
* rgheck wrote, On 16/07/09 13:51:
> On 07/16/2009 06:23 AM, Pavel Sanda wrote:
>> Richard Heck wrote:
>>   
>>> So are you doing this from outside LyX with calls to the lyxserver? If
>>> so, then use a for loop or something and call LFUN_DOWN repeatedly. Slow
>>> and stupid, but it'll work.
>>>  
>>
>> ouch, this will be dependent on the window resolution. navigate in .lyx
>> file is a bad idea anyway.
>>
>>
> Yes, I had the same thought. But from what I can tell, that's what he
> wants to do: Go to a particular line of the displayed LyX file.
> 
> Or did you want to go to a line of the LyX file, as it is saved on disk?

As saved on disk, as this is what gcc is complaining about (I've been
using notangle directly on the lyx file).

I'm resigned that it is impossible and wont easily be possible.

Sam


Re: server-goto-file-row goes to line 1

2009-07-16 Thread Sam Liddicott
* rgheck wrote, On 15/07/09 17:28:

> Here's what the docs say:
> 
> LFUN_SERVER_GOTO_FILE_ROW
> 
> * Action Sets the cursor position based on the row number of generated
> TeX file.
> 
> * Notion This can be useful for DVI inverse-search or detection of the
> problematic line from LaTeX compilation. Note that before this function
> can be used export to LaTeX output must occur (in order to map the row
> numbers).
> 
> * Syntax server-goto-file-row  
> 
> * Params : the filename. Environment variables are expaned in the
> path. In case this LFUN does not work make sure you are giving correct
> path to the file.If the file is located inside LyX temporary directory
> it will be mapped back into the appropriate opened buffer (e.g. for the
> case of generated .tex file). .ext: extensions will be automatically
> replaced by .lyx.
> 
> Note that the row number is that of the LaTeX output file, NOT the LyX
> file on screen.


atm this isn't working as you say either (for me)...

I fired up a fresh invocation of Lyx, CTRL+N and typed:
now is the time
for all good men
to drink lemonade
at the party

CTRL+S to save as /tmp/file.lyx

I then did a dvi preview, In /tmp/lyx_tmpdir.J19856/lyx_tmpbuf0 I can
see the files that were generated. file.tex shows:

--8<-8<-8<---
\batchmode
\makeatletter
\def\in...@path{{/tmp//}}
\makeatother
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}

\usepackage{babel}

\begin{document}
now is the time

for all good men

to drink lemonade

at the party
\end{document}
--8<-8<-8<---

and in the command buffer I type (to jump to "for all good men"):

server-goto-file-row /tmp/file.lyx 14

but the cursor just goes back to line 1 again...

I even tried (for good luck):
server-goto-file-row /tmp/lyx_tmpdir.J19856/lyx_tmpbuf0/file.tex 14

but the cursor jumps to line 1 still.

I've tried lines 1-17 but still it won't do anything apart from jump
back to line 1.


I then switched to "Article (noweb)".

I note that a .nw is created as an intermediate file - is this the file
used for the line number mappings or is it the text file generated by
noweave? This question really concerns me because I am trying to map
from source files back to the lyx document, not from the dvi back to the
lyx document.

Sam



lyx-code / scrap bug?

2009-07-21 Thread Sam Liddicott
Please could someone competent with Lyx 1.6.3 try this; create a
literate (noweb) document and have a scrap immediately follow a lyx-code
section.

In the generated .nw file (in the /tmp/lyx* dir when creating a dvi
preview) the file looks like this:

\}
\end{lyxcode}
\selectlanguage{english}%
\inputencoding{latin9}<>=
{
  NTSTATUS status;


The error being that "<>=" is the start of scrap and
should start on a new line.

I shall try and compile lyx 1.6.3 debs against the ubuntu 1.6.2 .dsc
file soon.

Sam


logical markup and noweb articles

2009-07-24 Thread Sam Liddicott
The logical markup module's code markup:
   \code{code here}

works fine, unless a noweb article is selected, in which case the
typewriter font runs through to the rest of the document. The other
logical markup types seem to work fine.

Any clues for me? (Lyx 1.6.2)

Sam


Re: logical markup and noweb articles

2009-07-24 Thread Sam Liddicott
* Sam Liddicott wrote, On 24/07/09 11:13:
> The logical markup module's code markup:
>\code{code here}
> 
> works fine, unless a noweb article is selected, in which case the
> typewriter font runs through to the rest of the document. The other
> logical markup types seem to work fine.
> 
> Any clues for me? (Lyx 1.6.2)


I found that it is because noweb.sty also defines a \code

I'll try and combine some variant of:
\newcommand{\ncode}{\code}
before the noweb declarations start

Sam


Re: logical markup and noweb articles

2009-07-24 Thread Sam Liddicott
* Sam Liddicott wrote, On 24/07/09 11:13:
> The logical markup module's code markup:
>\code{code here}
> 
> works fine, unless a noweb article is selected, in which case the
> typewriter font runs through to the rest of the document. The other
> logical markup types seem to work fine.
> 


As far as I can tell, noweb.sty doesn't actually use it's \code and
\edoc commands directly, and as noweb/lyx doesn't either, I just added
this line to my documents Latex preamble:

\renewcommand{\code}[1]{\texttt{#1}}

Sam


noweb chunk cross references in lyx

2009-07-24 Thread Sam Liddicott
I can use an ERT: \nextchunklabel{save-handle}
to define a label for a code chunk, and then refer to this from another
part of the document with ERT: \subpageref{save-handle}

Does/Can lyx support this more natively to avoid the ERT, but allow a
new label type beginning with nw: ?

Sam


lyx deb source Re: LyX 1.6.2 crashed

2009-07-25 Thread Sam Liddicott

Nikos Alexandris wrote:


[1] grab a .deb package from
http://www.getdeb.net/search.php?keywords=lyx
  
Thanks for posting that link, it was very helpful to me. (No more lyx 
1.6.2 bug reports from me, look forward to 1.6.3 bug reports).


Although the debs are available from the search results page:

   http://www.getdeb.net/search.php?keywords=lyx

The deb src is not. After much poking around and talking with João Pinto 
of getdeb.net I'm able to report that if you click on the "LyX" link to 
the right of the mini-screenshot:


   *LyX  1.6.3* - Tuesday, 14 Jul 2009
   12:56:16 CEST - Post Comment 

to get to the LyX project page (http://www.getdeb.net/app/LyX), and then 
click on a link under "Latest Versions" at the bottom of the page it 
brings you to a specific page like: http://www.getdeb.net/release/4583


Which looks very like the original search results page, but also has 
source deb links; e.g.:
*Developers: Source  
, Diff *


thus fulfilling GPL requirements.

Sam


Re: lyx-code / scrap bug?

2009-07-25 Thread Sam Liddicott

Sam Liddicott wrote:

Please could someone competent with Lyx 1.6.3 try this; create a
literate (noweb) document and have a scrap immediately follow a lyx-code
section.

In the generated .nw file (in the /tmp/lyx* dir when creating a dvi
preview) the file looks like this:

\}
\end{lyxcode}
\selectlanguage{english}%
\inputencoding{latin9}<>=
{
  NTSTATUS status;


The error being that "<>=" is the start of scrap and
should start on a new line.
  
It doesn't seem to affect 1.6.3, but I have noticed 
\selectlanguage{english} also cropping up in other cases on 1.6.2, like 
when ERT is deleted or modified. I'll keep my eye open for it occurring 
in 1.6.3


Sam

I shall try and compile lyx 1.6.3 debs against the ubuntu 1.6.2 .dsc
file soon.

Sam
  




shortcuts to apply text style

2009-07-27 Thread Sam Liddicott
With Lyx 1.6.3 I'm trying to define a shortcut which will apply the
logical markup text side CharStyle:Code.

I think that the command is:
 textstyle-apply CharStyle:Code

but it doesn't do anything; what am I doing wrong?

Sam


noweb should be a module not a class

2009-07-27 Thread Sam Liddicott
I think noweb should not exist as a class, but as a module; what if I
want to do a KOMA-script book with noweb fragments in?

noweb is really used with \usepackage{noweb} showing that it is not
actually a document class at all. Perhaps it would be better as a module?

Also; if \newenvironment is used in the pre-amble, can the defined
environment be added to the drop-down listbox so it can be applied to
the document?

Sam


Re: shortcuts to apply text style

2009-07-27 Thread Sam Liddicott
* Pavel Sanda wrote, On 27/07/09 11:35:
> Sam Liddicott wrote:
>> With Lyx 1.6.3 I'm trying to define a shortcut which will apply the
>> logical markup text side CharStyle:Code.
>>
>> I think that the command is:
>>  textstyle-apply CharStyle:Code
> 
> if you look in the lfuns manual you can see that textstyle-apply does
> not have any arguments...

I thought the manual was just incomplete...

> what you are looking for is flex-insert CharStyle:Code.
> pavel

thanks nicely!

Sam


Re: noweb should be a module not a class

2009-07-28 Thread Sam Liddicott
* Sam Liddicott wrote, On 27/07/09 11:21:
> I think noweb should not exist as a class, but as a module; what if I
> want to do a KOMA-script book with noweb fragments in?

I am now absolutely certain that noweb should be a module and not a class.

I see however that noweb (literate) file format is important to exist so
that noweave knows when to be called.

This is not enough reason to have noweb as a format though, modules must
also have the capability to be inserted into the output pipeline and
make transformations.

noweave should be called if the noweb module is used.

- almost noweave should always be called if it exists!

However I see that there is no conversion filter from Lyx -> Latex like
there is from noweb -> latex

However when add add a conversion filter from Lyx -> Latex I see that it
is never called; is there a way to make this work?

I would add a convertor which piped through awk to detect if noweb
module was used. If so; it would re-invoke through noweave, or after so
many lines of not finding the noweb module it would become pass-through.

Sam


Re: noweb should be a module not a class

2009-07-28 Thread Sam Liddicott
Wahey: maybe we can get noweb as a module very simply...

I added this file noweb.module to my .lyx/layouts directory (and
reconfigured Lyx).

--8<-8<-8<-8<-8<-8<-8<-8<-8<---
#\DeclareLyXModule[noweb.sty]{Noweb}
#DescriptionBegin
#Adds \usepackage{noweb} to your document, along with the Scrap style.
#Also fixes the CharStyle:Code to work with noweb, redefining nowebs
#\code command to \nwcode (if you need it).
#DescriptionEnd

Format 11

AddToPreamble
\usepackage{noweb}
% noweb breaks code command
\newcommand{\nwcode}{\code}
\renewcommand{\code}[1]{\texttt{#1}}
EndPreamble

Input literate-scrap.inc
--8<-8<-8<-8<-8<-8<-8<-8<-8<---

And now I can add "Noweb" module to "article (KOMA-Script)" and have the
Scrap style made available.

Because literate-scrap.inc says:
OutputType  literate

I get my .nw conversions for free!

I get the warnings:

Package(s) required: noweb.sty.
WARNING: Some required packages are unavailable!

and

Warning: Package not available

The module literate requires a package that is
not available in your LaTeX installation. LaTeX output
may not be possible.


Which I don't understand as I have /usr/share/texmf/tex/plain/misc/noweb.sty

However LaTeX output is just fine!

If I get this fixed, perhaps we can add noweb as a module?

Sam


Re: [Fwd: Re: paste gvim --> lyx]

2009-07-28 Thread Sam Liddicott
* Hellmut Weber wrote, On 28/07/09 11:08:
> Sorry,
> it must be
> 
> gvim:
> 1. Mark text using shift+V + arrow keys
> 2. alt+e, c (Menu "edit", "copy")
> 3. shift to lyx
> 4. shift+ctrl+v

Lyx could do with a paste mode that used CTRL+Enter type line joinings,
which would make pasting into code-scraps much easier.

Sam


Re: Question: View/Export PDF to Directory

2009-07-28 Thread Sam Liddicott
* Ken wrote, On 28/07/09 12:28:
> Hi all,
> 
> I have a simple question which I could not find an answer to online to
> which I was hoping an experienced LyX user may know the solution.
> 
> When I click on "File > Export > PDF (pdflatex)" the .pdf file gets
> generated in the same folder as the .lyx file. Would it be possible to
> have the .pdf file generated in a sub-directory of this folder--say, a
> folder named "./pdf" or "./export"? (I like saving my figures in a
> sub-directory and would similarly like the pdfs to automatically be
> saved in a subfolder so that only .lyx files are in the main directory
> for the project.
> 
> Related to the above, when I click on "View > PDF (pdflatex)" the .pdf
> file gets generated in a temporary folder. Would if be possible to
> have these generated in a sub-directory of the folder where the .lyx
> file resides--say, a folder named "./draft"?  Would it be possible to
> add a date prefix to the filename too? This would be so that I could
> save pdf drafts of the file.
> 
> How would I change the settings for these? (NB. I am a LyX 1.6.3 user
> on Windows XP).


I guess you look at your Lyx preferences File Handling, Converters.

For "Latex (plain) -> DVI" I guess you could change the converter from
"latex" to "c:\bin\latex-dvi.bat $$i $$o"

and your batch file could be:

@echo off
mkdir draft
latex %1 %2
move %2 draft


Or something along those lines; and do likewise your your other converters

Sam


alternate code scrap definition

2009-07-28 Thread Sam Liddicott
This is a long post, but quite exciting to anyone who uses or wants to
improve literate programming with Lyx.

Along with using a literate module instead of a literate class
(attached), I've got a suggestion for an alternate code scrap definition.

Instead of using LatexType Paragraph with LabelType Static, (which
requires literal <>= and @) I suggest these changes:

LatexType Environment
LatextName CodeScrap
LabelType Manual

It means that the first line which normally contains:
<>=

will be the environment's label, shown in a different colour and we can
do without the << >>= because it will still have semantic meaning with
Lyx as the label.

So far, the Latex would come out like this:

\begin{CodeScrap}
[{scrap-name}]
int x=2;
int y=3;
\end{CodeScrap}

Which is not right, but some sed can turn:
  \begin{CodeScrap}\n[{scrap-name}]
into
  \n<>=
and turn
  \end{CodeScrap}
into
  @

before we pass to notangle or noweave.

Such sed is:

sed -e '/\\begin{xdummy}/{s/^.*//;n;
s/^\[{/<>=/;};/\\end{xdummy}/s/^.*/@\n/'

Further-more, we can use optional non-label text on the same line as the
label to contain a cross-reference definition such as would be used by:
  \nextchunklabel{LABEL-NAME}

This means that to add a cross-reference label to a code chunk you would:
1. select "Scrap" from the drop-down
2. type in the scrap name
3. press space
3a. press space again and type the xref label
4. press ctrl enter and start typeing code.

just miss out step 3a if you don't want a cross-reference label.

This sed will do all of that (makes use of the hold space to detect the
CodeScrap environment):

sed -e '/\\begin{CodeScrap}/{h;s/^.*//};/\\end{CodeScrap}/s/^.*/@\n/;
/^\[{/{
  x;/\\begin{CodeScrap}/{x
  s/^\[{/<>=/
  x}
  x
}'

It converted this Lyx (CodeScrap environment):
--8<-8<-8<-8<-8<---
something() start-of-something
  int something() {
int x=2;
int y=3;
  }

something_else
  #warning I'm bored
--8<-8<-8<-8<-8<---

into this latex

--8<-8<-8<-8<-8<---

\nextchunklabel{start-of-something}
<>=
int something() {
  int x=2;
  int y=3;
}

<>=
#warning I'm bored
@
--8<-8<-8<-8<-8<---

Which is spot on!

I wish that a module file could define the conversion filter. The
attached module file says:

OutputType literate

it would be good if there was also:

OutputFilter: sed -e 

which defines a filter which is used to produce the specified output type.

Sam
#\DeclareLyXModule[noweb.sty]{Noweb}
#DescriptionBegin
#Adds \usepackage{noweb} to your document, along with the Scrap style.
#Also fixes the CharStyle:Code to work with noweb, redefining nowebs
#\code command to \nwcode (if you need it).
#DescriptionEnd

#use this filter on the output before passing to notangle or noweave:
# sed -e 
'/\\begin{CodeScrap}/{h;s/^.*//};/\\end{CodeScrap}/s/^.*/@\n/;/^\[{/{x;/\\begin{CodeScrap}/{x;s/^\[{/<>=/;x};x}'

Format 11
OutputType  literate

AddToPreamble
\usepackage{noweb}
% noweb breaks code command
\newcommand{\nwcode}{\code}
\renewcommand{\code}[1]{\texttt{#1}}
EndPreamble


Style Scrap
MarginFirst_Dynamic
LatexType Environment
LatexName CodeScrap
NewLine   0
LeftMarginMMM
ParSep0.4
TopSep0.4
BottomSep 0.4
ItemSep   0.4
Align Left
AlignPossible Block,Left
FreeSpacing   1
PassThru  1
LabelType Manual
LabelFont
  Color   magenta
EndFont
TextFont
  Color   latex
  Family  Typewriter
EndFont
End



LyX slow at 1 char per second, 94% cpu

2009-07-28 Thread Sam Liddicott
I'm editing a 146K Lyx document (with no pictures) and the typing speed
is dreadful.

Characters come out at about 1 character per second with top showing 94%
CPU used by Lyx.

The same instance of Lyx tabbed to a small document is very fast.

Has anyone tips on speeding this up?

- hmm a few hours later and a few lyx restarts and it's speeded up again...

I'll keep an eye on it and report back if I find anything else.

Sam


Re: LyX slow at 1 char per second, 94% cpu

2009-07-28 Thread Sam Liddicott
* Rich Shepard wrote, On 28/07/09 16:36:
> On Tue, 28 Jul 2009, Sam Liddicott wrote:
> 
>> Characters come out at about 1 character per second with top showing 94%
>> CPU used by Lyx.
> 
> Sam,
> 
>   Probably not LyX but other processes running. If you watch top while lyx
> is idle you can get a better sense of what else is happening.

?
Lyx was occupying the top process line of top at 94%. xorg was using 15%
(dual core).

I think if it was other processes Lyx would not have shown 94%.

But I'll check if it happens again, thanks for the advice.

Sam


Re: LyX slow at 1 char per second, 94% cpu

2009-07-28 Thread Sam Liddicott

Steve Litt wrote:

On Tuesday 28 July 2009 11:25:34 Sam Liddicott wrote:
  

I'm editing a 146K Lyx document (with no pictures) and the typing speed
is dreadful.



That's a tiny document.
  

Good :-)
  

Characters come out at about 1 character per second with top showing 94%
CPU used by Lyx.



Interestingly, there was a similar symptom way back maybe 6 years ago, where 
someone used an n squared algorithm instead of n log n, or something like 
that, for wordwrapping. The developer found it easily and did one of those 
forehead slaps.


You're not using LyX 1.2 or something like that, are you? What LyX version, 
what operating system, how much RAM on the system?
  


1.6.3 with 3Gig RAM, Ubuntu Jaunty 64 with radeonhd drivers.


The same instance of Lyx tabbed to a small document is very fast.

Has anyone tips on speeding this up?

- hmm a few hours later and a few lyx restarts and it's speeded up again...



You have an intermittent. I hate those. Keep an eye on it, and keep your 
  


Shall do, thanks for the advice.

Sam


Re: LyX slow at 1 char per second, 94% cpu

2009-07-28 Thread Sam Liddicott
Richard Heck wrote:  

Did you have View>Source open?

Yes - I'll bet that was it! Nicely spotted, thanks!

Sam


Re: LyX slow at 1 char per second, 94% cpu

2009-07-28 Thread Sam Liddicott

Steve Litt wrote:


What do you mean by "coming out at 1 character per second?" Do you mean it 
allows the typist only 1 char per second input, or do  you mean something 
else?
  

I mean it can't keep up with my typing, but I think Richard guessed right.
I'll prove it tomorrow on the same document.

In other news I'm finding the literate module much more convenient than 
literate class, and the new layout with manual labels much more 
congenial for entering; and I don't get caught out by missing out the 
trailing @.


Sam


Re: Setting paragraph style in document class

2009-07-29 Thread Sam Liddicott
* Luca Carlon wrote, On 29/07/09 10:04:
> Hi! I'm writing a book with LyX using the document class book. I just would 
> like
> to change the style of the 'Example' paragraph type so that it appears italic.
> Is this possible? I would like as well to reduce the font size of the text in
> the caption of the images: is this possible too?
> Thanks for any suggestion!
> 

Where did you get the 'Example' paragraph type from?
Book doesn't have this by default.

Sam


Re: problem with bibliography

2009-07-30 Thread Sam Liddicott
* Beny Spira wrote, On 29/07/09 22:05:
> Thanks to all that replied
> 
> It turned out the problem was in some references that contained URL with
> special characteres. I deleted the URLs and the problem vanished.


So... is that a Tex bug? Will you get a cheque for $655.36 ?

Sam


Re: Text wrap figure fails in a Hebrew document

2009-07-31 Thread Sam Liddicott
* Yosef Meller wrote, On 31/07/09 09:47:
> Hi,
> 
> I am trying to create a wrap figure in LyX. In an English document it
> works, but in a Hebrew document, inserting a wrap figure causes the DVI
> or PDF creation to fail with the following error in the LaTeX errors
> dialog:
> 
> Argument of \everypar has an extra }.
> 
> \par
> l.44 \end{wrapfigure}
> 
> Previously latex would stall indefinitely too, but that seems to be
> solved by installing the package "tetex-lang-hebrew" from Ubuntu
> repositories.


Stall indefinitely is usually because latex/tex is trying to read from
stdin.

If you run lyx from a console window then you can type ctrl-d and finish
the stall.

I generally run lyx 

Border around figure float

2009-08-01 Thread Sam Liddicott
My "figure" is actually a text rendering of an html website layout and 
so confusingly seems to merge in with the text of the page.


How can I get a border around my figure float?

Sam


Emphasis with passthrough

2009-08-06 Thread Sam Liddicott
If I use a layout with "Passthrough 1" then the Lyx "E" emphasis toolbar
button will still insert \emph{} but other "CharStyle:" insets won't work.

Is this a bug, or is there some way I can specify an inset so that it
also inserts Latex macros into an environment defined with Passthrough 1

Sam


Re: Emphasis with passthrough

2009-08-06 Thread Sam Liddicott

Jean-Marc Lasgouttes wrote:

"Sam Liddicott"  writes:
  

If I use a layout with "Passthrough 1" then the Lyx "E" emphasis toolbar
button will still insert \emph{} but other "CharStyle:" insets won't work.

Is this a bug, or is there some way I can specify an inset so that it
also inserts Latex macros into an environment defined with Passthrough 1



It is a bug. Note that the semantics of passthru paragraphs is not well
defined right now. I hope that I will be able to improve this in 1.7/2.0
  


Please keep me involved in the discussions.

I'm mostly re-written notangle in awk (to fix a few bugs) and so that it 
recognizes Latex macros like

\begin{CodeScrap}
instead of <<...>>=


and
\end{CodeScrap}
instead of @

And I want to use an inset instead of <<...>> for including chunks.

I'm also intending to re-write noweave entirely as latex macros if I can 
manage it, based on the listings package.



Sam


Re: Emphasis with passthrough

2009-08-06 Thread Sam Liddicott

Sam Liddicott wrote:

Jean-Marc Lasgouttes wrote:

"Sam Liddicott"  writes:
 
If I use a layout with "Passthrough 1" then the Lyx "E" emphasis 
toolbar
button will still insert \emph{} but other "CharStyle:" insets won't 
work.


Is this a bug, or is there some way I can specify an inset so that it
also inserts Latex macros into an environment defined with 
Passthrough 1



It is a bug. Note that the semantics of passthru paragraphs is not well
defined right now. I hope that I will be able to improve this in 1.7/2.0
  


Please keep me involved in the discussions.

I'm mostly re-written notangle in awk (to fix a few bugs) and so that 
it recognizes Latex macros 


I'm using the attached .layout file, which generates Latex like this;

\begin{CodeScrap}
\item [{new_chunk() }] 
function new_chunk(chunk_name)

{
 active_chunk = chunk_name;
 chunks[chunk_name, "part", ++chunk[chunk_name, "part"] ] =
chunk_name SUBSEP "chunklet" SUBSEP ++chunks[chunk_name, 
"chunklet"];

}
\end{CodeScrap}

Where the \item declares a chunk name.

I also want a \usechunk{chunk-name} which will be shown in Lyx with a 
static label "use chunk", but I don't know if that can be done as an 
inset...


I also want to be able to pass additional optional arguments to the \item.

So although it is "passthrough" it has the same problems as verbatim 
does which is that it still looks for some Latex, in this case \item and 
\end{CodeScrap}, however I'm not too worried. I'll invent a \literal{} 
if I have to (which would have to be expressed in a CodeScrap as 
\literal{{\literal}} no doubt).


(I'm also open to other notations if you have any suggestions).

Sam


#\DeclareLyXModule{Noweb Literate Lyx}
#DescriptionBegin
#Adds \usepackage{noweb} to your document, along with the Scrap style.
#Also fixes the CharStyle:Code to work with noweb, redefining nowebs
#\code command to \nwcode (if you need it).
#DescriptionEnd

Format 11
OutputType literate

AddToPreamble
\usepackage{noweb}
% noweb breaks code command for logical markup
\newcommand{\nwcode}{\code}
\renewcommand{\code}[1]{\texttt{#1}}
EndPreamble


Style Scrap
Category  List
MarginFirst_Dynamic
LatexType Item_environment
LatexName CodeScrap
#NextNoIndent  1
NewLine   0
LeftMarginMMM
LabelSep  MMM
ParSep0.4
TopSep0.4
BottomSep 0.4
ItemSep   0.4
Align Block
AlignPossible Block,Left
FreeSpacing   1
PassThru  1
LabelType Manual
LabelFont
  Color   magenta
EndFont
TextFont
  Color   latex
  Family  Typewriter
EndFont
End

InsetLayout CharStyle:Chunkref
LyxType   charstyle
LabelString   chunkref
LabelType static
LatexType command
LatexName chunkref
Font
  Series  bold
  Color   black
EndFont
Preamble
\newcommand{\chunkref}[1]{\texttt{#1}}
EndPreamble
End






environment feature request

2009-08-07 Thread Sam Liddicott
Could Lyx please set some environment variables before it calls it's
conversion routines? It would save the need to customize the conversion.

My current literate->program filter sets them for me:

cat $$i | newfangle -Rlyx-build - | env LYX_b=$$b LYX_i=$$i LYX_o=$$o
LYX_p=$$p LYX_r=$$r NOWEB_SOURCE=$$i bash

With a lyx-build fragment containing:

PROJECT_DIR="$LYX_r"
LYX_SRC="$PROJECT_DIR/${LYX_i%.nw}.lyx"
NW_DIR="$LYX_p"
NW_SRC="$NW_DIR/$LYX_i"
cd $PROJECT_DIR || exit 1

so that I can extract files in my lyx document directory.

The "extra flag" originaldir seems to do nothing.

Sam


latex macro help...

2009-08-08 Thread Sam Liddicott


I've got an environment CodeScrap that Lyx treats as a list environment. 
Each list item is a literate programming chunk, and the list item name 
is the chunk name.
I will be using the listings package to format the latex output; so I 
start like this:
(Please don't comment on the needless \startCodeScrap and so forth, it's 
just till I get it working).


\long\def\startCodeScrap{

\def\nfitem{\item}

\def\item##1[##2]{

\begin{lstlisting}[name=##2]

}

}

\newenvironment{CodeScrap}{\startCodeScrap}{

%\end{lstlisting}

\def\item\nfitem}


So I re-define item during a CodeScrap environment, so that it starts a 
lstlisting. That works fine; but of course lstlisting is looking for a 
literal \end{lstlisting} I think and there isn't one... now another 
\item or \end{CodeScrap}will occur instead.



I think my \def\item might need to be \long\def\item and maybe have a 
3rd parameter which ends with \item or \end{CodeScrap} (which will be 
hard enough, probably I'll have to do the third parameter ending on a \ 
and then do tail recursion to pull some more if the next symbol isn't 
\item or \end [won't someone write a yacc for tex?)



But I see that I still need to inject the \end{lstlisting} somewhere. I 
try to fake it by way of experiment:


\long\def\startCodeScrap{

\def\nfitem{\item}

\def\item##1[##2]##3\end{

{\begin{lstlisting}[name=##2]##3}

{\endlstlisting}

HELLO ##3

\end

}

}


But not only does it  not work, it's fetching the tokens not in the same 
mode as listings works, and eating my { } and so forth.I realise then 
that if I am going to fetch


ahead to the next item with ##3 and such that I need to mess about with 
catcodes too...



So before I go too far, any advice for me?


(I also realise that my 2nd \item will have to close the lstlisting of 
the previous item and so on)


Sam



newfangle - the new notangle and no more noweave Re: latex macro help...

2009-08-10 Thread Sam Liddicott
I've managed to avoid blowing up my brain and created a noweb aspect for
the latex listings package, with accompanying lyx module.

As a result I don't need to use noweave, but I get noweave looking
output with the listings generated by the listings package with all it's
pretty printing.

The lyx module (called "newfangle") treats each \lstlisting as a noweb
style chunk, and uses the listing name as the chunk name.

It uses the noweb package macros merely to generate the chunk header and
navigation arrows to the previous and next chunk.

This avoids the need to use noweave for most uses, and removes for me
the need to use the literate lyx file format.

I'm still lacking is noweb markup of <>. I need to get
lstlistings to spot these...

Because Lyx doesn't show the listing name visually while editing it can
be very confusing to remember which listing has which name, so I've
added a Chunk style which sets the listing name. This will be persistent
until the next Chunk or the next explicitly named listing.

I prefix most of my listings with a highly visible chunk header.

The Chunk style pretty much just prefixes "name=" to it's text, and then
calls \lstset, but it does some magic to preserve the chunk name into
the listing.

I also have a newfangle awk script which works like notangle, but nicely
recognizes the latex that listings uses to pick out the code. The awk
script has less bugs that notangle, can manage -L output without
breaking the indents, and manage to suck C code into multi-line macros
without breaking.

I can now do literate programming with much more simplicity than before.

I hope that Lyx will be able to accept this work, and make literate
programming work more naturally.

I've been "are we nearly there yet" for the last 6 weeks, and I think my
answer is "yes" (the 3rd time around).

I'll post the code tomorrow, I need to run, but I didn't want anyone
working on my latex macro question now I solved it.

Sam


New literate programming with Lyx

2009-08-11 Thread Sam Liddicott
I've posted on http://www.lyx.org/trac/attachment/ticket/6137/
my alternative literate programming style with Lyx. I put this together
because literate programming with noweb and Lyx has been absolutely
awful in so many ways - if I wasn't a sed wizard I'd have given up.

I encourage people to try this and to give feedback.

A literate class is no longer used, you can have any document class and
add the "Newfangle Literate Listings" module to your document.

Your document will no longer be the "literate" format, so you add a
build script as a conversion from "Latex" to "Program"

Noweave is not needed, but is (mostly) impemented as Latex macros.

The excellent lstlistings package is used for format the listings; it
has good support for syntax highlighting, line-numbering and so forth.

Because lstlistings is used server-goto-file-row almost works, so
compile errors bring you to the write lstlistings at least - but not the
actual line number,

notangle (which was buggy) is not used to generate the source, instead
an awk script, newfangle, is used, fixing various notangle bugs.

A new style "Chunk" is defined which can be used to easily name your
next lstlisting (otherwise right-clicking and using advanced) is a bit
long winded and you can't see the name you give it once you clicked OK.

Tomorrow I hope to post the chapter that produces a Makefile.inc which
automatically extracts all file sources, and can also glue into another
build system using recursive make (if you are writing literate modules
for an existing project).

Future:
I'm planning to add markup conversions between chunks; so that (for
instance) a shell-script fragment when included into a makefile will
automatically have $ converted to $$, and line endings with a \ for
multi-line shell script. This works nicely with lstlistings language
support.

There's already basic support for including fragments into some comment
contexts:

# <>
will cause each line of frag to being with #

<> \
causes each line of frag to end with \, ideal when C code is being
included into a mutli-line C macro.

Sam


Cases environment

2009-08-20 Thread Sam Liddicott
In a display-equation environment I can't get the cases environment to
work properly, unless I just use the first column.

I get the error:


Misplaced alignment tab character &.

 s &
  s\end{cases}$
I can't figure out why you would want to use a tab mark
here. If you just want an ampersand, the remedy is
simple: Just type `I\&' now. But if some right brace
up above has ended a previous alignment prematurely,
you're probably due for more error messages, and you
might try typing `S' now just to see what is salvageable.

Furthermore, if I just use the left column, then it is displayed all on
one line.

Has someone got this to do anything useful?

Sam


Re: Cases environment

2009-08-20 Thread Sam Liddicott
* rgheck wrote, On 20/08/09 14:02:
> On 08/20/2009 08:57 AM, Sam Liddicott wrote:
>> In a display-equation environment I can't get the cases environment to
>> work properly, unless I just use the first column.
..
>> Furthermore, if I just use the left column, then it is displayed all on
>> one line.
>>
>> Has someone got this to do anything useful?
>>
>>
> I've just done a simple one, attached. You want to attach what you are
> trying to do?


Thanks. Looks like I needed to add:
\usepackage{amsmath}

to my pre-amble, I didn't have "Use AMS match package automatically" ticked.

Sam


Re: Cases environment

2009-08-20 Thread Sam Liddicott
* rgheck wrote, On 20/08/09 15:15:
> On 08/20/2009 10:07 AM, Sam Liddicott wrote:
>> I didn't have "Use AMS match package automatically"
>> ticked.
>>
> Just tick that, unless you have some reason not to do so.

I think it was because I had imported a latex document to Lyx, and it
wasn't ticked. It seems to be ticked by default on new documents.

I guess I should file it as a bug? If we don't want to tick it for
imported options, then it ought to raise a warning at the point where it
would have included it... ?

Sam


Re: Photo-ready output

2009-08-20 Thread Sam Liddicott
* L Duperval wrote, On 20/08/09 16:03:
> Hi,
> 
> I want to create a booklet for a print-on-demand shop (Lulu, iUniverse, 
> Lightning Source, Book Locker). What I've seen is that they need PDF/X 
> photo-ready output. Does anyone know how to produce that, other than 
> using Acrobat Distiller?

Google likes me:
http://www.blackstoneresearch.com/pdf_tiffit.pdf
http://www.mastergardeneronline.com/pdf.php

It seems at least that the internal colours are to be CMYK (or spot
colours) and not RGB; and to be sure that all fonts are embedded (I
thought all PDF did that).

http://www.pdfxreport.com/doku.php?id=en:toolsl

Sam


Re: help - some questions

2009-08-21 Thread Sam Liddicott
* Ricardo Perrone wrote, On 21/08/09 04:05:
> Hi,
> 
> I need a little help with some questions:

I've thought of such things from time to time, and concluded that the
style authors have more knowledge of typesetting than I do, and that my
opinion of "more appropriate space" probably enjoys less acceptance than
their opinion.

However there is a case to make for being able to change it... you just
first need to ask yourself if you are sure that you know better than the
class designers. If you decision is based purely on "it's too wide" then
you probably don't know better and you should leave it alone.

> 1- Lyx has some default font size like Normal, small, smallest, etc. But how 
> can I change it to a specific font size to be applied in some places of my 
> document? For instance 10.5pt.

Font sizes in Lyx and Latex are given names:
http://www.image.ufl.edu/help/latex/fonts.shtml

So first you need to think if you literally want "10.5pt" or if you want
to set the size of one of the name styles or sizes to 10.5pt.

You can mess with tie \fontsize{}{} command; insert this in your pre-amble:

\newcommand\sizetf[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}

then you can use the command

\sizetf{I'm in 10.5pt}

in ERT in your document.

(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)


> 2- I am using enumerate environment, but it adds a large space between the 
> paragraph and the first item of environment. Is there a way to change it to a 
> more appropriated space? I am using book.cls template.

You probably want to read this:
http://tkcs-collins.com/truman/latex/list_examp.shtml

And you may find it easier to use these if you define a lyx .module file
to go with them. Look at existing lyx module files to work this out, and
install your own in ~/.lyx/layouts

Sam


Re: help - some questions

2009-08-21 Thread Sam Liddicott
* Olivier Ripoll wrote, On 21/08/09 10:29:
> Sam Liddicott wrote:
>> * Ricardo Perrone wrote, On 21/08/09 04:05:
>>> Hi,
>>>
> [...]
> 
>> You can mess with tie \fontsize{}{} command; insert this in your
>> pre-amble:
>>
>> \newcommand\sizetf[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}
>>
>>
>> then you can use the command
>>
>> \sizetf{I'm in 10.5pt}
>>
>> in ERT in your document.
>>
>> (I wish Lyx supported adding per-document layouts and elements in the
>> same way that it supports adding Latex commands in the preamble)
> 
> Isn't that what layout modules are for ? 

Sure, but as you can't embed a layout module in the lyx document, ERT
can sometimes be easier and more portable, and for small chunks of text
is already clearly delineated in the Lyx document by the red box.

(I suggested a layout module for his enums, it would be nuts to do those
with ERT)

And thanks for providing the examples that I was too lazy to provide..

Sam


\index expressions

2009-08-21 Thread Sam Liddicott
I'm trying to extend the indexing of newfangle literate code chunks.

I'm: \usepackage{index}

so that I can have multiple indexes; but the \index{} command seems to
literally interpret the first parameter, so that
\index{\chunkname}
indexes "\chunkname" instead of the name.

I've tried all kinds of use of \expandafter and other tricks with
secondary macros, like this:

\def\ch...@index#1{%
  \...@index[chunks]{#1}%
}%
\def\Chunk#1{%
  \lstset{title={\newfanglecaption},name=#1}%
  \global\edef\...@chunkname{\lst@intname}%
  \expandafter\ch...@index{\lst@chunkname}%
}%

But even then I get the literal text "\...@chunkname" as the indexed item.

The only thing that "nearly" works is if I pass #1 within \Chunk, but
then I get other text too, which I want to chop off.

Any clues on how to make the index package take an expression?

Sam


Re: \index expressions

2009-08-21 Thread Sam Liddicott

The Texbook says:

  The \write command is somewhht special, 
because its token
list is first read without expansion; expansion occurs later, when the 
tokens are actually

being written to a file.


As \index writes to a file, this may be the problem!

I'll see if I can do any tricks with
\def\trick#1
where  is delimiters to try and the name it out of the original 
text, as #1 macros seem to make it through fine...


Sam

Sam Liddicott wrote:

I'm trying to extend the indexing of newfangle literate code chunks.

I'm: \usepackage{index}

so that I can have multiple indexes; but the \index{} command seems to
literally interpret the first parameter, so that
\index{\chunkname}
indexes "\chunkname" instead of the name.

I've tried all kinds of use of \expandafter and other tricks with
secondary macros, like this:

\def\ch...@index#1{%
  \...@index[chunks]{#1}%
}%
\def\Chunk#1{%
  \lstset{title={\newfanglecaption},name=#1}%
  \global\edef\...@chunkname{\lst@intname}%
  \expandafter\ch...@index{\lst@chunkname}%
}%

But even then I get the literal text "\...@chunkname" as the indexed item.

The only thing that "nearly" works is if I pass #1 within \Chunk, but
then I get other text too, which I want to chop off.

Any clues on how to make the index package take an expression?

Sam
  




Re: Re : [Lyx] explicit mail subject

2009-09-02 Thread Sam Liddicott
* Delta moins wrote, On 02/09/09 09:28:
> Ok I knew this solution and yeah it works. I will use it.
> If I'm the only for who an explicit mail subject lacks it's ok.


You're not the only one. I heartily wish it had a list-id header.

Sam


Re: [Lyx] explicit mail subject

2009-09-02 Thread Sam Liddicott
* Manveru wrote, On 02/09/09 09:18:
> 2009/9/2 Delta moins :
>> Hello everybody,
>> I'm registred to this mailing list for few weeks and I'm very surprised 
>> about one thing : there is no keyword in the mail subject that tell people 
>> "this comes from the Lyx users list". It's very messing because you cannot 
>> filter the mails efficiently. In addition sometimes, mail subject is not so 
>> easy to link with Lyx so organising the mail box is not so easy.
>> I don't know if it should be done automaticaly by the list system or if 
>> people that send mail should add something like I've done for example 
>> manually.
>> It's a pity because informations in the mails are often very interesting :-)
>> It was just a remark to improve this list.
> 
> Just sort or filter your e-mails by From: field from header of your
> mails. All e-mail clients support this. At least all good e-mail
> clients.

Your message has:

From: "Manveru" 

which is not helpful.

I'm currently sorting based on To: or Cc: having lyx-users@lists.lyx.org
which sadly also selects messages that were emailed to me.

I'll have to have my sorting rules like this:

1. sort all list-id mailing lists
2. select all messages To: or Cc: me
3. sort all To: Cc: mailing lists

and that still won't catch Bcc messages to me (or Lyx).

So I just sort based on to or cc and swear and cuss from time to time
about the Lyx mailing list not supporting list-id header; and generally
fail to notice messages also sent directly to me as it's a thread I'm
involved in.

Sam


offtopic Re: [Lyx] explicit mail subject

2009-09-02 Thread Sam Liddicott
* A B wrote, On 02/09/09 09:53:
>> Your message has:
>>
>> From: "Manveru" 
>>
>> which is not helpful.
>>
>> I'm currently sorting based on To: or Cc: having lyx-users@lists.lyx.org
>> which sadly also selects messages that were emailed to me.
>>
>> I'll have to have my sorting rules like this:
>>
>> 1. sort all list-id mailing lists
>> 2. select all messages To: or Cc: me
>> 3. sort all To: Cc: mailing lists
>>
>> and that still won't catch Bcc messages to me (or Lyx).
>>
>> So I just sort based on to or cc and swear and cuss from time to time
>> about the Lyx mailing list not supporting list-id header; and generally
>> fail to notice messages also sent directly to me as it's a thread I'm
>> involved in.
>>
>> Sam
>>
> 
> The subject can be messed up when some programs keep adding Re: or
>  to the subject and the id
> header has to be added by the list server because there are those that
> forget to add the header.

sure, list-id should be added by the list server.

> I thought it was an unwritte rule: reply to the list, not the list AND
> an explicit email adress (unless they ask to) Or have I got this
> completly wrong?

Unwritten rules aren't rules; I generally do reply-to-all which is the
natural way to reply to all people. For most of my mailing lists it
means that the named recipients get their message from me, and the
mailing list suppresses the message to them as they are already listed
in the Cc or To headers -- although some mailing lists don't do that.

> Sending a personal reply on a question that might interest more people
> on the list is not optmal.

For sure, I don't generally do that.

Sam


Re: Re : [Lyx] explicit mail subject

2009-09-02 Thread Sam Liddicott
* Kornel Benko wrote, On 02/09/09 10:33:
> Am Wednesday 02 September 2009 schrieb Sam Liddicott:
>> * Delta moins wrote, On 02/09/09 09:28:
>>> Ok I knew this solution and yeah it works. I will use it.
>>> If I'm the only for who an explicit mail subject lacks it's ok.
>>
>> You're not the only one. I heartily wish it had a list-id header.
> 
> It has, I am using this one:
> Delivered-To: mailing list lyx-users@lists.lyx.org

The Delivered-To: header is not the same as the list-id header - I'm
more interested in how the message reached me (via the list or not),
Delivered-To: signifies something else, and my mail server does not
support it.

http://www.apps.ietf.org/rfc/rfc2919.html

Sam


Re: Re : [Lyx] explicit mail subject

2009-09-02 Thread Sam Liddicott
* Andrew Sullivan wrote, On 02/09/09 14:10:
> On Wed, Sep 02, 2009 at 11:38:02AM +0100, Sam Liddicott wrote:
>> The Delivered-To: header is not the same as the list-id header - I'm
>> more interested in how the message reached me (via the list or not),
>> Delivered-To: signifies something else, and my mail server does not
>> support it.
>>
>> http://www.apps.ietf.org/rfc/rfc2919.html
> 
> In another message, I referred to that, and I think I'd incorrectly
> believed there's a List-Id header on this list.  You're right that
> there isn't.
> 
> But you can cheat.  The list _does_ provide RFC2369 headers, and
> they're just as good for this purpose.  Evidently that's what I'm
> doing, since this all sorts nicely for me.


yeah; sadly Citadel mail server has support for list-id, but not the rest.

Sam


Re: [Lyx] explicit mail subject

2009-09-02 Thread Sam Liddicott
* Paul A. Rubin wrote, On 02/09/09 15:57:
> I understand there are some concerns about tampering with the subject
> line (and what happens when replies and forwards occur).
> 
> What about creating a LyX-specific header (X-LyX: userlist or X-LyX:
> developerlist or whatever)?  Will the list mailer (and GMANE, which is
> where I get my feed) support custom headers?  It's easy enough to filter
> on them in any mail client I've used.


Alas, not on my mail server. I can filter on many standard headers (like
List-ID) but not any custom header.

Sam


Re: [Lyx] explicit mail subject

2009-09-11 Thread Sam Liddicott

* Murray Eisenberg wrote, On 11/09/09 14:45:
Likewise, I find no way to modify the header in Thunderbird (at least 
the Windows Version), which is a common e-mail client.


In Thunderbird, I can, of course, set up a filter which looks at the CC: 
field and sends any "lyx-users@lists.lyx.org" messages to a separate 
folder.


But I don't want to bury the messages to a separate folder. I merely 
want to be able to tell a a glance from the Subject field that LyX is 
the subject.



There is also the difference between knowing that a message was sent TO 
lyx-users and whether you received a message FROM lyx-users (or were 
sent it directly).


Sam


Karmic Koala update slows down lyx

2009-09-12 Thread Sam Liddicott
The most recent Karmic Koala updates make updating the Lyx caret (text 
position) very slow.


If I click the left-arrow, it takes a second before the caret is seen in 
the new position and the old position is not erased properly.


This may not be a problem with Lyx, but I'm curious to know if other 
users have the same problem.


Sam


Re: Karmic Koala update slows down lyx

2009-09-14 Thread Sam Liddicott

* Uwe Stöhr wrote, On 12/09/09 21:41:

Andre Poenitz schrieb:


The most recent Karmic Koala updates make updating the Lyx caret (text
position) very slow.

What is Karmic Koala?


The next Ubuntu release (9.10)

PS: On Fridays I would have suggested to look at
http://lmgtfy.com/?q=karmic+koala ;-)


Well, I already googled it myself ;-). It is nevertheless a strange that 
people asking for help while the list members first have to google what 
they are talking about.


It is perhaps not so strange; I just guessed wrongly between "tediously 
verbose" and "obtusely arcane" - either of which has the potential to be 
annoying - however the joy of such public communication is the 
incidental widening of everyone's horizons.


I could had said "The Ubuntu GNU/Linux distribution alpha release Karmic 
Koala" but at the time even "Ubuntu Karmic Koala" seemed unnecessarily 
verbose. I shall take your tip, though, and presume that not everyone is 
so familiar with the progress of Ubuntu.



Back to the topic Ubuntu 9.10 is not stable and in beta state.


Heh, it's alpha 5 right now.


 I'm wondering why we should care about an unreleased OS.


Here's some reasons, although I don't propose that you personally  adopt 
any of them:

* Other mailing list members care
* It's a chance to spot problems before release
* Other Lyx users care

By using alpha Karmic Koala I was able to spot and report bugs in qemu 
and rhythmbox so that they will be fixed before release.


I'm not asking for support here on this issue, I'm only asking if anyone 
else has noticed this, as I may be able to get information to help me 
investigate further.


So far the problem has only shown itself on computers with nvidia 
drivers, my ATI machine does not show the problem. I'll investigate more 
when I get back to my nvidia machines.


To answer Steve Litt's question, I'm using lyx 1.6.3 (I don't know how 
to ask dpkg where it was built as I do for rpm's but I suspect it is a 
Jaunty Jackalope getdeb build), and qt 4.5.2


Sam


Re: Lyx and Ubuntu Hardy

2009-09-17 Thread Sam Liddicott

* Sven Hoexter wrote, On 17/09/09 10:47:

So maybe the easy way out for the OP might be to switch away from the LTS
release to the latest whatever is 'stable'.


I echo that. LTS means "I prefer stability over new releases" and that's 
exactly when it gives.


If people find they would rather have new release then they don't want LTS.

And yet... running XP wouldn't stop me using the latest Lyx on windows 
so it's somewhat funny that a similar situation holds true for Ubuntu.


Sam


Re: Lyx and Ubuntu Hardy

2009-09-17 Thread Sam Liddicott

* Sven Hoexter wrote, On 17/09/09 15:54:

On Thu, Sep 17, 2009 at 03:15:12PM +0100, Sam Liddicott wrote:

And yet... running XP wouldn't stop me using the latest Lyx on windows  
so it's somewhat funny that a similar situation holds true for Ubuntu.


Actually nothing stops you from compiling the latest LyX release on
the Ubuntu release in question and use it. It's just not click&run.
That's the price of diversity you pay for a more open operating system.
There is a benefit you get when you pay for a more closed plattform like
Windows or Mac OS (in this case: as long as there are community members
carring to provide builds - so thank the people doing the work).


You are quite right.

I want to put on record that I don't use windows, and that "apt-get -b 
source" is a friend of mine :-)


Sam


Re: Karmic Koala update slows down lyx

2009-09-22 Thread Sam Liddicott

* Sam Liddicott wrote, On 12/09/09 14:34:
The most recent Karmic Koala updates make updating the Lyx caret (text 
position) very slow.


If I click the left-arrow, it takes a second before the caret is seen in 
the new position and the old position is not erased properly.


This may not be a problem with Lyx, but I'm curious to know if other 
users have the same problem.


It seems to be a QT problem associated with nvidia drivers and compiz.

Even painting of the document properties preamble edit box is delayed 
indefinitely (until a change occurs, or the window is covered and 
uncovered).


So not a Lyx problem.

Sam


Re: program listing

2009-10-12 Thread Sam Liddicott

* Sajjad wrote, On 12/10/09 14:08:

Hello forum,

I want to write pseudo-code and i am doing that inside the program listing.

But when i generate the pdf , the code are cropped sideways.


Any hint to get around that issue?


Use smaller fonts, or short lines?

Sam


Re: program listing

2009-10-13 Thread Sam Liddicott

* Sajjad wrote, On 12/10/09 14:08:

Hello forum,

I want to write pseudo-code and i am doing that inside the program listing.

But when i generate the pdf , the code are cropped sideways.


Any hint to get around that issue?


Regards
Sajjad






Re: UML in Lyx.

2009-10-14 Thread Sam Liddicott

* nikunj . wrote, On 14/10/09 09:36:
> Hi,
>
> I have lyx 1.6.4 installed and want to draw few UML diagrams, like
> class diagram, activity diagram and sequence diagrams in Lyx.
>
> What should I do ?
> Any cue would be helpful.
>
> Thanks,
> Nikunj.

If you search in http://www.ctan.org/ you can find some latex extensions 
to do such things, so you could produce separate .latex files which you 
can then insert into your Lyx document.


Or you can use dia to produce the diagram - Lyx can allow you to insert 
a dia diagram, and will convert it for you.


Or (and someone else will have to explain how, or point to the right Lyx 
help page) use another favourite drawing tool and define a convertor for 
lyx; or you can have it export an eps which Lyx can import.


Sam


Re: References in program listings

2009-10-14 Thread Sam Liddicott

* Luca Carlon wrote, On 14/10/09 11:47:

Hi! Is it possible to insert references in program listings? I tried to do that
but the button apply is disabled. I tried even to copy and paste a reference but
the reference doesn't appear in the PDF. Is there any reason why this is not
possible?


Do you want to reference other parts of the document or other listings?

If you use newfangle:
http://repo.or.cz/w/newfangle.git

then you can create references between code blocks, or references within 
the document to a code block from the document, using the \chunkref{} 
command.


However you may want to consider using the lstset escapeinside option.

Newfangle uses:
  \lstset{escapeinside={=<}{>}}
You could put this in the document preamble directly:

You can then insert LaTeX like this:

=<\ref{myref}>

in the listing - sort of like an ERT for listings.

I used =< and > for the latex delimiters because =< is not valid in any 
language I know.


Sam


Re: References in program listings

2009-10-14 Thread Sam Liddicott

Luca Carlon wrote:

Sam Liddicott  writes:
  

Do you want to reference other parts of the document or other listings?

If you use newfangle:
http://repo.or.cz/w/newfangle.git

then you can create references between code blocks, or references within 
the document to a code block from the document, using the \chunkref{} 
command.


However you may want to consider using the lstset escapeinside option.

Newfangle uses:
   \lstset{escapeinside={=<}{>}}
You could put this in the document preamble directly:

You can then insert LaTeX like this:

=<\ref{myref}>

in the listing - sort of like an ERT for listings.

I used =< and > for the latex delimiters because =< is not valid in any 
language I know.


Sam



mmh... no, I don't think this is what I'm trying to do. I would like to insert
inside a listing a reference to other parts of the document, a Chapter for
instance, or an equation. For examples, in a C listing I could have:

// According to Equation() I can compute...

So that I have a reference to an equation inside the listing.
Is this possible?
Thanks!
  

Yes, I just told you how:
Put this in your document pre-amble

\lstset{escapeinside={=<}{>}}

Then in your listing put:

=<\ref{myref}>

where myref is your reference.

The =<...> behaves like ERT but for listings.

Sam


Luca

  




textcomp Error: symbol \textuparrow not provided by

2009-11-10 Thread Sam Liddicott
Having just added a symbol up-arrow, every time I build my PDF, Lyx 
gives this error:


textcomp Error: symbol \textuparrow not provided by

("by" is the last word of the error)

althought the PDF displays the arrow just fine.

The arrow is in a LyxCode environment, but further testing shows that it 
just hates doing an up-arrow within \ttfamily


as it works anyway, any tips to stop it complaining?

Sam


Re: textcomp Error: symbol \textuparrow not provided by

2009-11-11 Thread Sam Liddicott

* Uwe Stöhr wrote, On 10/11/09 17:32:

Sam Liddicott schrieb:

Having just added a symbol up-arrow, every time I build my PDF, Lyx 
gives this error:


textcomp Error: symbol \textuparrow not provided by

("by" is the last word of the error)


Can you please provide a _small_ LyX example file?


It seems to be a conflict with luximono

Sam


t1.lyx
Description: application/lyx


Phantom spaces

2009-11-11 Thread Sam Liddicott
In the attached lyx file, phantom at the beginning of a line results in 
a new-line. I have to use ctrl-space and insert a hard space to get the 
phantom to take any effect.


I'm also thinking what about a phantom text style (as text styles can be 
nested) but this might need whatever magic is required to get phantom to 
work at the start of a line.


Sam


phantom.lyx
Description: application/lyx


Re: textcomp Error: symbol \textuparrow not provided by

2009-11-11 Thread Sam Liddicott

* Uwe Stöhr wrote, On 11/11/09 14:08:

Sam Liddicott schrieb:

Having just added a symbol up-arrow, every time I build my PDF, Lyx 
gives this error:


textcomp Error: symbol \textuparrow not provided by


It seems to be a conflict with luximono


The luximono font does not yet provide a glyph for the uparrow 
character. It would be nice if you could report this to the luximono 
developers. Perhaps the next version of the luximono fonts will then 
contain some more glyphs.

For now, you need to use another font, for example Latin Modern Typewriter.


Thanks for the tip. I will report it.
I find it interesting that the up-arrow still rendered, but that the 
error stopped lyx's latex run (and second run to resolve references).


It seems like latex or lyx half works around this.

Sam



Howto: Poor mans bold

2009-11-11 Thread Sam Liddicott
I've been struggling for a long time to get poor-mans-bold working 
(because of the pain installing luximono) and now I've got it working, I 
post the answer here:


In your pre-amble:
\usepackage{amsbsy}

and then to have bold ttfamily text, \ttfamily\pmb{bold}

With lstlistings, I just do:

\lstset{
basicstyle=\small\ttfamily,
keywordstyle=\pmb
}

Sam


Re: textcomp Error: symbol \textuparrow not provided by

2009-11-12 Thread Sam Liddicott

* Uwe Stöhr wrote, On 11/11/09 15:16:

Sam Liddicott schrieb:

I find it interesting that the up-arrow still rendered, but that the 
error stopped lyx's latex run (and second run to resolve references).


This is the correct behaviour: When a LaTeX-error occurs, LyX stops 
because LaTeX stops. That this raises a LaTeX error instead of a LaTeX 
warning is another issue of the luximono fonts.



Fair enough.

I did submit a report to Bigelow and Holmes about luxi-mono.

I suppose another fix would be a package that redefines \textuparrow{} 
(etc) to switch font if running under the ul9 font.


I'll try and work out how to do that.

Sam


Re: Howto: Poor mans bold

2009-11-12 Thread Sam Liddicott

* Sam Liddicott wrote, On 11/11/09 15:48:
I've been struggling for a long time to get poor-mans-bold working 
(because of the pain installing luximono) and now I've got it working, I 
post the answer here:


In your pre-amble:
\usepackage{amsbsy}

and then to have bold ttfamily text, \ttfamily\pmb{bold}

With lstlistings, I just do:

\lstset{
basicstyle=\small\ttfamily,
keywordstyle=\pmb
}



Also:

\usepackage{amsbsy}
\let\oldlyxcode\lyxcode
\renewcommand{\lyxcode}{\def\strong{\pmb}\oldlyxcode}

I suppose there may be a neater way for \strong to be defined to \pmb in 
things other than lyxcode?


Sam


Re: Howto: Poor mans bold

2009-11-12 Thread Sam Liddicott

* Guenter Milde wrote, On 11/11/09 20:24:

On 2009-11-11, Sam Liddicott wrote:

I've been struggling for a long time to get poor-mans-bold working 
(because of the pain installing luximono)


May I recomment the txtt fonts from the txfonts package?

While the txfonts package is said to have problems with symbols and font
metrics (i.e. said to be ugly). However, the txtt teletype font is fine
and comes with bold and italic and even small-caps variants:

* Install txfonts_

* To use the teletype font from the txfonts_ package, write in the LaTeX
  preamble (or as ERT)::

\renewcommand{\ttdefault}{txtt}



Thanks for the tip.

they work well!

Sam


Re: Howto: Poor mans bold

2009-11-12 Thread Sam Liddicott

* Sam Liddicott wrote, On 12/11/09 09:52:

* Guenter Milde wrote, On 11/11/09 20:24:

On 2009-11-11, Sam Liddicott wrote:

I've been struggling for a long time to get poor-mans-bold working 
(because of the pain installing luximono)


May I recomment the txtt fonts from the txfonts package?

While the txfonts package is said to have problems with symbols and font
metrics (i.e. said to be ugly). However, the txtt teletype font is fine
and comes with bold and italic and even small-caps variants:

* Install txfonts_

* To use the teletype font from the txfonts_ package, write in the LaTeX
  preamble (or as ERT)::

\renewcommand{\ttdefault}{txtt}



Thanks for the tip.

they work well!



They were already installed for me, I wonder if Lyx should offer this as 
an available typewriter font. I also think lyx ought to do 
poor-mans-bold (perhaps by redefining bfseries), I could probably do 
this if the idea is reasonable to the Lyx maintainers. I've certainly 
spent HOURS trying to get bold to work for a typewriter font.


Sam


Re: CAS exposure in LyX (was Re: Importing Lyx files in SWP)

2009-11-24 Thread Sam Liddicott

* Liviu Andronic wrote, On 24/11/09 11:39:

Hello

On Mon, Nov 23, 2009 at 9:34 PM, rgheck  wrote:

On 11/23/2009 02:05 PM, Liviu Andronic wrote:

If I am not mistaking, symbolic calculations can be performed in LyX
via maxima, octave, etc.


I don't know how current the support is, but yes, there are routines in
mathed that support exporting to these sorts of formats: Mathematica, too.
So some work may need to be done, but we don't see a lot of requests for
this kind of thing. I haven't seen anyone working on it since I've been
involved in LyX.


One of the reasons for so few requests could be that the nifty feature
is so well hidden. Other than not being mentioned on the features page
[1], I couldn't find info on CAS (maxima and the likes) in any of the
possible documentation files, from Introduction through Math. Even the
feature-poll page contains a non-greened-out request for CAS [2]. In
the GUI, it is not much simpler. After having written a math
expression (say, 'x+x'), right-clicking on the math env will not show
anything CAS-related, while the math toolbars do not propose anything
obvious.

Thus, to discover the CAS support in LyX a user would need to go the
sometimes improbable way of writing in math env and, while there,
accessing the Edit > Math > Use CAS menu.


wow! thats great! Thanks for showing it.

Sam


apologies: Re: elyxer requests

2010-01-21 Thread Sam Liddicott

Sorry guys... wrong list "again"

Sam


RE: executing a lyx file

2010-02-24 Thread Sam Liddicott
Or:

C:\path\to\lyx -e pdf myfile.lyx

Sam

-Original Message-
From: John Kane 
Sent: 24 February 2010 16:29
To: lyx-users@lists.lyx.org; philanthropist 
Subject: Re: executing a lyx file


Just click on the dvi or pdf icon or View > PDF should work. Or am I 
misunderstanding the problem?

--- On Wed, 2/24/10, philanthropist  wrote:

> From: philanthropist 
> Subject: executing a lyx file
> To: lyx-users@lists.lyx.org
> Received: Wednesday, February 24, 2010, 9:58 AM
> I have a lyx file in vista, but do
> not know how to run it.  Currently it has 
> the markup commands in it,  but I do not know how to
> process the file to get 
> the finished typeset output.   I think I
> have both lyx and miktex installed.
> 
> 


  __
Get a sneak peak at messages with a handy reading pane with All new Yahoo! 
Mail: http://ca.promos.yahoo.com/newmail/overview2/



Re: new google docs interface, with wave backend. (collaboration trends)

2010-04-13 Thread Sam Liddicott

 On 12/04/10 21:28, Jose Quesada wrote:

Hi All,

New google docs interface, with wave backend. (collaboration trends).
googledocs.blogspot.com/2010/04/new-google-docs.html

Most people agree that collaboration tools in latex lag behing word/gdocs.
LyX has track changes, but it's very hard to convince collaborators to use
it.
It'd be good to keep an eye on this. Office will come up with online
versions for Office 2010. If every other tool has a cloud version, LyX will
be perceived as old-style and it'd be even harder to convince collaborators


Rich xml formats with overlapping features allow conversions to be done 
with xslt.


Perhaps google docs can be used as a collaboration back end, with xslt 
conversion to lyx's new xml format locally.


Sam