4

I am having some problems when I try parse an .xml file exported from from OmniOutliner. When I parse this lines

<context:item>It's a form of advocacy: I'm happy with the various tools that I've found, and I want to introduce people to them. If Mac users are in the least inclined towards typesetting, XML, or &tex;, then they should give &context; a look; neither &latex; nor XSL-FO is the last word in its respective space. Conversely, &context; users should take a look at the Mac: it runs familiar and powerful UNIX-based tools very well, but also has a first rate GUI and applications like OmniOutliner Pro that combine power with real elegance in design.</context:item>

I get this .pdf

export

This is what is supposed to be from the original pdf.

original

As you can note the LaTex word instead of being converted with the right font is framed. This is not the case of the words TeX and ConTeXt. Even fonts are different.

For parsing the file I am giving the command:

texexec --pdf main.xml
  • 3
    well what are the definitions of the respective entities &tex and &latex ? if &latex; expands to latex I'd expect context (or anything else) to typeset it as plain text – David Carlisle Jun 21 '14 at 13:52
  • That's the point. I cannot find out where are the definitions of &tex &context &latex... – Enrico Pirani Jun 21 '14 at 17:41
  • If the input XML is well formed the entities must be defined in the file, or in a dtd file explicitly referenced from the <!DOCTYPE line, something like <!ENTITY latex "latex"> – David Carlisle Jun 21 '14 at 18:00
  • (Untested) my guess is that you'll have to use &LATEX, etc. – Aditya Jun 21 '14 at 20:47
  • No doesn't work.. I think it has to do with the export plugin (tested with v.3) ant I think it is no longer maintained. – Enrico Pirani Jun 22 '14 at 18:08
3

It is unclear to me what exactly the question is. If I process the snippet you gave directly with ConTeXt, none of the entities is recognized. So in absence of a proper MWE I just made up “something” that works.

\startbuffer[test]
<?xml version='1.0' standalone='yes?>
<document>
  <itemize>
    <item>
      It's a form of advocacy: I'm happy with the various tools that I've
      found, and I want to introduce people to them. If Mac users are in
      the least inclined towards typesetting, XML, or &tex;, then they
      should give &context; a look; neither &latex; nor XSL-FO is the last
      word in its respective space. Conversely, &context; users should
      take a look at the Mac: it runs familiar and powerful UNIX-based
      tools very well, but also has a first rate GUI and applications like
      OmniOutliner Pro that combine power with real elegance in design.
    </item>
  </itemize>
</document>
\stopbuffer

\startxmlsetups xml:setup
  \xmlsetsetup{\xmldocument}{*}{-}
  \xmlsetsetup{\xmldocument}{document|itemize|item}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:setup}
\xmltexentity {tex}     {\TEX{}}
\xmltexentity {latex}   {\LATEX{}}
\xmltexentity {context} {\CONTEXT{}}

\startxmlsetups xml:document
  \startdocument
    \xmlflush{#1}
  \stopdocument
\stopxmlsetups

\startxmlsetups xml:itemize
  \startitemize
    \xmlflush{#1}
  \stopitemize
\stopxmlsetups

\startxmlsetups xml:item
  \startitem
    \xmlflush{#1}
  \stopitem
\stopxmlsetups

\xmlprocessbuffer{test}{test}{}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.