Re: Code listings in colored boxes

2018-04-04 Thread Scott Kostyshak
On Wed, Apr 04, 2018 at 05:27:34PM +, Kornel Benko wrote:

> Wow! This attached document would be pretty good as a lyx-preface.

Lloyd almost makes it feel like we are on an adventure! It has the
perfect mix of humor, information, and beautiful writing. Well done!

Scott


signature.asc
Description: PGP signature


Re: Code listings in colored boxes

2018-04-04 Thread Scott Kostyshak
On Wed, Apr 04, 2018 at 04:30:35PM +, ll...@writersglen.com wrote:
> Hello,
> 
> Just a note of hearty thanks to all for support of Lyx and Lyx users. And an 
> apology if I inadvertently abused list etiquette.

I don't think you did. I am just picky and do not like to leave threads
hanging without knowing whether they're solved or not.

> I've attached a piece that I wrote to document the solution to the code 
> listing problem that I posed on the list. I never would have found the 
> solution without the lyx-users list and the generous help of Paul Rubin.

As you put in your PDF, Paul is indeed a LyX wizard! He has helped many
users find their way.

Scott


signature.asc
Description: PGP signature


Re: Code listings in colored boxes

2018-04-04 Thread Kornel Benko
Am Mittwoch, 4. April 2018 12:30:35 CEST schrieb ll...@writersglen.com:
> Hello,
> 
> Just a note of hearty thanks to all for support of Lyx and Lyx users. And an
> apology if I inadvertently abused list etiquette.
> 
> I've attached a piece that I wrote to document the solution to the code
> listing problem that I posed on the list. I never would have found the
> solution without the lyx-users list and the generous help of Paul Rubin.
> 
> Thanks again,
> 
> Lloyd R. Prentice
> 
> 
> -Original Message-
> From: "Scott Kostyshak" 
> Sent: Wednesday, April 4, 2018 11:49am
> To: "Paul A. Rubin" 
> Cc: lyx-users@lists.lyx.org, ll...@writersglen.com
> Subject: Re: Code listings in colored boxes
> 
> On Wed, Apr 04, 2018 at 12:56:33PM +, Paul A. Rubin wrote:
> > Sorry. Lloyd got back to me directly and we sorted it out off the list. I
> > meant to come back and close the thread but forgot.
> 
> No problem! Thanks for the update. Good job figuring out the issue. I
> will let this thread rest peacefully now.
> 
> Scott

Wow! This attached document would be pretty good as a lyx-preface.

Kornel

signature.asc
Description: This is a digitally signed message part.


Re: Code listings in colored boxes

2018-04-04 Thread Scott Kostyshak
On Wed, Apr 04, 2018 at 12:56:33PM +, Paul A. Rubin wrote:

> Sorry. Lloyd got back to me directly and we sorted it out off the list. I
> meant to come back and close the thread but forgot.

No problem! Thanks for the update. Good job figuring out the issue. I
will let this thread rest peacefully now.

Scott


signature.asc
Description: PGP signature


Re: Code listings in colored boxes

2018-04-04 Thread Paul A. Rubin

On 04/03/2018 10:28 PM, Scott Kostyshak wrote:

On Sun, Feb 25, 2018 at 12:49:47AM +, Paul A. Rubin wrote:

On 02/24/2018 02:40 PM, ll...@writersglen.com wrote:

Hello,

I've been struggling to format attractive code listings. The boxes in
the attached mini-lyx document show my feeble attempts so far.

Box 2 is close to what I want, but has numerous problems:

1. Rather than red and white, I'd want black and light gray

2. I'd like width to be full width of text area of my page

3. I'd to use \listno\ in header, but get this error message when I try:

File ended while scanning use of \codelist.

<*> listno.tex

*** (job aborted, no legal \end found)

4. If I try to add a second code listing I get error messages or a
broken box depending upon how I try to terminate the first list
specification

5. I'd like to use a monospace font in the code area that has both
normal and bold face

Most of all, I'd like to understand how to gain programming control over
the appearance of my code list boxes. I've been studying the tcolorbox
manual. But when I try to change parameters in the lyx preamble nothing
seems to change. So I'm guessing there's a lyx issue I'm ignorant of.

