Re: Different textclasses warning

2018-09-25 Thread Daniel

On 25/09/2018 18:16, Richard Kimberly Heck wrote:

On 9/25/18 10:21 AM, Daniel wrote:

Hi

When a document with a child document with different textclass is
typeset LyX warns about this. I am wondering why that is since as far
as I understood the child document does not incorporate any class
information into the master document. So, is this warning because I
could have used commands incompatible with the master document, like
chapter when the master is an article?


Yes.


But then LyX would warn me anyway, or?


What do you mean? When might it warn you otherwise?


For example, if I compile an article master with a child book that has a 
chapter, then LyX will throw an "undefined control sequence" error.


Also, I find LyX's extra warning about the textclass a bit misleading. 
There seems to be nothing special about having another textclass 
compared to, say, using other modules. LyX does not create an extra 
warning in the latter case but the problem might be basically the same.


Daniel



Re: Graceful beamer <-> beamerarticle transition; help with conditional preamble code?

2018-09-25 Thread Paul A. Rubin

On 09/25/2018 04:08 PM, Paul Johnson wrote:

This seems like my LyX day to ask questions. Thanks for your help.

We have some instructional web pages that have accompanying Beamer
slides. It is a hassle to edit the web page and the Beamer slides,
content goes out of sync.

The idea hit me to write one document that can be exported as Beamer
Slides or as a Beamer Article.  I've explored the details quite a bit
and the process almost works smoothly. My preamble for slides has a
lot of customized settings and LyX does not gracefully convert from
Beamer slides to Beamer article as a result. I manually insert some
code... I need the \mode<> statements to adjust for the output format.
I control input for each format with \mode{} and
\mode{}.  I find the back-and-forth transition mostly works.

However, there is one piece of conditional code where I need your
help. A Beamer slide document  is declared like so

\documentclass[english]{beamer}

Because beamer is the class, then "\mode" is immediately available.

However, the Beamer article is declared as an article:

\documentclass[english]{article}

Because the \mode macro is not available yet, I am not able to
conditionalize setup statements for the article. I want to take the
"BeamerArticle" preamble code and wrap inside \mode:


\mode{
\makeatletter
% Textclass specific LaTeX commands.
\usepackage{beamerarticle,pgf}
% this default might be overridden by plain title style
\newcommand\makebeamertitle{\frame{\maketitle}}%
\AtBeginDocument{
\let\origtableofcontents=\tableofcontents
\def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
\def\gobbletableofcontents#1{\origtableofcontents}
}
\makeatother
}

That fails, pdflatex error:

