The TOC max level which could be specified by user is lost during the
export operation. However, this information could be useful in particular
with the ODT exporter. So if another script work on the ODT afterward and
ask to re-compute the TOC, the new TOC will keep this max level.
TINYCHANGE.
* contrib/lisp/org-odt.el (org-export-odt-max-image-size): New
variable.
(org-odt-image-size-from-file): Honor above variable.
Ivars Finvers <ifinvers@shaw.ca> says -
One minor issue that I came across in using the ODT
exporter relates to the size of embedded images. I often need
to include plots of simulation results in my documents. These
plots can be larger than a normal page, which causes problems
in the text flow. In LaTeX, I've grown used to being able to
automatically rescale a plot to match the maximum text width
of the document. It would be useful to have such a feature
for the ODT exporter.
* contrib/lisp/org-odt.el (org-odt-is-formula-link-p):
Recognize *.mml and *.mathml as mathml files. Recognize *.odf
files as OpenDocument formula file.
(org-odt-copy-formula-file): Use `org-odt-zip-extract-one' to
handle ODF formula files.
(org-export-odt-format-formula): If a ODF formula link has no
caption or label, embed it inline. Otherwise embed it as
displayed.
* contrib/lisp/org-odt.el (org-odt-update-styles-file)
(org-odt-write-mimetype-file): New. Extracted out of
`org-odt-save-as-outfile'.
(org-odt-save-as-outfile): Use above routines.
(org-export-odt-tmpdir-prefix)
(org-odt-init-outfile): Misc changes.
Preparing for introducing `org-export-as-odf'. The new
command will create OpenDocument Formula files out of LaTeX
fragments. Dynamic variable `org-lparse-backend' will be set
to 'odf during this command.
* contrib/lisp/org-odt.el (org-odt-encode-plain-text): New.
(org-odt-format-line)
(org-odt-format-source-code-or-example-plain): Use it.
(org-odt-format-object-description): New. Format svg:title
and svg:desc elements out of plain text.
(org-export-odt-format-formula, org-export-odt-format-image):
Check whether the incoming formula or image is generated out
of a latex fragment. If yes, pass the latex fragment for
downstream processing.
(org-odt-format-frame): Check if the object that is enclosed
in the frame has metadata associated with it. If yes, dump it
as part of svg:title and svg:desc elements.
(org-odt-protect-latex-fragment): New after advice for
`org-format-latex-as-mathml'. Fixes the following bug
http://lists.gnu.org/archive/html/emacs-orgmode/2011-11/msg00176.html
* contrib/lisp/org-odt.el
(org-odt-format-source-line-with-line-number-and-label): When
numbering was turned off, src blocks were getting stripped
from export. Fixed this regression.
* contrib/lisp/org-odt.el (org-odt-begin-table)
(org-export-odt-format-formula, org-export-odt-format-image)
(org-odt-entity-frame-styles, org-odt-format-entity): Use
"__Table__", "__Figure__", "__MathFormula__",
"__DvipngImage__" as internal category handles.
(org-export-odt-user-categories)
(org-export-odt-get-category-from-label)
(org-odt-label-styles, org-odt-category-map-alist): New
variables.
(org-odt-entity-labels-alist): Add label style as an
additional entry. Update docstring.
(org-odt-get-label-category-and-style): New defun.
(org-odt-add-label-definition)
(org-odt-format-label-definition)
(org-odt-format-label-reference)
(org-odt-fixup-label-references)
(org-odt-format-entity-caption, org-odt-init-outfile):
Modified.
(org-odt-label-def-ref-spec): Removed. Superceded by
`org-odt-label-styles'.
(org-odt-get-label-definition): Removed
Give user more control over how labels are generated and
referenced. This is accomplished by mapping each label to a
category-handle which in turn is used to locate the category,
counter and style to be associated with label.
* contrib/lisp/org-lparse.el (org-lparse-special-blocks): New
variable. Add "annotation" blocks in addition to the already
existing "list-table" blocks.
(org-lparse-get-block-params): New helper routine to read
params passed to a special block. Used in conjunction with
OpenDocument annotations and with parsing of "#+ATTR_ODT:..."
lines attached to images.
(org-lparse-par-open-stashed): New let-bound variable.
(org-do-lparse): Bind `org-lparse-par-open-stashed'. Treat
all blocks listed in `org-lparse-special-blocks' as special
environments. Honor options passed as part of
"#+begin_<block-name>[options]".
(org-lparse-preprocess-after-blockquote-hook): Handle all
blocks listed in `org-lparse-special-blocks' specially.
(org-lparse-strip-experimental-blocks-maybe-hook): New hook
that hooks up to `org-export-preprocess-hook'. Removes blocks
listed under `org-lparse-special-blocks' while exporting to
formats other than "odt" or "xhtml".
(org-lparse-begin-environment, org-lparse-end-environment):
Modified signature to accomodate block params.
(org-lparse-stash-save-paragraph-state)
(org-lparse-stash-pop-paragraph-state): New helper routines
for use with emitting of OpenDocument annotations.
(org-lparse-list-table-enable): Removed. "list tables" are
now always enabled.
* contrib/lisp/org-odt.el (org-odt-begin-annotation)
(org-odt-end-annotation): New routines.
(org-odt-begin-environment, org-odt-end-environment): Handle
block params. Handle the new "annotation" block.
(org-odt-format-author, org-odt-iso-date-from-org-timestamp):
New helper routnes for emitting author and comment timestamps
with annotation blocks.
(org-odt-update-meta-file): Use above routines.
(org-export-odt-format-image): Use
`org-lparse-get-block-params' to parse inline image attributes.
(org-odt-format-date): Removed. Superceded by
`org-odt-iso-date-from-org-timestamp'.
See http://lists.gnu.org/archive/html/emacs-orgmode/2011-10/msg01251.html
* contrib/lisp/org-odt.el
(org-export-odt-preferred-output-format): Use
`org-lparse-reachable-format'. Update docstring.
(org-export-odt-convert-processes)
(org-export-odt-convert-process)
(org-export-odt-convert-capabilities): New customizable
variables. Migrated from org-lparse.el.
(org-export-odt-convert): New. Replaces `org-lparse-convert'.
(org-odt-get): Handle options - `CONVERT-METHOD' and
`CONVERT-CAPABILITIES'.
* contrib/lisp/org-lparse.el (org-lparse-and-open)
(org-lparse-to-buffer)
(org-replace-region-by, org-lparse-region, org-lparse): Made
these functions non-interactive.
(org-lparse-convert): Removed. Splitted it in to
`org-lparse-convert-read-params' and `org-lparse-do-convert'.
(org-lparse-convert-read-params, org-lparse-do-convert): New
helper routines.
(org-lparse-convert-processes, org-lparse-convert-process)
(org-lparse-convert-capabilities): Removed. Migrated to
org-odt.el.
(org-lparse-get-other-backends, org-lparse-get-converter)
(org-lparse-all-backends): Removed these helper routines.
(org-lparse-do-reachable-formats)
(org-lparse-reachable-formats, org-lparse-reachable-p): New
helper routines.
(org-do-lparse): Misc changes.
org-lparse.el is likely to be replaced by Nicolas Goazious's
backend. So, with future-proofing in view, hide org-lparse.el
from direct user contact. This amounts to retiring all
interactive functions and customizable variables that have
org-lparse as prefix and migrating their existing functinality
to the odt namespace. This set of changes does precisely
that.
* contrib/lisp/org-odt.el (org-export-odt): Define the missing
customizable group and hook it up with `org-export'
customizable group.
(org-export-odt-preferred-output-format): Fix the `:group'
property.
* contrib/lisp/org-odt.el (org-export-odt-inline-images):
Renamed from `org-odt-export-inline-images'. Also removed
customizability.
(org-export-odt-inline-image-extensions): Renamed from
`org-odt-export-inline-image-extensions'. Also fixed the
`:group' property.
(org-odt-format-org-link): Propagate above changes.
* contrib/lisp/org-odt.el: Introduce a new option
"#+ODT_STYLES_FILE: ..." for per-file setting of
`org-export-odt-styles-file'.
(org-export-odt-styles-file): Mention above option in
docstring.
(org-odt-save-as-outfile): Honor above option.
* contrib/lisp/org-lparse.el
(org-lparse-table-get-colalign-info): Renamed
`org-forced-aligns' to `org-col-cookies'. Renamed local
variable `forced-aligns' to `col-cookies'.
(org-lparse-format-table-row): With the introduction of
`org-col-cookies' property the internal structure of
`org-lparse-table-colalign-info' has changed. Do the right
thing while setting up col alignment. Pass on the colwidth
property as horiz-span arg of `TABLE-CELL' callback.
* contrib/lisp/org-odt.el (org-odt-begin-table): Let the table
style be settable throught #+ATTR_ODT line. By default tables
are configured to occupy 90% of paper width. This is too big
for smaller tables. For aesthetic reasons, a user might
prefer that such tables of shorter width and thus specify a
different style.
(org-odt-end-table, org-odt-format-table-cell): Honor colwidth
specification.
* contrib/lisp/org-xhtml.el (org-xhtml-format-table-cell): Fix
signature as mandated by changes in TABLE-CELL callback.
See comments in the earlier patch. See also
http://lists.gnu.org/archive/html/emacs-orgmode/2011-08/msg01053.html
* contrib/lisp/org-odt.el (org-odt-get-label-definition): If a
label cannot be resolved, issue a warning and return nil.
(org-odt-fixup-label-references): Nothing to fixup if a
referenced label is not seen by the odt exporter.
* contrib/odt/styles/OrgOdtStyles.xml
(OrgFixedWidthBlockLastLine, OrgSrcBlockLastLine): New styles
to be applied to the last line of the source or example
blocks.
* contrib/lisp/org-odt.el
(org-odt-format-source-code-or-example-plain)
(org-odt-format-source-code-or-example-colored): Use above
styles.
* contrib/lisp/org-lparse.el (org-lparse-format-org-link):
Push the responsibility of calling
`org-export-get-coderef-format' to the backends.
* contrib/lisp/org-xhtml.el (org-xhtml-format-org-link): Take
up the above responsibility.
* contrib/lisp/org-odt.el (org-odt-format-link): Handle links whose
descriptions are actually line-numbers.
(org-odt-format-source-line-with-line-number-and-label): New.
Generate line numbers and link targets for lines that are part of
source or example blocks.
(org-odt-format-source-code-or-example-plain)
(org-odt-format-source-code-or-example-colored): Use
`org-odt-format-source-line-with-line-number-and-label'.
(org-odt-format-source-code-or-example): Pre-process input lines with
`org-export-number-lines'. Also handle numbering of src lines.
(org-odt-format-org-link): Rework handling of coderef links. Generate
ODF-specific markup for line-number based coderef links.
(org-xml-encode-plain-text-lines): Removed. Not used any more.
contrib/odt/styles/OrgOdtStyles.xml (OrgSrcBlockNumberedLine): New
style for automatic numbering of src and example lines.
* contrib/odt/styles/OrgOdtContentTemplate.xml: Add bottom
margin to "OrgTable". Modify border properties of
"OrgTblCell*"s. Add "OrgEquation" table styles for
typesetting of display equations.
* contrib/odt/styles/OrgOdtStyles.xml: Added various "graphic"
styles for formatting of inline and display equations.
Modified names of some "graphic" styles for images for reasons
of consistency.
* contrib/lisp/org-odt.el (org-export-odt-do-format-image):
Removed. This is now folded in to
`org-export-odt-format-image'. A part of this is extracted in
to `org-odt-format-entity'.
(org-odt-entity-frame-styles): New variable.
(org-odt-format-entity): New function. See previous entries.
(org-export-odt-format-image): Modified. See previous
entries.
(org-export-odt-do-format-numbered-formula)
(org-export-odt-do-format-formula): Removed. These functions
are now folded within `org-export-odt-format-formula'.
(org-export-odt-format-formula): Modified as noted above.
Also use `org-odt-format-entity'.
(org-odt-format-frame, org-odt-format-textbox): Modified
signature to facilitate elegant introduction of
`org-odt-format-entity'.
(org-odt-format-inlinetask): Honor change in signature.
(org-odt-label-def-ref-spec): Added an entry for "Equation".
Only MathML equations are typeset using tables. Dvipng equations are still
typeset as regular images.
* contrib/lisp/org-odt.el
(org-odt-entity-labels-alist, org-odt-entity-counts-plist)
(org-odt-label-def-ref-spec): New variables.
(org-odt-init-outfile): Reset above variables.
(org-odt-add-label-definition, org-odt-get-label-definition)
(org-odt-format-label-definition)
(org-odt-format-label-reference)
(org-odt-fixup-label-references): New functions.
(org-export-odt-preprocess-label-references): Modified.
(org-odt-end-export): Call `org-odt-fixup-label-references'.
(org-odt-parse-label): Removed
(org-odt-default-entity): Removed.
(org-odt-format-entity-caption): Fixed signature so that
category param is no longer optional. Use
`org-odt-format-label-definition'.
(org-export-odt-do-format-formula)
(org-export-odt-do-format-image): Pass the mandatory category
param to `org-odt-format-entity-caption'.
* contrib/odt/styles/OrgOdtContentTemplate.xml: Add Figure and
Equation as sequence declarations.
Most of these changes can be pushed to org-exp.el. For now park the
changes locally to org-odt.el.
* contrib/lisp/org-odt.el (org-odt-table-style)
(org-odt-table-style-spec): New variables.
(org-export-odt-table-styles): New user-customizable variable.
(org-odt-begin-table): Init `org-odt-table-style' from the
attributes.
(org-odt-get-table-cell-styles): New function.
(org-odt-end-table): Use the above function.
(org-odt-get-style-name-for-table-cell): Removed. Now folded
in to `org-odt-get-table-cell-styles'.
(org-odt-get-style-name-cookie-for-table-cell): Modified to
accommodate new user-defined styles.
Users now have the option of choosing Org's own way of styling or
using custom styling.
* contrib/odt/styles/OrgOdtAutomaticStyles.xml: Removed
* contrib/odt/styles/OrgOdtContentTemplate.xml: Added. This
file is now a fully-formed "content.xml" file but with "empty"
content. Note that the original "OrgOdtAutomaticStyles.xml"
was just an xml fragment.
* contrib/lisp/org-odt.el
(org-odt-document-content-header): Removed.
(org-export-odt-automatic-styles-file): Removed.
(org-export-odt-content-template-file): Renamed from
`org-export-odt-automatic-styles-file'.
(org-odt-data-dir): Update docstring.
(org-odt-begin-office-body, org-odt-begin-document-content):
Modified to accomodate changes introduced by the new
"OrgOdtContentTemplate.xml" file.
* contrib/lisp/org-odt.el
(org-odt-embedded-formulas-count):New variable.
(org-odt-init-outfile): Reset above variable.
(org-odt-is-formula-link-p, org-odt-format-inline-formula)
(org-odt-copy-formula-file, org-export-odt-format-formula)
(org-export-odt-do-format-formula)
(org-export-odt-do-format-numbered-formula): New functions for
formatting mathml file links as embedded ODF formulae.
(org-odt-format-org-link): Add check for links to mathml files
and call `org-odt-format-inline-formula'.
(org-export-odt-format-image): Update function signature. Use
`org-latex-src' property to identify latex dvipng images. Use
the (to be committed) `org-latex-src-embed-type' to identify
whether the equation image should be inlined or displayed.
(org-odt-format-textbox): Modified to accomodate correct
formatting of captioned formula.
(org-odt-format-inlinetask): Modified to accomodate changes to
the previous function.
(org-export-odt-do-format-image): Minor change.
(org-export-odt-do-preprocess-latex-fragments): When LaTeX
fragment option is set to `t' or `mathjax' check for
availability of latex to mathml converter using (to be
committed) `org-format-latex-mathml-available-p'. If such a
converter is available and configured, use it. Otherwise
default to the earlier behaviour.
Refer the following post for more information:
http://article.gmane.org/gmane.emacs.orgmode/46712
* contrib/lisp/org-odt.el (org-odt-format-frame): New.
(org-odt-format-textbox): Use the above function.
(org-export-odt-do-format-image): Use the above two functions.
Use the new custom styles for the Frame and Graphics elements.
(org-odt-image-attrs-from-size): Remove this.
* contrib/odt/styles/OrgOdtAutomaticStyles.xml: Removed all
Frame and Graphics entries.
* contrib/odt/styles/OrgOdtStyles.xml: Added following custom
styles - OrgSimpleGraphics, OrgCaptionedGraphics,
OrgCaptionFrame, OrgInlineGraphics and OrgInlineFormula.
* contrib/lisp/org-odt.el (org-odt-format-date): %:z format
specifier of `format-time-string' is not portable. Replace it
with an equivalent implementation using %z specifier.
Thanks to Anton Tarasenko for reporting this bug and verifying
this fix. See
http://lists.gnu.org/archive/html/emacs-orgmode/2011-09/msg00099.html
* contrib/lisp/org-odt.el (org-odt-embedded-images-count): New
variable.
(org-odt-copy-image-file): Use the above variable to name the
embedded image files. Remove some cruft as well.
(org-export-odt-file-list, org-export-odt-save-list): Removed.
(org-odt-init-outfile, org-odt-save-as-outfile): Related changes.
* contrib/lisp/org-odt.el (org-export-odt-manifest-lines):
Removed.
(org-odt-update-manifest-file): Removed.
(org-odt-create-manifest-file-entry)
(org-odt-write-manifest-file): New function.
(org-odt-manifest-file-entries): New variable.
(org-odt-manifest-file-entry-tag): Updated.
(org-odt-init-outfile): Don't create manifest.xml here. Don't
create Pictures directory so early in the export. Reset
`org-odt-manifest-file-entries'.
(org-odt-save-as-outfile): Modified. Use
`org-odt-create-manifest-file-entry' and
`org-odt-write-manifest-file'.
(org-odt-copy-image-file, org-odt-update-meta-file)
(org-odt-copy-styles-file): Use
`org-odt-create-manifest-file-entry'.
Rationalized creation of Manifest file entries. New entries are
created right at the point where new files are added to the odt file.
* contrib/lisp/org-odt.el (org-odt-init-outfile): Don't create
mimetype file here.
(org-odt-save-as-outfile): Create mimetype file here. Note
that this routine gets called towards the end of the export
just before files are zipped.
* contrib/lisp/org-odt.el
(org-odt-init-outfile): Don't create meta.xml here.
(org-odt-update-meta-file): Create and update meta.xml here
instead. Note that this routine gets called just before the
component files are zipped.
(org-export-odt-meta-lines): Remove it. Not needed any longer.
(org-odt-save-as-outfile): No need to create backup files
while saving xml buffers.
* contrib/lisp/org-lparse.el
(org-lparse-list-table:table-cell-open): New variable.
(org-lparse-begin-list-table:table-cell)
(org-lparse-end-list-table:table-cell): New routines. Use
`org-lparse-begin-collect' and `org-lparse-end-collect' to get
a string representation of a multi-line table cell.
(org-lparse-list-table-p, org-lparse-list-level)
(org-lparse-list-item-count, org-lparse-list-stack)
(org-lparse-list-table:table-cell-open)
(org-lparse-list-table:table-row)
(org-lparse-list-table:lines): New variables to keep track of
the state of the list at a point in time during export.
(org-do-lparse): Init above variables.
(org-lparse-begin-list, org-lparse-end-list)
(org-lparse-begin-list-item, org-lparse-end-list-item):
Modified so that list marked as list-table are exported as a
table. Refer notes in the file for more information.
(org-lparse-do-format-list-table): Make sure that `org-table'
is loaded.
* contrib/lisp/org-odt.el (org-odt-format-table-cell): Table
cells are list-tables are already paragraphs. No need to
enclose them in paragraphs again.