I'd much appreciate any and all tips to help solve these issues.

Many thanks,

Lloyd R. Prentice


[I screwed up and replied privately rather than to the list, so I'm
repeating the reply here.]

Lloyd,

There are a couple of problems with your MWE. One is that it won't compile
due to a typo. In the TeX box after "More code", you have a left parenthesis
where you need a left brace. The other is that you seem to be using a
nonstandard document class. It's a good idea to keep MWEs as vanilla as
possible.

To make the background for the text in your code box more gray, ratchet up
the "5" in colback settings. Right now you have gray!5!white, which is a mix
of 5% gray and 95% white. Try something like 25 rather than 5.

I believe the specification red!1175!black for the colframe parameter is
illegal; the xcolor package wants numbers between 0 and 100. Since I'm not
sure what you're going for here, I can't make a useful suggestion, other
than to say the closer you get to 0 (100) the more red (black) you get in
the mix.

If you want the box header to have a pure black background, add
"colbacktitle=black" to the definition of the box.

To get full text width, you may need to use \newtcolorbox rather than
\newtcbox (which does not seem to like the width option). That will mean
using \begin{my box name} and \end{my box name} to create the box. The extra
option you give in the definition of the color box is "width=\textwidth".

An easier approach, in my opinion, is to use the features of the LyX module
to define a custom color box. I've attached a hacked copy of your file,
changing the document type to plain old book, fiddling a bit with your
preamble (while noting that the color box stuff in the preamble won't be
needed at all if you use the module features), and demonstrating the custom
color box feature from the module.

As for your other questions, it's dinner time here, so you're on your own.
Hopefully someone else will pick up the thread.

Paul

I'm CC'ing Lloyd. Since I did not see a reply, I'm guessing that he did
not receive the email.

Scott
Sorry. Lloyd got back to me directly and we sorted it out off the list. 
I meant to come back and close the thread but forgot.


Paul



Re: LyX 2.3.0 and tables with footnotes

2018-04-04 Thread Niklas Huldén



On 04.04.2018 12:01, Stephan Witt wrote:

Am 04.04.2018 um 10:36 schrieb Andrew Parsloe :


On 4/04/2018 6:15 p.m., Niklas Huldén wrote:

On 03.04.2018 20:58, Paul A. Rubin wrote:

On 04/03/2018 12:38 PM, Niklas Huldén wrote:

Den 03-04-2018 kl. 18:51, skrev Paul A. Rubin:

On 04/03/2018 10:55 AM, Niklas Huldén wrote:

Hello all!

I am testing LyX 2.3.0 on windows 10 with MikTex 2.9. I have some old tables with 
footnotes inside them which used to line up fine with the table using the "minipage 
trick" putting the table in a minipage (whitout the caption).
In LyX 2.3.0 this results in the footnote becoming an ordinary footnote, which makes it 
hard to keep tables and footnotes on the same page. But I understand this is a feature 
now. Is there any way to "emulate" the old behavior? I include a MWF and two 
screenshots.

Thanks and all the best!
Niklas

You could add \renewcommand{\tablefootnote}{\footnote} to the document 
preamble. (If you do this a lot, you might want to cobble together a module for 
it.)

Paul


Thank you Paul! This works fine and takes me out of immediate danger zone. I 
guess a module would be a good idea in the long run.

A somewhat linked issue is that I get an error message if I use the rotate package in a 
LyX file that uses tablefootnotes: "Package tablefootnote Error: Package rotating 
loaded after tablefootnote."

Hard to find a place to load rotate before the tablefootnote though.

Many thanks again!

Niklas


Niklas,

I've attached a module. Try putting it in your local layouts folder 
(~/.lyx/layouts on most Linux systems), then reconfigure LyX, add it to your 
document (and do /not/ add the \renewcommand line in the preamble), then see if 
you get the desired results (including using the rotate package).

Cheers,
Paul


Hello,

Thank you Paul! I placed the module in (windows 10) 
"c:\Users\myselfwhatever\AppData\Local\LyX 2.3\Resources\layouts\ and 
reconfigured but could not find any module in restarted LyX. This might have 
something to do with my Windows configuration.

