Re: Command to put string in both the LyX authoring environment and the finished PDF?

2021-06-22 Thread Steve Litt
Richard Kimberly Heck said on Tue, 22 Jun 2021 11:16:56 -0400


>>
>> I changed the [0] number of arguments in the LaTeX command to [1] in
>> order to consume the argument. Once I did that, whatever I put in the
>> character style does not show up in the PDF.  
>
>There's a long-standing request for non-math macros, which is exactly
>what's needed here. Someday when I have time to work on LyX again, I
>might take that on.

Nice!


SteveT

Steve Litt 
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Command to put string in both the LyX authoring environment and the finished PDF?

2021-06-22 Thread Richard Kimberly Heck
On 6/22/21 10:05 AM, Steve Litt wrote:
> Steve Litt said on Sun, 20 Jun 2021 17:39:52 -0400
>
>> Hi all,
>>
>> I have a local layout, based on Book-extsizes, for my new book. I have
>> no idea what the book's title will be yet, and I sure nuff don't want
>> to have to search all instances of that title and replace them every
>> time I get a better idea for the title.
>>
>> S, what I want to do is put something in my local layout to
>> articulate the title, both in the LyX authoring environment and in the
>> compiled PDF, showing the title in a specific appearance. I tried to do
>> it as a character style, as follows:
>>
>> 
>> \definecolor{titlebodytextcolor}{HTML}{cc}
>>
>> % ### Character style for book title within body text
>> \newcommand{\chartitlebodytextL}[0]{{\color{titlebodytextcolor}My
>> Current Title As Of Today}}%
>>
>> CharStyle CharTitleInBody
>> Font
>>  Series  Bold
>>  Color   Red
>> EndFont
>> LabelFont
>>  Series  Bold
>>  SizeLarger
>>  Color   Red
>> EndLabelFont
>> LatexNamechartitlebodytextL
>> LatexTypeCommand
>> LabelString "My Current Title As Of Today"
>> End
>> 
>>
>> If I apply the character style CharTitleInBody to an empty string in
>> LyX, the exact right thing happens in the PDF, but in the LyX
>> authoring environment the title appears under the character style inset
>> and also under the following text, which is very disturbing if you're
>> trying to copy-edit your book in the LyX environment.
>>
>> Does anybody know what I can do to make the text appear inline, instead
>> of underneath, within the LyX authoring environment?
> My workaround is as follows:
>
> I changed the [0] number of arguments in the LaTeX command to [1] in
> order to consume the argument. Once I did that, whatever I put in the
> character style does not show up in the PDF.

There's a long-standing request for non-math macros, which is exactly
what's needed here. Someday when I have time to work on LyX again, I
might take that on.

Riki


-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Command to put string in both the LyX authoring environment and the finished PDF?

2021-06-22 Thread Steve Litt
Steve Litt said on Sun, 20 Jun 2021 17:39:52 -0400

>Hi all,
>
>I have a local layout, based on Book-extsizes, for my new book. I have
>no idea what the book's title will be yet, and I sure nuff don't want
>to have to search all instances of that title and replace them every
>time I get a better idea for the title.
>
>S, what I want to do is put something in my local layout to
>articulate the title, both in the LyX authoring environment and in the
>compiled PDF, showing the title in a specific appearance. I tried to do
>it as a character style, as follows:
>
>
>\definecolor{titlebodytextcolor}{HTML}{cc}
>
>% ### Character style for book title within body text
>\newcommand{\chartitlebodytextL}[0]{{\color{titlebodytextcolor}My
>Current Title As Of Today}}%
>
>CharStyle CharTitleInBody
>Font
>   Series  Bold
>   Color   Red
>EndFont
>LabelFont
>   Series  Bold
>   SizeLarger
>   Color   Red
>EndLabelFont
>LatexName  chartitlebodytextL
>LatexType  Command
>LabelString "My Current Title As Of Today"
>End
>
>
>If I apply the character style CharTitleInBody to an empty string in
>LyX, the exact right thing happens in the PDF, but in the LyX
>authoring environment the title appears under the character style inset
>and also under the following text, which is very disturbing if you're
>trying to copy-edit your book in the LyX environment.
>
>Does anybody know what I can do to make the text appear inline, instead
>of underneath, within the LyX authoring environment?

My workaround is as follows:

I changed the [0] number of arguments in the LaTeX command to [1] in
order to consume the argument. Once I did that, whatever I put in the
character style does not show up in the PDF.

Next, I changed the LyX label font size from Larger to Small, so it
wouldn't take up as much line length. Finally, I put a bunch of z
characters in the inset, so the inset and the label would be
approximately the same length. What this accomplished is that the title
actually looks reasonable in a line in the LyX authoring environment,
and the correct title shows up in the PDF.

Several of you had excellent ideas, including ERT LaTeX command, a Perl
script, and some other ideas. Thanks for the great ideas. Ultimately, I
decided that my workaround best meets my workflow needs for this
project.

