ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Including xfig graphics
@ 2011-01-06 12:21 Florian Unglaub
  2011-01-07  7:11 ` Taco Hoekwater
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Unglaub @ 2011-01-06 12:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi there,

I'm pretty new to ConTeXt and stumbled upon a problem when trying to use
Xfig:

I'm trying to create figures with xfig and including them in my ConTeXt
document. I would export them as PDF, but unfortunately I have TeX math
inside the figure and I'd like to have native fonts. I used to use a 
combinded LaTeX/PDF export in the past with LaTeX.

Is there any practical solution to this?

Regards, Florian.
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Including xfig graphics
  2011-01-06 12:21 Including xfig graphics Florian Unglaub
@ 2011-01-07  7:11 ` Taco Hoekwater
  2011-01-07  9:07   ` Alan BRASLAU
  0 siblings, 1 reply; 6+ messages in thread
From: Taco Hoekwater @ 2011-01-07  7:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Florian Unglaub

On 01/06/2011 01:21 PM, Florian Unglaub wrote:
> Hi there,
>
> I'm pretty new to ConTeXt and stumbled upon a problem when trying to use
> Xfig:
>
> I'm trying to create figures with xfig and including them in my ConTeXt
> document. I would export them as PDF, but unfortunately I have TeX math
> inside the figure and I'd like to have native fonts. I used to use a
> combinded LaTeX/PDF export in the past with LaTeX.
>
> Is there any practical solution to this?

It's been ages since I last used xfig, and I no longer know how to get
math into a figure. Can you post an example input file?
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Including xfig graphics
  2011-01-07  7:11 ` Taco Hoekwater
@ 2011-01-07  9:07   ` Alan BRASLAU
  2011-01-07  9:09     ` Taco Hoekwater
  0 siblings, 1 reply; 6+ messages in thread
From: Alan BRASLAU @ 2011-01-07  9:07 UTC (permalink / raw)
  To: ntg-context, Florian Unglaub; +Cc: Taco Hoekwater

Hello,

Ultimately, you will probably be more satisfied using Metapost graphics
"natively" within ConTeXt. With xfig, you can export to Metapost.
This code can probably be directly used by ConTexT, or perhaps with
minor modifications.

As Taco wrote, if you post an example (file.fig), someone can help
show how it can be used within ConTeXt.

There is no wiki page concerning xfig under
	http://wiki.contextgarden.net/Graphics
Maybe I can use this posting to create one...

Alan



On Friday 07 January 2011 08:11:14 Taco Hoekwater wrote:
> On 01/06/2011 01:21 PM, Florian Unglaub wrote:
> > Hi there,
> > 
> > I'm pretty new to ConTeXt and stumbled upon a problem when trying to use
> > Xfig:
> > 
> > I'm trying to create figures with xfig and including them in my ConTeXt
> > document. I would export them as PDF, but unfortunately I have TeX math
> > inside the figure and I'd like to have native fonts. I used to use a
> > combinded LaTeX/PDF export in the past with LaTeX.
> > 
> > Is there any practical solution to this?
> 
> It's been ages since I last used xfig, and I no longer know how to get
> math into a figure. Can you post an example input file?
> ___________________________________________________________________________
> ________ If your question is of interest to others as well, please add an
> entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context webpage  :
> http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________
> ________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Including xfig graphics
  2011-01-07  9:07   ` Alan BRASLAU
@ 2011-01-07  9:09     ` Taco Hoekwater
  2011-01-07 15:39       ` Florian Unglaub
  0 siblings, 1 reply; 6+ messages in thread
From: Taco Hoekwater @ 2011-01-07  9:09 UTC (permalink / raw)
  To: Alan BRASLAU; +Cc: ntg-context, Florian Unglaub

On 01/07/2011 10:07 AM, Alan BRASLAU wrote:
> Hello,
>
> Ultimately, you will probably be more satisfied using Metapost graphics
> "natively" within ConTeXt. With xfig, you can export to Metapost.
> This code can probably be directly used by ConTexT, or perhaps with
> minor modifications.

I did a quick test, and the transfig mp code starts with this nice (!)
block of verbatimtex:

% +MP-ADDITIONAL-HEADER
verbatimtex
%&latex
\documentclass{article}
\begin{document}
etex
% -MP-ADDITIONAL-HEADER


%SetFigFont macros for latex
verbatimtex
%
\begingroup\makeatletter\ifx\SetFigFont\undefined%
\gdef\SetFigFont#1#2#3#4#5{%
   \reset@font\fontsize{#1}{#2pt}%
   \fontfamily{#3}\fontseries{#4}\fontshape{#5}%
   \selectfont}%
\fi\endgroup%
\ifx\SetFigFontSize\undefined%
\gdef\SetFigFontSize#1#2{%
   \fontsize{#1}{#2pt}%
   \selectfont}%
\fi%
etex

It looks configurable-ish, but I do not feel like experimenting
without a proper test case.

Best wishes,
Taco
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Including xfig graphics
  2011-01-07  9:09     ` Taco Hoekwater
