stockor 0.1.9 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +254 -72
- data/Guardfile +1 -1
- data/README.md +24 -3
- data/app.json +28 -0
- data/client/skr/Extension.coffee +18 -0
- data/client/skr/components/BankAccountFinder.cjsx +34 -0
- data/client/skr/components/Currency.cjsx +19 -0
- data/client/skr/components/CustomerFinder.cjsx +37 -0
- data/client/skr/components/CustomerLink.cjsx +13 -0
- data/client/skr/components/CustomerProjectFinder.cjsx +49 -0
- data/client/skr/components/GlAccountChooser.cjsx +38 -0
- data/client/skr/components/InvoiceFinder.cjsx +37 -0
- data/client/skr/components/InvoiceLink.cjsx +13 -0
- data/client/skr/components/LocationChooser.cjsx +37 -0
- data/client/skr/components/PaymentCategoryFinder.cjsx +34 -0
- data/client/skr/components/PrintFormChooser.cjsx +29 -0
- data/client/skr/components/SalesOrderFinder.cjsx +38 -0
- data/client/skr/components/ScreenControls.cjsx +20 -0
- data/client/skr/components/SkuFinder.cjsx +30 -0
- data/client/skr/components/SkuLines.cjsx +76 -0
- data/client/skr/components/SystemSettings.cjsx +26 -0
- data/client/skr/components/TermsChooser.cjsx +40 -0
- data/client/skr/components/ToolbarButton.cjsx +7 -0
- data/client/skr/components/TotalsLine.cjsx +21 -0
- data/client/skr/components/TriStateIcon.cjsx +12 -0
- data/client/skr/components/UOMChooser.cjsx +24 -0
- data/client/skr/components/UserPreferences.cjsx +30 -0
- data/client/skr/components/VendorFinder.cjsx +40 -0
- data/client/skr/components/address/Address.cjsx +10 -10
- data/client/skr/components/styles.scss +16 -0
- data/client/skr/index.js +3 -1
- data/client/skr/models/Address.coffee +9 -1
- data/client/skr/models/BankAccount.coffee +17 -0
- data/client/skr/models/Base.coffee +6 -0
- data/client/skr/models/Customer.coffee +17 -10
- data/client/skr/models/CustomerProject.coffee +29 -0
- data/client/skr/models/GlAccount.coffee +22 -10
- data/client/skr/models/GlManualEntry.coffee +4 -2
- data/client/skr/models/GlPeriod.coffee +4 -6
- data/client/skr/models/GlPosting.coffee +7 -7
- data/client/skr/models/GlTransaction.coffee +3 -3
- data/client/skr/models/IaLine.coffee +9 -9
- data/client/skr/models/IaReason.coffee +4 -4
- data/client/skr/models/InvLine.coffee +30 -11
- data/client/skr/models/InventoryAdjustment.coffee +8 -6
- data/client/skr/models/Invoice.coffee +89 -18
- data/client/skr/models/Location.coffee +27 -6
- data/client/skr/models/Payment.coffee +36 -0
- data/client/skr/models/PaymentCategory.coffee +12 -0
- data/client/skr/models/PaymentTerm.coffee +17 -4
- data/client/skr/models/PickTicket.coffee +7 -5
- data/client/skr/models/PoLine.coffee +15 -15
- data/client/skr/models/PoReceipt.coffee +8 -6
- data/client/skr/models/PorLine.coffee +11 -11
- data/client/skr/models/PricingProvider.coffee +6 -0
- data/client/skr/models/PtLine.coffee +13 -13
- data/client/skr/models/PurchaseOrder.coffee +11 -9
- data/client/skr/models/SalesOrder.coffee +59 -22
- data/client/skr/models/Sku.coffee +17 -15
- data/client/skr/models/SkuLoc.coffee +14 -9
- data/client/skr/models/SkuTran.coffee +10 -10
- data/client/skr/models/SkuVendor.coffee +9 -9
- data/client/skr/models/SoLine.coffee +27 -20
- data/client/skr/models/TimeEntry.coffee +75 -0
- data/client/skr/models/Uom.coffee +27 -6
- data/client/skr/models/Vendor.coffee +14 -12
- data/client/skr/models/VoLine.coffee +11 -11
- data/client/skr/models/Voucher.coffee +7 -5
- data/client/skr/models/mixins/HasVisibleId.coffee +7 -0
- data/client/skr/models/mixins/PrintSupport.coffee +6 -0
- data/client/skr/models/mixins/SkuLine.coffee +61 -0
- data/client/skr/screens/Commands.coffee +29 -0
- data/client/skr/screens/bank-maint/BankMaint.cjsx +43 -0
- data/client/skr/screens/bank-maint/index.js +5 -0
- data/client/skr/screens/chart-of-accounts/ChartOfAccounts.cjsx +40 -0
- data/client/skr/screens/chart-of-accounts/index.js +1 -0
- data/client/skr/screens/chart-of-accounts/index.scss +12 -0
- data/client/skr/screens/customer-maint/CustomerMaint.cjsx +35 -36
- data/client/skr/screens/customer-projects/CustomerProjects.cjsx +70 -0
- data/client/skr/screens/customer-projects/index.js +5 -0
- data/client/skr/screens/customer-projects/index.scss +25 -0
- data/client/skr/screens/fresh-books-import/ApiInfo.cjsx +35 -0
- data/client/skr/screens/fresh-books-import/ChooseRecords.cjsx +116 -0
- data/client/skr/screens/fresh-books-import/FreshBooksImport.cjsx +31 -0
- data/client/skr/screens/fresh-books-import/Import.coffee +52 -0
- data/client/skr/screens/fresh-books-import/ViewRecords.cjsx +96 -0
- data/client/skr/screens/fresh-books-import/index.js +1 -0
- data/client/skr/screens/fresh-books-import/index.scss +39 -0
- data/client/skr/screens/gl-accounts/GlAccounts.cjsx +31 -0
- data/client/skr/screens/gl-accounts/index.js +5 -0
- data/client/skr/screens/gl-transactions/GlTransactions.cjsx +46 -0
- data/client/skr/screens/gl-transactions/index.js +1 -0
- data/client/skr/screens/gl-transactions/index.scss +12 -0
- data/client/skr/screens/invoice/Invoice.cjsx +92 -0
- data/client/skr/screens/invoice/Payment.cjsx +28 -0
- data/client/skr/screens/invoice/index.js +5 -0
- data/client/skr/screens/locations/Locations.cjsx +31 -0
- data/client/skr/screens/locations/index.js +5 -0
- data/client/skr/screens/payment-category/PaymentCategory.cjsx +28 -0
- data/client/skr/screens/payment-category/index.js +5 -0
- data/client/skr/screens/payment-category/index.scss +9 -0
- data/client/skr/screens/payment-terms/PaymentTerms.cjsx +28 -0
- data/client/skr/screens/payment-terms/index.js +5 -0
- data/client/skr/screens/payment-terms/index.scss +9 -0
- data/client/skr/screens/payments/Payments.cjsx +59 -0
- data/client/skr/screens/payments/index.js +5 -0
- data/client/skr/screens/sales-order/SalesOrder.cjsx +68 -0
- data/client/skr/screens/sales-order/index.js +1 -5
- data/client/skr/screens/sku-maint/SkuMaint.cjsx +53 -0
- data/client/skr/screens/sku-maint/SkuUomList.cjsx +209 -0
- data/client/skr/screens/sku-maint/index.js +2 -5
- data/client/skr/screens/sku-maint/index.scss +37 -6
- data/client/skr/screens/time-invoicing/TimeInvoicing.cjsx +156 -0
- data/client/skr/screens/time-invoicing/index.js +5 -0
- data/client/skr/screens/time-invoicing/index.scss +7 -0
- data/client/skr/screens/time-tracking/EditEntry.cjsx +54 -0
- data/client/skr/screens/time-tracking/Entries.coffee +132 -0
- data/client/skr/screens/time-tracking/Header.cjsx +71 -0
- data/client/skr/screens/time-tracking/Popover.cjsx +70 -0
- data/client/skr/screens/time-tracking/PopoverMiniControls.cjsx +25 -0
- data/client/skr/screens/time-tracking/TimeTracking.cjsx +63 -0
- data/client/skr/screens/time-tracking/WeekSummary.cjsx +16 -0
- data/client/skr/screens/time-tracking/index.js +1 -0
- data/client/skr/screens/time-tracking/index.scss +126 -0
- data/client/skr/screens/vendor-maint/VendorMaint.cjsx +45 -0
- data/client/skr/screens/vendor-maint/index.js +1 -5
- data/client/skr/styles.scss +1 -13
- data/config/puma.rb +4 -0
- data/config/routes.rb +21 -9
- data/config/screens.rb +147 -32
- data/db/migrate/20140202194700_create_skr_gl_transaction_details.rb +35 -0
- data/db/migrate/20140220031800_create_skr_locations.rb +2 -0
- data/db/migrate/20140220190836_create_skr_vendors.rb +1 -0
- data/db/migrate/20140220203029_create_skr_customers.rb +3 -2
- data/db/migrate/20140224034759_create_skr_skus.rb +2 -3
- data/db/migrate/20140322223912_create_skr_sales_orders.rb +4 -3
- data/db/migrate/20140322223920_create_skr_so_lines.rb +4 -5
- data/db/migrate/20140323001446_create_so_details_view.rb +7 -5
- data/db/migrate/20140327202209_create_skr_pt_lines.rb +2 -2
- data/db/migrate/20140327214000_create_customer_project.rb +16 -0
- data/db/migrate/20140327223002_create_time_entries.rb +17 -0
- data/db/migrate/20140327224000_create_skr_invoices.rb +5 -1
- data/db/migrate/20140327224002_create_skr_inv_lines.rb +3 -1
- data/db/migrate/20140422024010_create_skr_inv_details_view.rb +1 -1
- data/db/migrate/20151121211323_create_customer_project_details_views.rb +31 -0
- data/db/migrate/20160216142845_create_gl_account_balances_view.rb +20 -0
- data/db/migrate/20160229002044_create_bank_accounts.rb +18 -0
- data/db/migrate/20160229041711_create_payments.rb +33 -0
- data/db/migrate/20160307022705_create_create_combined_uom_views.rb +18 -0
- data/db/schema.sql +639 -140
- data/db/seed/chart_of_accounts.yml +8 -6
- data/db/seed/payment_categories.yml +12 -0
- data/db/seed/skus.yml +32 -0
- data/db/seed.rb +21 -0
- data/lib/skr/access_roles.rb +19 -6
- data/lib/skr/concerns/has_sku_loc_lines.rb +0 -16
- data/lib/skr/concerns/inv_extensions.rb +24 -0
- data/lib/skr/concerns/is_sku_loc_line.rb +3 -4
- data/lib/skr/concerns/so_extensions.rb +8 -0
- data/lib/skr/concerns/visible_id_identifier.rb +1 -1
- data/lib/skr/db/migration_helpers.rb +2 -4
- data/lib/skr/extension.rb +11 -4
- data/lib/skr/handlers/fresh_books_import.rb +20 -0
- data/lib/skr/handlers/invoice_from_time_entries.rb +49 -0
- data/lib/skr/jobs/fresh_books/base.rb +54 -0
- data/lib/skr/jobs/fresh_books/import.rb +151 -0
- data/lib/skr/jobs/fresh_books/retrieve.rb +62 -0
- data/lib/skr/model.rb +5 -0
- data/lib/skr/models/address.rb +1 -1
- data/lib/skr/models/bank_account.rb +13 -0
- data/lib/skr/models/business_entity.rb +3 -0
- data/lib/skr/models/customer.rb +1 -1
- data/lib/skr/models/customer_project.rb +22 -0
- data/lib/skr/models/gl_account.rb +13 -3
- data/lib/skr/models/gl_period.rb +6 -0
- data/lib/skr/models/gl_posting.rb +7 -4
- data/lib/skr/models/gl_transaction.rb +19 -33
- data/lib/skr/models/ia_line.rb +1 -1
- data/lib/skr/models/inv_line.rb +33 -15
- data/lib/skr/models/invoice.rb +47 -20
- data/lib/skr/models/location.rb +7 -1
- data/lib/skr/models/payment.rb +49 -0
- data/lib/skr/models/payment_category.rb +11 -0
- data/lib/skr/models/payment_term.rb +1 -1
- data/lib/skr/models/por_line.rb +1 -1
- data/lib/skr/models/pt_line.rb +1 -1
- data/lib/skr/models/sales_order.rb +9 -9
- data/lib/skr/models/sku_loc.rb +1 -1
- data/lib/skr/models/sku_tran.rb +6 -11
- data/lib/skr/models/so_line.rb +22 -12
- data/lib/skr/models/time_entry.rb +36 -0
- data/lib/skr/models/uom.rb +11 -10
- data/lib/skr/models/user_proxy.rb +1 -1
- data/lib/skr/number.rb +25 -0
- data/lib/skr/print/form.rb +46 -0
- data/lib/skr/print/template.rb +48 -0
- data/lib/skr/print.rb +11 -0
- data/lib/skr/string.rb +11 -0
- data/lib/skr/version.rb +1 -1
- data/lib/skr.rb +9 -0
- data/spec/fixtures/skr/address.yml +164 -4
- data/spec/fixtures/skr/bank_account.yml +8 -0
- data/spec/fixtures/skr/customer.yml +30 -4
- data/spec/fixtures/skr/customer_project.yml +20 -0
- data/spec/fixtures/skr/gl_account.yml +19 -1
- data/spec/fixtures/skr/gl_period.yml +3 -0
- data/spec/fixtures/skr/gl_posting.yml +22 -1
- data/spec/fixtures/skr/gl_transaction.yml +4 -1
- data/spec/fixtures/skr/inv_line.yml +35 -0
- data/spec/fixtures/skr/invoice.yml +13 -2
- data/spec/fixtures/skr/location.yml +5 -0
- data/spec/fixtures/skr/payment.yml +10 -0
- data/spec/fixtures/skr/payment_category.yml +8 -0
- data/spec/fixtures/skr/payment_term.yml +37 -3
- data/spec/fixtures/skr/sales_order.yml +12 -1
- data/spec/fixtures/skr/sku.yml +78 -1
- data/spec/fixtures/skr/sku_loc.yml +42 -1
- data/spec/fixtures/skr/sku_tran.yml +24 -1
- data/spec/fixtures/skr/so_line.yml +32 -0
- data/spec/fixtures/skr/time_entry.yml +82 -0
- data/spec/fixtures/skr/uom.yml +52 -1
- data/spec/fixtures/skr/vendor.yml +28 -1
- data/spec/fixtures/stockor.png +0 -0
- data/spec/server/bank_account_spec.rb +10 -0
- data/spec/server/customer_project_spec.rb +10 -0
- data/spec/server/handlers/invoice_from_time_entries_spec.rb +49 -0
- data/spec/server/jobs/fresh_books/import_spec.rb +69 -0
- data/spec/server/jobs/fresh_books/retrieve_spec.rb +37 -0
- data/spec/server/models/address_spec.rb +4 -3
- data/spec/server/models/gl_transaction_spec.rb +3 -3
- data/spec/server/models/inv_line_spec.rb +83 -3
- data/spec/server/models/invoice_spec.rb +32 -3
- data/spec/server/models/payment_spec.rb +40 -0
- data/spec/server/models/sales_order_spec.rb +1 -1
- data/spec/server/models/so_line_spec.rb +3 -3
- data/spec/server/models/spec_helper_spec.rb +1 -1
- data/spec/server/payment_spec.rb +10 -0
- data/spec/server/print/form_spec.rb +47 -0
- data/spec/server/print/template_spec.rb +36 -0
- data/spec/server/spec_helper.rb +14 -1
- data/spec/server/time_entry_spec.rb +10 -0
- data/spec/skr/components/SkuLinesSpec.coffee +61 -0
- data/spec/skr/models/BankAccountSpec.coffee +5 -0
- data/spec/skr/models/CustomerProjectSpec.coffee +5 -0
- data/spec/skr/models/CustomerSpec.coffee +2 -2
- data/spec/skr/models/PaymentSpec.coffee +5 -0
- data/spec/skr/models/SalesOrderSpec.coffee +21 -5
- data/spec/skr/models/SoLineSpec.coffee +7 -2
- data/spec/skr/models/TimeEntrySpec.coffee +5 -0
- data/spec/skr/screens/bank-maint/BankMaintSpec.coffee +5 -0
- data/spec/skr/screens/customer-projects/CustomerProjectsSpec.coffee +5 -0
- data/spec/skr/screens/fresh-books-import/FreshBooksImportSpec.coffee +1 -0
- data/spec/skr/screens/gl-accounts/GlAccountsSpec.coffee +5 -0
- data/spec/skr/screens/invoice/InvoiceSpec.coffee +5 -0
- data/spec/skr/screens/locations/LocationsSpec.coffee +5 -0
- data/spec/skr/screens/payment-category/PaymentCategorySpec.coffee +5 -0
- data/spec/skr/screens/payment-terms/PaymentTermsSpec.coffee +5 -0
- data/spec/skr/screens/payments/PaymentsSpec.coffee +5 -0
- data/spec/skr/screens/time-invoicing/TimeInvoicingSpec.coffee +5 -0
- data/spec/skr/screens/time-tracking/TimeTrackingSpec.coffee +14 -0
- data/spec/vcr/freshbooks.yml +698 -0
- data/stockor.gemspec +5 -1
- data/templates/print/fonts/GnuMICR.otf +0 -0
- data/templates/print/layout.tex.erb +39 -0
- data/templates/print/packages/booktabs.sty +182 -0
- data/templates/print/packages/fancybox.sty +966 -0
- data/templates/print/packages/fancyhdr.sty +485 -0
- data/templates/print/packages/graphbox.sty +129 -0
- data/templates/print/packages/lastpage.sty +283 -0
- data/templates/print/packages/lastpage209.sty +70 -0
- data/templates/print/packages/marginnote.sty +412 -0
- data/templates/print/packages/multirow.sty +159 -0
- data/templates/print/packages/rotating.sty +282 -0
- data/templates/print/packages/tabu.sty +2557 -0
- data/templates/print/packages/textpos.sty +361 -0
- data/templates/print/packages/varwidth.sty +318 -0
- data/templates/print/partials/address.tex.erb +6 -0
- data/templates/print/partials/bill_to_ship_to.tex.erb +13 -0
- data/templates/print/partials/header.tex.erb +13 -0
- data/templates/print/partials/invoice_paid_state.tex.erb +2 -0
- data/templates/print/partials/old/inv_lines_grouping.tex.erb +8 -0
- data/templates/print/partials/old/labor_lines_footer.tex.erb +18 -0
- data/templates/print/partials/skus_table.tex.erb +32 -0
- data/templates/print/partials/skus_table_col_hdr.tex.erb +8 -0
- data/templates/print/partials/skus_table_footer.tex.erb +5 -0
- data/templates/print/partials/skus_table_group_footer.tex.erb +4 -0
- data/templates/print/partials/skus_table_invoice_footer.tex.erb +25 -0
- data/templates/print/partials/skus_table_invoice_info_line.tex.erb +16 -0
- data/templates/print/partials/skus_table_labor_col_hdr.tex.erb +8 -0
- data/templates/print/partials/skus_table_labor_group_footer.tex.erb +7 -0
- data/templates/print/partials/skus_table_labor_line.tex.erb +11 -0
- data/templates/print/partials/skus_table_line.tex.erb +6 -0
- data/templates/print/partials/skus_table_other_charge_lines.tex.erb +7 -0
- data/templates/print/partials/so_info_line.tex.erb +14 -0
- data/templates/print/types/invoice/default.tex.erb +13 -0
- data/templates/print/types/invoice/labor.tex.erb +33 -0
- data/templates/print/types/payment/default.tex.erb +64 -0
- data/templates/print/types/sales-order/default.tex.erb +8 -0
- metadata +252 -15
- data/client/skr/components/address/address.html +0 -20
- data/client/skr/models/mixins/CodeField.coffee +0 -5
- data/client/skr/screens/customer-maint/index.scss +0 -11
- data/client/skr/screens/customer-maint/layout.html +0 -32
- data/client/skr/screens/sales-order/SalesOrder.coffee +0 -30
- data/client/skr/screens/sales-order/index.scss +0 -8
- data/client/skr/screens/sales-order/layout.html +0 -30
- data/client/skr/screens/sku-maint/SkuMaint.coffee +0 -18
- data/client/skr/screens/sku-maint/layout.html +0 -16
- data/client/skr/screens/vendor-maint/VendorMaint.coffee +0 -28
- data/client/skr/screens/vendor-maint/index.scss +0 -8
- data/client/skr/screens/vendor-maint/layout.html +0 -32
@@ -0,0 +1,412 @@
|
|
1
|
+
%%
|
2
|
+
%% This is file `marginnote.sty',
|
3
|
+
%% generated with the docstrip utility.
|
4
|
+
%%
|
5
|
+
%% The original source files were:
|
6
|
+
%%
|
7
|
+
%% marginnote.dtx (with options: `package')
|
8
|
+
%%
|
9
|
+
%% IMPORTANT NOTE:
|
10
|
+
%%
|
11
|
+
%% This is a generated file and you are not allowed to distribute it
|
12
|
+
%% without the source ot the work. See below about more informations
|
13
|
+
%% about the files the work consists of.
|
14
|
+
%%
|
15
|
+
%% Copyright (c) Markus Kohm 2005-2012
|
16
|
+
%%
|
17
|
+
%% This work may be distributed and/or modified under the
|
18
|
+
%% conditions of the LaTeX Project Public License, either version 1.3
|
19
|
+
%% of this license or (at your option) any later version.
|
20
|
+
%% The latest version of this license is in
|
21
|
+
%% http://www.latex-project.org/lppl.txt
|
22
|
+
%% and version 1.3 or later is part of all distributions of LaTeX
|
23
|
+
%% version 2003/12/01 or later.
|
24
|
+
%%
|
25
|
+
%% This work has the LPPL maintenance status "maintained".
|
26
|
+
%%
|
27
|
+
%% The author of the initial version of these work was
|
28
|
+
%% Markus Kohm <komascript@gmx.info>
|
29
|
+
%%
|
30
|
+
%% This work consists of the files marginnote.dtx, marginnote.ins,
|
31
|
+
%% and REAMDE.
|
32
|
+
%%
|
33
|
+
%% Important Recommendation:
|
34
|
+
%% The LPPL requires that distributions of the Work contain all the files of
|
35
|
+
%% the Work (see ``Important Recommendations'' at lppl.txt).
|
36
|
+
%%
|
37
|
+
\ProvidesPackage{marginnote}[%
|
38
|
+
2012/03/29 v1.1i non floating margin notes for LaTeX]
|
39
|
+
\begingroup
|
40
|
+
\def\@tempb{}%
|
41
|
+
\def\@tempa{%
|
42
|
+
\PackageError{marginnote}{seems you are not running e-TeX\@tempb}{%
|
43
|
+
Since 2004 the LaTeX team recommends to use e-TeX.\MessageBreak
|
44
|
+
marginnote since version 1.1d uses e-TeX features.\MessageBreak
|
45
|
+
At actual systems `latex' should already use e-TeX.\MessageBreak
|
46
|
+
At deprecated systems it may be called `elatex'.\MessageBreak
|
47
|
+
Use either unsupported marginnote up to version 1.1c or\MessageBreak
|
48
|
+
ask you administrator for LaTeX using e-TeX\@tempb.\MessageBreak
|
49
|
+
Not using e-TeX\@tempb\space is a fatal error!\MessageBreak
|
50
|
+
Processing cannot be continued!}%
|
51
|
+
\endgroup
|
52
|
+
\batchmode \errmessage{}\csname @@end\endcsname\end\relax
|
53
|
+
\csname endinput\endcsname
|
54
|
+
}%
|
55
|
+
\expandafter\ifx\csname eTeXversion\endcsname\relax\else
|
56
|
+
\ifnum\eTeXversion <2
|
57
|
+
\def\@tempb{ V 2}%
|
58
|
+
\else
|
59
|
+
\let\@tempa\endgroup
|
60
|
+
\fi
|
61
|
+
\fi
|
62
|
+
\@tempa
|
63
|
+
\newif\if@mn@verbose\@mn@verbosetrue
|
64
|
+
\DeclareOption{verbose}{\@mn@verbosetrue}
|
65
|
+
\DeclareOption{quiet}{\@mn@verbosefalse}
|
66
|
+
\newcommand*{\mn@strut}{}
|
67
|
+
\newcommand{\mn@zbox}[1]{}
|
68
|
+
\DeclareOption{fulladjust}{%
|
69
|
+
\renewcommand*{\mn@strut}{\strut}%
|
70
|
+
\renewcommand{\mn@zbox}[1]{%
|
71
|
+
\bgroup
|
72
|
+
\setbox\@tempboxa\vbox{#1}%
|
73
|
+
\ht\@tempboxa\ht\strutbox
|
74
|
+
\dp\@tempboxa\dp\strutbox
|
75
|
+
\wd\@tempboxa\z@
|
76
|
+
\box\@tempboxa
|
77
|
+
\egroup
|
78
|
+
}%
|
79
|
+
}
|
80
|
+
\DeclareOption{heightadjust}{%
|
81
|
+
\renewcommand*{\mn@strut}{\begingroup\dp\strutbox\z@\strut\endgroup}%
|
82
|
+
\renewcommand{\mn@zbox}[1]{%
|
83
|
+
\bgroup
|
84
|
+
\setbox\@tempboxa\vbox{#1}%
|
85
|
+
\ht\@tempboxa\ht\strutbox
|
86
|
+
\dp\@tempboxa\dp\z@
|
87
|
+
\wd\@tempboxa\z@
|
88
|
+
\box\@tempboxa
|
89
|
+
\egroup
|
90
|
+
}%
|
91
|
+
}
|
92
|
+
\DeclareOption{depthadjust}{%
|
93
|
+
\renewcommand*{\mn@strut}{\begingroup\ht\strutbox\z@\strut\endgroup}%
|
94
|
+
\renewcommand{\mn@zbox}[1]{%
|
95
|
+
\bgroup
|
96
|
+
\setbox\@tempboxa\vbox{#1}%
|
97
|
+
\ht\@tempboxa\ht\z@
|
98
|
+
\dp\@tempboxa\dp\strutbox
|
99
|
+
\wd\@tempboxa\z@
|
100
|
+
\box\@tempboxa
|
101
|
+
\egroup
|
102
|
+
}%
|
103
|
+
}
|
104
|
+
\DeclareOption{noadjust}{%
|
105
|
+
\renewcommand*{\mn@strut}{\relax}%
|
106
|
+
\renewcommand{\mn@zbox}[1]{%
|
107
|
+
\bgroup
|
108
|
+
\setbox\@tempboxa\vbox{\kern-\ht\strutbox #1}%
|
109
|
+
\ht\@tempboxa\ht\z@
|
110
|
+
\dp\@tempboxa\dp\z@
|
111
|
+
\wd\@tempboxa\z@
|
112
|
+
\box\@tempboxa
|
113
|
+
\egroup
|
114
|
+
}%
|
115
|
+
}
|
116
|
+
\ExecuteOptions{verbose,fulladjust}
|
117
|
+
\ProcessOptions\relax
|
118
|
+
\newcommand*{\newmarginnote}{\@newl@bel{mn}}
|
119
|
+
\newif\if@mn@pdfmode\@mn@pdfmodefalse
|
120
|
+
\AtBeginDocument{%
|
121
|
+
\begingroup\expandafter\expandafter\expandafter\endgroup
|
122
|
+
\expandafter\ifx\csname pdflastxpos\endcsname\relax\else % bg or 1
|
123
|
+
\begingroup\expandafter\expandafter\expandafter\endgroup
|
124
|
+
\expandafter\ifx\csname pdftexversion\endcsname\relax % bg 2
|
125
|
+
\begingroup\expandafter\expandafter\expandafter\endgroup
|
126
|
+
\expandafter\ifx\csname pdfoutput\endcsname\relax % bg 3
|
127
|
+
\begingroup\expandafter\expandafter\expandafter\endgroup
|
128
|
+
\expandafter\ifx\csname XeTeXrevision\endcsname\relax\else % bg 4
|
129
|
+
\@mn@pdfmodetrue
|
130
|
+
\fi % ed 4
|
131
|
+
\else % or 3
|
132
|
+
\ifcase\pdfoutput\else\@mn@pdfmodetrue\fi % bg ed 4
|
133
|
+
\fi % ed 3
|
134
|
+
\else % or 2
|
135
|
+
\ifnum \pdftexversion<140 % bg 3
|
136
|
+
\begingroup\expandafter\expandafter\expandafter\endgroup
|
137
|
+
\expandafter\ifx\csname pdfoutput\endcsname\relax % bg 4
|
138
|
+
\else % or 4
|
139
|
+
\ifcase\pdfoutput\else\@mn@pdfmodetrue\fi % bg ed 5
|
140
|
+
\fi % ed 4
|
141
|
+
\else % or 3
|
142
|
+
\@mn@pdfmodetrue
|
143
|
+
\fi % ed 3
|
144
|
+
\fi % ed 2
|
145
|
+
\fi % ed 1
|
146
|
+
\if@mn@verbose
|
147
|
+
\if@mn@pdfmode
|
148
|
+
\PackageInfo{marginnote}{%
|
149
|
+
\string\pdfoutput\space not 0 and \string\pdflastxpos\space
|
150
|
+
available.\MessageBreak
|
151
|
+
Extended position detection mode activated\@gobble
|
152
|
+
}%
|
153
|
+
\else
|
154
|
+
\PackageInfo{marginnote}{%
|
155
|
+
either \string\pdflastxpos\space or \string\pdfoutput\space not
|
156
|
+
available\MessageBreak
|
157
|
+
or \string\pdfoutput\space set to 0.\MessageBreak
|
158
|
+
Extended position detection mode deactivated\@gobble
|
159
|
+
}%
|
160
|
+
\fi
|
161
|
+
\fi
|
162
|
+
}
|
163
|
+
\newcommand*{\marginnotetextwidth}{}
|
164
|
+
\let\marginnotetextwidth\textwidth
|
165
|
+
\AtBeginDocument{\if@mn@pdfmode\edef\marginnotetextwidth{\the\textwidth}\fi}
|
166
|
+
\newcommand*{\@mn@thispage}{}
|
167
|
+
\newcommand*{\@mn@currpage}{}
|
168
|
+
\newcommand*{\@mn@currxpos}{}
|
169
|
+
\newcounter{mn@abspage}
|
170
|
+
\AtBeginDocument{\setcounter{mn@abspage}{1}%
|
171
|
+
\g@addto@macro\@outputpage{\stepcounter{mn@abspage}}}
|
172
|
+
\newcommand*{\@mn@margintest}{%
|
173
|
+
\expandafter\ifx\csname @mn@thispage\endcsname\@empty
|
174
|
+
\gdef\@mn@atthispage{1}%
|
175
|
+
\else\expandafter\ifnum \@mn@thispage=\value{mn@abspage}%
|
176
|
+
\begingroup
|
177
|
+
\@tempcnta\@mn@atthispage\advance\@tempcnta by \@ne
|
178
|
+
\xdef\@mn@atthispage{\the\@tempcnta}%
|
179
|
+
\endgroup
|
180
|
+
\else
|
181
|
+
\gdef\@mn@atthispage{1}%
|
182
|
+
\fi
|
183
|
+
\fi
|
184
|
+
\xdef\@mn@thispage{\themn@abspage}%
|
185
|
+
\let\@mn@currpage\relax
|
186
|
+
\let\@mn@currxpos\relax
|
187
|
+
\if@mn@pdfmode
|
188
|
+
\pdfsavepos
|
189
|
+
\protected@write\@auxout{\let\themn@abspage\relax}{%
|
190
|
+
\string\newmarginnote{note.\@mn@thispage.\@mn@atthispage}{%
|
191
|
+
{\themn@abspage}{\noexpand\number\pdflastxpos sp}}%
|
192
|
+
}%
|
193
|
+
\else
|
194
|
+
\protected@write\@auxout{\let\themn@abspage\relax}{%
|
195
|
+
\string\newmarginnote{note.\@mn@thispage.\@mn@atthispage}{%
|
196
|
+
{\themn@abspage}{}}%
|
197
|
+
}%
|
198
|
+
\fi
|
199
|
+
\expandafter\ifx\csname mn@note.\@mn@thispage.\@mn@atthispage\endcsname\relax
|
200
|
+
\if@twoside
|
201
|
+
\if@mn@verbose
|
202
|
+
\PackageInfo{marginnote}{Suggest that margin
|
203
|
+
note \@mn@thispage.\@mn@atthispage\space will be on\MessageBreak
|
204
|
+
absolute page \themn@abspage.\MessageBreak
|
205
|
+
This may be wrong}%
|
206
|
+
\fi
|
207
|
+
\ifodd\value{mn@abspage}\@tempswatrue\else\@tempswafalse\fi
|
208
|
+
\else
|
209
|
+
\if@mn@verbose
|
210
|
+
\PackageInfo{marginnote}{right page because not two side mode}%
|
211
|
+
\fi
|
212
|
+
\@tempswatrue
|
213
|
+
\fi
|
214
|
+
\else
|
215
|
+
\edef\@mn@currpage{\csname
|
216
|
+
mn@note.\@mn@thispage.\@mn@atthispage\endcsname}%
|
217
|
+
\edef\@mn@currxpos{\expandafter\@secondoftwo\@mn@currpage}%
|
218
|
+
\edef\@mn@currxpos{\the\dimexpr \@mn@currxpos -\hoffset\relax}%
|
219
|
+
\begingroup\expandafter\expandafter\expandafter\endgroup
|
220
|
+
\expandafter\ifx\csname pdfhorigin\endcsname\relax\else
|
221
|
+
\begingroup\expandafter\expandafter\expandafter\endgroup
|
222
|
+
\expandafter\ifx\csname pdfoutput\endcsname\relax\else
|
223
|
+
\ifnum \pdfoutput=1 %
|
224
|
+
\edef\@mn@currxpos{\the\dimexpr \@mn@currxpos -\pdfhorigin
|
225
|
+
+1in\relax}%
|
226
|
+
\fi
|
227
|
+
\fi
|
228
|
+
\fi
|
229
|
+
\edef\@mn@currpage{\expandafter\@firstoftwo\@mn@currpage}%
|
230
|
+
\if@mn@verbose
|
231
|
+
\PackageInfo{marginnote}{Margin note \@mn@thispage.\@mn@atthispage\space
|
232
|
+
is on absolute page \@mn@currpage\MessageBreak}%
|
233
|
+
\fi
|
234
|
+
\if@twoside
|
235
|
+
\ifodd\@mn@currpage\relax
|
236
|
+
\@tempswatrue
|
237
|
+
\else
|
238
|
+
\@tempswafalse
|
239
|
+
\fi
|
240
|
+
\else
|
241
|
+
\if@mn@verbose
|
242
|
+
\PackageInfo{marginnote}{right page because not two side mode}%
|
243
|
+
\fi
|
244
|
+
\@tempswatrue
|
245
|
+
\fi
|
246
|
+
\fi
|
247
|
+
}
|
248
|
+
\newcommand*{\marginnote}{%
|
249
|
+
\@dblarg\@mn@marginnote
|
250
|
+
}
|
251
|
+
\newcommand{\@mn@marginnote}[2][]{%
|
252
|
+
\ifhmode
|
253
|
+
\@bsphack
|
254
|
+
\begingroup
|
255
|
+
\ifdim\@savsk>\z@\else
|
256
|
+
\def\:{\@xifnch}\expandafter\def\: { \futurelet\@let@token\@ifnch}%
|
257
|
+
\fi
|
258
|
+
\else
|
259
|
+
\begingroup
|
260
|
+
\fi
|
261
|
+
\@ifnextchar [{\@mn@@marginnote[{#1}]{#2}}{\@mn@@marginnote[{#1}]{#2}[\z@]}%
|
262
|
+
}
|
263
|
+
\newcommand{\@mn@@marginnote}{}
|
264
|
+
\long\def\@mn@@marginnote[#1]#2[#3]{%
|
265
|
+
\endgroup
|
266
|
+
\ifhmode
|
267
|
+
\@mn@@@marginnote[{#1}]{#2}[{#3}]%
|
268
|
+
\@esphack
|
269
|
+
\else
|
270
|
+
\@mn@@@marginnote[{#1}]{#2}[{#3}]%
|
271
|
+
\fi
|
272
|
+
}
|
273
|
+
\newcommand{\@mn@@@marginnote}{}
|
274
|
+
\long\def\@mn@@@marginnote[#1]#2[#3]{%
|
275
|
+
\begingroup
|
276
|
+
\ifmmode\mn@strut\let\@tempa\mn@vadjust\else
|
277
|
+
\if@inlabel\leavevmode\fi
|
278
|
+
\ifhmode\mn@strut\let\@tempa\mn@vadjust\else\let\@tempa\mn@vlap\fi
|
279
|
+
\fi
|
280
|
+
\@tempa{%
|
281
|
+
\vbox to\z@{%
|
282
|
+
\vss
|
283
|
+
\@mn@margintest
|
284
|
+
\if@reversemargin\if@tempswa
|
285
|
+
\@tempswafalse
|
286
|
+
\else
|
287
|
+
\@tempswatrue
|
288
|
+
\fi\fi
|
289
|
+
\if@tempswa
|
290
|
+
\rlap{%
|
291
|
+
\ifx\@mn@currxpos\relax
|
292
|
+
\kern\marginnoterightadjust
|
293
|
+
\if@mn@verbose
|
294
|
+
\PackageInfo{marginnote}{%
|
295
|
+
xpos not known,\MessageBreak
|
296
|
+
using \string\marginnoterightadjust}%
|
297
|
+
\fi
|
298
|
+
\else\ifx\@mn@currxpos\@empty
|
299
|
+
\kern\marginnoterightadjust
|
300
|
+
\if@mn@verbose
|
301
|
+
\PackageInfo{marginnote}{%
|
302
|
+
xpos not known,\MessageBreak
|
303
|
+
using \string\marginnoterightadjust}%
|
304
|
+
\fi
|
305
|
+
\else
|
306
|
+
\if@mn@verbose
|
307
|
+
\PackageInfo{marginnote}{%
|
308
|
+
xpos seems to be \@mn@currxpos,\MessageBreak
|
309
|
+
\string\marginnoterightadjust
|
310
|
+
\space ignored}%
|
311
|
+
\fi
|
312
|
+
\begingroup
|
313
|
+
\setlength{\@tempdima}{\@mn@currxpos}%
|
314
|
+
\kern-\@tempdima
|
315
|
+
\if@twoside\ifodd\@mn@currpage\relax
|
316
|
+
\kern\oddsidemargin
|
317
|
+
\else
|
318
|
+
\kern\evensidemargin
|
319
|
+
\fi
|
320
|
+
\else
|
321
|
+
\kern\oddsidemargin
|
322
|
+
\fi
|
323
|
+
\kern 1in
|
324
|
+
\endgroup
|
325
|
+
\fi
|
326
|
+
\fi
|
327
|
+
\kern\marginnotetextwidth\kern\marginparsep
|
328
|
+
\vbox to\z@{\kern\marginnotevadjust\kern #3
|
329
|
+
\vbox to\z@{%
|
330
|
+
\hsize\marginparwidth
|
331
|
+
\linewidth\hsize
|
332
|
+
\kern-\parskip
|
333
|
+
\marginfont\raggedrightmarginnote\strut\hspace{\z@}%
|
334
|
+
\ignorespaces#2\endgraf
|
335
|
+
\vss}%
|
336
|
+
\vss}%
|
337
|
+
}%
|
338
|
+
\else
|
339
|
+
\llap{%
|
340
|
+
\vbox to\z@{\kern\marginnotevadjust\kern #3
|
341
|
+
\vbox to\z@{%
|
342
|
+
\hsize\marginparwidth
|
343
|
+
\linewidth\hsize
|
344
|
+
\kern-\parskip
|
345
|
+
\marginfont\raggedleftmarginnote\strut\hspace{\z@}%
|
346
|
+
\ignorespaces#1\endgraf
|
347
|
+
\vss}%
|
348
|
+
\vss}%
|
349
|
+
\ifx\@mn@currxpos\relax
|
350
|
+
\kern\marginnoteleftadjust
|
351
|
+
\if@mn@verbose
|
352
|
+
\PackageInfo{marginnote}{%
|
353
|
+
xpos not known,\MessageBreak
|
354
|
+
using \string\marginnoteleftadjust}%
|
355
|
+
\fi
|
356
|
+
\else\ifx\@mn@currxpos\@empty
|
357
|
+
\kern\marginnoteleftadjust
|
358
|
+
\if@mn@verbose
|
359
|
+
\PackageInfo{marginnote}{%
|
360
|
+
xpos not known,\MessageBreak
|
361
|
+
using \string\marginnoteleftadjust}%
|
362
|
+
\fi
|
363
|
+
\else
|
364
|
+
\if@mn@verbose
|
365
|
+
\PackageInfo{marginnote}{%
|
366
|
+
xpos seems to be \@mn@currxpos,\MessageBreak
|
367
|
+
\string\marginnoteleftadjust
|
368
|
+
\space ignored}%
|
369
|
+
\fi
|
370
|
+
\begingroup
|
371
|
+
\kern\@mn@currxpos
|
372
|
+
\if@twoside\ifodd\@mn@currpage\relax
|
373
|
+
\kern-\oddsidemargin
|
374
|
+
\else
|
375
|
+
\kern-\evensidemargin
|
376
|
+
\fi
|
377
|
+
\else
|
378
|
+
\kern-\oddsidemargin
|
379
|
+
\fi
|
380
|
+
\kern-1in
|
381
|
+
\endgroup
|
382
|
+
\fi
|
383
|
+
\fi
|
384
|
+
\kern\marginparsep
|
385
|
+
}%
|
386
|
+
\fi
|
387
|
+
}%
|
388
|
+
}%
|
389
|
+
\endgroup
|
390
|
+
}
|
391
|
+
\newcommand*{\marginnoterightadjust}{}
|
392
|
+
\newcommand*{\marginnoteleftadjust}{}
|
393
|
+
\let\marginnoterightadjust\z@
|
394
|
+
\let\marginnoteleftadjust\z@
|
395
|
+
\newcommand*{\marginnotevadjust}{}
|
396
|
+
\let\marginnotevadjust\z@
|
397
|
+
\newcommand{\mn@vlap}[1]{%
|
398
|
+
\setbox\@tempboxa\vbox to \ht\strutbox{#1\vss}%
|
399
|
+
\box\@tempboxa\vskip-\baselineskip
|
400
|
+
}
|
401
|
+
\newcommand{\mn@vadjust}[1]{%
|
402
|
+
\mn@zbox{\kern-\parskip
|
403
|
+
\leavevmode\vadjust{#1}%
|
404
|
+
\kern\parskip
|
405
|
+
}%
|
406
|
+
}
|
407
|
+
\providecommand*{\marginfont}{}
|
408
|
+
\newcommand*{\raggedleftmarginnote}{\raggedleft}
|
409
|
+
\newcommand*{\raggedrightmarginnote}{\raggedright}
|
410
|
+
\endinput
|
411
|
+
%%
|
412
|
+
%% End of file `marginnote.sty'.
|
@@ -0,0 +1,159 @@
|
|
1
|
+
%%
|
2
|
+
%% multirow.sty V1.6 version (5-May-2004)
|
3
|
+
%%
|
4
|
+
%% Author: Jerry Leichter <jerrold.leichter@smarts.com>
|
5
|
+
%% Piet van Oostrum <piet@cs.uu.nl>
|
6
|
+
%%
|
7
|
+
%% This file may be distributed under the terms of the LaTeX Project Public
|
8
|
+
%% License, as described in lppl.txt in the base LaTeX distribution.
|
9
|
+
%% Either version 1 or, at your option, any later version.
|
10
|
+
%%
|
11
|
+
%% V1.0 was distributed anonymously, based on a Usenet posting that was
|
12
|
+
%% not intended for stand-alone use.
|
13
|
+
%% V1.1 was modified by Piet van Oostrum <piet@cs.uu.nl> to allow it to
|
14
|
+
%% work without bigstrut.sty.
|
15
|
+
%% V1.2 was modified by Jerry Leichter for the same goal, but using a
|
16
|
+
%% different approach which will work properly in conjunction with
|
17
|
+
%% bigstrut.sty.
|
18
|
+
%% V1.2a was modified by Piet van Oostrum <piet@cs.uu.nl> to use \vskip
|
19
|
+
%% instead of \raise in positioning, avoiding making rows too high
|
20
|
+
%% when the adjustment is large.
|
21
|
+
%% V1.3 was modified by Piet van Oostrum to work properly in a p{} column
|
22
|
+
%% (\leavevmode added)
|
23
|
+
%% V1.4 was modified by Piet van Oostrum to check for the special case that
|
24
|
+
%% the width is given as an *. In this case the natural
|
25
|
+
%% width of the text argument will be used and the argument
|
26
|
+
%% is processed in LR-mode.
|
27
|
+
%% V1.5 was modified by Piet van Oostrum: Added a % after \hbox{#5}\vfill}.
|
28
|
+
%% Added \struts around #5 for better vertical positioning.
|
29
|
+
%% Additional coding for negative value of nrows.
|
30
|
+
%% V1.6 was modified by Piet van Oostrum: Replace a space by \relax after
|
31
|
+
%% \advance\@tempdima#4.
|
32
|
+
%%
|
33
|
+
% Make an entry that will span multiple rows of a table.
|
34
|
+
%
|
35
|
+
% \multirow{nrows}[bigstruts]{width}[fixup]{text}
|
36
|
+
%
|
37
|
+
% nrows is the number of rows to span. It's up to you to leave the other
|
38
|
+
% rows empty, or the stuff created by \multirow will over-write it.
|
39
|
+
% With a positive value of nrows the spanned colomns are this row and
|
40
|
+
% (nrows-1) rows below it. With a negative value of nrows they are
|
41
|
+
% this row and (1-nrows) above it.
|
42
|
+
%
|
43
|
+
% bigstruts is mainly used if you've used bigstrut.sty. In that case it
|
44
|
+
% is the total number of uses of \bigstrut within the rows being
|
45
|
+
% spanned. Count 2 uses for each \bigstrut, 1 for each \bigstrut[x]
|
46
|
+
% where x is either t or b. The default is 0.
|
47
|
+
% width is the width to which the text is to be set, or * to indicate that
|
48
|
+
% the text argument's natural width is to be used.
|
49
|
+
%
|
50
|
+
% text is the actual text. If the width was set explicitly, the text will
|
51
|
+
% be set in a parbox of that width; you can use \\ to force linebreaks
|
52
|
+
% where you like.
|
53
|
+
%
|
54
|
+
% If the width was given as * the text will be set in LR mode. If you
|
55
|
+
% want a multiline entry in this case you should use a tabular or array
|
56
|
+
% in the text parameter.
|
57
|
+
%
|
58
|
+
% The text is centered vertically within the range spanned by nrows.
|
59
|
+
%
|
60
|
+
% fixup is a length used for fine tuning: The text will be raised (or
|
61
|
+
% lowered, if fixup is negative) by that length above (below) wherever
|
62
|
+
% it would otherwise have gone.
|
63
|
+
%
|
64
|
+
% For example (using both multirow and bigstrut)
|
65
|
+
%
|
66
|
+
% \newcommand{\minitab}[2][l]{\begin{tabular}{#1}#2\end{tabular}}
|
67
|
+
% \begin{tabular}{|c|c|}
|
68
|
+
% \hline
|
69
|
+
% \multirow{4}{1in}{Common g text} & Column g2a\\
|
70
|
+
% & Column g2b \\
|
71
|
+
% & Column g2c \\
|
72
|
+
% & Column g2d \\
|
73
|
+
% \hline
|
74
|
+
% \multirow{3}[6]*{Common g text} & Column g2a\bigstrut\\\cline{2-2}
|
75
|
+
% & Column g2b \bigstrut\\\cline{2-2}
|
76
|
+
% & Column g2c \bigstrut\\
|
77
|
+
% \hline
|
78
|
+
% \multirow{4}[8]{1in}{Common g text} & Column g2a\bigstrut\\\cline{2-2}
|
79
|
+
% & Column g2b \bigstrut\\\cline{2-2}
|
80
|
+
% & Column g2c \bigstrut\\\cline{2-2}
|
81
|
+
% & Column g2d \bigstrut\\
|
82
|
+
% \hline
|
83
|
+
% \multirow{4}*{\minitab[c]{Common \\ g text}} & Column g2a\\
|
84
|
+
% & Column g2b \\
|
85
|
+
% & Column g2c \\
|
86
|
+
% & Column g2d \\
|
87
|
+
% \hline
|
88
|
+
% \end{tabular}
|
89
|
+
%
|
90
|
+
% If any of the spanned rows are unusually large, or if you're using
|
91
|
+
% bigstrut.sty and \bigstrut's are used assymetrically about the centerline of
|
92
|
+
% the spanned rows, the vertical centering may not come out right. Use the
|
93
|
+
% fixup argument in this case.
|
94
|
+
%
|
95
|
+
% Just before "text" is expanded, the \multirowsetup macro is expanded to
|
96
|
+
% set up any special environment. Initially, \multirowsetup contains just
|
97
|
+
% \raggedright. It can be redefined with \renewcommand.
|
98
|
+
%
|
99
|
+
% Bugs: It's just about impossible to deal correctly with descenders. The
|
100
|
+
% text will be set up centered, but it may then have a baseline that doesn't
|
101
|
+
% match the baseline of the stuff beside it, in particular if the stuff
|
102
|
+
% beside it has descenders and "text" does not. This may result in a small
|
103
|
+
% missalignment. About all that can be done is to do a final touchup on
|
104
|
+
% "text", using the fixup optional argument. (Hint: If you use a measure
|
105
|
+
% like .1ex, there's a reasonable chance that the fixup will still be correct
|
106
|
+
% if you change the point size.)
|
107
|
+
%
|
108
|
+
% \multirow is mainly designed for use with table, as opposed to array,
|
109
|
+
% environments. It will not work well in an array environment since the lines
|
110
|
+
% have an extra \jot of space between them which it won't account for. Fixing
|
111
|
+
% this is difficult in general, and doesn't seem worth it. The bigstruts
|
112
|
+
% argument can be used to provide a semi-automatic fix: First set
|
113
|
+
% \bigstrutjot to .5\jot. Then simply repeat nrows as the bigstruts argument.
|
114
|
+
% This will be close, but probably not exact; you can use the fixup argument
|
115
|
+
% to refine the result. (If you do this repeatedly, you'll probably want to
|
116
|
+
% wrap these steps up in a simple macro. Note that the modified \bigstrutjot
|
117
|
+
% value will not give reasonable results if you have bigstruts and use this
|
118
|
+
% argument for its intended purpose elsewhere. In that case, you might want
|
119
|
+
% to set it locally.)
|
120
|
+
%
|
121
|
+
% If you use \multirow with the colortbl package you have to take
|
122
|
+
% precautions if you want to color the column that has the \multirow in it.
|
123
|
+
% colortbl works by coloring each cell separately. So if you use \multirow
|
124
|
+
% with a positive nrows value, colortbl will first color the top cell, then
|
125
|
+
% \multirow will typeset nrows cells starting with this cell, and later
|
126
|
+
% colortbl will color the other cells, effectively hiding the text in that
|
127
|
+
% area. This can be solved by putting the \multirow is the last row with a
|
128
|
+
% negative nrows value.
|
129
|
+
% Example:
|
130
|
+
%
|
131
|
+
% \begin{tabular}{l>{\columncolor{yellow}}l}
|
132
|
+
% aaaa & \\
|
133
|
+
% cccc & \\
|
134
|
+
% dddd & \multirow{-3}*{bbbb}\\
|
135
|
+
% \end{tabular}
|
136
|
+
%
|
137
|
+
\def\multirowsetup{\raggedright}
|
138
|
+
\def\multirow#1{\relax\@ifnextchar
|
139
|
+
[{\@multirow{#1}}{\@multirow{#1}[0]}}
|
140
|
+
\def\@multirow#1[#2]#3{\@ifnextchar [{\@xmultirow{#1}[#2]{#3}}%
|
141
|
+
{\@xmultirow{#1}[#2]{#3}[0pt]}}
|
142
|
+
\def\@xmultirow#1[#2]#3[#4]#5{\@tempcnta=#1%
|
143
|
+
\@tempdima\@tempcnta\ht\@arstrutbox
|
144
|
+
\advance\@tempdima\@tempcnta\dp\@arstrutbox
|
145
|
+
\ifnum\@tempcnta<0\@tempdima=-\@tempdima\fi
|
146
|
+
\advance\@tempdima#2\bigstrutjot
|
147
|
+
\if*#3\setbox0\vtop to \@tempdima{\vfill\multirowsetup
|
148
|
+
\hbox{\strut#5\strut}\vfill}%
|
149
|
+
\else
|
150
|
+
\setbox0\vtop to \@tempdima{\hsize#3\@parboxrestore
|
151
|
+
\vfill \multirowsetup \strut#5\strut\par\vfill}%
|
152
|
+
\fi
|
153
|
+
\ht0\z@\dp0\z@
|
154
|
+
\ifnum\@tempcnta<0\advance\@tempdima-\dp\@arstrutbox
|
155
|
+
\else\@tempdima=\ht\@arstrutbox
|
156
|
+
\ifnum#2>0 \advance\@tempdima\bigstrutjot \fi
|
157
|
+
\fi
|
158
|
+
\advance\@tempdima#4\relax\leavevmode\vtop{\vskip-\@tempdima\box0\vss}}
|
159
|
+
\@ifundefined{bigstrutjot}{\newdimen\bigstrutjot \bigstrutjot\jot}{}
|