Thanks,

SteveT

Steve Litt 
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Command to put string in both the LyX authoring environment and the finished PDF?

2021-06-21 Thread Dr Eberhard Lisse



On 2021-06-21 01:44 , Paul A. Rubin wrote:

On 6/20/21 5:39 PM, Steve Litt wrote:

Hi all,

I have a local layout, based on Book-extsizes, for my new book. I have
no idea what the book's title will be yet, and I sure nuff don't want
to have to search all instances of that title and replace them every
time I get a better idea for the title.

[...]


This is not an answer to your question, but possibly something
simpler.  If you load the 'titling' package in the document preamble,
you can put anything you want in the document's title environment and
then just use \thetitle (or maybe \thetitle{}) in ERT any place you
want to repeat the title.  If you get the hots for a new title later,
you just have to change it in the title environment.  This doesn't
deal directly with the funky formatting of the title, but it does
eliminate the search-and-replace aspect.

Paul



This is not an answer to your question, but I use stuff like $$SURNAME$$
in a number of my LyX templates and then something like

$Surname = 'Doe';
s/\$\$SURNAME\$\$/$Surname/g';

in my Perl script to fill in the variables :-)-O

el

--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Command to put string in both the LyX authoring environment and the finished PDF?

2021-06-21 Thread Andrew Parsloe


On 21/06/2021 9:39 am, Steve Litt wrote:

Hi all,

I have a local layout, based on Book-extsizes, for my new book. I have
no idea what the book's title will be yet, and I sure nuff don't want
to have to search all instances of that title and replace them every
time I get a better idea for the title.

S, what I want to do is put something in my local layout to
articulate the title, both in the LyX authoring environment and in the
compiled PDF, showing the title in a specific appearance. I tried to do
it as a character style, as follows:


\definecolor{titlebodytextcolor}{HTML}{cc}

% ### Character style for book title within body text
\newcommand{\chartitlebodytextL}[0]{{\color{titlebodytextcolor}My
Current Title As Of Today}}%

CharStyle CharTitleInBody
Font
Series  Bold
Color   Red
EndFont
LabelFont
Series  Bold
SizeLarger
Color   Red
EndLabelFont
LatexName   chartitlebodytextL
LatexType   Command
LabelString "My Current Title As Of Today"
End


If I apply the character style CharTitleInBody to an empty string in
LyX, the exact right thing happens in the PDF, but in the LyX
authoring environment the title appears under the character style inset
and also under the following text, which is very disturbing if you're
trying to copy-edit your book in the LyX environment.

Does anybody know what I can do to make the text appear inline, instead
of underneath, within the LyX authoring environment?

Thanks,

SteveT


Steve, does adding

Decoration  minimalistic

after CharStyle CharTitleInBody help? Or

Decoration  classic

if you prefer? Your current style uses the CharStyle default decoration  
called conglomerate.


Andrew

--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: Command to put string in both the LyX authoring environment and the finished PDF?

2021-06-20 Thread Paul A. Rubin

On 6/20/21 5:39 PM, Steve Litt wrote:

Hi all,

I have a local layout, based on Book-extsizes, for my new book. I have
no idea what the book's title will be yet, and I sure nuff don't want
to have to search all instances of that title and replace them every
time I get a better idea for the title.

S, what I want to do is put something in my local layout to
articulate the title, both in the LyX authoring environment and in the
compiled PDF, showing the title in a specific appearance. I tried to do
it as a character style, as follows:


\definecolor{titlebodytextcolor}{HTML}{cc}

% ### Character style for book title within body text
\newcommand{\chartitlebodytextL}[0]{{\color{titlebodytextcolor}My
Current Title As Of Today}}%

CharStyle CharTitleInBody
Font
Series  Bold
Color   Red
EndFont
LabelFont
Series  Bold
SizeLarger
Color   Red
EndLabelFont
LatexName   chartitlebodytextL
LatexType   Command
LabelString "My Current Title As Of Today"
End


If I apply the character style CharTitleInBody to an empty string in
LyX, the exact right thing happens in the PDF, but in the LyX
authoring environment the title appears under the character style inset
and also under the following text, which is very disturbing if you're
trying to copy-edit your book in the LyX environment.

Does anybody know what I can do to make the text appear inline, instead
of underneath, within the LyX authoring environment?

Thanks,

SteveT

Steve Litt
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques

Steve,

This is not an answer to your question, but possibly something simpler. 
If you load the 'titling' package in the document preamble, you can put 
anything you want in the document's title environment and then just use 
\thetitle (or maybe \thetitle{}) in ERT any place you want to repeat the 
title. If you get the hots for a new title later, you just have to 
change it in the title environment. This doesn't deal directly with the 
funky formatting of the title, but it does eliminate the 
search-and-replace aspect.


Paul

--
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users