Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: jpicedt/format/latex/LatexConstants.java


1   /*
2    LatexConstants.java - March 1, 2002 - jPicEdt 1.3.2, a picture editor for LaTeX.
3    Copyright (C) 1999-2002 Sylvain Reynal
4   
5    Département de Physique
6    Ecole Nationale Supérieure de l'Electronique et de ses Applications (ENSEA)
7    6, avenue du Ponceau
8    F-95014 CERGY CEDEX
9   
10   Tel : +33 130 736 245
11   Fax : +33 130 736 667
12   e-mail : reynal@ensea.fr
13   jPicEdt web page : http://www.jpicedt.org/
14    
15   This program is free software; you can redistribute it and/or
16   modify it under the terms of the GNU General Public License
17   as published by the Free Software Foundation; either version 2
18   of the License, or any later version.
19    
20   This program is distributed in the hope that it will be useful,
21   but WITHOUT ANY WARRANTY; without even the implied warranty of
22   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23   GNU General Public License for more details.
24    
25   You should have received a copy of the GNU General Public License
26   along with this program; if not, write to the Free Software
27   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
28   */
29   
30  package jpicedt.format.latex;
31  
32  /** 
33   * "emulated latex" parameters : these parameters get used by LatexFormatter, LatexParser
34   *  and LatexViewFactory.
35   * <ul>
36   * <li>lineThickness : (mm) ; used when parsing LaTeX file, when no \\lineThickness command is found
37   * <li>emLineLength : (mm) when in "em. latex" mode, a line whose slope doesn't match an existing
38   * <li>LaTeX slope (cf. picture environment) is emulated by tiny horizontal and/or
39   * vertical segments ; this parameter determines the length of these segments
40   * <li>maxLatexCircleDiameter (mm) : circles whose diameter is greater than this value are emulated ;
41   *                                        this ususally depends on available "lasym" fonts
42   * <li>maxLatexDiskDiameter (mm) : same thing, but for disks now.
43   * <li>maxEmLineSlope : line with an absolute slope greater than this value are considered to be vertical, i.e. "line(0,1){etc...}"
44   * <li>minEmLineSlope : same thing, but for horizontal lines.
45   * <li>fileWrapperProlog and fileWrapperEpilog : things to prepend and append before and after
46   *     "begin{picture}" and "end{picture}" to create a content able to be compiled by latex. May include
47   *     things like "include{package}",... 
48   */
49  public interface LatexConstants {
50    
51    /**
52     * Line separator for the current platform (i.e. "\n" on Unix, "\n\r" on Windows, "\r" on Mac,..)
53     */
54    public static final String CR_LF = System.getProperty("line.separator");
55  
56    //////////////////////////////
57    // KEY for PROPERTIES 
58    /////////////////////////////
59    public static final String KEY_LINE_THICKNESS = "latex.line-thickness";
60    public static final String KEY_EM_LINE_LENGTH = "latex.emulated-line-length";
61    public static final String KEY_MAX_CIRCLE_DIAMETER = "latex.max-circle-diameter";
62    public static final String KEY_MAX_DISK_DIAMETER ="latex.max-disk-diameter";
63    public static final String KEY_MAX_EM_CIRCLE_SEGMENT_LENGTH = "latex.max-emulated-circle-segment-length";
64    public static final String KEY_MAX_EM_LINE_SLOPE = "latex.max-emulated-line-slope";
65    public static final String KEY_FILE_WRAPPER_PROLOG = "latex.file-wrapper-prolog";
66    public static final String KEY_FILE_WRAPPER_EPILOG = "latex.file-wrapper-epilog";
67  
68    ////////////////////////////////
69    //// DEFAULT VALUES
70    ////////////////////////////////  
71      public static final double DEFAULT_LINE_THICKNESS = 0.15; // 0.15mm (environ 0.4pt) -> \\thinlines (\\thicklines = 0.3mm)
72      public static final double DEFAULT_EM_LINE_LENGTH = 0.12;
73      public static final double DEFAULT_MAX_CIRCLE_DIAMETER = 14 ; //mm
74      public static final double DEFAULT_MAX_DISK_DIAMETER = 5.4; //mm
75      public static final double DEFAULT_MAX_EM_CIRCLE_SEGMENT_LENGTH = 1;
76      public static final double DEFAULT_MAX_EM_LINE_SLOPE = 1000.0 ;
77    public static final String DEFAULT_FILE_WRAPPER_PROLOG = 
78      "\\documentclass{article} "+CR_LF+"\\begin{document} "+CR_LF;
79    public static final String DEFAULT_FILE_WRAPPER_EPILOG = "\\end{document}";
80    
81  }