emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: Matt Price <moptop99@gmail.com>
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: org->odt/html table export: adjusting default behaviour?
Date: Mon, 29 Aug 2011 04:03:28 +0530	[thread overview]
Message-ID: <81mxetdv47.fsf@gmail.com> (raw)
In-Reply-To: <CAN_Dec9wpi1Us_5t5+39CWM2e9OWje0RyYtfhmgfg0U9aH-GhA@mail.gmail.com> (Matt Price's message of "Fri, 26 Aug 2011 10:24:38 -0400")

[-- Attachment #1: Type: text/plain, Size: 3131 bytes --]


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.

-- 

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: table.org --]
[-- Type: text/x-org, Size: 6480 bytes --]

#+TITLE:     test.org
#+AUTHOR:    Matt Price
#+EMAIL:     matt.price@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 #3: table.odt --]
[-- Type: application/vnd.oasis.opendocument.text, Size: 18646 bytes --]

  reply	other threads:[~2011-08-28 22:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 15:12 org->odt/html table export: adjusting default behaviour? Matt Price
2011-08-25 15:36 ` Matt Price
2011-08-25 21:40 ` Jambunathan K
2011-08-26 14:24   ` Matt Price
2011-08-28 22:33     ` Jambunathan K [this message]
2011-08-28 22:40       ` [PATCH 1/2] Parse and store both col align and col width spec for later use Jambunathan K
2011-08-28 22:41       ` [PATCH 2/2] org-odt.el: Put table style and col sizes under direct user control Jambunathan K
2011-09-14  9:56   ` [odt] Support for table templates (was Re: org->odt/html table export: adjusting default behaviour?) Jambunathan K
2011-08-25 22:01 ` org->odt/html table export: adjusting default behaviour? Jambunathan K
2011-08-26 14:13   ` Matt Price

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81mxetdv47.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=moptop99@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).