stockor 0.1.9 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (313) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/Gemfile.lock +254 -72
  4. data/Guardfile +1 -1
  5. data/README.md +24 -3
  6. data/app.json +28 -0
  7. data/client/skr/Extension.coffee +18 -0
  8. data/client/skr/components/BankAccountFinder.cjsx +34 -0
  9. data/client/skr/components/Currency.cjsx +19 -0
  10. data/client/skr/components/CustomerFinder.cjsx +37 -0
  11. data/client/skr/components/CustomerLink.cjsx +13 -0
  12. data/client/skr/components/CustomerProjectFinder.cjsx +49 -0
  13. data/client/skr/components/GlAccountChooser.cjsx +38 -0
  14. data/client/skr/components/InvoiceFinder.cjsx +37 -0
  15. data/client/skr/components/InvoiceLink.cjsx +13 -0
  16. data/client/skr/components/LocationChooser.cjsx +37 -0
  17. data/client/skr/components/PaymentCategoryFinder.cjsx +34 -0
  18. data/client/skr/components/PrintFormChooser.cjsx +29 -0
  19. data/client/skr/components/SalesOrderFinder.cjsx +38 -0
  20. data/client/skr/components/ScreenControls.cjsx +20 -0
  21. data/client/skr/components/SkuFinder.cjsx +30 -0
  22. data/client/skr/components/SkuLines.cjsx +76 -0
  23. data/client/skr/components/SystemSettings.cjsx +26 -0
  24. data/client/skr/components/TermsChooser.cjsx +40 -0
  25. data/client/skr/components/ToolbarButton.cjsx +7 -0
  26. data/client/skr/components/TotalsLine.cjsx +21 -0
  27. data/client/skr/components/TriStateIcon.cjsx +12 -0
  28. data/client/skr/components/UOMChooser.cjsx +24 -0
  29. data/client/skr/components/UserPreferences.cjsx +30 -0
  30. data/client/skr/components/VendorFinder.cjsx +40 -0
  31. data/client/skr/components/address/Address.cjsx +10 -10
  32. data/client/skr/components/styles.scss +16 -0
  33. data/client/skr/index.js +3 -1
  34. data/client/skr/models/Address.coffee +9 -1
  35. data/client/skr/models/BankAccount.coffee +17 -0
  36. data/client/skr/models/Base.coffee +6 -0
  37. data/client/skr/models/Customer.coffee +17 -10
  38. data/client/skr/models/CustomerProject.coffee +29 -0
  39. data/client/skr/models/GlAccount.coffee +22 -10
  40. data/client/skr/models/GlManualEntry.coffee +4 -2
  41. data/client/skr/models/GlPeriod.coffee +4 -6
  42. data/client/skr/models/GlPosting.coffee +7 -7
  43. data/client/skr/models/GlTransaction.coffee +3 -3
  44. data/client/skr/models/IaLine.coffee +9 -9
  45. data/client/skr/models/IaReason.coffee +4 -4
  46. data/client/skr/models/InvLine.coffee +30 -11
  47. data/client/skr/models/InventoryAdjustment.coffee +8 -6
  48. data/client/skr/models/Invoice.coffee +89 -18
  49. data/client/skr/models/Location.coffee +27 -6
  50. data/client/skr/models/Payment.coffee +36 -0
  51. data/client/skr/models/PaymentCategory.coffee +12 -0
  52. data/client/skr/models/PaymentTerm.coffee +17 -4
  53. data/client/skr/models/PickTicket.coffee +7 -5
  54. data/client/skr/models/PoLine.coffee +15 -15
  55. data/client/skr/models/PoReceipt.coffee +8 -6
  56. data/client/skr/models/PorLine.coffee +11 -11
  57. data/client/skr/models/PricingProvider.coffee +6 -0
  58. data/client/skr/models/PtLine.coffee +13 -13
  59. data/client/skr/models/PurchaseOrder.coffee +11 -9
  60. data/client/skr/models/SalesOrder.coffee +59 -22
  61. data/client/skr/models/Sku.coffee +17 -15
  62. data/client/skr/models/SkuLoc.coffee +14 -9
  63. data/client/skr/models/SkuTran.coffee +10 -10
  64. data/client/skr/models/SkuVendor.coffee +9 -9
  65. data/client/skr/models/SoLine.coffee +27 -20
  66. data/client/skr/models/TimeEntry.coffee +75 -0
  67. data/client/skr/models/Uom.coffee +27 -6
  68. data/client/skr/models/Vendor.coffee +14 -12
  69. data/client/skr/models/VoLine.coffee +11 -11
  70. data/client/skr/models/Voucher.coffee +7 -5
  71. data/client/skr/models/mixins/HasVisibleId.coffee +7 -0
  72. data/client/skr/models/mixins/PrintSupport.coffee +6 -0
  73. data/client/skr/models/mixins/SkuLine.coffee +61 -0
  74. data/client/skr/screens/Commands.coffee +29 -0
  75. data/client/skr/screens/bank-maint/BankMaint.cjsx +43 -0
  76. data/client/skr/screens/bank-maint/index.js +5 -0
  77. data/client/skr/screens/chart-of-accounts/ChartOfAccounts.cjsx +40 -0
  78. data/client/skr/screens/chart-of-accounts/index.js +1 -0
  79. data/client/skr/screens/chart-of-accounts/index.scss +12 -0
  80. data/client/skr/screens/customer-maint/CustomerMaint.cjsx +35 -36
  81. data/client/skr/screens/customer-projects/CustomerProjects.cjsx +70 -0
  82. data/client/skr/screens/customer-projects/index.js +5 -0
  83. data/client/skr/screens/customer-projects/index.scss +25 -0
  84. data/client/skr/screens/fresh-books-import/ApiInfo.cjsx +35 -0
  85. data/client/skr/screens/fresh-books-import/ChooseRecords.cjsx +116 -0
  86. data/client/skr/screens/fresh-books-import/FreshBooksImport.cjsx +31 -0
  87. data/client/skr/screens/fresh-books-import/Import.coffee +52 -0
  88. data/client/skr/screens/fresh-books-import/ViewRecords.cjsx +96 -0
  89. data/client/skr/screens/fresh-books-import/index.js +1 -0
  90. data/client/skr/screens/fresh-books-import/index.scss +39 -0
  91. data/client/skr/screens/gl-accounts/GlAccounts.cjsx +31 -0
  92. data/client/skr/screens/gl-accounts/index.js +5 -0
  93. data/client/skr/screens/gl-transactions/GlTransactions.cjsx +46 -0
  94. data/client/skr/screens/gl-transactions/index.js +1 -0
  95. data/client/skr/screens/gl-transactions/index.scss +12 -0
  96. data/client/skr/screens/invoice/Invoice.cjsx +92 -0
  97. data/client/skr/screens/invoice/Payment.cjsx +28 -0
  98. data/client/skr/screens/invoice/index.js +5 -0
  99. data/client/skr/screens/locations/Locations.cjsx +31 -0
  100. data/client/skr/screens/locations/index.js +5 -0
  101. data/client/skr/screens/payment-category/PaymentCategory.cjsx +28 -0
  102. data/client/skr/screens/payment-category/index.js +5 -0
  103. data/client/skr/screens/payment-category/index.scss +9 -0
  104. data/client/skr/screens/payment-terms/PaymentTerms.cjsx +28 -0
  105. data/client/skr/screens/payment-terms/index.js +5 -0
  106. data/client/skr/screens/payment-terms/index.scss +9 -0
  107. data/client/skr/screens/payments/Payments.cjsx +59 -0
  108. data/client/skr/screens/payments/index.js +5 -0
  109. data/client/skr/screens/sales-order/SalesOrder.cjsx +68 -0
  110. data/client/skr/screens/sales-order/index.js +1 -5
  111. data/client/skr/screens/sku-maint/SkuMaint.cjsx +53 -0
  112. data/client/skr/screens/sku-maint/SkuUomList.cjsx +209 -0
  113. data/client/skr/screens/sku-maint/index.js +2 -5
  114. data/client/skr/screens/sku-maint/index.scss +37 -6
  115. data/client/skr/screens/time-invoicing/TimeInvoicing.cjsx +156 -0
  116. data/client/skr/screens/time-invoicing/index.js +5 -0
  117. data/client/skr/screens/time-invoicing/index.scss +7 -0
  118. data/client/skr/screens/time-tracking/EditEntry.cjsx +54 -0
  119. data/client/skr/screens/time-tracking/Entries.coffee +132 -0
  120. data/client/skr/screens/time-tracking/Header.cjsx +71 -0
  121. data/client/skr/screens/time-tracking/Popover.cjsx +70 -0
  122. data/client/skr/screens/time-tracking/PopoverMiniControls.cjsx +25 -0
  123. data/client/skr/screens/time-tracking/TimeTracking.cjsx +63 -0
  124. data/client/skr/screens/time-tracking/WeekSummary.cjsx +16 -0
  125. data/client/skr/screens/time-tracking/index.js +1 -0
  126. data/client/skr/screens/time-tracking/index.scss +126 -0
  127. data/client/skr/screens/vendor-maint/VendorMaint.cjsx +45 -0
  128. data/client/skr/screens/vendor-maint/index.js +1 -5
  129. data/client/skr/styles.scss +1 -13
  130. data/config/puma.rb +4 -0
  131. data/config/routes.rb +21 -9
  132. data/config/screens.rb +147 -32
  133. data/db/migrate/20140202194700_create_skr_gl_transaction_details.rb +35 -0
  134. data/db/migrate/20140220031800_create_skr_locations.rb +2 -0
  135. data/db/migrate/20140220190836_create_skr_vendors.rb +1 -0
  136. data/db/migrate/20140220203029_create_skr_customers.rb +3 -2
  137. data/db/migrate/20140224034759_create_skr_skus.rb +2 -3
  138. data/db/migrate/20140322223912_create_skr_sales_orders.rb +4 -3
  139. data/db/migrate/20140322223920_create_skr_so_lines.rb +4 -5
  140. data/db/migrate/20140323001446_create_so_details_view.rb +7 -5
  141. data/db/migrate/20140327202209_create_skr_pt_lines.rb +2 -2
  142. data/db/migrate/20140327214000_create_customer_project.rb +16 -0
  143. data/db/migrate/20140327223002_create_time_entries.rb +17 -0
  144. data/db/migrate/20140327224000_create_skr_invoices.rb +5 -1
  145. data/db/migrate/20140327224002_create_skr_inv_lines.rb +3 -1
  146. data/db/migrate/20140422024010_create_skr_inv_details_view.rb +1 -1
  147. data/db/migrate/20151121211323_create_customer_project_details_views.rb +31 -0
  148. data/db/migrate/20160216142845_create_gl_account_balances_view.rb +20 -0
  149. data/db/migrate/20160229002044_create_bank_accounts.rb +18 -0
  150. data/db/migrate/20160229041711_create_payments.rb +33 -0
  151. data/db/migrate/20160307022705_create_create_combined_uom_views.rb +18 -0
  152. data/db/schema.sql +639 -140
  153. data/db/seed/chart_of_accounts.yml +8 -6
  154. data/db/seed/payment_categories.yml +12 -0
  155. data/db/seed/skus.yml +32 -0
  156. data/db/seed.rb +21 -0
  157. data/lib/skr/access_roles.rb +19 -6
  158. data/lib/skr/concerns/has_sku_loc_lines.rb +0 -16
  159. data/lib/skr/concerns/inv_extensions.rb +24 -0
  160. data/lib/skr/concerns/is_sku_loc_line.rb +3 -4
  161. data/lib/skr/concerns/so_extensions.rb +8 -0
  162. data/lib/skr/concerns/visible_id_identifier.rb +1 -1
  163. data/lib/skr/db/migration_helpers.rb +2 -4
  164. data/lib/skr/extension.rb +11 -4
  165. data/lib/skr/handlers/fresh_books_import.rb +20 -0
  166. data/lib/skr/handlers/invoice_from_time_entries.rb +49 -0
  167. data/lib/skr/jobs/fresh_books/base.rb +54 -0
  168. data/lib/skr/jobs/fresh_books/import.rb +151 -0
  169. data/lib/skr/jobs/fresh_books/retrieve.rb +62 -0
  170. data/lib/skr/model.rb +5 -0
  171. data/lib/skr/models/address.rb +1 -1
  172. data/lib/skr/models/bank_account.rb +13 -0
  173. data/lib/skr/models/business_entity.rb +3 -0
  174. data/lib/skr/models/customer.rb +1 -1
  175. data/lib/skr/models/customer_project.rb +22 -0
  176. data/lib/skr/models/gl_account.rb +13 -3
  177. data/lib/skr/models/gl_period.rb +6 -0
  178. data/lib/skr/models/gl_posting.rb +7 -4
  179. data/lib/skr/models/gl_transaction.rb +19 -33
  180. data/lib/skr/models/ia_line.rb +1 -1
  181. data/lib/skr/models/inv_line.rb +33 -15
  182. data/lib/skr/models/invoice.rb +47 -20
  183. data/lib/skr/models/location.rb +7 -1
  184. data/lib/skr/models/payment.rb +49 -0
  185. data/lib/skr/models/payment_category.rb +11 -0
  186. data/lib/skr/models/payment_term.rb +1 -1
  187. data/lib/skr/models/por_line.rb +1 -1
  188. data/lib/skr/models/pt_line.rb +1 -1
  189. data/lib/skr/models/sales_order.rb +9 -9
  190. data/lib/skr/models/sku_loc.rb +1 -1
  191. data/lib/skr/models/sku_tran.rb +6 -11
  192. data/lib/skr/models/so_line.rb +22 -12
  193. data/lib/skr/models/time_entry.rb +36 -0
  194. data/lib/skr/models/uom.rb +11 -10
  195. data/lib/skr/models/user_proxy.rb +1 -1
  196. data/lib/skr/number.rb +25 -0
  197. data/lib/skr/print/form.rb +46 -0
  198. data/lib/skr/print/template.rb +48 -0
  199. data/lib/skr/print.rb +11 -0
  200. data/lib/skr/string.rb +11 -0
  201. data/lib/skr/version.rb +1 -1
  202. data/lib/skr.rb +9 -0
  203. data/spec/fixtures/skr/address.yml +164 -4
  204. data/spec/fixtures/skr/bank_account.yml +8 -0
  205. data/spec/fixtures/skr/customer.yml +30 -4
  206. data/spec/fixtures/skr/customer_project.yml +20 -0
  207. data/spec/fixtures/skr/gl_account.yml +19 -1
  208. data/spec/fixtures/skr/gl_period.yml +3 -0
  209. data/spec/fixtures/skr/gl_posting.yml +22 -1
  210. data/spec/fixtures/skr/gl_transaction.yml +4 -1
  211. data/spec/fixtures/skr/inv_line.yml +35 -0
  212. data/spec/fixtures/skr/invoice.yml +13 -2
  213. data/spec/fixtures/skr/location.yml +5 -0
  214. data/spec/fixtures/skr/payment.yml +10 -0
  215. data/spec/fixtures/skr/payment_category.yml +8 -0
  216. data/spec/fixtures/skr/payment_term.yml +37 -3
  217. data/spec/fixtures/skr/sales_order.yml +12 -1
  218. data/spec/fixtures/skr/sku.yml +78 -1
  219. data/spec/fixtures/skr/sku_loc.yml +42 -1
  220. data/spec/fixtures/skr/sku_tran.yml +24 -1
  221. data/spec/fixtures/skr/so_line.yml +32 -0
  222. data/spec/fixtures/skr/time_entry.yml +82 -0
  223. data/spec/fixtures/skr/uom.yml +52 -1
  224. data/spec/fixtures/skr/vendor.yml +28 -1
  225. data/spec/fixtures/stockor.png +0 -0
  226. data/spec/server/bank_account_spec.rb +10 -0
  227. data/spec/server/customer_project_spec.rb +10 -0
  228. data/spec/server/handlers/invoice_from_time_entries_spec.rb +49 -0
  229. data/spec/server/jobs/fresh_books/import_spec.rb +69 -0
  230. data/spec/server/jobs/fresh_books/retrieve_spec.rb +37 -0
  231. data/spec/server/models/address_spec.rb +4 -3
  232. data/spec/server/models/gl_transaction_spec.rb +3 -3
  233. data/spec/server/models/inv_line_spec.rb +83 -3
  234. data/spec/server/models/invoice_spec.rb +32 -3
  235. data/spec/server/models/payment_spec.rb +40 -0
  236. data/spec/server/models/sales_order_spec.rb +1 -1
  237. data/spec/server/models/so_line_spec.rb +3 -3
  238. data/spec/server/models/spec_helper_spec.rb +1 -1
  239. data/spec/server/payment_spec.rb +10 -0
  240. data/spec/server/print/form_spec.rb +47 -0
  241. data/spec/server/print/template_spec.rb +36 -0
  242. data/spec/server/spec_helper.rb +14 -1
  243. data/spec/server/time_entry_spec.rb +10 -0
  244. data/spec/skr/components/SkuLinesSpec.coffee +61 -0
  245. data/spec/skr/models/BankAccountSpec.coffee +5 -0
  246. data/spec/skr/models/CustomerProjectSpec.coffee +5 -0
  247. data/spec/skr/models/CustomerSpec.coffee +2 -2
  248. data/spec/skr/models/PaymentSpec.coffee +5 -0
  249. data/spec/skr/models/SalesOrderSpec.coffee +21 -5
  250. data/spec/skr/models/SoLineSpec.coffee +7 -2
  251. data/spec/skr/models/TimeEntrySpec.coffee +5 -0
  252. data/spec/skr/screens/bank-maint/BankMaintSpec.coffee +5 -0
  253. data/spec/skr/screens/customer-projects/CustomerProjectsSpec.coffee +5 -0
  254. data/spec/skr/screens/fresh-books-import/FreshBooksImportSpec.coffee +1 -0
  255. data/spec/skr/screens/gl-accounts/GlAccountsSpec.coffee +5 -0
  256. data/spec/skr/screens/invoice/InvoiceSpec.coffee +5 -0
  257. data/spec/skr/screens/locations/LocationsSpec.coffee +5 -0
  258. data/spec/skr/screens/payment-category/PaymentCategorySpec.coffee +5 -0
  259. data/spec/skr/screens/payment-terms/PaymentTermsSpec.coffee +5 -0
  260. data/spec/skr/screens/payments/PaymentsSpec.coffee +5 -0
  261. data/spec/skr/screens/time-invoicing/TimeInvoicingSpec.coffee +5 -0
  262. data/spec/skr/screens/time-tracking/TimeTrackingSpec.coffee +14 -0
  263. data/spec/vcr/freshbooks.yml +698 -0
  264. data/stockor.gemspec +5 -1
  265. data/templates/print/fonts/GnuMICR.otf +0 -0
  266. data/templates/print/layout.tex.erb +39 -0
  267. data/templates/print/packages/booktabs.sty +182 -0
  268. data/templates/print/packages/fancybox.sty +966 -0
  269. data/templates/print/packages/fancyhdr.sty +485 -0
  270. data/templates/print/packages/graphbox.sty +129 -0
  271. data/templates/print/packages/lastpage.sty +283 -0
  272. data/templates/print/packages/lastpage209.sty +70 -0
  273. data/templates/print/packages/marginnote.sty +412 -0
  274. data/templates/print/packages/multirow.sty +159 -0
  275. data/templates/print/packages/rotating.sty +282 -0
  276. data/templates/print/packages/tabu.sty +2557 -0
  277. data/templates/print/packages/textpos.sty +361 -0
  278. data/templates/print/packages/varwidth.sty +318 -0
  279. data/templates/print/partials/address.tex.erb +6 -0
  280. data/templates/print/partials/bill_to_ship_to.tex.erb +13 -0
  281. data/templates/print/partials/header.tex.erb +13 -0
  282. data/templates/print/partials/invoice_paid_state.tex.erb +2 -0
  283. data/templates/print/partials/old/inv_lines_grouping.tex.erb +8 -0
  284. data/templates/print/partials/old/labor_lines_footer.tex.erb +18 -0
  285. data/templates/print/partials/skus_table.tex.erb +32 -0
  286. data/templates/print/partials/skus_table_col_hdr.tex.erb +8 -0
  287. data/templates/print/partials/skus_table_footer.tex.erb +5 -0
  288. data/templates/print/partials/skus_table_group_footer.tex.erb +4 -0
  289. data/templates/print/partials/skus_table_invoice_footer.tex.erb +25 -0
  290. data/templates/print/partials/skus_table_invoice_info_line.tex.erb +16 -0
  291. data/templates/print/partials/skus_table_labor_col_hdr.tex.erb +8 -0
  292. data/templates/print/partials/skus_table_labor_group_footer.tex.erb +7 -0
  293. data/templates/print/partials/skus_table_labor_line.tex.erb +11 -0
  294. data/templates/print/partials/skus_table_line.tex.erb +6 -0
  295. data/templates/print/partials/skus_table_other_charge_lines.tex.erb +7 -0
  296. data/templates/print/partials/so_info_line.tex.erb +14 -0
  297. data/templates/print/types/invoice/default.tex.erb +13 -0
  298. data/templates/print/types/invoice/labor.tex.erb +33 -0
  299. data/templates/print/types/payment/default.tex.erb +64 -0
  300. data/templates/print/types/sales-order/default.tex.erb +8 -0
  301. metadata +252 -15
  302. data/client/skr/components/address/address.html +0 -20
  303. data/client/skr/models/mixins/CodeField.coffee +0 -5
  304. data/client/skr/screens/customer-maint/index.scss +0 -11
  305. data/client/skr/screens/customer-maint/layout.html +0 -32
  306. data/client/skr/screens/sales-order/SalesOrder.coffee +0 -30
  307. data/client/skr/screens/sales-order/index.scss +0 -8
  308. data/client/skr/screens/sales-order/layout.html +0 -30
  309. data/client/skr/screens/sku-maint/SkuMaint.coffee +0 -18
  310. data/client/skr/screens/sku-maint/layout.html +0 -16
  311. data/client/skr/screens/vendor-maint/VendorMaint.coffee +0 -28
  312. data/client/skr/screens/vendor-maint/index.scss +0 -8
  313. data/client/skr/screens/vendor-maint/layout.html +0 -32
