summaryrefslogtreecommitdiff
path: root/graphics/jpicedt/doc/parsing.html
blob: 169312198f103bf3ac67628723d773b9301cc364 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
  <HEAD>
    <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=iso-8859-1">
	<META key="author" CONTENT="Sylvain Reynal">
    <TITLE>jPicEdt 1.3.2 Help Content </TITLE>
  </HEAD>

  <BODY BGCOLOR="#ffffff">

  <H2>Parsing input files</H2>

  <P>When parsing input files, jPicEdt can handle a variety of, say,
  syntax <I>deviations</I>... I carved it fairly robust :-), and you
  needn't worry too much about whether your syntax is perfectly
  <I>LaTeX-, epic- or PsTricks- compliant</I> or not, since jPicEdt will issue a pretty
  informative message as soon as it finds a syntax error, an incorrect
  format number, etc... However, we strongly encourage you to follow
  these rules :</P>
  <UL>
	<LI>jPicEdt expects to find a
	<CODE>\unitlength</CODE> or a <CODE>\psset{unit=xxx}</CODE> (or xunit, yunit, runit)  
	command at the very beginning of your file, or at least before the
	first command you want to be processed ; it not, default unitlength will be
	assumed, e.g. 1cm for PsTricks until one of these commands are found.
	</LI>
	<LI>jPicEdt accepts almost every command of the LaTeX picture
	environment, the epic/eepic packages, and the PsTricks base-package, though for the later
	add-ons packages are not supported yet, e.g. pst-nodes.sty or pst-coils.sty.
	<code>\multiput</code> (and its PsTricks equivalent) are not handled yet.
	</LI>
	<li>
	It is perfectly possible to mix LaTeX, eepic and Pstricks commands in the same file.
	PsTricks default parameters (those set by <code>\psset</code> commands) won't interfere
	with LaTeX or eepic ones (e.g. <code>linethickness</code>).
	</LI>
	<li>As of LaTeX boxes (e.g. framebox,...), don't expect true WYSIWYG behaviour ! JPicEdt doesn't
	embed any TeX compiler, hence only a limited set of LR-commands is handled (specifically : only
	very commands related to the picture environment, see <i>LaTeX, a documentation preparation system,
	Leslie Lamport, p.97 and p.108</i>).
	</li>
	<li>The parsing process ends if, either an End-of-file is encountered, or a
	<code>\end{picture}</code> (or its equivalent for PsTricks) is found.
   </UL>

