1

Background

Using pandoc to convert markdown source text into a .tex file. The .tex file is fed to ConTeXt.

There are two different styles. One for a polished version and one for a manuscript submission. The idea is to use the markdown files for both, changing only the style to create two different PDFs. The polished version has figures, the manuscript submission must not.

Problem

A figure in the markdown is transformed into the following example snippet:

\placefigure{anomaly}{\externalfigure[anomaly]}

The style defines both placefigure and externalfigure as follows:

\setupcaptions[
  location=none,
]

\define[1]\placefigure{}
\define[1]\externalfigure{}

This almost works. Inside the manuscript PDF, where the figure has been removed, is the following text, verbatim:

anomaly]

Question

How would you change placefigure and externalfigure to completely suppress figure output, including the parameter text (as shown in the problem)?

2

You can add a new option hidden to the float mechanism which saves the content but doesn’t flush it afterwards.

\setupexternalfigures[location=default]

\installfloatmethod {singlecolumn} {hidden} \donothing

\setupfloat[figure][default=hidden]

\starttext

\input knuth

\placefigure{A dutch cow}{\externalfigure[cow]}

\input knuth

\stoptext
2

The command placefigure takes two arguments; redefine it thusly:

\define[2]\placefigure{\null\relax}

Eliminate the empty paragraph gap (left by nullifying the macros) using:

\define[2]\placefigure{\blank[back]}
  • 1
    And \def\externalfigure[#1]{} also. – Manuel Dec 3 '15 at 7:37

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.