emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Aligned glosses in orgmode (for export to odt/doc)
       [not found] <mailman.111.1359046822.1194.emacs-orgmode@gnu.org>
@ 2014-01-22 17:07 ` Benjamin Slade
  2014-01-22 18:16   ` Jambunathan K
  2014-01-23 14:14   ` Jambunathan K
  0 siblings, 2 replies; 4+ messages in thread
From: Benjamin Slade @ 2014-01-22 17:07 UTC (permalink / raw)
  To: emacs-orgmode

I'm contemplating writing a linguistics article in orgmode because I
know I will need to provide a doc(x) file (normally I would otherwise
use LaTeX).

One of things I will need to be able to is produce numbered examples
with aligned interlinear glosses (like these:
http://www.eva.mpg.de/lingua/resources/glossing-rules.php ). It's been a
while since I've done this in a doc(x)-ish format, but the obvious ways
would be (1) to do something with tab alignment or (2) use
borderless/invisible tables.

Can anyone suggest how this (or some other solution to producing
interlinear glosses) might be implemented in an orgmode->odt/doc/docx
setup? One potential solution would be an orgmode setup which produces
borderless tables with an "optimal width" column setting. I don't know
how to do this in orgmode though (or if it can be done currently).

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dr Benjamin Slade
 Dept. of Linguistics, Uni. of Utah

pgp fingerprint: 21BA 2AE1 28F6 DF36 110A 0E9C A320 BBE8 2B52 EE19
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{sent by mu4e on Emacs running under GNU/Linux}
(Choose Linux, Choose Freedom)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Aligned glosses in orgmode (for export to odt/doc)
  2014-01-22 17:07 ` Aligned glosses in orgmode (for export to odt/doc) Benjamin Slade
@ 2014-01-22 18:16   ` Jambunathan K
  2014-01-24 17:39     ` Jambunathan K
  2014-01-23 14:14   ` Jambunathan K
  1 sibling, 1 reply; 4+ messages in thread
From: Jambunathan K @ 2014-01-22 18:16 UTC (permalink / raw)
  Cc: emacs-orgmode

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


Benjamin Slade <slade@jnanam.net> writes:

> One potential solution would be an orgmode setup which produces
> borderless tables with an "optimal width" column setting. I don't know
> how to do this in orgmode though (or if it can be done currently).

This feature is available only in my private repo.  

----------------------------------------------------------------

If you are using Git see instructions at:

    http://lists.gnu.org/archive/html/emacs-orgmode/2013-12/msg00522.html

   (Search for "Download")

Once you download and copy the ox-odt.el file, make sure you do

    M-x byte-compile-file

to create .elc file.

----------------------------------------------------------------

If you are using ELPA see instructions at:

    http://lists.gnu.org/archive/html/emacs-orgmode/2014-01/msg00518.html

    (Search for "Untar")

----------------------------------------------------------------

1. Identity where your styles files come from.  Look at the *Messages*
   buffer for clue.

2. Open OrgOdtContentTemplate.xml and find a style named
"CustomTableCell".  Edit it so that it has no borders.

Replace this

    <style:style style:name="CustomTableCell" style:family="table-cell">
      <style:table-cell-properties style:vertical-align="top" fo:background-color="#ffffff" fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000">

with this:

    <style:style style:name="CustomTableCell" style:family="table-cell">
      <style:table-cell-properties style:vertical-align="top"
      fo:background-color="#ffffff" fo:padding="0.097cm">


3. Create a tables as below.  ("GriddedTable" is part of C-h v
   `org-odt-table-styles').  WARNING: Don't try to understand the
   documentation.  I don't it understand it myself.

--8<---------------cut here---------------start------------->8---


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

Rows will be in the ratio of 2:3:4

#+ATTR_ODT: :style "GriddedTable"
| <1> | <2> | <3> |
| _a_ | _b_ | _c_ |
| _d_ | _e_ | _f_ |


Rows will be in the ratio of 4:7:10.  Table will occupy 80% of page width.

#+ATTR_ODT: :rel-width 80
#+ATTR_ODT: :widths 3,6,9
#+ATTR_ODT: :style "GriddedTable"
| <1> | <2> | <3> |
| _a_ | _b_ | _c_ |
| _d_ | _e_ | _f_ |


