SV: SV: Error in Latex output, LyX adds an extra brace

2011-02-24 Thread Ingar Pareliussen
Hi

>First let me talk about your particular document; sorry if you already know
>everything I say. Then I'll talk about your suggested workaround.

Don't be sorry for explaining things, even if I understand some LaTeX,
it is much easier when we are certain that we understand each other.  And
my English is my second language and I do not always have enough time
to express myself clearly :).

>As I said in my last email, I really don't think you mean to use the 
>"paragraph"
>layout here, especially _inside_ the marginpar. "Paragraph" (in this context)
>means a type of heading. You should only use it if you have divided your
>document into sections, subsections, subsubsections, and now want to divide it
>into even smaller pieces. And by making the *inside* of marginal notes 
>paragraph
>layout, you are saying that these are headings too.
>
>To put it another way, if you make the table of contents more detailed (you can
>do this in document settings under "numbering and TOC"), then *all text in
>paragraph layouts* will appear in the table of contents. Including these
>marginal notes, on their own lines.

I agree, no sane person should do this. So with paragraph, atleast, it only 
happens by accident.



>Changed: \paragraph{ xxx } \protect\marginpar{ yyy } \paragraph { zzz }
>This is a paragraph-level heading "xxx", followed by an empty paragraph (not a
>heading) with margin note "yyy", followed by a paragraph-level heading "zzz".

Yes, I see what you mean. Paragraph is different, and a poor example. However,
the same happens with other headings as well, where my work around makes
sort of sense(?). Someone might want to put a subsection as a marginpar and
have it show up in TOC. Maybe as an example box or something... Not that I 
would advise it though :).

>I think that perhaps \paragraph{\marginpar{\paragraph{ blah }}} could be
>disallowed in LyX, because it doesn't make any sense, but something like
>\paragraph{\marginpar{\itemize{ blah }}} makes sense and might one day work, if
>this LaTeX bug is fixed. So overall I don't think LyX should do anything about
>it.

The easiest way would be to make it impossible to put a marginpar in a heading 
in LyX. As marginpars floats in the margin there should not be any big 
difference 
where it is put in the final document.

Ingar



Re: SV: Error in Latex output, LyX adds an extra brace

2011-02-24 Thread Jim Oldfield




> From: Ingar Pareliussen 
> 
> > I think this is a bug in LaTeX rather than LyX, especially  (1)+(2a). I
> > googled
> > for a (LaTeX) workaround, but I can't see  one.
> 
> Yes, you are right, it is a LaTeX error, I was blinded by the  errormsg.
> 
> Anyhow this is LyX, and LyX makes LaTeX code that do not  compile
> if you make some unwise choices. I guess we could say that you should  not
> make these choices, which is the easiest way :).
> 
> However, if we  could get LyX to end the environments before starting the 
> marginpar the  problem would go away. 
> 
> Contrast the LaTeX code outputed by LyX, which  does not work:
> 
> \paragraph{\emph{Elymus foliis mucronato-pungentibus, s.  Elymus arenarius.  
>}\textmd{\emph{}}%
> \protect\marginpar{
> \paragraph{\textmd{\emph{\small  Leymus arenarius}}}%
> }}
> 
> With my hand written one that does work, (the  only difference is that I 
> moved 

>the
> brace to end the paragraph before I start  the marginpar):
> 
> \paragraph{\emph{Elymus foliis mucronato-pungentibus, s.  Elymus arenarius. 
>}\textmd{\emph{}}}% <--extra brace  here
> \protect\marginpar{
> \paragraph{\textmd {\emph{\small Leymus  arenarius}}}%
> } %<-- one less brace here
> 
> 

First let me talk about your particular document; sorry if you already know 
everything I say. Then I'll talk about your suggested workaround.


As I said in my last email, I really don't think you mean to use the 
"paragraph" 
layout here, especially _inside_ the marginpar. "Paragraph" (in this context) 
means a type of heading. You should only use it if you have divided your 
document into sections, subsections, subsubsections, and now want to divide it 
into even smaller pieces. And by making the *inside* of marginal notes 
paragraph 
layout, you are saying that these are headings too.

To put it another way, if you make the table of contents more detailed (you can 
do this in document settings under "numbering and TOC"), then *all text in 
paragraph layouts* will appear in the table of contents. Including these 
marginal notes, on their own lines.