@ 2011-01-07 15:39       ` Florian Unglaub
  2011-01-08 17:34         ` Alan BRASLAU
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Unglaub @ 2011-01-07 15:39 UTC (permalink / raw)
  To: ntg-context

On Fri, Jan 07, 2011 at 10:09:47AM +0100, Taco Hoekwater wrote:
> I did a quick test, and the transfig mp code starts with this nice (!)
> block of verbatimtex:
> 
> % +MP-ADDITIONAL-HEADER
> verbatimtex
> %&latex
> \documentclass{article}
> \begin{document}
> etex
> % -MP-ADDITIONAL-HEADER

[...]

> It looks configurable-ish, but I do not feel like experimenting
> without a proper test case.

I tried exporting to metapost inside xfig aswell yesterday, leading to
similar results as posted above.

I found out that XFig uses a small shell script called 'fig2dev' to do
all the exporting to other formats. This script supports an option '-o'
to use plain TeX.

I tried \input'ing the resulting .mp file into my ConTeXt-file:

\startuseMPgraphic{foo}
  \input ../figures/bar.fig
\stopuseMPgraphic

\placefigure[here][fig:foo]{A small test}{
  \useMPgraphic{foo}
}

This, however, doesn't work and shows the figure as 'undefined' in the
PDF.

My current solution now is to convert the XFig file to MetaPost with
fig2dev and use mptopdf.

Regards, Florian.

PS: Sorry for the duplicate message, Taco. I forgot to CC to the list.
-- 
Florian Unglaub
<f.unglaub@gmail.com>
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Including xfig graphics
  2011-01-07 15:39       ` Florian Unglaub
@ 2011-01-08 17:34         ` Alan BRASLAU
  0 siblings, 0 replies; 6+ messages in thread
From: Alan BRASLAU @ 2011-01-08 17:34 UTC (permalink / raw)
  To: Florian Unglaub; +Cc: ntg-context

Florian,

This is not exactly how to proceed.
The metapost export needs to be stripped of its preamble
before being used with ConTeXt.

Can you send us a (simple) concrete example, i.e. .fig file.

It may not be worth the effort to get fig2dev fixed to produce pure (LaTeX 
free) metapost. I had started learning Metapost playing with xfig exports, but 
quickly entirely dropped xfig and now work directly with metapost code.

Alan


On Friday 07 January 2011 16:39:45 Florian Unglaub wrote:
> On Fri, Jan 07, 2011 at 10:09:47AM +0100, Taco Hoekwater wrote:
> > I did a quick test, and the transfig mp code starts with this nice (!)
> > block of verbatimtex:
> > 
> > % +MP-ADDITIONAL-HEADER
> > verbatimtex
> > %&latex
> > \documentclass{article}
> > \begin{document}
> > etex
> > % -MP-ADDITIONAL-HEADER
> 
> [...]
> 
> > It looks configurable-ish, but I do not feel like experimenting
> > without a proper test case.
> 
> I tried exporting to metapost inside xfig aswell yesterday, leading to
> similar results as posted above.
> 
> I found out that XFig uses a small shell script called 'fig2dev' to do
> all the exporting to other formats. This script supports an option '-o'
> to use plain TeX.
> 
> I tried \input'ing the resulting .mp file into my ConTeXt-file:
> 
> \startuseMPgraphic{foo}
>   \input ../figures/bar.fig
> \stopuseMPgraphic
> 
> \placefigure[here][fig:foo]{A small test}{
>   \useMPgraphic{foo}
> }
> 
> This, however, doesn't work and shows the figure as 'undefined' in the
> PDF.
> 
> My current solution now is to convert the XFig file to MetaPost with
> fig2dev and use mptopdf.
> 
> Regards, Florian.
> 
> PS: Sorry for the duplicate message, Taco. I forgot to CC to the list.

-- 
Alan Braslau
CEA DSM-IRAMIS-SPEC
CNRS URA 2464
Orme des Merisiers
91191 Gif-sur-Yvette cedex FRANCE
tel: +33 1 69 08 73 15
fax: +33 1 69 08 87 86
mailto:alan.braslau@cea.fr

 .''`.
: :'  :
`. `'`
  `-
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-01-08 17:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-06 12:21 Including xfig graphics Florian Unglaub
2011-01-07  7:11 ` Taco Hoekwater
2011-01-07  9:07   ` Alan BRASLAU
2011-01-07  9:09     ` Taco Hoekwater
2011-01-07 15:39       ` Florian Unglaub
2011-01-08 17:34         ` Alan BRASLAU

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).