(announcement) from pandoc to ConTeXt
![](https://secure.gravatar.com/avatar/5955e8e90611e77ccbfc7721b6112027.jpg?s=120&d=mm&r=g)
Dear list, this is a bit weird, because the vast majority of the list members are way forward in the path of ConTeXt knowledge than myself. But just in case you were interested, I created an environment to typeset XHTML generated by pandoc with ConTeXt MkIV. Here you have the websites: http://www.from-pandoc-to-context.tk https://github.com/ousia/from-pandoc-to-context Just in case it might help to anyone. Many thanks to Hans for his help explaining the XML interface to ConTeXt MkIV. Pablo -- http://www.ousia.tk
![](https://secure.gravatar.com/avatar/b79687264c3e06cba13b54d05b12a9f5.jpg?s=120&d=mm&r=g)
Pablo Rodriguez mailto:oinos@gmx.es 9. Juli 2015 18:32 Dear list,
this is a bit weird, because the vast majority of the list members are way forward in the path of ConTeXt knowledge than myself.
But just in case you were interested, I created an environment to typeset XHTML generated by pandoc with ConTeXt MkIV.
Here you have the websites:
http://www.from-pandoc-to-context.tk https://github.com/ousia/from-pandoc-to-context
Just a few comments on your code. 1. When you use \vfill at the begin of a makeup environment you don’t need \mbox and a ConTeXt user would use \dontleavehmode instead of \mbox. 2. To create a language dependant header for the TOC etc. you can use the \headtext command, e.g. \title{\headtext{content}} \placelist[part,chapter] 3. Be careful when you use _ in command names, e.g. \TOC_Title because it your case you created the command \TOC followed by the string “_Title”. 4. Better use \crlf to force a line break for the <br/> tag because \\ can produce different results depending in the environment. 5. Use \define[2]\... or \unexpanded\def\... to create your \href command. 6. ConTeXt already has a \url command. 7. Your \url command has two font changes (\tt and \hw) and one should be removed. Wolfgang
![](https://secure.gravatar.com/avatar/5955e8e90611e77ccbfc7721b6112027.jpg?s=120&d=mm&r=g)
On 07/09/2015 07:05 PM, Wolfgang Schuster wrote:
Pablo Rodriguez 9. Juli 2015 18:32 [...] Here you have the websites:
http://www.from-pandoc-to-context.tk https://github.com/ousia/from-pandoc-to-context
Just a few comments on your code.
Many thanks for your comments, Wolfgang. I really appreciate your help. Many thanks for all the improvements. The original code only shows my ignorance related to ConTeXt matters :-).
5. Use \define[2]\... or \unexpanded\def\... to create your \href command.
Sorry, but I don’t get it. Why do I need expansion when having more than one arguments? BTW, it isn’t clear to me what expansion may be.
6. ConTeXt already has a \url command.
To avoid name clashes, I replaced the command with \mypersonalurl.
7. Your \url command has two font changes (\tt and \hw) and one should be removed.
Yes, but this is the workaround that came to my mind to solve the following scenario: I may want to a special mono typeface only for urls. This mono typeface would be different from the general mono font. The problem when using \setupbodyfont or \switchtobodyfont is that it doesn’t work with other sizes than the default one. This sample shows the issue: \definefontfamily [anothermono] [ss] [DejaVu Sans Mono] \starttext \tfxx smaller text with \anothermono\ss second mono. \stoptext Either I define the handwriting or calligraphy font for the same font family, or I get wrong sizes when using other than the default. Is this a bug or is my approach wrong? BTW, if you allow me a question, I’d be very interested in setting up a \hiddentitle that adds no extra vertical space (I need the \hiddentitle to be displayed in the PDF bookmarks). \setupinteraction[state=start] \placebookmarks[chapter,hiddentitle] \definehead[hiddentitle][chapter] \setuphead [hiddentitle] [placehead=empty, incrementnumber=list, number=no, before=, after=] \starttext \completecontent \startmakeup[copyright][top=] \hiddentitle{[Copyright]} This document is released to the public... \stopmakeup \chapter{Foreword} aa \chapter{Introduction} \stoptext I need to have no space inserted by \hiddentitle. Otherwise, vertical spacing in makeups won’t work. Many thanks for your help again, Pablo -- http://www.ousia.tk
participants (2)
-
Pablo Rodriguez
-
Wolfgang Schuster