On Sat, Feb 18, 2017 at 03:18:59AM -0500, Richard Heck wrote:
> On 02/16/2017 04:04 AM, Jürgen Spitzmüller wrote:
> > Am Donnerstag, den 16.02.2017, 00:22 -0500 schrieb Scott Kostyshak:
> >> Probably the ideal approach is to maximize a weighted average, where
> >> the
> >> weights are how often the document classes are used. Unfortunately, I
> >> don't know how to calculate the weights.
> > This would be an application of the IfStyle tag Richard once proposed
> > (but never implemented apparently):
> > http://marc.info/?l=lyx-devel&m=124967798121429&w=2
> >
> > You could use the most frequent setting in the module, and then in the
> > diverging classes:
> >
> > IfStyle Theorem
> >   NextNoIndent          0
> > End
> 
> This is called "ModifyStyle" now.
> 
> ModifyStyle Theorem
>   NextNoIndent          0
> End
> 
> Richard
> 

Attached are two patches. The first fixes ParIndent for a few styles.
The second implements the NextNoIndent 0. After looking at output from
many classes, I do not think a ModifyStyle is needed.

I only tested classes that would compile a simple document that
contained only standard text and a Theorem environment. If someone
thinks it's worth the effort to set up documents (e.g. use as a base our
templates) for the other classes, I will do it.

As noted in the commit log, hollywood and broadway are strange cases. I
attach some sample PDF output from them. I don't plan on thinking of a
fix for these.

Scott
From 086a222ddeb77e47db7d5dccd405a3fdb047845b Mon Sep 17 00:00:00 2001
From: Scott Kostyshak <skost...@lyx.org>
Date: Sun, 19 Feb 2017 18:20:52 -0500
Subject: [PATCH 1/2] Fix ParIndent for various styles

---
 lib/layouts/g-brief.layout  | 4 ++++
 lib/layouts/g-brief2.layout | 4 ++++
 lib/layouts/letter.layout   | 3 +++
 lib/layouts/scrlttr2.layout | 1 +
 4 files changed, 12 insertions(+)

diff --git a/lib/layouts/g-brief.layout b/lib/layouts/g-brief.layout
index 93233aa..abc78f8 100644
--- a/lib/layouts/g-brief.layout
+++ b/lib/layouts/g-brief.layout
@@ -9,6 +9,10 @@ Input stdinsets.inc
 Input stdfloats.inc
 Input stdcounters.inc
 
+ModifyStyle Standard
+       ParIndent       ""
+End
+
 Columns                 1
 Sides                   1
 PageStyle               Empty
diff --git a/lib/layouts/g-brief2.layout b/lib/layouts/g-brief2.layout
index 9224c78..aa6f5b7 100644
--- a/lib/layouts/g-brief2.layout
+++ b/lib/layouts/g-brief2.layout
@@ -1024,3 +1024,7 @@ NoStyle                   Verse
 # Remove some unwanted styles.
 # NoStyle              Right_Address
 # NoStyle              Address
+
+ModifyStyle Standard
+  ParIndent            ""
+End
diff --git a/lib/layouts/letter.layout b/lib/layouts/letter.layout
index 382dc6e..53943b2 100644
--- a/lib/layouts/letter.layout
+++ b/lib/layouts/letter.layout
@@ -17,3 +17,6 @@ Input stdlayouts.inc
 NoStyle         Right_Address
 NoStyle         Address
 
+ModifyStyle Standard
+  ParIndent          ""
+End
diff --git a/lib/layouts/scrlttr2.layout b/lib/layouts/scrlttr2.layout
index da7ab97..de96843 100644
--- a/lib/layouts/scrlttr2.layout
+++ b/lib/layouts/scrlttr2.layout
@@ -13,6 +13,7 @@ Style Standard
        LatexName             dummy
        ParSep                0.4
        AlignPossible         Block, Left, Right, Center
+       ParIndent             MM
 End
 
 Input stdlists.inc
-- 
2.7.4

From 54399c4030d3d8c4bc49d4a44c7b226b77f5d95b Mon Sep 17 00:00:00 2001
From: Scott Kostyshak <skost...@lyx.org>
Date: Fri, 11 Nov 2016 11:55:31 -0500
Subject: [PATCH 2/2] Theorem style: set NextNoIndent to 0

After a Theorem environment, LaTeX does by default indent the
following paragraph.

I checked various classes and no ModifyStyle was needed. The
hollywood and broadway classes are strange cases where there is an
indent after the Theorem environment, but it is much smaller than
the normal indent. The indent is the same as the opening indent of
normal text, which we currently ignore. Further, I don't expect it
is common to use theorems in these classes.
---
 lib/layouts/theorems-ams.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/layouts/theorems-ams.inc b/lib/layouts/theorems-ams.inc
index a05b781..c4345be 100644
--- a/lib/layouts/theorems-ams.inc
+++ b/lib/layouts/theorems-ams.inc
@@ -29,7 +29,7 @@ Style Theorem
        Margin                First_Dynamic
        LatexType             Environment
        LatexName             thm
-       NextNoIndent          1
+       NextNoIndent          0
        ResetArgs             1
        AddToToc              thm
        IsTocCaption          1
-- 
2.7.4

Attachment: broadway.pdf
Description: Adobe PDF document

Attachment: hollywood.pdf
Description: Adobe PDF document

Attachment: signature.asc
Description: PGP signature

Reply via email to