I then placed it in "c:\Program Files (x86)\LyX 2.3\Resources\layouts\" as 
administrator, reconfigured and now it is available in document settings/modules. 
Everything works including getting rid of the rotating error message :)

I will try it in my Mac tonight.

All the best!
Niklas


On Windows 7 the module should go to "C:\Users\\AppData\Roaming\LyX2.3\layouts\".  I would expect this to be the same on Windows 10. The 
"c:\Program Files (x86)\LyX 2.3\Resources\layouts\" location should be left for layouts and 
modules of the official LyX distribution. When LyX 2.3.1 comes out and you upgrade, this folder will be 
overwritten and Paul's module will be lost (unless it gets incorporated into the official LyX distro.).

Andrew


The correct path name for the user configuration directory is
shown in the About LyX dialog. Probably there is a missing or
an additional space in path name here.


Hi!

Yes of course. The path should be "C:\Users\name>\AppData\Roaming\LyX2.3\". I was too quick and put it in 
~\local\Lyx2.3\Resourses in mistake. I now removed it från c:\Program 
Files (x86)\LyX 2.3\Resources\layouts\", reconfigured and all is well.


Thanks

Niklas


On Mac the directory path name should contain LyX-2.3, BTW.

Stephan



Re: LyX 2.3.0 and tables with footnotes

2018-04-04 Thread Stephan Witt
Am 04.04.2018 um 10:36 schrieb Andrew Parsloe :
> 
> On 4/04/2018 6:15 p.m., Niklas Huldén wrote:
>> On 03.04.2018 20:58, Paul A. Rubin wrote:
>>> On 04/03/2018 12:38 PM, Niklas Huldén wrote:
 Den 03-04-2018 kl. 18:51, skrev Paul A. Rubin:
> On 04/03/2018 10:55 AM, Niklas Huldén wrote:
>> Hello all!
>> 
>> I am testing LyX 2.3.0 on windows 10 with MikTex 2.9. I have some old 
>> tables with footnotes inside them which used to line up fine with the 
>> table using the "minipage trick" putting the table in a minipage 
>> (whitout the caption).
>> In LyX 2.3.0 this results in the footnote becoming an ordinary footnote, 
>> which makes it hard to keep tables and footnotes on the same page. But I 
>> understand this is a feature now. Is there any way to "emulate" the old 
>> behavior? I include a MWF and two screenshots.
>> 
>> Thanks and all the best!
>> Niklas
> You could add \renewcommand{\tablefootnote}{\footnote} to the document 
> preamble. (If you do this a lot, you might want to cobble together a 
> module for it.)
> 
> Paul
> 
 Thank you Paul! This works fine and takes me out of immediate danger zone. 
 I guess a module would be a good idea in the long run.
 
 A somewhat linked issue is that I get an error message if I use the rotate 
 package in a LyX file that uses tablefootnotes: "Package tablefootnote 
 Error: Package rotating loaded after tablefootnote."
 
 Hard to find a place to load rotate before the tablefootnote though.
 
 Many thanks again!
 
 Niklas
 
>>> Niklas,
>>> 
>>> I've attached a module. Try putting it in your local layouts folder 
>>> (~/.lyx/layouts on most Linux systems), then reconfigure LyX, add it to 
>>> your document (and do /not/ add the \renewcommand line in the preamble), 
>>> then see if you get the desired results (including using the rotate 
>>> package).
>>> 
>>> Cheers,
>>> Paul
>>> 
>> Hello,
>> 
>> Thank you Paul! I placed the module in (windows 10) 
>> "c:\Users\myselfwhatever\AppData\Local\LyX 2.3\Resources\layouts\ and 
>> reconfigured but could not find any module in restarted LyX. This might have 
>> something to do with my Windows configuration.
>> 
>> I then placed it in "c:\Program Files (x86)\LyX 2.3\Resources\layouts\" as 
>> administrator, reconfigured and now it is available in document 
>> settings/modules. Everything works including getting rid of the rotating 
>> error message :)
>> 
>> I will try it in my Mac tonight.
>> 
>> All the best!
>> Niklas
>> 
> On Windows 7 the module should go to "C:\Users\ name>\AppData\Roaming\LyX2.3\layouts\".  I would expect this to be the same 
> on Windows 10. The "c:\Program Files (x86)\LyX 2.3\Resources\layouts\" 
> location should be left for layouts and modules of the official LyX 
> distribution. When LyX 2.3.1 comes out and you upgrade, this folder will be 
> overwritten and Paul's module will be lost (unless it gets incorporated into 
> the official LyX distro.).
> 
> Andrew

