latex_lib.tex 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773
  1. @c ---content LibInfo---
  2. @comment This file was generated by doc2tex.pl from d2t_singular/latex_lib.doc
  3. @comment DO NOT EDIT DIRECTLY, BUT EDIT d2t_singular/latex_lib.doc INSTEAD
  4. @c library version: (1.19.2.1,2002/02/20)
  5. @c library file: ../Singular/LIB/latex.lib
  6. @cindex latex.lib
  7. @cindex latex_lib
  8. @table @asis
  9. @item @strong{Library:}
  10. latex.lib
  11. @item @strong{Purpose:}
  12. Typesetting of Singular-Objects in LaTeX2e
  13. @item @strong{Author:}
  14. Christian Gorzel, gorzelc@@math.uni-muenster.de
  15. @end table
  16. @strong{Procedures:}
  17. @menu
  18. * closetex:: writes closing line for LaTeX-document
  19. * opentex:: writes header for LaTeX-file fnm
  20. * tex:: calls LaTeX2e for LaTeX-file fnm
  21. * texdemo:: produces a file explaining the features of this lib
  22. * texfactorize:: creates string in LaTeX-format for factors of poly f
  23. * texmap:: creates string in LaTeX-format for map m:r1->r2
  24. * texname:: creates string in LaTeX-format for identifier
  25. * texobj:: creates string in LaTeX-format for any (basic) type
  26. * texpoly:: creates string in LaTeX-format for poly
  27. * texproc:: creates string in LaTeX-format of text from proc p
  28. * texring:: creates string in LaTeX-format for ring/qring
  29. * rmx:: removes .aux and .log files of LaTeX-files
  30. * xdvi:: calls xdvi for dvi-files
  31. @end menu
  32. @table @asis
  33. @item @strong{Global variables:}
  34. TeXwidth, TeXnofrac, TeXbrack, TeXproj, TeXaligned, TeXreplace, NoDollars
  35. are used to control the typesetting.
  36. Call @code{texdemo();} to obtain a LaTeX2e file @code{texlibdemo.tex}
  37. explaining the features of @code{latex.lib} and its global variables.
  38. @format
  39. @code{TeXwidth} (int) -1, 0, 1..9, >9: controls breaking of long polynomials
  40. @code{TeXnofrac} (int) flag: write 1/2 instead of \frac@{1@}@{2@}
  41. @code{TeXbrack} (string) "@{", "(", "<", "|", empty string:
  42. controls brackets around ideals and matrices
  43. @code{TeXproj} (int) flag: write ":" instead of "," in vectors
  44. @code{TeXaligned} (int) flag: write maps (and ideals) aligned
  45. @code{TeXreplace} (list) list entries = 2 strings: replacing symbols
  46. @code{NoDollars} (int) flag: suppresses surrounding $ signs
  47. @end format
  48. @end table
  49. @c ---end content LibInfo---
  50. @c ------------------- closetex -------------
  51. @node closetex, opentex,, latex_lib
  52. @subsubsection closetex
  53. @cindex closetex
  54. @c ---content closetex---
  55. Procedure from library @code{latex.lib} (@pxref{latex_lib}).
  56. @table @asis
  57. @item @strong{Usage:}
  58. closetex(fname); fname string
  59. @item @strong{Return:}
  60. nothing; writes a LaTeX2e closing line into file @code{<fname>}.
  61. @item @strong{Note:}
  62. preceding ">>" are deleted and suffix ".tex" (if not given)
  63. is added to @code{fname}.
  64. @end table
  65. @strong{Example:}
  66. @smallexample
  67. @c computed example closetex d2t_singular/latex_lib.doc:73
  68. LIB "latex.lib";
  69. opentex("exmpl");
  70. texobj("exmpl","@{\\large \\bf hello@}");
  71. closetex("exmpl");
  72. @c end example closetex d2t_singular/latex_lib.doc:73
  73. @end smallexample
  74. @c ---end content closetex---
  75. @c ------------------- opentex -------------
  76. @node opentex, tex, closetex, latex_lib
  77. @subsubsection opentex
  78. @cindex opentex
  79. @c ---content opentex---
  80. Procedure from library @code{latex.lib} (@pxref{latex_lib}).
  81. @table @asis
  82. @item @strong{Usage:}
  83. opentex(fname); fname string
  84. @item @strong{Return:}
  85. nothing; writes a LaTeX2e header into a new file @code{<fname>}.
  86. @item @strong{Note:}
  87. preceding ">>" are deleted and suffix ".tex" (if not given)
  88. is added to @code{fname}.
  89. @end table
  90. @strong{Example:}
  91. @smallexample
  92. @c computed example opentex d2t_singular/latex_lib.doc:103
  93. LIB "latex.lib";
  94. opentex("exmpl");
  95. texobj("exmpl","hello");
  96. closetex("exmpl");
  97. @c end example opentex d2t_singular/latex_lib.doc:103
  98. @end smallexample
  99. @c ---end content opentex---
  100. @c ------------------- tex -------------
  101. @node tex, texdemo, opentex, latex_lib
  102. @subsubsection tex
  103. @cindex tex
  104. @c ---content tex---
  105. Procedure from library @code{latex.lib} (@pxref{latex_lib}).
  106. @table @asis
  107. @item @strong{Usage:}
  108. tex(fname); fname string
  109. @item @strong{Return:}
  110. nothing; calls latex (LaTeX2e) for compiling the file fname
  111. @item @strong{Note:}
  112. preceding ">>" are deleted and suffix ".tex" (if not given)
  113. is added to @code{fname}.
  114. @end table
  115. @strong{Example:}
  116. @smallexample
  117. @c computed example tex d2t_singular/latex_lib.doc:133
  118. LIB "latex.lib";
  119. ring r;
  120. ideal I = maxideal(7);
  121. opentex("exp001"); // open latex2e document
  122. texobj("exp001","An ideal ",I);
  123. closetex("exp001");
  124. tex("exp001");
  125. @expansion{} calling latex2e for : exp001.tex
  126. @expansion{}
  127. @expansion{} This is TeX, Version 3.14159 (Web2C 7.3.1)
  128. @expansion{} (exp001.tex
  129. @expansion{} LaTeX2e <1998/12/01> patch level 1
  130. @expansion{} Babel <v3.6x> and hyphenation patterns for american, french, german, nger\
  131. man, i
  132. @expansion{} talian, nohyphenation, loaded.
  133. @expansion{} (/usr/share/texmf/tex/latex/base/article.cls
  134. @expansion{} Document Class: article 1999/01/07 v1.4a Standard LaTeX document class
  135. @expansion{} (/usr/share/texmf/tex/latex/base/size10.clo))
  136. @expansion{} (/usr/share/texmf/tex/latex/amslatex/amsmath.sty
  137. @expansion{} (/usr/share/texmf/tex/latex/amslatex/amstext.sty
  138. @expansion{} (/usr/share/texmf/tex/latex/amslatex/amsgen.sty))
  139. @expansion{} (/usr/share/texmf/tex/latex/amslatex/amsbsy.sty)
  140. @expansion{} (/usr/share/texmf/tex/latex/amslatex/amsopn.sty))
  141. @expansion{} (/usr/share/texmf/tex/latex/amsfonts/amssymb.sty
  142. @expansion{} (/usr/share/texmf/tex/latex/amsfonts/amsfonts.sty))
  143. @expansion{} No file exp001.aux.
  144. @expansion{} (/usr/share/texmf/tex/latex/amsfonts/umsa.fd)
  145. @expansion{} (/usr/share/texmf/tex/latex/amsfonts/umsb.fd) [1] (exp001.aux) )
  146. @expansion{} Output written on exp001.dvi (1 page, 2912 bytes).
  147. @expansion{} Transcript written on exp001.log.
  148. system("sh","rm exp001.*");
  149. @expansion{} 0
  150. @c end example tex d2t_singular/latex_lib.doc:133
  151. @end smallexample
  152. @c ---end content tex---
  153. @c ------------------- texdemo -------------
  154. @node texdemo, texfactorize, tex, latex_lib
  155. @subsubsection texdemo
  156. @cindex texdemo
  157. @c ---content texdemo---
  158. Procedure from library @code{latex.lib} (@pxref{latex_lib}).
  159. @table @asis
  160. @item @strong{Usage:}
  161. texdemo();
  162. @item @strong{Return:}
  163. nothing; generates a LaTeX2e file called @code{texlibdemo.tex}
  164. explaining the features of @code{latex.lib} and its global variables.
  165. @item @strong{Note:}
  166. this proc may take some time.
  167. @end table
  168. @c ---end content texdemo---
  169. @c ------------------- texfactorize -------------
  170. @node texfactorize, texmap, texdemo, latex_lib
  171. @subsubsection texfactorize
  172. @cindex texfactorize
  173. @c ---content texfactorize---
  174. Procedure from library @code{latex.lib} (@pxref{latex_lib}).
  175. @table @asis
  176. @item @strong{Usage:}
  177. texfactorize(fname,f); fname string, f poly
  178. @item @strong{Return:}
  179. if @code{fname=""}: string, f as a product of its irreducible
  180. factors@*
  181. otherwise: append this string to the file @code{<fname>}, and
  182. return nothing.
  183. @item @strong{Note:}
  184. preceding ">>" are deleted and suffix ".tex" (if not given)
  185. is added to @code{fname}.
  186. @end table
  187. @strong{Example:}
  188. @smallexample
  189. @c computed example texfactorize d2t_singular/latex_lib.doc:191
  190. LIB "latex.lib";
  191. ring r2 = 13,(x,y),dp;
  192. poly f = (x+1+y)^2*x3y*(2x-2y)*y12;
  193. texfactorize("",f);
  194. @expansion{} $-2\cdot x^@{3@}\cdot y^@{13@}\cdot (-x+y)\cdot (x+y+1)^@{2@}$
  195. ring R49 = (7,a),x,dp;
  196. minpoly = a2+a+3;
  197. poly f = (a24x5+x3)*a2x6*(x+1)^2;
  198. f;
  199. @expansion{} (a+3)*x13+(2a-1)*x12+(-2a+1)*x10+(-a-3)*x9
  200. texfactorize("",f);
  201. @expansion{} $(a+3)\cdot (x-1)\cdot (x+1)^@{3@}\cdot x^@{9@}$
  202. @c end example texfactorize d2t_singular/latex_lib.doc:191
  203. @end smallexample
  204. @c ---end content texfactorize---
  205. @c ------------------- texmap -------------
  206. @node texmap, texname, texfactorize, latex_lib
  207. @subsubsection texmap
  208. @cindex texmap
  209. @c ---content texmap---
  210. Procedure from library @code{latex.lib} (@pxref{latex_lib}).
  211. @table @asis
  212. @item @strong{Usage:}
  213. texmap(fname,m,@@r1,@@r2); fname string, m string/map, @@r1,@@r2 rings
  214. @item @strong{Return:}
  215. if @code{fname=""}: string, the map m from @@r1 to @@r2 (preceded
  216. by its name if m = string) in TeX-typesetting;@*
  217. otherwise: append this string to the file @code{<fname>}, and
  218. return nothing.
  219. @item @strong{Note:}
  220. preceding ">>" are deleted in @code{fname}, and suffix ".tex"
  221. (if not given) is added to @code{fname}.
  222. If m is a string then it has to be the name of an existing map
  223. from @@r1 to @@r2.
  224. @end table
  225. @strong{Example:}
  226. @smallexample
  227. @c computed example texmap d2t_singular/latex_lib.doc:231
  228. LIB "latex.lib";
  229. // -------- prepare for example ---------
  230. if (defined(TeXaligned)) @{int Teali=TeXaligned; kill TeXaligned;@}
  231. if (defined(TeXreplace)) @{list Terep=TeXreplace; kill TeXreplace;@}
  232. // -------- the example starts here ---------
  233. //
  234. string fname = "tldemo";
  235. ring @@r1=0,(x,y,z),dp;
  236. if(system("with","Namespaces")) @{ exportto(Current, @@r1); @}
  237. else @{ export @@r1; @}
  238. @expansion{} // ** `@@r1` is already global
  239. ring r2=0,(u,v),dp;
  240. map @@phi =(@@r1,u2,uv -v,v2); export @@phi;
  241. @expansion{} // ** `@@phi` is already global
  242. list TeXreplace;
  243. TeXreplace[1] = list("@@phi","\\phi"); // @@phi --> \phi
  244. export TeXreplace;
  245. @expansion{} // ** `TeXreplace` is already global
  246. texmap("","@@phi",@@r1,r2); // standard form
  247. @expansion{} $$
  248. @expansion{} \begin@{array@}@{rcc@}
  249. @expansion{} \phi:\Q[x,y,z] & \longrightarrow & \Q[u,v]\\[2mm]
  250. @expansion{} \left(x,y,z\right) & \longmapsto &
  251. @expansion{} \left(
  252. @expansion{} \begin@{array@}@{c@}
  253. @expansion{} u^@{2@}\\
  254. @expansion{} uv-v\\
  255. @expansion{} v^@{2@}
  256. @expansion{} \end@{array@}
  257. @expansion{} \right)
  258. @expansion{} \end@{array@}
  259. @expansion{} $$
  260. //
  261. int TeXaligned; export TeXaligned; // map in one line
  262. @expansion{} // ** `TeXaligned` is already global
  263. texmap("",@@phi,@@r1,r2);
  264. @expansion{} $\Q[x,y,z]\longrightarrow\Q[u,v], \ \left(x,y,z\right)\longmapsto \left(u\
  265. ^@{2@},uv-v,v^@{2@}\right)$
  266. //
  267. kill @@r1,TeXreplace,TeXaligned;
  268. //
  269. // --- restore global variables if previously defined ---
  270. if (defined(Teali)) @{int TeXaligned=Teali; export TeXaligned; kill Teali;@}
  271. if (defined(Terep)) @{list TeXreplace=Terep; export TeXreplace; kill Terep;@}
  272. @c end example texmap d2t_singular/latex_lib.doc:231
  273. @end smallexample
  274. @c ---end content texmap---
  275. @c ------------------- texname -------------
  276. @node texname, texobj, texmap, latex_lib
  277. @subsubsection texname
  278. @cindex texname
  279. @c ---content texname---
  280. Procedure from library @code{latex.lib} (@pxref{latex_lib}).
  281. @table @asis
  282. @item @strong{Usage:}
  283. texname(fname,s); fname,s strings
  284. @item @strong{Return:}
  285. if @code{fname=""}: string, the transformed string s, where the
  286. following rules apply:
  287. @smallexample
  288. s' + "~" --> "\\tilde@{"+ s' +"@}"
  289. "_" + int --> "_@{" + int +"@}"
  290. "[" + s' + "]" --> "_@{" + s' + "@}"
  291. "A..Z" + int --> "A..Z" + "^@{" + int + "@}"
  292. "a..z" + int --> "a..z" + "_@{" + int + "@}"
  293. "(" + int + "," + s' + ")" --> "_@{"+ int +"@}" + "^@{" + s'+"@}"
  294. @end smallexample
  295. Anyhow, strings which begin with a @code{"@{"} are only changed
  296. by deleting the first and last character (intended to remove the
  297. surrounding curly brackets).
  298. if @code{fname!=""}: append the transformed string s to the file
  299. @code{<fname>}, and return nothing.
  300. @item @strong{Note:}
  301. preceding ">>" are deleted in @code{fname}, and suffix ".tex"
  302. (if not given) is added to @code{fname}.
  303. @end table
  304. @strong{Example:}
  305. @smallexample
  306. @c computed example texname d2t_singular/latex_lib.doc:297
  307. LIB "latex.lib";
  308. ring r = 0,(x,y),lp;
  309. poly f = 3xy4 + 2xy2 + x5y3 + x + y6;
  310. texname("","@{f(10)@}");
  311. @expansion{} f(10)
  312. texname("","f(10) =");
  313. @expansion{} f_@{10@} =
  314. texname("","n1");
  315. @expansion{} n_@{1@}
  316. texname("","T1_12");
  317. @expansion{} T^@{1@}_@{12@}
  318. texname("","g'_11");
  319. @expansion{} g'_@{11@}
  320. texname("","f23");
  321. @expansion{} f_@{23@}
  322. texname("","M[2,3]");
  323. @expansion{} M_@{2,3@}
  324. texname("","A(0,3);");
  325. @expansion{} A_@{0@}^@{3@};
  326. texname("","E~(3)");
  327. @expansion{} \tilde@{E@}_@{3@}
  328. @c end example texname d2t_singular/latex_lib.doc:297
  329. @end smallexample
  330. @c ---end content texname---
  331. @c ------------------- texobj -------------
  332. @node texobj, texpoly, texname, latex_lib
  333. @subsubsection texobj
  334. @cindex texobj
  335. @c ---content texobj---
  336. Procedure from library @code{latex.lib} (@pxref{latex_lib}).
  337. @table @asis
  338. @item @strong{Usage:}
  339. texobj(fname,l); fname string, l list
  340. @item @strong{Return:}
  341. if @code{fname=""}: string, the entries of l in LaTeX-typesetting;@*
  342. otherwise: append this string to the file @code{<fname>}, and
  343. return nothing.
  344. @item @strong{Note:}
  345. preceding ">>" are deleted in @code{fname}, and suffix ".tex"
  346. (if not given) is added to @code{fname}.
  347. @end table
  348. @strong{Example:}
  349. @smallexample
  350. @c computed example texobj d2t_singular/latex_lib.doc:337
  351. LIB "latex.lib";
  352. // -------- prepare for example ---------
  353. if (defined(TeXaligned)) @{int Teali=TeXaligned; kill TeXaligned;@}
  354. if (defined(TeXbrack))@{string Tebra=TeXbrack; kill TeXbrack;@}
  355. //
  356. // -------------- typesetting for polynomials ----------
  357. ring r = 0,(x,y),lp;
  358. poly f = x5y3 + 3xy4 + 2xy2 + y6;
  359. f;
  360. @expansion{} x5y3+3xy4+2xy2+y6
  361. texobj("",f);
  362. @expansion{} $$\begin@{array@}@{rl@}
  363. @expansion{} & x^@{5@}y^@{3@}+3xy^@{4@}+2xy^@{2@}+y^@{6@}\\
  364. @expansion{} \end@{array@}
  365. @expansion{} $$
  366. @expansion{}
  367. // -------------- typesetting for ideals ----------
  368. ideal G = jacob(f);
  369. G;
  370. @expansion{} G[1]=5x4y3+3y4+2y2
  371. @expansion{} G[2]=3x5y2+12xy3+4xy+6y5
  372. texobj("",G);
  373. @expansion{} $$\left(
  374. @expansion{} \begin@{array@}@{c@}
  375. @expansion{} 5x^@{4@}y^@{3@}+3y^@{4@}+2y^@{2@}, \\
  376. @expansion{} 3x^@{5@}y^@{2@}+12xy^@{3@}+4xy+6y^@{5@}
  377. @expansion{} \end@{array@}
  378. @expansion{} \right)$$
  379. @expansion{}
  380. // -------------- variation of typesetting for ideals ----------
  381. int TeXaligned = 1; export TeXaligned;
  382. @expansion{} // ** `TeXaligned` is already global
  383. string TeXbrack = "<"; export TeXbrack;
  384. @expansion{} // ** `TeXbrack` is already global
  385. texobj("",G);
  386. @expansion{} $\left<5x^@{4@}y^@{3@}+3y^@{4@}+2y^@{2@},3x^@{5@}y^@{2@}+12xy^@{3@}+4xy+6y^@{5@}\right>$
  387. @expansion{}
  388. kill TeXaligned, TeXbrack;
  389. // -------------- typesetting for matrices ----------
  390. matrix J = jacob(G);
  391. texobj("",J);
  392. @expansion{} $$\left(
  393. @expansion{} \begin@{array@}@{*@{2@}@{c@}@}
  394. @expansion{} 20x^@{3@}y^@{3@} & 15x^@{4@}y^@{2@}+12y^@{3@}+4y \\
  395. @expansion{} 15x^@{4@}y^@{2@}+12y^@{3@}+4y & 6x^@{5@}y+36xy^@{2@}+4x+30y^@{4@}
  396. @expansion{} \end@{array@}
  397. @expansion{} \right)
  398. @expansion{} $$
  399. @expansion{}
  400. // -------------- typesetting for intmats ----------
  401. intmat m[3][4] = 9,2,4,5,2,5,-2,4,-6,10,-1,2,7;
  402. texobj("",m);
  403. @expansion{} $$\left(
  404. @expansion{} \begin@{array@}@{*@{4@}@{r@}@}
  405. @expansion{} 9 & 2 & 4 & 5\\
  406. @expansion{} 2 & 5 & -2 & 4\\
  407. @expansion{} -6 & 10 & -1 & 2
  408. @expansion{} \end@{array@}
  409. @expansion{} \right)
  410. @expansion{} $$
  411. @expansion{}
  412. //
  413. // --- restore global variables if previously defined ---
  414. if (defined(Teali))@{int TeXaligned=Teali; export TeXaligned; kill Teali;@}
  415. if (defined(Tebra))@{string TeXbrack=Tebra; export TeXbrack; kill Tebra;@}
  416. @c end example texobj d2t_singular/latex_lib.doc:337
  417. @end smallexample
  418. @c ---end content texobj---
  419. @c ------------------- texpoly -------------
  420. @node texpoly, texproc, texobj, latex_lib
  421. @subsubsection texpoly
  422. @cindex texpoly
  423. @c ---content texpoly---
  424. Procedure from library @code{latex.lib} (@pxref{latex_lib}).
  425. @table @asis
  426. @item @strong{Usage:}
  427. texpoly(fname,p); fname string, p poly
  428. @item @strong{Return:}
  429. if @code{fname=""}: string, the poly p in LaTeX-typesetting;@*
  430. otherwise: append this string to the file @code{<fname>}, and
  431. return nothing.
  432. @item @strong{Note:}
  433. preceding ">>" are deleted in @code{fname}, and suffix ".tex"
  434. (if not given) is added to @code{fname}.
  435. @end table
  436. @strong{Example:}
  437. @smallexample
  438. @c computed example texpoly d2t_singular/latex_lib.doc:394
  439. LIB "latex.lib";
  440. ring r0=0,(x,y,z),dp;
  441. poly f = -1x^2 + 2;
  442. texpoly("",f);
  443. @expansion{} $-x^@{2@}+2$
  444. ring rr= real,(x,y,z),dp;
  445. texpoly("",2x2y23z);
  446. @expansion{} $2.000x^@{2@}y^@{23@}z$
  447. ring r7= 7,(x,y,z),dp;
  448. poly f = 2x2y23z;
  449. texpoly("",f);
  450. @expansion{} $2x^@{2@}y^@{23@}z$
  451. ring rab =(0,a,b),(x,y,z),dp;
  452. poly f = (-2a2 +b3 -2)/a * x2y4z5 + (a2+1)*x + a+1;
  453. f;
  454. @expansion{} (-2a2+b3-2)/(a)*x2y4z5+(a2+1)*x+(a+1)
  455. texpoly("",f);
  456. @expansion{} $-\frac@{2a^@{2@}-b^@{3@}+2@}@{a@}x^@{2@}y^@{4@}z^@{5@}+(a^@{2@}+1)x+(a+1)$
  457. @c end example texpoly d2t_singular/latex_lib.doc:394
  458. @end smallexample
  459. @c ---end content texpoly---
  460. @c ------------------- texproc -------------
  461. @node texproc, texring, texpoly, latex_lib
  462. @subsubsection texproc
  463. @cindex texproc
  464. @c ---content texproc---
  465. Procedure from library @code{latex.lib} (@pxref{latex_lib}).
  466. @table @asis
  467. @item @strong{Usage:}
  468. texproc(fname,pname); fname,pname strings
  469. @item @strong{Assume:}
  470. @code{`pname`} is a procedure.
  471. @item @strong{Return:}
  472. if @code{fname=""}: string, the proc @code{`pname`} in a verbatim
  473. environment in LaTeX-typesetting;@*
  474. otherwise: append this string to the file @code{<fname>}, and
  475. return nothing.
  476. @item @strong{Note:}
  477. preceding ">>" are deleted in @code{fname}, and suffix ".tex"
  478. (if not given) is added to @code{fname}.@*
  479. @code{texproc} cannot be applied to itself correctly.
  480. @end table
  481. @strong{Example:}
  482. @smallexample
  483. @c computed example texproc d2t_singular/latex_lib.doc:440
  484. LIB "latex.lib";
  485. proc exp(int i,int j,list #)
  486. @{ string s;
  487. if (size(#))
  488. @{
  489. for(i;i<=j;i++)
  490. @{ s = s + string(j) + string(#); @}
  491. @}
  492. return(s);
  493. @}
  494. export exp;
  495. @expansion{} // ** `exp` is already global
  496. texproc("","exp");
  497. @expansion{} \begin@{verbatim@}
  498. @expansion{} proc exp(int i,int j,list #)
  499. @expansion{} @{
  500. @expansion{} string s;
  501. @expansion{} if (size(#))
  502. @expansion{} @{
  503. @expansion{} for(i;i<=j;i++)
  504. @expansion{} @{ s = s + string(j) + string(#); @}
  505. @expansion{} @}
  506. @expansion{} return(s);
  507. @expansion{}
  508. @expansion{} @}
  509. @expansion{} \end@{verbatim@}
  510. @expansion{}
  511. kill exp;
  512. @c end example texproc d2t_singular/latex_lib.doc:440
  513. @end smallexample
  514. @c ---end content texproc---
  515. @c ------------------- texring -------------
  516. @node texring, rmx, texproc, latex_lib
  517. @subsubsection texring
  518. @cindex texring
  519. @c ---content texring---
  520. Procedure from library @code{latex.lib} (@pxref{latex_lib}).
  521. @table @asis
  522. @item @strong{Usage:}
  523. texring(fname, r[,L]); fname string, r ring, L list
  524. @item @strong{Return:}
  525. if @code{fname=""}: string, the ring in TeX-typesetting;@*
  526. otherwise: append this string to the file @code{<fname>} and
  527. return nothing.
  528. @item @strong{Note:}
  529. preceding ">>" are deleted and suffix ".tex" (if not given)
  530. is added to @code{fname}.@*
  531. The optional list L is assumed to be a list of strings which control,
  532. e.g., the symbol for the field of coefficients.@*
  533. For more details call @code{texdemo();} (generates a LaTeX2e
  534. file called @code{texlibdemo.tex} which explains all features of
  535. @code{texring}).
  536. @end table
  537. @strong{Example:}
  538. @smallexample
  539. @c computed example texring d2t_singular/latex_lib.doc:486
  540. LIB "latex.lib";
  541. ring r0 = 0,(x,y),dp; // char = 0, polynomial ordering
  542. texring("",r0);
  543. @expansion{} $\Q[x,y]$
  544. //
  545. ring r7 =7,(x(0..2)),ds; // char = 7, local ordering
  546. texring("",r7);
  547. @expansion{} $\Z_@{7@}[[x_@{0@},x_@{1@},x_@{2@}]]$
  548. //
  549. ring r1 = 0,(x1,x2,y1,y2),wp(1,2,3,4);
  550. texring("",r1);
  551. @expansion{} $\Q[x_@{1@},x_@{2@},y_@{1@},y_@{2@}]$
  552. //
  553. ring rr = real,(x),dp; // real numbers
  554. texring("",rr);
  555. @expansion{} $\R[x]$
  556. //
  557. ring rabc =(0,t1,t2,t3),(x,y),dp; // ring with parameters
  558. texring("",rabc);
  559. @expansion{} $\Q(t_@{1@},t_@{2@},t_@{3@})[x,y]$
  560. //
  561. ring ralg = (7,a),(x1,x2),ds; // algebraic extension
  562. minpoly = a2-a+3;
  563. texring("",ralg);
  564. @expansion{} $\Z_@{7@}(a)[[x_@{1@},x_@{2@}]]$
  565. texring("",ralg,"mipo");
  566. @expansion{} $\Z_@{7@}(a)/(a^@{2@}-a+3)[[x_@{1@},x_@{2@}]]$
  567. //
  568. ring r49=(49,a),x,dp; // Galois field
  569. texring("",r49);
  570. @expansion{} $\F_@{49@}[x]$
  571. //
  572. setring r0; // quotient ring
  573. ideal i = x2-y3;
  574. qring q = std(i);
  575. texring("",q);
  576. @expansion{} $\Q[x,y]/\left(y^@{3@}-x^@{2@}\right)
  577. @expansion{} $
  578. //
  579. // ------------------ additional features -------------------
  580. ring r9 =0,(x(0..9)),ds;
  581. texring("",r9,1);
  582. @expansion{} $\Q[[x_@{0@},\ldots,x_@{9@}]]$
  583. texring("",r9,"C","@{","^G");
  584. @expansion{} $\C\@{x_@{0@},x_@{1@},x_@{2@},x_@{3@},x_@{4@},x_@{5@},x_@{6@},x_@{7@},x_@{8@},x_@{9@}\@}^G$
  585. //
  586. ring rxy = 0,(x(1..5),y(1..6)),ds;
  587. intvec v = 5,6;
  588. texring("",rxy,v);
  589. @expansion{} $\Q[[x_@{1@},\ldots,x_@{5@},y_@{1@},\ldots,y_@{6@}]]$
  590. @c end example texring d2t_singular/latex_lib.doc:486
  591. @end smallexample
  592. @c ---end content texring---
  593. @c ------------------- rmx -------------
  594. @node rmx, xdvi, texring, latex_lib
  595. @subsubsection rmx
  596. @cindex rmx
  597. @c ---content rmx---
  598. Procedure from library @code{latex.lib} (@pxref{latex_lib}).
  599. @table @asis
  600. @item @strong{Usage:}
  601. rmx(fname); fname string
  602. @item @strong{Return:}
  603. nothing; removes the @code{.log} and @code{.aux} files associated to
  604. the LaTeX file <fname>.@*
  605. @item @strong{Note:}
  606. If @code{fname} ends by @code{".dvi"} or @code{".tex"}, the
  607. @code{.dvi} or @code{.tex} file will be deleted, too.
  608. @end table
  609. @strong{Example:}
  610. @smallexample
  611. @c computed example rmx d2t_singular/latex_lib.doc:550
  612. LIB "latex.lib";
  613. ring r;
  614. poly f = x+y+z;
  615. opentex("exp001"); // defaulted latex2e document
  616. texobj("exp001","A polynom",f);
  617. closetex("exp001");
  618. tex("exp001");
  619. @expansion{} calling latex2e for : exp001.tex
  620. @expansion{}
  621. @expansion{} This is TeX, Version 3.14159 (Web2C 7.3.1)
  622. @expansion{} (exp001.tex
  623. @expansion{} LaTeX2e <1998/12/01> patch level 1
  624. @expansion{} Babel <v3.6x> and hyphenation patterns for american, french, german, nger\
  625. man, i
  626. @expansion{} talian, nohyphenation, loaded.
  627. @expansion{} (/usr/share/texmf/tex/latex/base/article.cls
  628. @expansion{} Document Class: article 1999/01/07 v1.4a Standard LaTeX document class
  629. @expansion{} (/usr/share/texmf/tex/latex/base/size10.clo))
  630. @expansion{} (/usr/share/texmf/tex/latex/amslatex/amsmath.sty
  631. @expansion{} (/usr/share/texmf/tex/latex/amslatex/amstext.sty
  632. @expansion{} (/usr/share/texmf/tex/latex/amslatex/amsgen.sty))
  633. @expansion{} (/usr/share/texmf/tex/latex/amslatex/amsbsy.sty)
  634. @expansion{} (/usr/share/texmf/tex/latex/amslatex/amsopn.sty))
  635. @expansion{} (/usr/share/texmf/tex/latex/amsfonts/amssymb.sty
  636. @expansion{} (/usr/share/texmf/tex/latex/amsfonts/amsfonts.sty))
  637. @expansion{} No file exp001.aux.
  638. @expansion{} (/usr/share/texmf/tex/latex/amsfonts/umsa.fd)
  639. @expansion{} (/usr/share/texmf/tex/latex/amsfonts/umsb.fd) [1] (exp001.aux) )
  640. @expansion{} Output written on exp001.dvi (1 page, 308 bytes).
  641. @expansion{} Transcript written on exp001.log.
  642. rmx("exp001"); // removes aux and log file of exp001
  643. system("sh","rm exp001.*");
  644. @expansion{} 0
  645. @c end example rmx d2t_singular/latex_lib.doc:550
  646. @end smallexample
  647. @c ---end content rmx---
  648. @c ------------------- xdvi -------------
  649. @node xdvi,, rmx, latex_lib
  650. @subsubsection xdvi
  651. @cindex xdvi
  652. @c ---content xdvi---
  653. Procedure from library @code{latex.lib} (@pxref{latex_lib}).
  654. @table @asis
  655. @item @strong{Usage:}
  656. xdvi(fname[,style]); fname,style = string
  657. @item @strong{Return:}
  658. nothing; displays dvi-file fname.dvi with previewer xdvi
  659. @item @strong{Note:}
  660. ending .dvi may miss in fname
  661. @*style overwrites the default setting xdvi
  662. @end table
  663. @strong{Example:}
  664. @smallexample
  665. @c computed example xdvi d2t_singular/latex_lib.doc:585
  666. LIB "latex.lib";
  667. intmat m[3][4] = 9,2,4,5,2,5,-2,4,-6,10,-1,2,7;
  668. opentex("exp001");
  669. texobj("exp001","An intmat: ",m);
  670. closetex("exp001");
  671. tex("exp001");
  672. @expansion{} calling latex2e for : exp001.tex
  673. @expansion{}
  674. @expansion{} This is TeX, Version 3.14159 (Web2C 7.3.1)
  675. @expansion{} (exp001.tex
  676. @expansion{} LaTeX2e <1998/12/01> patch level 1
  677. @expansion{} Babel <v3.6x> and hyphenation patterns for american, french, german, nger\
  678. man, i
  679. @expansion{} talian, nohyphenation, loaded.
  680. @expansion{} (/usr/share/texmf/tex/latex/base/article.cls
  681. @expansion{} Document Class: article 1999/01/07 v1.4a Standard LaTeX document class
  682. @expansion{} (/usr/share/texmf/tex/latex/base/size10.clo))
  683. @expansion{} (/usr/share/texmf/tex/latex/amslatex/amsmath.sty
  684. @expansion{} (/usr/share/texmf/tex/latex/amslatex/amstext.sty
  685. @expansion{} (/usr/share/texmf/tex/latex/amslatex/amsgen.sty))
  686. @expansion{} (/usr/share/texmf/tex/latex/amslatex/amsbsy.sty)
  687. @expansion{} (/usr/share/texmf/tex/latex/amslatex/amsopn.sty))
  688. @expansion{} (/usr/share/texmf/tex/latex/amsfonts/amssymb.sty
  689. @expansion{} (/usr/share/texmf/tex/latex/amsfonts/amsfonts.sty))
  690. @expansion{} No file exp001.aux.
  691. @expansion{} (/usr/share/texmf/tex/latex/amsfonts/umsa.fd)
  692. @expansion{} (/usr/share/texmf/tex/latex/amsfonts/umsb.fd) [1] (exp001.aux) )
  693. @expansion{} Output written on exp001.dvi (1 page, 524 bytes).
  694. @expansion{} Transcript written on exp001.log.
  695. xdvi("exp001");
  696. @expansion{} calling xdvi for : exp001
  697. @expansion{}
  698. system("sh","rm exp001.*");
  699. @expansion{} 0
  700. @c end example xdvi d2t_singular/latex_lib.doc:585
  701. @end smallexample
  702. @c ---end content xdvi---