[-- Attachment #3: Type: text/plain, Size: 120 bytes --]


--8<---------------cut here---------------end--------------->8---

4. Export it.  You will get the attached ODT file.


[-- Attachment #4: test.odt --]
[-- Type: application/vnd.oasis.opendocument.text, Size: 10609 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Aligned glosses in orgmode (for export to odt/doc)
  2014-01-22 17:07 ` Aligned glosses in orgmode (for export to odt/doc) Benjamin Slade
  2014-01-22 18:16   ` Jambunathan K
@ 2014-01-23 14:14   ` Jambunathan K
  1 sibling, 0 replies; 4+ messages in thread
From: Jambunathan K @ 2014-01-23 14:14 UTC (permalink / raw)
  Cc: emacs-orgmode

Benjamin Slade <slade@jnanam.net> writes:

> Can anyone suggest how this (or some other solution to producing
> interlinear glosses) might be implemented in an orgmode->odt/doc/docx
> setup? One potential solution would be an orgmode setup which produces
> borderless tables with an "optimal width" column setting. I don't know
> how to do this in orgmode though (or if it can be done currently).

Feel free to use my ELPA package. I have documented the procedure here

    http://permalink.gmane.org/gmane.emacs.orgmode/81347

Going forward, I will release my packages - ox-odt and org-jabref - via
ELPA tarball.  So, ELPA installation will be the recommended method for
accessing my private package.

----------------------------------------------------------------

You can ignore my earlier message at:

    http://permalink.gmane.org/gmane.emacs.orgmode/81301

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Aligned glosses in orgmode (for export to odt/doc)
  2014-01-22 18:16   ` Jambunathan K
@ 2014-01-24 17:39     ` Jambunathan K
  0 siblings, 0 replies; 4+ messages in thread
From: Jambunathan K @ 2014-01-24 17:39 UTC (permalink / raw)
  Cc: emacs-orgmode

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


Jambunathan K <kjambunathan@gmail.com> writes:

> Benjamin Slade <slade@jnanam.net> writes:
>
>> One potential solution would be an orgmode setup which produces
>> borderless tables with an "optimal width" column setting. I don't know
>> how to do this in orgmode though (or if it can be done currently).

In Office XML, the style:table-column-properties has
style:use-optimal-column-width="true".  Based on my little
experimentation, I find that LibreOffice doesn't honor this setting.
This is the reason why columns are emitted unoptimized.

From LibreOffice UI, if you choose "Optimal Column Width", then the
table columns are emitted NOT with above XML attribute but with
hard-coded on-the-fly widths.

May be someone can take the above issue with LibreOffice folks...

> 2. Open OrgOdtContentTemplate.xml and find a style named
> "CustomTableCell".  Edit it so that it has no borders.

Ignore the above suggestion.  It is too tedious.  I have flushed out a
fix as part of the following ELPA tar

    http://repo.or.cz/w/org-mode/org-kjn.git/blob_plain/master:/org-odt-20140124.tar

With this fix, the behaviour of the rules in the ODT table will be much
the same as that in

    (info "(org) Tables in ODT export")

except for the following modification:

The ODT table will have top rule (or bottom rule) only if the Org-mode
table has one.

Similarly, ODT table will have left rule (resp. right rule) only if the
leftmost (resp. rightmost) data column has "<" and ">" markers.

----------------------------------------------------------------

To cut the long story short, here is how you produce a borderless table.
Use the :widths and :rel-width property to have the table look compact
and nice.


--8<---------------cut here---------------start------------->8---


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

This table has no rules.  It occupies 80% of page width.  The columns
will be in the ratio of 4:7:10.

#+ATTR_ODT: :rel-width 80
#+ATTR_ODT: :widths 3,6,9
| a   | b | c |
| d   | e | f |


[-- Attachment #3: Type: text/plain, Size: 68 bytes --]


--8<---------------cut here---------------end--------------->8---


[-- Attachment #4: test.odt --]
[-- Type: application/vnd.oasis.opendocument.text, Size: 10544 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-24 17:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.111.1359046822.1194.emacs-orgmode@gnu.org>
2014-01-22 17:07 ` Aligned glosses in orgmode (for export to odt/doc) Benjamin Slade
2014-01-22 18:16   ` Jambunathan K
2014-01-24 17:39     ` Jambunathan K
2014-01-23 14:14   ` Jambunathan K

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).