\mode{
The control sequence at the end of the top line of your error message
was never \def'ed.

Well, that should happen. "\mode" is an unrecognized symbol in the
article document. I can't have any \mode or
\mode settings until "\usepackage{beamerarticle}" package is
loaded.

I need to write a conditional statement like "if this document is not
a Beamer slide document, then include the following code" to fix the
problem. That's where I'm stuck at the current time.

pj

Have you tried using the other Beamer article layout (listed in the 
document settings as "Beamer Article (KOMA-script)", using the 
scrarticle-beamer.layout layout file? I just tried it, and \mode seems 
to be defined.


Paul Rubin



Graceful beamer <-> beamerarticle transition; help with conditional preamble code?

2018-09-25 Thread Paul Johnson
This seems like my LyX day to ask questions. Thanks for your help.

We have some instructional web pages that have accompanying Beamer
slides. It is a hassle to edit the web page and the Beamer slides,
content goes out of sync.

The idea hit me to write one document that can be exported as Beamer
Slides or as a Beamer Article.  I've explored the details quite a bit
and the process almost works smoothly. My preamble for slides has a
lot of customized settings and LyX does not gracefully convert from
Beamer slides to Beamer article as a result. I manually insert some
code... I need the \mode<> statements to adjust for the output format.
I control input for each format with \mode{} and
\mode{}.  I find the back-and-forth transition mostly works.

However, there is one piece of conditional code where I need your
help. A Beamer slide document  is declared like so

\documentclass[english]{beamer}

Because beamer is the class, then "\mode" is immediately available.

However, the Beamer article is declared as an article:

\documentclass[english]{article}

Because the \mode macro is not available yet, I am not able to
conditionalize setup statements for the article. I want to take the
"BeamerArticle" preamble code and wrap inside \mode:


\mode{
\makeatletter
% Textclass specific LaTeX commands.
\usepackage{beamerarticle,pgf}
% this default might be overridden by plain title style
\newcommand\makebeamertitle{\frame{\maketitle}}%
\AtBeginDocument{
\let\origtableofcontents=\tableofcontents
\def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
\def\gobbletableofcontents#1{\origtableofcontents}
}
\makeatother
}

That fails, pdflatex error:

\mode{
The control sequence at the end of the top line of your error message
was never \def'ed.

Well, that should happen. "\mode" is an unrecognized symbol in the
article document. I can't have any \mode or
\mode settings until "\usepackage{beamerarticle}" package is
loaded.

I need to write a conditional statement like "if this document is not
a Beamer slide document, then include the following code" to fix the
problem. That's where I'm stuck at the current time.

pj

-- 
Paul E. Johnson   http://pj.freefaculty.org
Director, Center for Research Methods and Data Analysis http://crmda.ku.edu

To write to me directly, please address me at pauljohn at ku.edu.


user interface bug latin9 -> Unicode

2018-09-25 Thread Paul Johnson
This looks like a bug to me.

Create a new empty article and use the Insert Symbol tool to put in
some miscellaneous smiley faces and what not. This is the source view
of the file, which does compile.:

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{wasysym}
\usepackage{babel}
\begin{document}
\frownie \smiley \blacksmiley \sun{}
\end{document}

Then I went into Settings -> Language and changed input to utf-8.

That had the effect of automatically replacing \frownie and \smiley
with unicode symbols in the LaTeX source, like so:

\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{wasysym}
\usepackage{babel}
\begin{document}
☹☺☻☼
\end{document}

That does not compile, rather the error messages say:

Package inputenc Error: Unicode char ☹ (U+2639)
Package inputenc Error: Unicode char ☺ (U+263A)
Package inputenc Error: Unicode char ☻ (U+263B)
Package inputenc Error: Unicode char ☼ (U+263C)

My thought was that LyX should not replace \frownie with ☹ unless the
document would otherwise compile correctly.

I had not too much understanding of Unicode when I started to look
into this.  I found several ways to deal with this. The easiest is to
simply put "\frownie" and "\smiliey" back in the document. So far as I
can see, there's no real benefit to me that those things are entered
as ☹ symbol. I can understand, however, that when authors need to
enter letters with accents, then they have a more pressing need to
make this work.

I wrote out ways this can be corrected, with preamble adjustments
using either DeclareUnicodeCharacter or newunicodechar, on
Stackexchange 
(https://tex.stackexchange.com/questions/452494/lost-my-smilies-it-is-worth-the-effort-to-make-unicode-work),
we'll see what they say about it. I'm predicting the answer will be
"learn the ins and outs of xelatex".

But I do think it is a LyX bug that Unicode symbols are introduced but
can't be compiled.

I'm interested to hear your ideas.

pj

-- 
Paul E. Johnson   http://pj.freefaculty.org
Director, Center for Research Methods and Data Analysis http://crmda.ku.edu

To write to me directly, please address me at pauljohn at ku.edu.


Re: Different textclasses warning

2018-09-25 Thread Richard Kimberly Heck
On 9/25/18 10:21 AM, Daniel wrote:
> Hi
>
> When a document with a child document with different textclass is
> typeset LyX warns about this. I am wondering why that is since as far
> as I understood the child document does not incorporate any class
> information into the master document. So, is this warning because I
> could have used commands incompatible with the master document, like
> chapter when the master is an article?

Yes.

> But then LyX would warn me anyway, or? 

What do you mean? When might it warn you otherwise?

Riki





Re: replace all

2018-09-25 Thread Paul A. Rubin

On 09/25/2018 03:54 AM, Patrick Dupre wrote:

OK Paul,

I made a sort file and tested the "replace all"
It works, but, it leaves the spellchecker mode at the end,
while it could have kept it open, by
1) dealing with the next occurrence to potentially correct (keeping in mind
that it will have to deal with all the replacements previously asked),
or
2) dealing with all the replacements (like it does now), and then returning to the 
"beginning"
of the document to deal to the next occurrence.

Too complicate?

I see what you mean. I agree with you. Once opened, the spelling check 
window should remain open until the user closes it (or at least until 
all errors are fixed). I made a little test document with three 
occurrences of one error and one occurrence of a different error. After 
doing a global replace to fix the first problem, the dialog closed, 
leaving the second error still present.


Personally, I think it would be fine to close the window when there are 
no errors left. I just filed a bug ticket on this 
(https://www.lyx.org/trac/ticket/11310). If you disagree about closing 
the dialog when the document is error-free (according to the spellcheck 
engine and current dictionaries), feel free to attach a comment to the 
ticket.


Paul


Different textclasses warning

2018-09-25 Thread Daniel

Hi

When a document with a child document with different textclass is 
typeset LyX warns about this. I am wondering why that is since as far as 
I understood the child document does not incorporate any class 
information into the master document. So, is this warning because I 
could have used commands incompatible with the master document, like 
chapter when the master is an article? But then LyX would warn me 
anyway, or? So I am wondering whether I am missing something important 
or whether I could just ignore the warning.


Daniel



Re: issue with bibliography

2018-09-25 Thread Paul A. Rubin

On 09/25/2018 03:43 AM, Patrick Dupre wrote:

OK,

Thank,

It works, even for elsarticle!

Anyway, is it considered as a bug?

My Best.


My guess is that it's a feature. I presume that someone designed those 
layout files to use whatever bibliographic standards the corresponding 
journals use. That said, it would be nice if class defaults, 
bibliographic choices etc. specified in a layout file were exposed in 
the document settings dialog (as if a user had typed them in), so that 
they could be overridden more easily.


Paul



Re: replace all

2018-09-25 Thread Dr Eberhard Lisse
On 2.3.1, Mac 10.13.6 it shows same behavior.

el


On 25/09/2018 09:54, Patrick Dupre wrote:
> OK Paul,
> 
> I made a sort file and tested the "replace all"
> It works, but, it leaves the spellchecker mode at the end,
> while it could have kept it open, by
> 1) dealing with the next occurrence to potentially correct (keeping in mind
> that it will have to deal with all the replacements previously asked),
> or
> 2) dealing with all the replacements (like it does now), and then returning 
> to the "beginning"
> of the document to deal to the next occurrence.
> 
> Too complicate?
> 
> Regards.
[...]
>> Sent: Tuesday, September 25, 2018 at 12:07 AM
>> From: "Paul A. Rubin" 
>> To: lyx-users@lists.lyx.org
>> Subject: Re: replace all
>>
>> On 09/24/2018 03:15 PM, Patrick Dupre wrote:
>>> Hello,
>>>
>>> Using the spellchecker (F7), it seems that the option "replace all"
>>> does not work. It just leaves the mode.
>>>
>>>
>> It works for me. Can you give specific steps that lead to failure?
>>
>> Paul
>>
>>
> 



Re: replace all

2018-09-25 Thread Patrick Dupre
OK Paul,

I made a sort file and tested the "replace all"
It works, but, it leaves the spellchecker mode at the end,
while it could have kept it open, by
1) dealing with the next occurrence to potentially correct (keeping in mind
that it will have to deal with all the replacements previously asked),
or
2) dealing with all the replacements (like it does now), and then returning to 
the "beginning"
of the document to deal to the next occurrence.

