ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: Hello -- and RFH (Request For Help) for privately typesetting a new travelling book
Date: Mon, 09 Mar 2015 23:14:17 +0100	[thread overview]
Message-ID: <54FE1B39.6000405@wxs.nl> (raw)
In-Reply-To: <20150309210034.GA2528@hl.fritz.box>

On 3/9/2015 10:00 PM, Harald Koenig wrote:
> Hello ConTeXt users!
>
> since I'm new to this list (and the group of context users;) a quick introduction
> to myself and my current project:
>
> I've been using LaTeX since 1986 -- some of you may know me from some TeX meetings
> (and recently also the context users's meetings -- without really using context so far).
>
> in 2009 using LaTeX I typeset a 100 page diary+pictures book about a group tour
> from our parish to Israel and Jordan.  making text flowing around the picutres
> with LaTeX (in the way I'd like to typeset it) was a real nightmare with LaTeX.
>
> so after finishing that project with LaTeX due to severe time constraints,
> I've used that text to convert it to context and learn a bit how this book
> can be typeset (much better?) using context -- mostly whenever I met Hans
> at every tex conference I could et hands on him, and also Willi and other helpers!
> but the "context-way" Isreal book  always remained unfinished or at least unpolished
> as there was no need (and again no time) to really perfectly finish up.
>
>
> now this happend again:
> recently I've been traveling through India, again with a group of our parish.
> and again, there was that idea to make such a nice book like for the Isreal tour.
> so this time, I'd like to use context instead of latex...
>
>
> BUT, there are still quite some issues where I'll need *your* help
> to make this really work and get a nice book.
>
> I'll try to split up my questions into separate mails,
> hopefully with small to minimal examples if possible
> (and if you'd like to get hards on my complete ugly tex code,
> plesae feel free to ask me!... ;-)

Hi Harald,

% In most of our projects we need to do some kind of conversion and
% for that we use some built-in trickery. You can define a converter
% like this:

\startluacode

     figures.converters.jpg = figures.converters.jpg or { }

     figures.converters.jpg["lowresjpg.pdf"] = 
function(oldname,newname,resolution)
         figures.programs.run (
             [[gm]],
             [[convert -geometry %resolution%x%resolution% -compress 
JPEG "%oldname%" "%newname%"]],
             {
                 oldname    = oldname,
                 newname    = newname,
                 resolution = resolution,
             }
         )
     end

\stopluacode

% This will downsample and make a pdf which loads faster.  As we
% want to use some resolution we specify that here. When a graphic
% is updated or when the resolution changes the process is done
% automatically. You can delete m_k_v_i* files if you want to
% clean up.

\setupexternalfigures
   [order={pdf,jpg},
    resolution=100, % experiment with a value
    method=auto]

% In case it doesn't work this shows some log:

% \enabletrackers[graphics.*]

% Then, in the source you can do this the following.

\starttext

     \externalfigure[france-2015.jpg][height=10cm]
     \externalfigure[france-2015.jpg][height=10cm,conversion=lowresjpg.pdf]

\stoptext

I'm sure you can figure out the right 'gm' parameters. In grph-inc.lua 
you can see some predefined converters, e.g. we use:

\enabledirectives[graphics.conversion.eps.cleanup.ai]
\enabledirectives[graphics.extracheck]

\setupexternalfigures
   [order={pdf,eps,png,jpg},
    conversion=cmyk.pdf,
    method=auto]

(which btw assumes some color profiles to be present but these are in 
the latest minimals)

Hans




-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

  parent reply	other threads:[~2015-03-09 22:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-09 21:00 Harald Koenig
2015-03-09 21:34 ` luigi scarso
2015-03-09 22:14 ` Hans Hagen [this message]
2015-03-09 22:21 ` Jaroslav Hajtmar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54FE1B39.6000405@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).