Hot answers tagged

10 votes

Compare ConTeXt with speedata publisher for database publishing and dynamic page layout

As mentioned: the answer I give is based on my limited view of ConTeXT's XML processing capabilities. So please edit the answer as I might be wrong. Input: The input of ConTeXt is mixed TeX and XML. ...
8 votes
Accepted

Does a (Lua) approach exist, to read XML data into a .tex file?

Here is the general idea with the luaxml "package". \documentclass{article} \usepackage{luacode} \begin{luacode*} xml = require('luaxml-mod-xml') handler = require('luaxml-mod-handler') \end{luacode*}...
user avatar
  • 9,498
8 votes
Accepted

How to convert Latex entities to hex value?

Any existing tex-to-html or tex-to-xml convertor will be doing this already but if you are rolling your own code the easiest place to get the table of replacements that you need is in the file used by ...
user avatar
8 votes

Pretty printing DTDs (Document Type Declaration)

If it is Document type definitions that you want, Pygments has support for it and produces a very neat output imo. For LaTeX documents you can harness it easily with the minted-package, e.g.: \...
user avatar
  • 2,817
7 votes
Accepted

Macro overloading, catcode redefining… or how can I parse XML with TeX?

Suppose following input example: <?xml version="1.0" encoding="utf8"?> <cenik> <nazev>Počítačové komponenty</nazev> <platnost od="1.1.2000" do="31.3.2000"/> <...
user avatar
  • 53.6k
6 votes

ConTeXt: How to use xmlflush in lua?

First of all, context.quotation(lxml.flush(t)) cannot work because lxml.flush does not yield a return value. Why that is and what the consequences are is discussed below. You have encountered the ...
user avatar
6 votes
Accepted

Arabic font for Listing