Too complicate?

Regards.

===
 Patrick DUPRÉ | | email: pdu...@gmx.com
 Laboratoire de Physico-Chimie de l'Atmosphère | |
 Université du Littoral-Côte d'Opale   | |
 Tel.  (33)-(0)3 28 23 76 12   | | Fax: 03 28 65 82 44
 189A, avenue Maurice Schumann | | 59140 Dunkerque, France
===


> Sent: Tuesday, September 25, 2018 at 12:07 AM
> From: "Paul A. Rubin" 
> To: lyx-users@lists.lyx.org
> Subject: Re: replace all
>
> On 09/24/2018 03:15 PM, Patrick Dupre wrote:
> > Hello,
> >
> > Using the spellchecker (F7), it seems that the option "replace all"
> > does not work. It just leaves the mode.
> >
> >
> It works for me. Can you give specific steps that lead to failure?
> 
> Paul
> 
>


Re: issue with bibliography

2018-09-25 Thread Patrick Dupre
OK,

Thank,

It works, even for elsarticle!

Anyway, is it considered as a bug?

My Best.

===
 Patrick DUPRÉ | | email: pdu...@gmx.com
 Laboratoire de Physico-Chimie de l'Atmosphère | |
 Université du Littoral-Côte d'Opale   | |
 Tel.  (33)-(0)3 28 23 76 12   | | Fax: 03 28 65 82 44
 189A, avenue Maurice Schumann | | 59140 Dunkerque, France
