ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Idris Samawi Hamid ادريس سماوي حامد" <ishamid@colostate.edu>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: Exporting highlights
Date: Mon, 16 Mar 2015 08:34:08 -0600	[thread overview]
Message-ID: <op.xvlhe6qhfkrasx@ishamid-pc> (raw)
In-Reply-To: <op.xvj98eazfkrasx@ishamid-pc>

Ok, I've made some progress:

On Sun, 15 Mar 2015 17:01:16 -0600, Idris Samawi Hamid ادريس سماوي حامد  
<ishamid@colostate.edu> wrote:

> ============export-highlight.tex==============
> \setupbackend
>    [export=yes,css=highlight.css]

\setupexport[cssfile=highlight.css]
\setupbackend[export=yes]

> \definehighlight[emphasis] [style=italic]
> \definehighlight[important][style=bold]
> \definehighlight[regular][style=\tf]
>
> \starttext
>
> \startchapter[title=Highlights]
> \startparagraph
> This is \emphasis{emphasis}. This is \important{important}. This is
> \regular{regular}.
>
> This is \emphasis{some emphasized text, with \regular{regular} in  
> between}.
>
> This is \important{some important text, with \regular{regular} in  
> between}.
> \stopparagraph
> \stopchapter
> \stoptext
> ===============================================
>
> In highlight.css (copied from export-sample.css and modified) I added
> these lines:
>
> ==================
> highlight [detail="emphasis"]{
> 	font-weight : italic ;
> }
>
> highlight [detail="important"]{
> 	font-weight : bold ;
> }
>
> highlight [detail="regular"]{
> 	font-weight : regular ;
> }
> ==================

Syntax correction (thanks Aditya!):

.highlight.emphasis {
   font-style: italic;
}

etc.

> Challenge 1:
> Neither export-highlight-tag.xhtml nor export-highlight-div.xhtml renders
> the highlights. What do we need to do?

For italic, see above. For bold, we need

font-weight: bold;

> Challenge 2:
> export-highlight-div.xhtml breaks the line before a highlight as well as
> after a highlight. What is missing here?

display: inline;

So here is exactly what we need:

.highlight.important {
    font-weight: bold;
   font-style: normal;
    display: inline;
}

.highlight.emphasis {
   font-weight: normal;
   font-style: italic;
   display: inline;
}

.highlight.regular {
   font-weight: normal;
   font-style: normal;
   display: inline;
}

Now export-highlight-div.xhtml renders in the browser exactly as in  
export-highlight.pdf.

This is progress: a first step!

Best wishes
Idris
-- 
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___________________________________________________________________________________
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-16 14:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-15 23:01 Idris Samawi Hamid ادريس سماوي حامد
2015-03-16  4:49 ` Aditya Mahajan
2015-03-16 14:34 ` Idris Samawi Hamid ادريس سماوي حامد [this message]

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=op.xvlhe6qhfkrasx@ishamid-pc \
    --to=ishamid@colostate.edu \
    --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).