One of solution is this. first define your listingstyle like this before \begin{document} If your main Language is persian then: \documentclass[11pt]{book} \usepackage{listings} \usepackage{...
user avatar
  • 427
6 votes
Accepted

ConTeXt XML: How do I typeset blank lines, leading spaces

Use \xmlflushspacewise to obey spaces and newline inside the nodes and use \dontleavehmode before so that successive \par can't be collapsed. \startbuffer[demo] <?xml version="1.0" encoding="UTF-8"...
user avatar
6 votes
Accepted

ConTeXt XML: Configureable Titleblock

If the document has only one title and one author, you can use xmlfilter to filter out that information before flushing the rest of the content. For example: \startbuffer[test] <?xml version='1.0' ...
user avatar
  • 61k
6 votes
Accepted

ConTeXt XML: Nested section elements

One option is to map the <section> tags to \startsectionlevel macros, which can be nested: \starttext \startstructurelevel[title=Section heading] Some text \startstructurelevel[title=...
user avatar
  • 61k
6 votes
Accepted

SVG as page layout in Latex

Here is a proof of concept using LuaXML for SVG parsing and Flowfram for flow frames. I've created a package svgflowfram.sty: \ProvidesPackage{svgflowfram} \RequirePackage{flowfram} \RequirePackage{...
user avatar
  • 45.1k
5 votes

Converting Jats XML to LaTeX

I have developed a small app written in Java for JATS to LaTeX conversion. It is open source: https://github.com/Vitaliy-1/JATS2LaTeX
user avatar
  • 151
5 votes
Accepted

ConTeXt: Optional XML in two columns

Depends a bit on what is the desired output when <source> is missing. You can use \xmlfilter{#1}{...} or \xmldoif... etc. Here is one example: \startbuffer[demo] <?xml version="1.0" encoding=...
user avatar
  • 61k
5 votes
Accepted

ConTeXt: Read an XML file into a buffer for processing

You don't have to read the file into a buffer first. There is \xmlprocessfile to directly process an XML file. For more info read the XML manual (PDF). If you want to read the file into a buffer ...
user avatar
5 votes
Accepted

How to add caption correctly in listing?

Load minted with the newfloat option \usepackage[newfloat]{minted} and write \caption before the actual listing code: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{inconsolata} \...
user avatar
5 votes
Accepted

ConTeXt XML: Footnote references and footnote content

You can set fn-group to empty but flush fn: \startxmlsetups xml:test \xmlsetsetup{#1}{*}{-} \xmlsetsetup{#1}{article|front|body|back|p}{xml:*} % Footnotes \xmlsetsetup{#1}{fn-group}{} ...
user avatar
  • 61k
5 votes

moodle.sty does not insert graphics in xml output file

Indeed moodle.sty does not use \graphicspath for the conversion to base64 internally. The conversion command is defined as follows: \openssl\otherspace enc -base64 -in #2.png -out #2.enc with \...
user avatar
  • 29.8k
5 votes

LaTeX in an XML production environment

I am developer of TeX4ht, one of systems used for the LaTeX to XML conversion. The development is in progress, as can be seen from the ChangeLog. It is driven by user requests. I can say that we don't ...
user avatar
  • 45.1k
4 votes
Accepted

What software packages have been used to produce the FCLA book and why that might be a more suitable choice than LaTeX?

The comments in the files show http://mathbook.pugetsound.edu/ is the convertor used from XML to the various formats.
user avatar
4 votes
Accepted

How to display the symbol dollar $ correctly?

Simply use $: \documentclass{article} \usepackage{minted} \usepackage{listings} \begin{document} \begin{listing}[ht] \begin{minted}{xml} <plugin> <groupId>maven....
user avatar
4 votes
Accepted

How to properly number between lstlisting and listing the same latex file?

Add to your preamble \makeatletter \AtBeginDocument{\let\c@listing\c@lstlisting} \makeatother which will use the same counter for both float types. Full example: \documentclass{article} \...
user avatar
  • 993k
4 votes

Why convert TeX to XML before compilation to PDF?

Well, maybe it is just for LaTeX. Maybe they also accept Microsoft Word-based submissions. In that case, it would make some sort of sense to convert everything to a common format. I am not an expert ...
user avatar
4 votes
Accepted

Problems with XML Syntax Highlighting

I couldn't come up with a perfect solution right now, but juggling with the solution from what you linked and from my answer here I came up with the following, which isn't too bad: \documentclass{...
user avatar
  • 3,426
4 votes
Accepted

XML syntax highlighting: comments not recognized

I don't find it very sane to define everything not in a tag as a string. It would be better to set the tag color to red. The problem with this approach is that listings colors the delimiters in the ...
user avatar
4 votes
Accepted

cloze multichoice question in the latex using the package 'moodle'

Unfortunately, I suspect it is a bug/limitation of the Cloze type of questions. This MWE % \documentclass{article} \usepackage[T1]{fontenc} \usepackage{moodle} \begin{document} \begin{quiz}{Test ...
user avatar
  • 30.3k
4 votes
Accepted

phone sms xml to boxed conversation-like in latex

** Edit ** OP had lot of additional requests, here is the updated code. The additional functionality filters the XML DOM object before it is transformed to LaTeX code. In particular, it filters ...
user avatar
  • 45.1k
4 votes

moodle xml conversion to LaTeX

Here is a solution that uses LuaXML. The main library is named moodle-transform.lua: local transform = require "luaxml-transform" local domobject = require "luaxml-domobject" ...
user avatar
  • 45.1k
3 votes
Accepted

XML parsing and data retrieving in ConTeXt

For \xmlfirst to “work” (it does, you're just using it wrong), remove the line \xmlsetsetup{#1}{*}{-}. From the documentation (which you linked in your question): The line: \xmlsetsetup{demo}{*}{-...
3 votes
Accepted

Tex4ht, LaTeX to Docbook: Quote-Environment not transformed to <blockquote>

The configuration for quote environment is missing in tex4ht support for Docbook. You can try the following configuration file: \Preamble{xhtml} \ConfigureEnv{quote}{\ifvmode\IgnorePar\fi\EndP\HCode{&...
user avatar
  • 45.1k
3 votes

Compare ConTeXt with speedata publisher for database publishing and dynamic page layout

Having built a database publishing system based on ConTeXt I can confirm it's very well suited for the task, however IT IS NOT a database publishing system which means you have to build such system ...
user avatar
  • 1,498

Only top scored, non community-wiki answers of a minimum length are eligible