If you were just after the formatting that the "paragraph" layout produces, 
then 
you can email this list with exactly what you're trying to do and we can help 
you achieve it the easiest way.

Back to your suggestion. Unfortunately your workaround doesn't just fix the 
compile error, but produces completely different output. E.g. (this is 
simplified but the same idea):

Original: \paragraph{ xxx \protect\marginpar{ yyy } zzz }
This is a single paragraph-level heading "xxx zzz" with a margin note "yyy" 
next 
to it.

Changed: \paragraph{ xxx } \protect\marginpar{ yyy } \paragraph { zzz } 
This is a paragraph-level heading "xxx", followed by an empty paragraph (not a 
heading) with margin note "yyy", followed by a paragraph-level heading "zzz".

I think that perhaps \paragraph{\marginpar{\paragraph{ blah }}} could be 
disallowed in LyX, because it doesn't make any sense, but something like 
\paragraph{\marginpar{\itemize{ blah }}} makes sense and might one day work, if 
this LaTeX bug is fixed. So overall I don't think LyX should do anything about 
it.

Jim





Re: language settings?

2011-02-24 Thread Charlie
On Thu, 24 Feb 2011 14:52:37 -0800
Gwen Barnes  wrote:

> Hi,
> 
> I just want my text within LyX to be in English.  Somehow, without me
> trying, LyX seems to think that I'm writing in Afrikaans.  If I check
> "mark foreign languages" in the LyX preferences, my entire document
> gets underlined in blue. The status bar at the bottom says Font:
> Default, Language: Afrikaans.  I can't figure out how to change
> this.  Under LyX: Preferences, the Default language is English.
> Under Document Settings, Language is English, and encoding is
> Language Default.  I don't know what else to do. Could someone help
> me out please?
> 
> -Gwen

In your LyX - Tools - Preferences - Language Settings

I use English (UK)

And go to the bottom and click on "Save"

In my LyX - Document Settings - Language

I use English (UK)

and Save as Document Defaults as you will see below in that same window.

Click on Apply and Close.

If you prefer another flavour of English, then select that.

HTH
Charlie
-- 
http://www.skymesh.net.au/~taogypsy/
-
Registered Linux User:- 329524
***

After the ecstasy, the laundry.  ZEN SAYING

***

Debian GNU/Linux - just the best way to create magic

-


colortbl no output

2011-02-24 Thread Daniele Danese

Hi to all,
I am just trying to get the first row of a long table in a multi-file 
document colored yellow.

So when I put
\usepackage{colortbl} in the preambel of the file where the long table 
is in and put in the wanted cell:

\cellcolor{yellow} it works fine.
But in this way all the numberings of the sections are wrong. But putting
\usepackage{colortbl} in the preambel of the main document leads to the 
following error messages:


...ftskip \@tempdima \hskip -\leftskip \let B
  lack Black\special 
{color ...

Please don't say `\def cs{...}', say `\def\cs{...}'.
I've inserted an inaccessible control sequence so that your
definition will be completed without mixing me up too badly.
You can recover graciously from this error, if you're
careful; see exercise 27.2 in The TeXbook.


...5em{\hss }}}\par \relax \endgroup \penalty
   20010
A left brace was mandatory here, so I've put one in.
You might want to delete and/or insert some corrections
so that I will find a matching right brace soon.
(If you're confused by all this, try typing `I}' now.)


...{A}Anhang A - Zellkultur}{A.1}{appendix.A}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.


\select@language {german}

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

Defining a color didn't help.
When leaving out the command \usepackage everything (but the missing 
color in the table) works fine...

I'm on Windows XP SP3, Lyx 1.9.2 MikTex, everything updated...

Any help would be great! Thanks in advance.


language settings?

2011-02-24 Thread Gwen Barnes
Hi,

I just want my text within LyX to be in English.  Somehow, without me
trying, LyX seems to think that I'm writing in Afrikaans.  If I check "mark
foreign languages" in the LyX preferences, my entire document gets
underlined in blue. The status bar at the bottom says Font: Default,
Language: Afrikaans.  I can't figure out how to change this.  Under LyX:
Preferences, the Default language is English.  Under Document Settings,
Language is English, and encoding is Language Default.  I don't know what
else to do. Could someone help me out please?

