Matt

>  It would be nice if I could code the table formatting into the org
> file so that I don't have to hand-fix the formatting on each
> iteration.

Thanks for your feedback. 

I have worked up a patch which intends to give users more control over
how tables are formatted. The patch modifies files that I don't own so
the changes will take sometime to hit the repo.

With this patch applied one can
1. Choose the style of the table (Is the table wide or narrow?)
2. Control relative size of the individual columns

The new feature is best illustrated by an example. If you look at the
attached file you will see that:

1. The first table which has only 2 columns and less text has the
   following attribute.

,----
|    #+ATTR_ODT: OrgTableSmall
`----

   The intention is to format the table so that it occupies lesser
   width. 

   The table styles are stored in
   contrib/odt/styles/OrgOdtAutomaticStyles.xml. Visit this file and
   look for "OrgTable" property and you will that it occupies 90% of
   page width. 

,---- OrgTable
|   <style:style style:name="OrgTable" style:family="table">
|    <style:table-properties style:rel-width="90%" table:align="center"/>
|   </style:style>
`----

   Now I add another entry "OrgTableSmall" which occupies 30% of page
   width as below

,---- OrgTableSmall
|   <style:style style:name="OrgTableSmall" style:family="table">
|    <style:table-properties style:rel-width="30%" table:align="center"/>
|   </style:style>
`----

2. Modify the bigger table as below
   - specify no #+ATTR_ODT
     This will ensure that the default 90% style is used for the table
   - indicate colgroups (Note the new row full of "<>" as field entries)
     This will ensure that exported table will have vertical grid lines
   - horizontal separators
     This will ensure that exported table has horizontal grid lines
   - The width specifier has been adjusted so that exported table is
     well-balanced. Note that the "Readings" columns which has no
     entries is given very negligible weightage and other columns has
     fairly good weightage.

3. Export the file to Odt.

4. Now you will have a resonably good looking Table. To make it more
   pleasing you need to reduce the font size of the table entries. This
   you can do by F11->Paragraph Styles->OrgTableContents-><set font size
   to 10 pt> 

   Or 

   If you are imaptient you can grok the
   contrib/odt/styles/OrgOdtStyles.xml file for "OrgTableContents" and
   fix the font-size there.

I am attaching the resulting file at the end of step 4. 

Hope these adjustments make the export of table more flexible. Let me
know what you know think.

Rant: The only way to customize Tables in LibreOffice is through the
Autoformat utility. The OASIS specification clearly outlines ways to
create custom table-related styles. Unfortunately, the state of affairs
with LibreOffice is such that such styles are ignored when used. So one
has to really rely on automatic styles for formatting of tables going
forward. This makes styling of tables a bit more involved for me - the
developer and you - the user.

Thanks, 
Jambunathan K.

-- 
#+TITLE:     test.org
#+AUTHOR:    Matt Price
#+EMAIL:     matt.pr...@utoronto.ca
#+DATE:      2011-08-23 Tue
#+DESCRIPTION:
#+KEYWORDS:
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js
#+EXPORT_SELECT_TAGS: export
#+EXPORT_EXCLUDE_TAGS: noexport
#+LINK_UP:   
#+LINK_HOME: 
#+XSLT:

* heading1
** heading2

#+ATTR_ODT: OrgTableSmall
| table | 1 | 2 |
|       |   |   |

** heading2 -2
some text.

* Outline

|       Week | Date                 | Topic                          | Description                         | Tech Topics          | Assignments          | Readings | Notes                |
|------------+----------------------+--------------------------------+-------------------------------------+----------------------+----------------------+-------+----------------------|
|          / | <>                   | <>                             | <>                                  | <>                   | <>                   | <>    | <>                   |
|       <10> | <20>                 | <30>                           | <35>                                | <20>                 | <20>                 | <5>   | <20>                 |
|          1 | 9/12/2011            | Intro:What is History For?     | The uses of history; engagement and objectivity; etc | Intro to Website     | --                   |       |                      |
|------------+----------------------+--------------------------------+-------------------------------------+----------------------+----------------------+-------+----------------------|
|          2 | 9/19/2011            | History and the Public Sphere  | "What is the Public Sphere, & what role does history play in it?" | HTML Workshop        |                      |       |                      |
|------------+----------------------+--------------------------------+-------------------------------------+----------------------+----------------------+-------+----------------------|
|          3 | 9/26/2011            | What ais the Canadian Public Sphere | "Multiculturalism, Immigration, and National Identity as questions of mediality" |                      |                      |       |                      |
|------------+----------------------+--------------------------------+-------------------------------------+----------------------+----------------------+-------+----------------------|
|          4 | 10/3/2011            | History From Below             | "History from below,' oral history, & implications for the practice of history" | Audio Workshop       | Oral History Interview |       |                      |
|------------+----------------------+--------------------------------+-------------------------------------+----------------------+----------------------+-------+----------------------|
|          6 | 10/10/2011           | Th Wisdom of the Crowd?        | "Crowdsourcing, Wikipedia, Citizen Science & Collaborative history" | Collective Bibliographies | Zotero Assignment    |       | Transcription of Interview |
|------------+----------------------+--------------------------------+-------------------------------------+----------------------+----------------------+-------+----------------------|
|          5 | 10/17/2011           | Language of The Web            | From Memex to HTML5; the Web as a Utopian project | google maps/jsbin workshop? maybe not. |                      |       | Visits to Archive    |
|------------+----------------------+--------------------------------+-------------------------------------+----------------------+----------------------+-------+----------------------|
|          7 | 10/24/2011           | Engaged History                |                                     |                      |                      |       | Background Research  |
|------------+----------------------+--------------------------------+-------------------------------------+----------------------+----------------------+-------+----------------------|
|          8 | 10/31/2011           | Recursive Publics              | Open Source/Open Access/Open standards | Timelines            | Timeline Assignment -- needs a lab |       | Open Access Week. Peer review of audio stories. |
|------------+----------------------+--------------------------------+-------------------------------------+----------------------+----------------------+-------+----------------------|
|          9 | 11/7/2011            | Information Abundance          |                                     |                      |                      |       |                      |
|------------+----------------------+--------------------------------+-------------------------------------+----------------------+----------------------+-------+----------------------|
|         10 | 11/14/2011           | Thinking with Pictures         | Maps and the visual Representation of Information | GIS                  | GIS Assignment       |       |                      |
|------------+----------------------+--------------------------------+-------------------------------------+----------------------+----------------------+-------+----------------------|
|         11 | 11/21/2011           | Making Sense of copyright      |                                     |                      |                      |       |                      |
|------------+----------------------+--------------------------------+-------------------------------------+----------------------+----------------------+-------+----------------------|
|         12 | 11/28/2011           | Digital Divides                |                                     |                      |                      |       |                      |
|------------+----------------------+--------------------------------+-------------------------------------+----------------------+----------------------+-------+----------------------|
|         13 | 12/5/2011            | Review Authorship              |                                     |                      | Final Assignment     |       |                      |
|------------+----------------------+--------------------------------+-------------------------------------+----------------------+----------------------+-------+----------------------|

Attachment: table.odt
Description: table.odt

Reply via email to