@@ -0,0 +1,966 @@
1
+ %% BEGIN fancybox.sty
2
+ %%
3
+ %% COPYRIGHT 1993-2010, by Timothy Van Zandt, Timothy.VAN-ZANDT@insead.edu
4
+ %%
5
+ %% DESCRIPTION:
6
+ %% fancybox.sty is a LaTeX style option, consisting of:
7
+ %% * Variants of \fbox: \shadowbox, \doublebox, \ovalbox, \Ovalbox.
8
+ %% * Helpful tools for using box macros.
9
+ %% * Extensive documentation about how to use box macros.
10
+ %% * Flexible verbatim macros.
11
+ %%
12
+ %% INSTALLATION:
13
+ %% Put this file where your TeX looks for inputs.
14
+ %%
15
+ %% DOCUMENTATION:
16
+ %% See fancybox.doc, which might be appended to this file.
17
+ %%
18
+ %% This file may be distributed and/or modified under the conditions of
19
+ %% the LaTeX Project Public License, either version 1.2 of this license
20
+ %% or (at your option) any later version. The latest version of this
21
+ %% license is in:
22
+ %%
23
+ %% http://www.latex-project.org/lppl.txt
24
+ %%
25
+ %% and version 1.2 or later is part of all distributions of LaTeX version
26
+ %% 1999/12/01 or later.
27
+ %%
28
+ %%
29
+ %%
30
+ \def\fileversion{1.4}
31
+ \def\filedate{2010/05/15}
32
+ % DG/SR modification begin - September 19, 2000
33
+ % (suggested by Heiko Oberdiek <oberdiek@ruf.uni-freiburg.de>)
34
+ \@ifundefined{ProvidesPackage}{}{%
35
+ \ProvidesPackage{fancybox}[\filedate\space\fileversion]}
36
+ % DG/SR modification end
37
+ % DG/SR modification begin - May 16, 1997
38
+ \providecommand\@begindvi{} % For rather old versions of LaTeX 2e
39
+ % DG/SR modification end
40
+ % DG/SR modification begin - Feb. 27, 1997
41
+ % Now defined only in latex209.def
42
+ \def\@lquote{\leavevmode{\kern\z@}`}
43
+ % DG/SR modification end
44
+ %% CODE:
45
+ \expandafter\ifx\csname fb@framepage\endcsname\relax\else
46
+ \expandafter\endinput
47
+ \fi
48
+ \typeout{Style option: `fancybox' v\fileversion \space <\filedate> (tvz)}
49
+
50
+ \newbox\@fancybox
51
+ \@ifundefined{@tempdimc}{\newdimen\@tempdimc}{}
52
+
53
+ %% \shadowbox
54
+
55
+ \newdimen\shadowsize
56
+ \shadowsize 4pt
57
+
58
+ \def\shadowbox{\VerbBox\@shadowbox}
59
+ \def\@shadowbox#1{%
60
+ \setbox\@fancybox\hbox{\fbox{#1}}%
61
+ \leavevmode\vbox{%
62
+ \offinterlineskip
63
+ \dimen@=\shadowsize
64
+ \advance\dimen@ .5\fboxrule
65
+ \hbox{\copy\@fancybox\kern-.5\fboxrule\lower\shadowsize\hbox{%
66
+ \vrule \@height\ht\@fancybox \@depth\dp\@fancybox \@width\dimen@}}%
67
+ \vskip-\dimen@
68
+ \moveright\shadowsize\vbox{%
69
+ \hrule \@width\wd\@fancybox \@height\dimen@}}}
70
+
71
+ % \fancyoval
72
+
73
+ \def\cornersize{\@ifstar{\@cornersize}{\@@cornersize}}
74
+ \def\@cornersize#1{%
75
+ \@tempdima=#1\relax
76
+ \edef\the@cornersize{\number\@tempdima sp}}
77
+ \def\@@cornersize#1{%
78
+ \edef\the@cornersize{#1\noexpand\@tempdimb}}
79
+ \cornersize{.5}
80
+
81
+ % This is just a simple change to \oval, making use of the \cornersize
82
+ % parameter instead of making the corner arcs are large as possible.
83
+
84
+ \def\fancyoval(#1,#2){\@ifnextchar[{\fancy@oval(#1,#2)}{\fancy@oval(#1,#2)[]}}
85
+
86
+ \def\fancy@oval(#1,#2)[#3]{%
87
+ \begingroup
88
+ \fancy@@oval{#1\unitlength}{#2\unitlength}{#3}%
89
+ \@put{-.5\wd\@tempboxa}{-.5\ht\@tempboxa}{\ht\@tempboxa=\z@\box\@tempboxa}%
90
+ \endgroup}
91
+
92
+ \def\fancy@@oval#1#2#3{%
93
+ \boxmaxdepth \maxdimen
94
+ \@ovttrue \@ovbtrue \@ovltrue \@ovrtrue
95
+ \@tfor\@tempa :=#3\do{\csname @ov\@tempa false\endcsname}%
96
+ \@ovxx#1\relax
97
+ \advance\@ovxx-\@wholewidth
98
+ \@ovyy#2\relax
99
+ \advance\@ovyy-\@wholewidth
100
+ \@tempdimb \ifdim \@ovyy >\@ovxx \@ovxx\else \@ovyy \fi
101
+ \advance\@tempdimb-2\p@
102
+ \ifdim\@tempdimb>\the@cornersize\relax
103
+ \@tempdimb=\the@cornersize
104
+ \fi
105
+ \@getcirc\@tempdimb
106
+ \@ovro\ht\@tempboxa \@ovri\dp\@tempboxa
107
+ \@ovdx\@ovxx \advance\@ovdx-\@tempdima \divide\@ovdx \tw@
108
+ \@ovdy\@ovyy \advance\@ovdy-\@tempdima \divide\@ovdy \tw@
109
+ \@circlefnt
110
+ \setbox\@tempboxa\hbox{%
111
+ \if@ovr \@ovvert32\kern -\@tempdima \fi
112
+ \if@ovl \kern \@ovxx \@ovvert01\kern -\@tempdima \kern -\@ovxx \fi
113
+ \if@ovt \@ovhorz \kern -\@ovxx \fi
114
+ \if@ovb \raise \@ovyy \@ovhorz \fi}%
115
+ \advance\@ovdx\@ovro
116
+ \advance\@ovdy\@ovro
117
+ \advance\@ovxx\@wholewidth
118
+ \wd\@tempboxa=\@ovxx
119
+ \dp\@tempboxa=\z@}
120
+
121
+ % \ovalbox
122
+
123
+ \def\ovalbox{\VerbBox{\@ovalbox\thinlines}}
124
+ \def\Ovalbox{\VerbBox{\@ovalbox\thicklines}}
125
+ \def\@ovalbox#1#2{%
126
+ \begingroup
127
+ #1\relax
128
+ \setbox\@fancybox\hbox{{#2}}%
129
+ \@tempdimc\fboxsep \advance\@tempdimc\@wholewidth
130
+ \@tempdima\ht\@fancybox \advance\@tempdima\dp\@fancybox
131
+ \advance\@tempdima2\@tempdimc
132
+ \@tempdimb\wd\@fancybox \advance\@tempdimb2\@tempdimc
133
+ \fancy@@oval\@tempdimb\@tempdima{}%
134
+ \@tempdima\dp\@fancybox \advance\@tempdima\@tempdimc
135
+ \wd\@tempboxa=\z@
136
+ \leavevmode\hbox{%
137
+ \lower\@tempdima\box\@tempboxa
138
+ \kern\@tempdimc\box\@fancybox\kern\@tempdimc}%
139
+ \endgroup}
140
+
141
+ % \doublebox
142
+
143
+ \def\doublebox{\VerbBox\@doublebox}
144
+ \def\@doublebox#1{%
145
+ \begingroup
146
+ \setbox\@fancybox\hbox{{#1}}%
147
+ \fboxrule=.75\fboxrule
148
+ \setbox\@fancybox\hbox{\fbox{\box\@fancybox}}%
149
+ \fboxrule=2\fboxrule
150
+ \fboxsep=\fboxrule
151
+ \advance\fboxsep .5pt
152
+ \fbox{\box\@fancybox}%
153
+ \endgroup}
154
+
155
+ % Frames for seminar.sty:
156
+
157
+ \@ifundefined{newslideframe}{}{%
158
+ \newslideframe{shadow}{\shadowbox{#1}}
159
+ \newslideframe{double}{\doublebox{#1}}
160
+ \newslideframe{oval}{\ovalbox{#1}}
161
+ \newslideframe{Oval}{\Ovalbox{#1}}}
162
+
163
+ % Sbox environment
164
+
165
+ \newbox\@Sbox
166
+
167
+ \def\Sbox{\global\setbox\@Sbox\hbox\bgroup\ignorespaces}
168
+
169
+ \def\endSbox{%
170
+ \@testtrue\ifhmode\ifinner\@testfalse\fi\fi
171
+ \if@test\@latexerr{Misplaced \string\endSbox! Should be in LR mode}\@ehd\fi
172
+ \egroup}
173
+
174
+ \def\TheSbox{%
175
+ \ifvoid\@Sbox
176
+ \@latexerr{\string\TheSbox\space is empty!}\@ehd
177
+ \else
178
+ \box\@Sbox
179
+ \fi}
180
+
181
+ \def\beginsbox#1{\setbox#1\hbox\bgroup\ignorespaces}
182
+
183
+ \def\endsbox{\endSbox}
184
+
185
+ % \VerbBox
186
+
187
+ \newtoks\do@VerbBox
188
+
189
+ \def\VerbBox#1{%
190
+ \do@VerbBox{#1}%
191
+ \afterassignment\begin@VerbBox
192
+ \setbox\@fancybox=\hbox}
193
+ \def\begin@VerbBox{\aftergroup\end@VerbBox}
194
+ \def\end@VerbBox{\the\do@VerbBox{\box\@fancybox}}%
195
+
196
+ % \Btrivlist
197
+
198
+ \def\@Blistrestore{%
199
+ \let\par\relax
200
+ \let\-\@dischyph \let\'\@acci \let\`\@accii \let\=\@acciii
201
+ \lineskip\normallineskip \baselineskip\normalbaselineskip}
202
+
203
+ \def\Btrivlist#1{\@ifnextchar[{\@Btrivlist{#1}}{\@Btrivlist{#1}[]}}
204
+ \def\@Btrivlist#1[#2]{%
205
+ \@Blistrestore
206
+ \let\\=\@Btrivlistcr
207
+ \fb@beginvbox{#2}%
208
+ \halign\bgroup
209
+ \if#1l\else\@empty\hfil\fi
210
+ \ignorespaces##\unskip
211
+ \if#1r\@empty\else\hfil\fi\cr}
212
+ \def\endBtrivlist{\crcr\egroup\egroup\if@pboxsw$\fi}
213
+
214
+ \def\fb@beginvbox#1{%
215
+ \leavevmode
216
+ \@pboxswfalse
217
+ \if#1b\@empty\vbox\else\if#1t\@empty\vtop\else
218
+ \ifmmode\vcenter\else\@pboxswtrue$\vcenter\fi% $
219
+ \fi\fi\bgroup}
220
+
221
+ \def\@Btrivlistcr{\@ifstar
222
+ {\@ifnextchar[{@@Btrivlistcr}{\cr}}{\@ifnextchar[{\@@Btrivlistcr}{\cr}}}
223
+ \def\@@Btrivlistcr[#1]{\cr\noalign{\vskip #1}}
224
+
225
+ \def\Bcenter{\Btrivlist{c}}
226
+ \def\endBcenter{\endBtrivlist}
227
+
228
+ \def\Bflushleft{\Btrivlist{l}}
229
+ \def\endBflushleft{\endBtrivlist}
230
+
231
+ \def\Bflushright{\Btrivlist{r}}
232
+ \def\endBflushright{\endBtrivlist}
233
+
234
+ % \Blist
235
+
236
+ \def\Blist#1#2{\@ifnextchar[{\@Blist{#1}{#2}}{\@Blist{#1}{#2}[]}}
237
+
238
+ \def\@Blist#1#2[#3]{%
239
+ \ifnum\@listdepth>5
240
+ \@toodeep
241
+ \else
242
+ \global\advance\@listdepth\@ne
243
+ \fi
244
+ \itemindent\z@
245
+ \csname @list\romannumeral\the\@listdepth\endcsname
246
+ \def\@itemlabel{#1}%
247
+ \let\makelabel\@mklab
248
+ \@nmbrlistfalse
249
+ \@Blistrestore
250
+ \let\\=\@Blistcr
251
+ \let\item\Bitem
252
+ \@Bitemswfalse
253
+ #2\relax
254
+ \fb@beginvbox{#3}%
255
+ \halign\bgroup
256
+ \ignorespaces##&\hskip\labelsep\ignorespaces##\unskip\hfil\cr}
257
+
258
+ \def\endBlist{\endBtrivlist\global\advance\@listdepth\m@ne}
259
+
260
+ \newif\if@Bitemsw
261
+
262
+ \def\Bitem{\@ifnextchar({\@Bitemcr\Bitem@skip}{\@Bitemcr\@Bitem}}
263
+
264
+ \def\@Bitemcr{%
265
+ \if@Bitemsw
266
+ \def\next{\cr\noalign{\vskip\itemsep}}%
267
+ \else
268
+ \def\next{\global\@Bitemswtrue}%
269
+ \fi
270
+ \next}
271
+
272
+ \def\Bitem@skip(#1){\noalign{\vskip #1}\@Bitem}
273
+
274
+ \def\@Bitem{\@ifnextchar[{\Bitem@label}{\Bitem@nolabel}}
275
+
276
+ \def\Bitem@label[#1]{\makelabel{#1}&}
277
+
278
+ \def\Bitem@nolabel{%
279
+ \if@nmbrlist
280
+ \expandafter\advance\csname c@\@listctr\endcsname1 \fi
281
+ \makelabel{\@itemlabel}%
282
+ &%
283
+ \if@nmbrlist\refstepcounter{\@listctr}\fi}
284
+
285
+ \def\@Blistcr{\@ifstar
286
+ {\@ifnextchar[{@@Blistcr}{\cr&}}{\@ifnextchar[{\@@Blistcr}{\cr&}}}
287
+
288
+ \def\@@Blistcr[#1]{\cr\noalign{\vskip #1}&}
289
+
290
+ % \Bitemize
291
+
292
+ \def\Bitemize{%
293
+ \ifnum\@itemdepth>3
294
+ \@toodeep
295
+ \else
296
+ \advance\@itemdepth\@ne
297
+ \fi
298
+ \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
299
+ \Blist{\csname\@itemitem\endcsname}{\def\makelabel####1{\hfil####1}}}
300
+ \def\endBitemize{\endBlist}
301
+
302
+ % \Bdescription
303
+
304
+ \def\Bdescription{\Blist{}{\def\makelabel####1{\bf####1\hfil}}}
305
+ \def\endBdescription{\endBlist}
306
+
307
+ % \Benumerate
308
+
309
+ \def\Benumerate{%
310
+ \ifnum\@enumdepth>3
311
+ \@toodeep
312
+ \else
313
+ \advance\@enumdepth\@ne
314
+ \fi
315
+ \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
316
+ \Blist{\csname label\@enumctr\endcsname}%
317
+ {\usecounter{\@enumctr}\def\makelabel####1{\hfil####1}}}
318
+ \def\endBenumerate{\endBlist}
319
+
320
+ % Beqnarray
321
+
322
+ \def\Beqnarray{%
323
+ \stepcounter{equation}%
324
+ \let\@currentlabel\theequation
325
+ \def\@eqnnum{{\csname reset@font\endcsname\rm (\theequation)}}%
326
+ \global\@eqnswtrue\m@th
327
+ \global\@eqcnt\z@
328
+ \tabskip\@centering
329
+ \let\\\@eqncr
330
+ \vbox\bgroup
331
+ \halign\bgroup
332
+ \@eqnsel
333
+ \hskip\@centering
334
+ $\displaystyle\tabskip\z@{##}$%
335
+ &\global\@eqcnt\@ne
336
+ \hskip 2\arraycolsep
337
+ \hfil${##}$\hfil
338
+ &\global\@eqcnt\tw@
339
+ \hskip 2\arraycolsep
340
+ $\displaystyle\tabskip\z@{##}$%
341
+ \hfil
342
+ \tabskip\@centering
343
+ &\if@eqnsw\hskip 1em\fi
344
+ \hfil{##}\tabskip\z@
345
+ \cr}
346
+
347
+ \def\endBeqnarray{%
348
+ \@@eqncr
349
+ \egroup
350
+ \global\advance\c@equation\m@ne
351
+ \egroup
352
+ \global\@ignoretrue}
353
+
354
+ \@namedef{Beqnarray*}{\def\@eqncr{\nonumber\@seqncr}\Beqnarray}
355
+ \@namedef{endBeqnarray*}{\nonumber\endBeqnarray}
356
+
357
+ % \fb@outputage
358
+
359
+ % Here we insert various hooks for rotating or framing the page.
360
+ % Otherwise, it is the usual \@outputpage
361
+
362
+ \def\fb@outputpage{%
363
+ \begingroup
364
+ \catcode`\ =10
365
+ \let\-\@dischyph
366
+ \let\'\@acci
367
+ \let\`\@accii
368
+ \let\=\@acciii
369
+ \if@specialpage
370
+ \global\@specialpagefalse\@nameuse{ps@\@specialstyle}%
371
+ \fi
372
+ \if@twoside
373
+ \ifodd\count\z@
374
+ \let\@thehead\@oddhead
375
+ \let\@thefoot\@oddfoot
376
+ \let\@themargin\oddsidemargin
377
+ \else
378
+ \let\@thehead\@evenhead
379
+ \let\@thefoot\@evenfoot
380
+ \let\@themargin\evensidemargin
381
+ \fi
382
+ \fi
383
+ \csname reset@font\endcsname
384
+ \normalsize
385
+ \baselineskip\z@
386
+ \lineskip\z@
387
+ \let\par\@@par
388
+ \ifx\this@fancypage\@empty\else
389
+ \this@fancypage
390
+ \gdef\this@fancypage{}%
391
+ \fi
392
+ \ifx\the@fancypage\@empty\else
393
+ \setbox\@outputbox\hbox{\the@fancypage{\box\@outputbox}}%
394
+ \fi
395
+ \ifx\fb@@rotatepage\@empty\else
396
+ \setbox\@outputbox\hbox{\fb@@rotatepage{\box\@outputbox}}%
397
+ \fi
398
+ \setbox\@outputbox\vbox{%
399
+ \@tempdima=\wd\@outputbox
400
+ \setbox\@tempboxa=\hbox to\@tempdima{%
401
+ \let\label\@gobble
402
+ \let\index\@gobble
403
+ \let\glossary\@gobble
404
+ \@thehead}%
405
+ \ht\@tempboxa\headheight
406
+ \dp\@tempboxa\z@
407
+ \box\@tempboxa
408
+ \vskip\headsep
409
+ \box\@outputbox
410
+ \baselineskip\footskip
411
+ \hbox to\@tempdima{%
412
+ \let\label\@gobble
413
+ \let\index\@gobble
414
+ \let\glossary\@gobble
415
+ \@thefoot}}
416
+ \ifx\the@@fancypage\@empty\else
417
+ \setbox\@outputbox\hbox{\the@@fancypage{\box\@outputbox}}%
418
+ \fi
419
+ \setbox\@outputbox\vbox{%
420
+ \ifnum\fancyput@flag>-1 \do@fancyput\fi
421
+ \vskip\topmargin
422
+ \moveright\@themargin\box\@outputbox}%
423
+ \ifx\fb@rotatepage\@empty\else
424
+ \setbox\@outputbox\hbox{\lower\ht\@outputbox\box\@outputbox}%
425
+ \dp\@outputbox\z@
426
+ \wd\@outputbox\z@
427
+ \setbox\@outputbox\hbox{\fb@rotatepage{\box\@outputbox}}%
428
+ \expandafter\fb@setoffsets\fb@theoffsets
429
+ \fi
430
+ % DG/SR modification begin - September 19, 2000
431
+ % (suggested by Marcin Wolinski <wolinski@melkor.mimuw.edu.pl> and
432
+ % Heiko Oberdiek <oberdiek@ruf.uni-freiburg.de>)
433
+ \let\protect\noexpand
434
+ % DG/SR modification end
435
+ \shipout\box\@outputbox
436
+ \global\@colht\textheight
437
+ \endgroup
438
+ \stepcounter{page}%
439
+ \let\firstmark\botmark}
440
+
441
+ % \fancypage
442
+
443
+ \def\the@fancypage{}
444
+ \def\the@@fancypage{}
445
+ \def\this@fancypage{}
446
+
447
+ \def\fancypage#1#2{%
448
+ % DG/SR modification begin - May 16, 1997
449
+ \@begindvi % Need today by LaTeX 2e
450
+ % DG/SR modification end
451
+ \def\the@fancypage{#1}%
452
+ \def\the@@fancypage{#2}%
453
+ \def\@outputpage{\fb@outputpage}}
454
+
455
+ \def\thisfancypage#1#2{%
456
+ % DG/SR modification begin - May 16, 1997
457
+ \@begindvi % Need today by LaTeX 2e
458
+ % DG/SR modification end
459
+ \gdef\@outputpage{\fb@outputpage}%
460
+ \gdef\this@fancypage{\def\the@fancypage{#1}\def\the@@fancypage{#2}}}
461
+
462
+ % \fancyput
463
+
464
+ % Token registers used to make it easier to put definitions in argument.
465
+ % Boxes not processed until output so that contents can depend, e.g., on
466
+ % current page or marks or whatever. This makes everything slightly more
467
+ % complicated than one would expect.
468
+
469
+ \newtoks\the@fancyput
470
+ \newtoks\this@fancyput
471
+ \def\fancyput@flag{-1}%
472
+
473
+ % \fancyput@flag=-1 if no fancyput, 0 if regular fancyput, 1 if thisfancyput.
474
+
475
+ \def\fancyput{%
476
+ % DG/SR modification begin - May 16, 1997
477
+ \@begindvi % Need today by LaTeX 2e
478
+ % DG/SR modification end
479
+ \def\@outputpage{\fb@outputpage}
480
+ \@ifstar{\@testtrue\@fancyput}{\@testfalse\@fancyput}}
481
+ \def\@fancyput{\@ifnextchar({\@@fancyput}{\@@fancyput(\z@,\z@)}}
482
+ \def\@@fancyput(#1,#2)#3{%
483
+ \if@test
484
+ \expandafter\the@fancyput\expandafter{\the\the@fancyput\do{#1}{#2}{#3}}%
485
+ \else
486
+ \the@fancyput{\do{#1}{#2}{#3}}%
487
+ \fi
488
+ \gdef\fancyput@flag{\z@}}
489
+
490
+ \def\thisfancyput{%
491
+ % DG/SR modification begin - May 16, 1997
492
+ \@begindvi % Need today by LaTeX 2e
493
+ % DG/SR modification end
494
+ \gdef\@outputpage{\fb@outputpage}
495
+ \@ifstar{\@testtrue\@thisfancyput}{\@testfalse\@thisfancyput}}
496
+ \def\@thisfancyput{\@ifnextchar({\@@thisfancyput}{\@@thisfancyput(\z@,\z@)}}
497
+ \def\@@thisfancyput(#1,#2)#3{%
498
+ \if@test
499
+ \ifnum\fancyput@flag=\z@
500
+ \expandafter\global\expandafter\this@fancyput\expandafter{%
501
+ \the\this@fancyput\do{#1}{#2}{#3}}%
502
+ \else
503
+ \expandafter\global\expandafter\this@fancyput\expandafter{%
504
+ \the\the@fancyput\do{#1}{#2}{#3}}%
505
+ \fi
506
+ \else
507
+ \global\this@fancyput{\do{#1}{#2}{#3}}%
508
+ \fi
509
+ \gdef\fancyput@flag{1}}
510
+
511
+ \def\do@fancyput{%
512
+ \def\do##1##2##3{\raise##2\hbox to\z@{\kern##1\relax##3\hss}}%
513
+ \setbox\@tempboxa=\hbox to\z@{%
514
+ \kern-\hoffset
515
+ \raise\voffset\hbox{%
516
+ \ifnum\fancyput@flag=\z@\the\the@fancyput\else\the\this@fancyput\fi}%
517
+ \hss}%
518
+ \ht\@tempboxa=\z@ \dp\@tempboxa=\z@
519
+ \box\@tempboxa
520
+ \gdef\fancyput@flag{\z@}%
521
+ \global\this@fancyput{}}
522
+
523
+ % \Landscape
524
+
525
+ \def\UsePageParameters{%
526
+ \clearpage
527
+ \global\@colht\textheight
528
+ \onecolumn}
529
+
530
+ \def\fb@rotatepage{}
531
+
532
+
533
+ \def\Landscape{\@ifstar{\@testtrue\@Landscape}{\@testfalse\@Landscape}}
534
+ \def\@Landscape#1#2#3{%
535
+ % DG/SR modification begin - May 16, 1997
536
+ \@begindvi % Need today by LaTeX 2e
537
+ % DG/SR modification end
538
+ \clearpage
539
+ \def\fb@rotatepage{#3}%
540
+ \def\@outputpage{\fb@outputpage}%
541
+ \@tempdima#1\relax
542
+ \@tempdimb#2\relax
543
+ \if@test
544
+ \edef\fb@theoffsets{{\voffset}{\hoffset}{\number\@tempdima sp}}%
545
+ \else
546
+ \edef\fb@theoffsets{{\hoffset}{\voffset}{\number\@tempdimb sp}}%
547
+ \fi
548
+ \advance\@tempdimb-\@tempdima
549
+ \advance\textwidth\@tempdimb
550
+ \advance\textheight-\@tempdimb
551
+ \UsePageParameters}
552
+ \def\endLandscape{\clearpage\aftergroup\UsePageParameters}
553
+
554
+ \def\fb@setoffsets#1#2#3{%
555
+ \@tempdima#1%
556
+ \advance#1#2%
557
+ #2#3
558
+ \advance#2-2in
559
+ \advance#2-\@tempdima}
560
+
561
+ \@namedef{Landscape*}{\@testtrue\@Landscape}
562
+ \@namedef{endLandscape*}{\endLandscape}
563
+
564
+ % \LandScape
565
+
566
+ \def\fb@@rotatepage{}
567
+
568
+ \def\LandScape#1{%
569
+ % DG/SR modification begin - May 16, 1997
570
+ \@begindvi % Need today by LaTeX 2e
571
+ % DG/SR modification end
572
+ \clearpage
573
+ \def\fb@@rotatepage{#1}%
574
+ \def\@outputpage{\fb@outputpage}%
575
+ \@tempdima\textheight
576
+ \textheight\textwidth
577
+ \textwidth\@tempdima
578
+ \UsePageParameters}
579
+ \def\endLandScape{\clearpage\aftergroup\UsePageParameters}
580
+
581
+ % \GenericCaption
582
+
583
+ \def\GenericCaption#1{%
584
+ \par
585
+ \begingroup
586
+ \@parboxrestore
587
+ \normalsize
588
+ \vskip 10\p@
589
+ \setbox\@tempboxa\hbox{#1}%
590
+ \ifdim\wd\@tempboxa>\hsize
591
+ #1\par
592
+ \else
593
+ \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
594
+ \fi
595
+ \endgroup
596
+ \par}
597
+
598
+ % \landfloat
599
+
600
+ \def\landfloat#1#2{%
601
+ \gdef\curr@landfloat{#1}%
602
+ \gdef\float@rotation{#2}%
603
+ \begin{#1}[p]%
604
+ \setbox\@tempboxa\vbox\bgroup
605
+ \hsize\@colht
606
+ \@parboxrestore}
607
+ \def\endlandfloat{%
608
+ \par\vskip\z@
609
+ \egroup
610
+ \setbox\@tempboxa\hbox{\float@rotation{\box\@tempboxa}}%
611
+ \centerline{\box\@tempboxa}%
612
+ \expandafter\end\expandafter{\curr@landfloat}}
613
+
614
+ % \boxput
615
+
616
+ \def\boxput{\@ifstar{\@testtrue\@boxput}{\@testfalse\@boxput}}
617
+ \def\@boxput{\@ifnextchar({\@@boxput}{\@@boxput(0,0)}}
618
+ \long\def\@@boxput(#1,#2)#3#4{%
619
+ \setbox\@fancybox\hbox{{#4}}%
620
+ \setbox\@tempboxa\vbox to\z@{\vss\hbox to\z@{\hss{#3}\hss}\vss}%
621
+ \@tempdima=#1\wd\@fancybox
622
+ \advance\@tempdima\wd\@fancybox
623
+ \divide\@tempdima 2
624
+ \ifcat a#2\relax
625
+ \@tempdimb=\z@
626
+ \else
627
+ \@tempdimb=.5\ht\@fancybox
628
+ \advance\@tempdimb.5\dp\@fancybox
629
+ \@tempdimc=\@tempdimb
630
+ \advance\@tempdimc-\dp\@fancybox
631
+ \@tempdimb=#2\@tempdimb
632
+ \advance\@tempdimb\@tempdimc
633
+ \fi
634
+ \setbox\@tempboxa\hbox to \z@{%
635
+ \if@test\kern-\wd\@fancybox\fi
636
+ \kern\@tempdima\raise\@tempdimb\box\@tempboxa\hss}%
637
+ \ht\@tempboxa=\z@ \dp\@tempboxa=\z@
638
+ \leavevmode
639
+ \if@test
640
+ \hbox{\box\@fancybox\box\@tempboxa}%
641
+ \else
642
+ \hbox{\box\@tempboxa\box\@fancybox}%
643
+ \fi}
644
+
645
+ % \Vfootnotes
646
+
647
+ \def\VerbatimFootnotes{\let\@footnotetext\V@footnotetext}
648
+
649
+ \long\def\V@footnotetext{%
650
+ \afterassignment\V@@footnotetext
651
+ \let\@tempa}
652
+ \def\V@@footnotetext{%
653
+ \insert\footins\bgroup
654
+ \csname reset@font\endcsname
655
+ \footnotesize
656
+ \interlinepenalty\interfootnotelinepenalty
657
+ \splittopskip\footnotesep
658
+ \splitmaxdepth\dp\strutbox
659
+ \floatingpenalty \@MM
660
+ \hsize\columnwidth
661
+ \@parboxrestore
662
+ \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}%
663
+ \@makefntext{}%
664
+ \rule{\z@}{\footnotesep}%
665
+ \bgroup
666
+ \aftergroup\V@@@footnotetext
667
+ \ignorespaces}
668
+ \def\V@@@footnotetext{\strut\egroup}
669
+
670
+ % Verbatim
671
+
672
+ % The main idea is to separate the reading and formatting of the
673
+ % verbatim listing. It's pretty simple.
674
+
675
+ \def\Verbatim@Codes{%
676
+ \let\do\@makeother
677
+ \dospecials
678
+ \Verbatim@ObeyThings
679
+ \ThisVerbCodes\relax\gdef\ThisVerbCodes{}}
680
+
681
+ \def\EveryVerbatimCodes{}
682
+
683
+ % \Verbatim is redefined temporarilly in \Get@Verbatim to scan the
684
+ % verbatim text. \Verbatim is used so that error messages are more
685
+ % enlightening. \next checks whether \Verbatim found its argument,
686
+ % and attempts to recover if not.
687
+ %
688
+ % Heuristically, if current environment is `foo' and argument of
689
+ % \Get@Verbatim is \The@Verbatim, then definition of \Verbatim is
690
+ %
691
+ % \def\Verbatim#1^^M#2^^M\the\EndVerbatimTokens\end{foo}{%
692
+ % \xdef\The@Verbatim{\noexpand\Every@VerbatimLine#2}%
693
+ % \endgroup\end{foo}}
694
+ %
695
+ % \The@Verbatim is then equal to the verbatim text, with spaces
696
+ % replaced by \Verbatim@Space, tabs replaced by \Verbatim@Tab,
697
+ % and ` replaced by \@lquote. In addition, each line begins with
698
+ % \Every@VerbatimLine, and each line but the last ends with
699
+ % \Verbatim@Par. It is then possible to redefine these when formatting
700
+ % the verbatim text. To insert each line as an argument to \foo, use
701
+ % \def\Every@VerbatimLine#1\Verbatim@Par{\foo{#1}}
702
+ % \The@Verbatim\Verbatim@Par
703
+ %
704
+ \newtoks\EndVerbatimTokens
705
+ \begingroup
706
+ \catcode`\|=0
707
+ \catcode`\[=1
708
+ \catcode`\]=2
709
+ \catcode`\{=12
710
+ \catcode`\}=12
711
+ \catcode`\^^M=13%
712
+ \catcode`\\=12%
713
+ |gdef|Get@Verbatim#1[%
714
+ |begingroup%
715
+ |Verbatim@Codes|EveryVerbatimCodes%
716
+ |let|protect|noexpand%
717
+ |VerbatimEnvironment%
718
+ |edef|next[|noexpand|def|noexpand|Verbatim####1|noexpand^^M####2%
719
+ |noexpand^^M|the|EndVerbatimTokens\end{|@VerbEnvir}]%
720
+ |edef|endVerbatim[|noexpand|endgroup|noexpand|end[|@VerbEnvir]]%
721
+ |global|let|@VerbEnvir|relax%
722
+ |next[|@nil|xdef#1[|noexpand|Every@VerbatimLine##2]|endVerbatim]%
723
+ |def|next[|@ifnextchar|@nil[|@gobble]% If \@nil is there, then
724
+ [|gdef#1[]|endVerbatim|end[document]]]% \Verbatim found its argument.
725
+ |expandafter|next|Verbatim]% Otherwise, try to recover.
726
+ |gdef|AltGet@Verbatim#1[%
727
+ |begingroup%
728
+ |Verbatim@Codes|EveryVerbatimCodes%
729
+ |def^^M##1^^M##2[%
730
+ |ifx|@nil##2|@empty|else%
731
+ |noexpand|Verbatim@Par|noexpand|Every@VerbatimLine##1%
732
+ |expandafter^^M|expandafter##2%
733
+ |fi]%
734
+ |let|protect|noexpand%
735
+ |VerbatimEnvironment%
736
+ |edef|next[|noexpand|def|noexpand|Verbatim####1|noexpand^^M####2%
737
+ \end{|@VerbEnvir}]%
738
+ |edef|endVerbatim[|noexpand|endgroup|noexpand|end[|@VerbEnvir]]%
739
+ |global|let|@VerbEnvir|relax%
740
+ |next[|@nil|xdef#1[|noexpand|Every@VerbatimLine##2^^M|@nil]|endVerbatim]%
741
+ |def|next[|@ifnextchar|@nil[|@gobble]%
742
+ [|gdef#1[]|endVerbatim|end[document]]]%
743
+ |expandafter|next|Verbatim]%
744
+ |endgroup
745
+ \def\AltGetVerbatim{\let\Get@Verbatim\AltGet@Verbatim}
746
+
747
+ % It is enough to not use \begin or \end when defining new verbatim
748
+ % environments, as the default is for \Get@Verbatim to look for the
749
+ % end of the current environment, but using \VerbatimEnvironment
750
+ % is easier to explain to users.
751
+
752
+ \def\VerbatimEnvironment{%
753
+ \ifx\@VerbEnvir\relax\xdef\@VerbEnvir{\@currenvir}\fi}
754
+
755
+ \let\@VerbEnvir\relax
756
+
757
+ \def\The@VerbatimErr{%
758
+ \gdef\The@Verbatim{\@latexerr{Misplaced \string\end{Verbatim}}\@ehd}}
759
+ \The@VerbatimErr
760
+
761
+ \begingroup
762
+ \catcode`\^^M=\active%
763
+ \catcode`\ =\active%
764
+ \catcode`\^^I=\active%
765
+ \gdef\Verbatim@ObeyThings{%
766
+ \catcode`\^^M=\active%
767
+ \catcode`\ =\active%
768
+ \catcode`\^^I=\active%
769
+ \catcode``=\active%
770
+ \def^^M{\noexpand\Verbatim@Par\noexpand\Every@VerbatimLine}%
771
+ \def^^I{\noexpand\Verbatim@Tab}%
772
+ \def {\noexpand\Verbatim@Space}%
773
+ \Verbatim@NoLigs}%
774
+ \gdef\Verbatim@DontObeyLines{\outer\def^^M{}}%
775
+ \endgroup
776
+
777
+ \def\SaveVerbatim{\@bsphack\Get@Verbatim}
778
+
779
+ \def\endSaveVerbatim{\@esphack}
780
+
781
+ {\catcode``13 \gdef\Verbatim@NoLigs{\def`{\noexpand\@lquote}}}
782
+
783
+ \def\Verbatim@Prep{%
784
+ \frenchspacing
785
+ \ThisVerb\relax\gdef\ThisVerb{}%
786
+ \VerbatimFont
787
+ \EveryVerbatim
788
+ \let\Every@VerbatimLine\EveryVerbatimLine
789
+ \def\Verbatim@Space{\leavevmode\penalty\@M\VerbatimSpace}%
790
+ \def\Verbatim@Tab{\leavevmode\penalty\@M\VerbatimTab}}%
791
+
792
+ \def\Verb@Prep{%
793
+ \frenchspacing
794
+ \ThisVerb\relax\gdef\ThisVerb{}%
795
+ \VerbFont
796
+ \EveryVerb
797
+ \let\Every@VerbatimLine\EveryVerbatimLine
798
+ \def\Verbatim@Space{\leavevmode\penalty\@M\VerbSpace}%
799
+ \def\Verbatim@Tab{\leavevmode\penalty\@M\VerbTab}}%
800
+
801
+ \def\Verbatim@Par{\leavevmode\null\@@par\penalty\interlinepenalty}
802
+
803
+ % Parameter initialization:
804
+
805
+ \def\VerbatimSpace{\ }
806
+
807
+ {\catcode`\ =12\gdef\ttspace{{\tt }}}
808
+ \def\VerbSpace{\ }
809
+ \def\VerbatimTab{\ \ \ \ \ \ \ \ }
810
+ \def\VerbTab{\ }
811
+ \def\EveryVerbatim{}
812
+ \def\EveryVerb{}
813
+ \def\ThisVerb{}
814
+ \def\EveryVerbatimLine{}%
815
+ \def\EveryVerbOutLine{}
816
+ \def\VerbatimFont{\tt}
817
+ \def\VerbFont{\tt}
818
+ \def\VerbatimFuzz{2pt}%
819
+ \def\EveryVerbatimCodes{}
820
+ \def\EveryVerbCodes{}
821
+ \def\EveryVerbOutCodes{}
822
+ \def\ThisVerbCodes{}
823
+ \def\Verbatim@List#1{%
824
+ \if@minipage\else\vskip\parskip\fi
825
+ \leftskip\@totalleftmargin
826
+ \@rightskip\@flushglue \rightskip\@rightskip
827
+ \parindent\z@
828
+ \parskip\z@
829
+ \parfillskip\@flushglue
830
+ \hfuzz\VerbatimFuzz\relax
831
+ \@@par
832
+ \global\@inlabelfalse %Prevents vspace from being inserted when
833
+ \Verbatim@Prep %first line exceeds \hsize.
834
+ #1%
835
+ \Verbatim@Par}%
836
+
837
+ \def\UseVerbatim#1{%
838
+ \begingroup\trivlist\item[]\Verbatim@List{#1}\endtrivlist\endgroup}
839
+
840
+ \def\Verbatim{\Get@Verbatim\The@Verbatim}
841
+ \def\endVerbatim{\UseVerbatim\The@Verbatim\The@VerbatimErr}
842
+
843
+ \def\LUseVerbatim#1{%
844
+ \begingroup\list{}{}\item[]\Verbatim@List{#1}\endlist\endgroup}
845
+
846
+ \def\LVerbatim{\Get@Verbatim\The@Verbatim}
847
+ \def\endLVerbatim{\LUseVerbatim\The@Verbatim\The@VerbatimErr}
848
+
849
+ \def\BUseVerbatim{%
850
+ \@ifnextchar[{\@BUseVerbatim}{\@BUseVerbatim[]}}
851
+ \def\@BUseVerbatim[#1]#2{%
852
+ \begingroup
853
+ \Verbatim@Prep
854
+ \let\Verbatim@Par\@Btrivlistcr
855
+ \@Btrivlist{l}[#1]%
856
+ #2%
857
+ \endBtrivlist
858
+ \endgroup}%
859
+
860
+ \def\BVerbatim{%
861
+ \catcode`\^^M=13\relax
862
+ \@ifnextchar[{\@BVerbatim}{\@BVerbatim[]}}
863
+ \def\@BVerbatim[#1]{\def\@tempa{[#1]}\Get@Verbatim\The@Verbatim}
864
+ \def\endBVerbatim{
865
+ \expandafter\@BUseVerbatim\@tempa\The@Verbatim\The@VerbatimErr}
866
+
867
+ \newwrite\Verbatim@Outfile
868
+ \def\VerbatimOut#1{%
869
+ \@bsphack
870
+ \begingroup
871
+ \immediate\openout\Verbatim@Outfile #1\relax
872
+ \def\EveryVerbatimCodes{\EveryVerbOutCodes}%
873
+ \Get@Verbatim\The@Verbatim}
874
+ \def\endVerbatimOut{%
875
+ \Verbatim@ObeyThings
876
+ \def\Verbatim@Par{^^J}%
877
+ \def\Verbatim@Space{\space}%
878
+ \def\Verbatim@Tab{\space}%
879
+ \def\@lquote{\string`}%
880
+ \ThisVerb\relax\gdef\ThisVerb{}%
881
+ \let\Every@VerbatimLine\EveryVerbOutLine
882
+ \immediate\write\Verbatim@Outfile{\The@Verbatim}%
883
+ \immediate\closeout\Verbatim@Outfile
884
+ \endgroup
885
+ \The@VerbatimErr
886
+ \@esphack}
887
+
888
+ % This one is a little tricky because:
889
+ % * we want to ignore the ^^M at the end of the last line,
890
+ % * we want to handle files that end with newline and files that don't
891
+ % * we want comment characters to work properly,
892
+ % * we want to expand each line before inserting \Every@VerbatimLine and
893
+ % \Verbatim@Par,
894
+ %
895
+ % \The@GVerbatim is used as scratch with global redefinition.
896
+ \newread\Verbatim@Infile
897
+ \def\Verbatim@Input#1#2{%
898
+ \begingroup
899
+ \Verbatim@Codes\EveryVerbatimCodes
900
+ \immediate\openin\Verbatim@Infile #1\relax
901
+ \ifeof\Verbatim@Infile
902
+ \@latexerr{No verbatim file #1}\@ehd
903
+ \else
904
+ \def\The@GVerbatim{}\Verbatim@NextLine
905
+ \ifeof\Verbatim@Infile
906
+ \@latexerr{Verbatim file #1 is empty}\@ehd
907
+ \else
908
+ \let\The@Verbatim\The@GVerbatim
909
+ \def\The@GVerbatim{}\Verbatim@NextLine
910
+ #2{\Verbatim@@Input}%
911
+ \fi
912
+ \fi
913
+ \immediate\closein\Verbatim@Infile
914
+ \endgroup}
915
+ \def\Verbatim@@Input{%
916
+ \let\protect\noexpand
917
+ \edef\The@Verbatim{%
918
+ \noexpand\Every@VerbatimLine
919
+ \The@Verbatim
920
+ \ifeof\Verbatim@Infile\else\noexpand\Verbatim@Par\fi}%
921
+ \let\protect\relax
922
+ \The@Verbatim
923
+ \ifeof\Verbatim@Infile\else
924
+ \let\The@Verbatim\The@GVerbatim
925
+ \def\The@GVerbatim{}\Verbatim@NextLine
926
+ \expandafter\Verbatim@@Input
927
+ \fi}%
928
+ \begingroup\catcode`\^^M=\active%
929
+ \gdef\Verbatim@NextLine{%
930
+ \ifeof\Verbatim@Infile\else%
931
+ \immediate\read\Verbatim@Infile to\@tempa%
932
+ \expandafter\Verbatim@@NextLine\@tempa^^M\relax^^M\@nil%
933
+ \fi}%
934
+ % #2 is empty if line ends in ^^M, #2=\relax otherwise.
935
+ \gdef\Verbatim@@NextLine#1^^M#2^^M#3\@nil{%
936
+ \expandafter\gdef\expandafter\The@GVerbatim\expandafter{\The@GVerbatim#1}%
937
+ \ifx#2\@empty\@empty\else\expandafter\Verbatim@NextLine\fi}%
938
+ \endgroup%
939
+
940
+ \def\UseVerb#1{\begingroup\Verb@Prep#1\endgroup}
941
+
942
+ \def\SaveVerb{\@ifnextchar[{\Save@Verb}{\Save@Verb[]}}
943
+
944
+ \long\def\Save@Verb[#1]#2{%
945
+ \begingroup
946
+ \Verbatim@Codes\Verbatim@DontObeyLines\EveryVerbCodes
947
+ \Save@@Verb{#1}{#2}}
948
+
949
+ \long\def\Save@@Verb#1#2#3{%
950
+ \let\protect\noexpand
951
+ \def\next{\@ifnextchar\@nil{\@gobble}{\endgroup}}%
952
+ \long\def\Verb##1#3{\@nil\xdef#2{##1}\endgroup#1}%
953
+ \expandafter\next\Verb}
954
+
955
+ \def\Verb{\Save@Verb[\UseVerb{\The@Verbatim}]{\The@Verbatim}}
956
+
957
+ \def\VerbatimInput#1{\begingroup\Verbatim@Input{#1}\UseVerbatim\endgroup}
958
+
959
+ \def\LVerbatimInput#1{\begingroup\Verbatim@Input{#1}\LUseVerbatim\endgroup}
960
+
961
+ \def\BVerbatimInput{\@ifnextchar[{\@BVerbatimInput}{\@BVerbatimInput[]}}
962
+ \def\@BVerbatimInput[#1]#2{%
963
+ \begingroup\Verbatim@Input{#2}{\@BUseVerbatim[#1]}\endgroup}
964
+
965
+ \endinput
966
+ %% END fancybox.sty