-Gwen


SV: Error in Latex output, LyX adds an extra brace

2011-02-24 Thread Ingar Pareliussen
Hi

> I think this is a bug in LaTeX rather than LyX, especially (1)+(2a). I
> googled
> for a (LaTeX) workaround, but I can't see one.

Yes, you are right, it is a LaTeX error, I was blinded by the errormsg.

Anyhow this is LyX, and LyX makes LaTeX code that do not compile
if you make some unwise choices. I guess we could say that you should not
make these choices, which is the easiest way :).

However, if we could get LyX to end the environments before starting the 
marginpar the problem would go away. 

Contrast the LaTeX code outputed by LyX, which does not work:

\paragraph{\emph{Elymus foliis mucronato-pungentibus, s. Elymus arenarius. 
}\textmd{\emph{}}%
\protect\marginpar{
\paragraph{\textmd{\emph{\small Leymus arenarius}}}%
}}

With my hand written one that does work, (the only difference is that I moved 
the
brace to end the paragraph before I start the marginpar):

\paragraph{\emph{Elymus foliis mucronato-pungentibus, s. Elymus arenarius. 
}\textmd{\emph{}}}% <--extra brace here
\protect\marginpar{
\paragraph{\textmd {\emph{\small Leymus arenarius}}}%
} %<-- one less brace here

I am not a programmer and do not understand the LaTeX "lexer", however, I 
understand that this might be difficult to accomplish and thus I leave it to
the programmers to decide if this is something that happens so often
that we should use time to fix it.

yours,
Ingar Pareliussen.  


Re: Error in Latex output, LyX adds an extra brace

2011-02-24 Thread Jim Oldfield


> From: Jim Oldfield 

> > From: Ingar Pareliussen 
> >  I am working on a large document and there seem to be an error where  LyX  
>adds 
>
> >an extra brace to the LaTeX code. Removing the margin note from  the  
> >paragraph-environment fixes the error, so the workaround is  easy. However, 
> >I  
>
> >think this is an error, should I report it the  bugtracker?
> 
> However, changing the inner layout to standard doesn't seem to fix the  error.

Sorry, it *does* fix the error. By the time I tried this, I'd put a paragraph 
break in the margin note while I was messing around (now using "paragraph" in 
the sense of "any old paragraph of text" sense!).

It seems that there is a LaTeX error if:
 (1) You have a margin note in a heading environment (chapter, section, 
paragraph, etc)
 AND (2) you have EITHER:
   (2a) More than one (plain old) paragraph in the margin note
   OR (2b) You have an environment in the margin note (including headings such 
as paragraph, and lists such as itemize).

I think this is a bug in LaTeX rather than LyX, especially (1)+(2a). I googled 
for a (LaTeX) workaround, but I can't see one.

Jim 





Re: Error in Latex output, LyX adds an extra brace

2011-02-24 Thread Jim Oldfield




> From: Ingar Pareliussen 
> I am working on a large document and there seem to be an error where  LyX 
> adds 
>an extra brace to the LaTeX code. Removing the margin note from the  
>paragraph-environment fixes the error, so the workaround is easy. However, I  
>think this is an error, should I report it the bugtracker?


LyX is correctly matching braces. The error is misleading, it's an internal 
LaTeX error. 

Before I say more, let me point out a common cause of confusion: "paragraph" 
layout does not mean any old paragraph, it means paragraph **heading** (in the 
same way that section/chapter/etc layouts mean the headings for these, not 
their 
entire content). So it changes the formatting a bit, and also indicates that a 
(very small) logical unit of text is about to follow.

So, you should not be using a paragraph layout *inside* a marginal note, as you 
are in this document, in the same way you wouldn't put a chapter heading in a 
marginal note (well, you can, but you have to do special things). If you just 
like how this environment makes things bold you should be doing something else, 
not using heading layouts. You can ask on this list for help. 

However, changing the inner layout to standard doesn't seem to fix the error. 
On 
the other hand, changing the *outer* layout to standard does fix it, as you 
say. 
Since you *should* be able to have a marginal note in a paragraph heading (or 
section heading, etc), this is a bit strange. This problem doesn't happen to me 
in a fresh document, so I think something in your document's preamble or 
settings is having an effect here. I don't have time to look at it right now 
though.

Jim