<P>In case you are still fathoming out what those weird comment lines that jPicEdt adds to your
file really mean, here are some hints. We rely on this trick for commands that cannot be put on a single line : using a
<i>%Begin</i> and <i>%End</i> blocks is a way of making jpicedt understand that every command that lies
inside the block belongs to the same graphical element, e.g. a circle, a line,.... Obviously, 
for graphical elements whose
formatted string holds on a single line (which is always the case for PsTricks, so far), 
there's no need to rely on this trick however. 
</P>
<p><i>Note : this small grammar was designed at a time where only the LaTeX picture environment and the
epic/eepic package were handled by jPicEdt.
Don't expect to find parameters related to colours, shadows or textures ! (please use PsTricks in this case). 
Only rules needed to properly represent a compound graphical object with the set of graphical attributes
offered by the eepic package are part of this grammar, no less, no more...</i>    
<TABLE BORDER=3 CELLPADDING=2 CELLSPACING=2>
	<TR>
		<TD><P>Line</P></TD>
		<TD><P>%Line 0 0 (x1,y1)(x2,y2)<BR>%End Line</P></TD>
	</TR>
	<TR>
		<TD><P>Vector (arrow on first end)</P></TD>
		<TD><P>%Line 1 0 (x1,y1)(x2,y2)<BR>%End Line</P></TD>
	</TR>
	<TR>
		<TD><P>Vector (arrow on second end)</P></TD>
		<TD><P>%Line 0 1 (x1,y1)(x2,y2)<BR>%End Line</P></TD>
	</TR>
	<TR>
		<TD><P>Vector (two arrows)</P></TD>
		<TD><P>%Line 1 1 (x1,y1)(x2,y2)<BR>%End Line</P></TD>
	</TR>
	<TR>
		<TD><P>Dashed line (or vector) *</P></TD>
		<TD><P>%Line 0 0 (x1,y1)(x2,y2) dash=value_in_mm<BR>%End Line</P></TD>
	</TR>
	<TR>
		<TD><P>Ellipse (hollowed)</P></TD>
		<TD><P>%Ellipse (x_centre,y_centre)(width)(height)<BR>%End Ellipse</P></TD>
	</TR>
	<TR>
		<TD><P>Black-, gray- or white-filled ellipse *</P></TD>
		<TD><P>%Ellipse (x_centre,y_centre)(width)(height) blacken|shade|whiten<BR>%End Ellipse</P>
		</TD>
	</TR>
	<TR>
		<TD><P>Dashed ellipse *</P></TD>
		<TD><P>%Ellipse (x_centre,y_centre)(diameter)(diameter) dash=value_in_mm<BR>%End Ellipse</P>
		</TD>
	</TR>
	<TR>
		<TD><P>Arc</P></TD>
		<TD><P>%Ellipse (x_centre,y_centre)(diameter)(diameter) arcStart=angle_in_degree arcExtent=angle_in_degree<BR>%End Ellipse</P>
		</TD>
	</TR>
	<TR>
		<TD><P>Rectangle (First point = bottom left corner ; second point = top right corner)</P></TD>
		<TD><P>%Rectangle(x1,y1)(x2,y2)<BR>%End Rectangle</P></TD>
	</TR>
	<TR>
		<TD><P>Black-, gray- or white-filled rectangle *</P></TD>
		<TD><P>%Rectangle(x1,y1)(x2,y2) blacken|shade|whiten<BR>%End Rectangle</P></TD>
	</TR>
	<TR>
		<TD><P>Dashed rectangle</P></TD>
		<TD><P>%Rectangle(x1,y1)(x2,y2) dash=value_in_mm<BR>%End Rectangle</P></TD>
	</TR>
	<TR>
		<TD><P>Bezier splines (quadratic)</P></TD>
		<TD><P>%Bezier 0 0 (x1,y1)(x_control,y_control)(x2,y2)<BR>%End Bezier</P></TD>
	</TR>
	<TR>
		<TD><P>Bezier splines (quadratic) with an arrow on the first point</P></TD>
		<TD><P>%Bezier 1 0 (x1,y1)(x_control,y_control)(x2,y2)<BR>%End Bezier</P></TD>
	</TR>
	<TR>
		<TD><P>Bezier splines (quadratic) with an arrow on the second point</P></TD>
		<TD><P>%Bezier 0 1 (x1,y1)(x_control,y_control)(x2,y2)<BR>%End Bezier</P></TD>
	</TR>
	<TR>
		<TD><P>Bezier splines (quadratic) with two arrows</P></TD>
		<TD><P>%Bezier 1 1 (x1,y1)(x_control,y_control)(x2,y2)<BR>%End Bezier</P></TD>
	</TR>
	<TR>
		<TD><P>Filled Polygons (possibly closed) *</P></TD>
		<TD><P>%Polygon (x1,y1)...(xN,yN) blacken|shade|whiten closed<BR>%End Polygon</P></TD>
	</TR>
	<TR>
		<TD><P>Dashed Polygons (possibly closed)</P></TD>
		<TD><P>%Polygon (x1,y1)...(xN,yN) dash=value_in_mm closed<BR>%End Polygon</P></TD>
	</TR>
	<TR>
		<TD><P>Begin group</P></TD>
		<TD><P>%Begin group</P></TD>
	</TR>
	<TR>
		<TD><P>End group</P></TD>
		<TD><P>%End group</P></TD>
	</TR>
	<TR>
		<TD><P>Text</P></TD>
		<TD><P>See LaTeX and PsTricks documentation about using \makebox,\framebox, \dashbox, \psframebox,... commands.</P></TD>
	</TR>
</TABLE>
<p>Please note : </p>
<ul>
<li>commands marked with an * are supported by eepic only.</li>
<li>Order of optional params (such as dash=..., fill-colour, etc...) is not significant.</li>
<li>Cubic splines, which are not
	supported by the LaTeX picture environment, are converted to a pair of quad
	splines before formatting (see "Numerical Recipes in Fortran" for the algorithm
	used to convert a cubic to two quads).</li>
</ul>
</BODY>
</HTML>