===


> Sent: Tuesday, September 25, 2018 at 12:06 AM
> From: "Paul A. Rubin" 
> To: lyx-users@lists.lyx.org
> Subject: Re: issue with bibliography
>
> On 09/24/2018 02:22 PM, Patrick Dupre wrote:
> > Hello,
> >
> > I have a file that I created with yje class revtex 4.1
> > Then, I changed to elsevier
> >
> > At the same time it change the bibliography style
> > Here is the difference:
> >
> > < \textclass revtex4-1
> > ---
> >> \textclass elsarticle
> > < \cite_engine_type default
> > ---
> >> \cite_engine_type authoryear
> > This creates real problems when I compile.
> > Hence, I returned to revtex 4.1
> > but lyx keeps the bibliography style
> >
> > < \cite_engine_type default
> > < \biblio_style plain
> > ---
> >> \cite_engine_type authoryear
> >> \biblio_style plainnat
> > There is no way to get rid of the plainnat (and go back to plain)
> > Actually, when I try to change it to plan, it seems that it is done, but it 
> > is never really applied.
> >
> > Question.
> > How can I return to plan style, without the variant Author-year?
> > Actually, I cannot remove this option.
> >
> > It seems that this issue appears with version 2.3.0 (I am still using it 
> > because,
> > it has not been updated by fedora 28).
> >
> >
> > Thank.
> >
> The layout files for both revtex4-1 and elsarticle specify use of 
> natbib. For revtex4-1, at least, I can propose a fix. In Document > 
> Settings, go to Local Layout, enter "Provides natbib-internal 0" 
> (without the quotes), validate and then apply it. Still in the settings 
> dialog, go to Bibliography and switch the Style format drop-down (which 
> should now give you several choices).
> 
> This does not work with elsarticle. I suspect it is because the layout 
> file for elsarticle specifies natbib.sty as a class option. Someone who 
> knows more about this than I do may know a way to override that in Local 
> Layout, but I don't. Another possibility, if you really want to use 
> elsarticle, is to copy the layout file to your local layouts folder, 
> open it in a text editor, and strip out any references to natbib. You 
> might also want to give it a different file name and a different name in 
> the \DeclareLaTeXClass command (such as "My Elsevier") to distinguish it 
> from the original.
> 
> Paul
> 
>