The correct path name for the user configuration directory is
shown in the About LyX dialog. Probably there is a missing or
an additional space in path name here.

On Mac the directory path name should contain LyX-2.3, BTW.

Stephan

Re: LyX 2.3.0 and tables with footnotes

2018-04-04 Thread Jürgen Spitzmüller
2018-04-03 17:54 GMT+02:00 Scott Kostyshak :

> By the way, I think there are two questions here: 1. do we want to
> change the output of 2.2.x files? and 2. do we want the behavior in new
> 2.3.x-created files to be different? I would guess the answer to 2. is
> yes it is expected. I'm not sure about 1.
>

We should not do the tablefootnote thing if the table is in a minipage.
That was an oversight when we implemented table footnote support.

I'll fix that.

Jürgen


>
> Best,
>
> Scott
>


Re: LyX 2.3.0 and tables with footnotes

2018-04-04 Thread Andrew Parsloe



On 4/04/2018 6:15 p.m., Niklas Huldén wrote:

On 03.04.2018 20:58, Paul A. Rubin wrote:

On 04/03/2018 12:38 PM, Niklas Huldén wrote:

Den 03-04-2018 kl. 18:51, skrev Paul A. Rubin:

On 04/03/2018 10:55 AM, Niklas Huldén wrote:

Hello all!

I am testing LyX 2.3.0 on windows 10 with MikTex 2.9. I have some 
old tables with footnotes inside them which used to line up fine 
with the table using the "minipage trick" putting the table in a 
minipage (whitout the caption).
In LyX 2.3.0 this results in the footnote becoming an ordinary 
footnote, which makes it hard to keep tables and footnotes on the 
same page. But I understand this is a feature now. Is there any 
way to "emulate" the old behavior? I include a MWF and two 
screenshots.


Thanks and all the best!
Niklas
You could add \renewcommand{\tablefootnote}{\footnote} to the 
document preamble. (If you do this a lot, you might want to cobble 
together a module for it.)


Paul

Thank you Paul! This works fine and takes me out of immediate danger 
zone. I guess a module would be a good idea in the long run.


A somewhat linked issue is that I get an error message if I use the 
rotate package in a LyX file that uses tablefootnotes: "Package 
tablefootnote Error: Package rotating loaded after tablefootnote."


Hard to find a place to load rotate before the tablefootnote though.

Many thanks again!

Niklas


Niklas,

I've attached a module. Try putting it in your local layouts folder 
(~/.lyx/layouts on most Linux systems), then reconfigure LyX, add it 
to your document (and do /not/ add the \renewcommand line in the 
preamble), then see if you get the desired results (including using 
the rotate package).


Cheers,
Paul


Hello,

Thank you Paul! I placed the module in (windows 10) 
"c:\Users\myselfwhatever\AppData\Local\LyX 2.3\Resources\layouts\ and 
reconfigured but could not find any module in restarted LyX. This 
might have something to do with my Windows configuration.


I then placed it in "c:\Program Files (x86)\LyX 
2.3\Resources\layouts\" as administrator, reconfigured and now it is 
available in document settings/modules. Everything works including 
getting rid of the rotating error message :)


I will try it in my Mac tonight.

All the best!
Niklas

On Windows 7 the module should go to "C:\Users\name>\AppData\Roaming\LyX2.3\layouts\".  I would expect this to be the 
same on Windows 10. The "c:\Program Files (x86)\LyX 
2.3\Resources\layouts\" location should be left for layouts and modules 
of the official LyX distribution. When LyX 2.3.1 comes out and you 
upgrade, this folder will be overwritten and Paul's module will be lost 
(unless it gets incorporated into the official LyX distro.).


Andrew


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus