]> git.lyx.org Git - lyx.git/commitdiff
Dekel patch to add EndLabelString tag to layout files.
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 12 May 2000 13:11:20 +0000 (13:11 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 12 May 2000 13:11:20 +0000 (13:11 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@731 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
NEWS
lib/layouts/broadway.layout
lib/layouts/heb-article.layout
lib/layouts/hollywood.layout
src/buffer.C
src/layout.C
src/layout.h
src/text.C

index 5553394acf0e4d35c0f97cb1a49c88b1a7b65be5..a844e75457697369e7c5a99babe20e2f75d85dc2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+20000-05-11  Dekel Tsur  <dekel@math.tau.ac.il>
+
+       * src/layout.C: Add new keyword "endlabelstring" to layout file
+
+       * src/text.C (GetVisibleRow): Draw endlabel string.
+
+       * lib/layouts/broadway.layout
+       * lib/layouts/hollywood.layout: Added endlabel for the
+       Parenthetical layout.
+
+       * lib/layouts/heb-article.layout: Do not use slanted font shape
+       for Theorem like environments.
+
+       * src/buffer.C (makeLaTeXFile): Always add "american" to 
+       the UsedLanguages list if document language is RTL. 
+
 2000-05-11  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
 
        * add addendum to README.OS2 and small patch (from SMiyata)
diff --git a/NEWS b/NEWS
index 705edafc52b3964bc8ec60e8d285cbca3dfac638..ab7a3d1899b0fda1116f987ac65824c1a3ad795f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -37,8 +37,9 @@ User-visible changes:
   (The color ones, and -mono -fastselection, -reverse)
 
 - new lyxrc variables: \show_banner [true|false] to remove the banner
-  screen, and \backupdir_path to tell where the backup files created
-  by lyx should be stored. 
+  screen, \backupdir_path to tell where the backup files created
+  by lyx should be stored, and \override_x_deadkeys to tell whether 
+  lyx should provide its own accent keys handling (default is true). 
 
 
 
index 787d9ec2bcb9e510be3e5fcc4378beff0673993c..aa4ce16f0e1ff5acb314394042c6c244b691a1ed 100644 (file)
@@ -141,8 +141,7 @@ Style Speaker
 End
 
 # Parenthetical instruction to speaker (in parenthises, l.c.)
-# The ( will automatically appear on screen, both () will be
-# in print, so don't type any.
+# The ( and ) will automatically appear on screen, so don't type any.
 Style Parenthetical  
   Margin                Static
   LatexType             Environment
@@ -151,6 +150,8 @@ Style Parenthetical
   AlignPossible         Center
   LabelType            Static
   LabelString          (
+  EndLabelType         Static
+  EndLabelString       )
 
 Font
   Family                Roman
index 15f378f10d2c77146b90417336d5530ee1cf667b..0b10bf3914b6ed9fad5a7a1c99bc55329dc7c948 100644 (file)
@@ -2,22 +2,29 @@
 #  \DeclareLaTeXClass[article]{article (Hebrew)}
 # Hebrew article textclass definition file.
 # Author: Dekel Tsur <dekel@math.tau.ac.il>
+# Few changes by Baruch Even <baruch.even@writeme.com>
 
 Input article
 
 Preamble
-\newtheorem{theorem}{\R{\mem\shin\pe\tet}}[section]
-\newtheorem{lemma}[theorem]{\R{\lamed\mem\he}}
-\newtheorem{claim}[theorem]{\R{\tet\ayin\nun\he}}
-\newtheorem{corollary}[theorem]{\R{\mem\samekh\qof\nun\he}}
-\newenvironment{proof}{\R{\em \he\vav\kaf\het\he:}}{\hfill\rule{2mm}{2mm}\par\vspace{2mm}}
+\usepackage{theorem}
+\theorembodyfont{\upshape}
+\newtheorem{theorem}{\R{îùôè}}[section]
+\make@lr\thetheorem
 EndPreamble
 
-# Proof style declaration
-Style Proof
+Style Comment
+  LabelString           ":äøòä"
+End
+
+Style Abstract
+  LabelString           "øéö÷ú"
+End
+
+Style Theorem
   Margin                First_Dynamic
   LatexType             Environment
-  LatexName             proof
+  LatexName             theorem
   NextNoIndent          1
   LabelSep              xx
   ParIndent             MMM
@@ -29,8 +36,7 @@ Style Proof
   Align                 Block
   AlignPossible         Block, Left
   LabelType             Static
-  LabelString           ":äçëåä"
-  EndLabelType         Filled_Box
+  LabelString           ".# èôùî"
   # standard font definition
   Font
     Shape               Up
@@ -38,14 +44,60 @@ Style Proof
   EndFont
   # label font definition
   LabelFont
-    Shape               Italic
+    Shape               Up
+    Series              Bold
   EndFont
 End
 
-Style Theorem
+Style Lemma
+  CopyStyle             Theorem
+  LatexName             lemma
+  LabelString           ".# äîì"
+  Preamble
+\newtheorem{lemma}[theorem]{\R{ìîä}}
+  EndPreamble
+End
+
+Style Corollary
+  CopyStyle             Theorem
+  LatexName             corollary
+  LabelString           ".# äð÷ñî"
+  Preamble
+\newtheorem{corollary}[theorem]{\R{îñ÷ðä}}
+  EndPreamble
+End
+
+Style Claim
+  CopyStyle             Theorem
+  LatexName             claim
+  LabelString           ".# äðòè"
+  Preamble
+\newtheorem{claim}[theorem]{\R{èòðä}}
+  EndPreamble
+End
+
+Style Definition
+  CopyStyle             Theorem
+  LatexName             definition
+  LabelString           ".# äøãâä"
+  Preamble
+\newtheorem{definition}[theorem]{\R{äâãøä}}
+  EndPreamble
+End
+
+Style Remarks
+  CopyStyle             Theorem
+  LatexName             remark
+  LabelString           ".# äøòä"
+  Preamble
+\newtheorem{remark}[theorem]{\R{äòøä}}
+  EndPreamble
+End
+
+Style Proof
   Margin                First_Dynamic
   LatexType             Environment
-  LatexName             theorem
+  LatexName             proof
   NextNoIndent          1
   LabelSep              xx
   ParIndent             MMM
@@ -57,41 +109,19 @@ Style Theorem
   Align                 Block
   AlignPossible         Block, Left
   LabelType             Static
-  LabelString           ".# èôùî"
+  LabelString           ":äçëåä"
+  EndLabelType         Filled_Box
   # standard font definition
   Font
-    Shape               Italic
+    Shape               Up
     Size                Normal
   EndFont
   # label font definition
   LabelFont
-    Shape               Up
+    Shape               Normal
     Series              Bold
   EndFont
+  Preamble
+\newenvironment{proof}{\R{\textbf{äåëçä:}}}{\hfill\rule{2mm}{2mm}\par\vspace{2mm}}
+  EndPreamble
 End
-
-Style Corollary
-  CopyStyle             Theorem
-  LatexName             corollary
-  LabelString           ".# äð÷ñî"
-End
-
-Style Lemma
-  CopyStyle             Theorem
-  LatexName             lemma
-  LabelString           ".# äîì"
-End
-
-Style Claim
-  CopyStyle             Theorem
-  LatexName             claim
-  LabelString           ".# äðòè"
-End
-
-Style Comment
-  LabelString           ": äøòä"
-End
-
-Style Abstract
-  LabelString           "øéö÷ú"
-End
\ No newline at end of file
index 800ac81bfa5344eb68aef9632ea7e371ceec5d5a..bb1a4a9851c1cfaf27d195aaf27ac2d1cc3172cd 100644 (file)
@@ -164,8 +164,7 @@ Style Speaker
 End
 
 # Parenthetical instruction to speaker (in parenthises, l.c.)
-# The ( will automatically appear on screen, both () will be
-# in print, so don't type any.
+# The ( and ) will automatically appear on screen, so don't type any.
 Style Parenthetical  
   Margin                Static
   LatexType             Environment
@@ -178,6 +177,9 @@ Style Parenthetical
   AlignPossible         Left
   LabelType            Static
   LabelString          (
+  EndLabelType         Static
+  EndLabelString       )
+
 Font
   Family                Typewriter
   Series                Medium
index 5ad15c8feac170f93b1449ed459fb22c58fd2d76..be74bf1351c855d6e4c702a9d1624bea4c221e81 100644 (file)
@@ -1739,6 +1739,8 @@ void Buffer::makeLaTeXFile(string const & fname,
                
                // language should be a parameter to \documentclass
                bool use_babel = false;
+               if (params.language_info->RightToLeft) // This seems necessary
+                       features.UsedLanguages.insert(default_language);
                if (params.language != "default" ||
                    !features.UsedLanguages.empty() ) {
                        use_babel = true;
index 853114a7c2ac0d0166d3f1ca55a11c4224dbd658..37898f03844cc55ec54a8d4671ed18792e68e559 100644 (file)
@@ -77,6 +77,7 @@ enum LayoutTags {
        LT_LABELSTRING, 
        LT_LABELSTRING_APPENDIX, 
        LT_LABELTYPE,
+       LT_ENDLABELSTRING,
        LT_ENDLABELTYPE,
        LT_LATEXNAME, 
        LT_LATEXPARAM, 
@@ -141,6 +142,7 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                { "bottomsep",                  LT_BOTTOMSEP },
                { "copystyle",                  LT_COPYSTYLE },
                { "end",                        LT_END },
+               { "endlabelstring",             LT_ENDLABELSTRING },
                { "endlabeltype",               LT_ENDLABELTYPE },
                { "fill_bottom",                LT_FILL_BOTTOM },
                { "fill_top",                   LT_FILL_TOP },
@@ -371,6 +373,11 @@ bool LyXLayout::Read (LyXLex & lexrc, LyXTextClass const & tclass)
                                labelstring_ = lexrc.GetString();
                        break;
 
+               case LT_ENDLABELSTRING: // endlabel string definition
+                       if (lexrc.next())
+                               endlabelstring_ = lexrc.GetString();
+                       break;
+
                case LT_LABELSTRING_APPENDIX: // label string appendix definition
                        if (lexrc.next())
                                labelstring_appendix_ = lexrc.GetString();
@@ -613,7 +620,8 @@ void LyXLayout::readLabelType(LyXLex & lexrc)
 static keyword_item endlabelTypeTags[] = {
        { "box",        END_LABEL_BOX },
        { "filled_box", END_LABEL_FILLED_BOX },
-       { "no_label",   END_LABEL_NO_LABEL }
+       { "no_label",   END_LABEL_NO_LABEL },
+       { "static",     END_LABEL_STATIC }
 };
 
 void LyXLayout::readEndLabelType(LyXLex & lexrc)
@@ -625,6 +633,7 @@ void LyXLayout::readEndLabelType(LyXLex & lexrc)
        case LyXLex::LEX_UNDEF:
                lexrc.printError("Unknown labeltype tag `$$Token'");
                break;
+       case END_LABEL_STATIC:
        case END_LABEL_BOX:
        case END_LABEL_FILLED_BOX:
        case END_LABEL_NO_LABEL:
index f29ebb2572af29ea635f69e9ea31c525f1da9386..bc9dd8c15382919b25fa2a3f431e3720cf6bcfc3 100644 (file)
@@ -153,9 +153,11 @@ enum LYX_END_LABEL_TYPES {
        ///
        END_LABEL_FILLED_BOX,
        ///
+       END_LABEL_STATIC,
+       ///
        END_LABEL_ENUM_FIRST = END_LABEL_NO_LABEL,
        ///
-       END_LABEL_ENUM_LAST = END_LABEL_FILLED_BOX
+       END_LABEL_ENUM_LAST = END_LABEL_STATIC
 };
                
 /* Fix labels are printed flushright, manual labels flushleft. 
@@ -201,6 +203,7 @@ public:
        string const & obsoleted_by() const { return obsoleted_by_; }
        string const & latexname() const { return latexname_; }
        string const & labelstring() const { return labelstring_; }
+       string const & endlabelstring() const { return endlabelstring_; }
        string const & preamble() const { return preamble_; }
        string const & latexparam() const { return latexparam_; }
        string const & labelstring_appendix() const {
@@ -339,6 +342,9 @@ private:
        /// Label string. "Abstract", "Reference", "Caption"...
        string labelstring_;
 
+       ///
+       string endlabelstring_;
+
        /// Label string inside appendix. "Appendix", ...
        string labelstring_appendix_;
 
index aa747375da7dfefa8895586492f32b118d18f72a..a702305f0a31b9e3c2234621eeb8c926899c466f 100644 (file)
@@ -4210,8 +4210,10 @@ void LyXText::GetVisibleRow(int offset, Row * row_ptr, long y)
 
                // draw an endlabel
                int endlabel = row_ptr->par->GetEndLabel();
-               if (endlabel == END_LABEL_BOX ||
-                   endlabel == END_LABEL_FILLED_BOX) {
+               switch (endlabel) {
+               case END_LABEL_BOX:
+               case END_LABEL_FILLED_BOX:
+               {
                        LyXFont font = GetFont(row_ptr->par, last);
                        int size = int(0.75 * lyxfont::maxAscent(font));
                        int y = (offset + row_ptr->baseline) - size;
@@ -4238,6 +4240,21 @@ void LyXText::GetVisibleRow(int offset, Row * row_ptr, long y)
                        } else
                                pain.fillRectangle(x, y, size, size,
                                                   LColor::eolmarker);
+                       break;
+               }
+               case END_LABEL_STATIC:
+               {
+                       LyXTextClass::LayoutList::size_type layout = row_ptr->par->GetLayout();
+                       string tmpstring = textclasslist.Style(buffer->params.textclass,
+                                                        layout).endlabelstring();
+                       font = GetFont(row_ptr->par, -2);
+                       int tmpx = is_rtl ? int(x) - lyxfont::width(tmpstring, font)
+                               : paperwidth - RightMargin(row_ptr) - row_ptr->fill;
+                       pain.text( tmpx, offset + row_ptr->baseline, tmpstring, font);
+                       break;
+               }
+               case END_LABEL_NO_LABEL:
+                       break;
                }
        }