From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: New markup for revising manuscripts Date: Sat, 11 Mar 2017 13:22:43 -0500 Message-ID: References: <4F883241-1170-4E41-88AE-A13C99581597@ur.rochester.edu> <9AA2ED58-08EB-4EF4-BA42-71E5CA6C4ABF@ur.rochester.edu> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cmlfG-0002qA-7e for emacs-orgmode@gnu.org; Sat, 11 Mar 2017 13:22:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cmlfC-0000q0-20 for emacs-orgmode@gnu.org; Sat, 11 Mar 2017 13:22:50 -0500 Received: from mail-qt0-x230.google.com ([2607:f8b0:400d:c0d::230]:36182) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cmlfB-0000po-TB for emacs-orgmode@gnu.org; Sat, 11 Mar 2017 13:22:45 -0500 Received: by mail-qt0-x230.google.com with SMTP id r45so9564677qte.3 for ; Sat, 11 Mar 2017 10:22:45 -0800 (PST) In-reply-to: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: "Doyley, Marvin M." Cc: "emacs-orgmode@gnu.org" , Kaushal Modi This is probably not feasible with links. that is also a challenge with Eric's markup approach. One way is to use visual wrapping so whole paragraphs are actually one line. Another is to use some kind of custom block. It has been a while since I tried this: http://kitchingroup.cheme.cmu.edu/blog/2013/11/30/Custom-directives/ Multiline mostly works with criticmarks using multiline fontlock. The nice thing about this is that it is still plain text markup, but relies on font-lock which can be slow, and or unreliable in my experience. This was one reason I started looking at the overlay approach in ov-highlighter. It nicely manages multiline comments, but is not part of org markup though. A downside is you have to store the overlays in the document to get persistence, and it is easily breakable if others edit the document without using the package. Doyley, Marvin M. writes: > Thanks John, > > Works like a charm. Any idea how to write comments that spans multiple lines ? > > cheers, > M >> On Mar 11, 2017, at 7:55 AM, John Kitchin wrote: >> >> it looks like you forgot to include format in the (eq ..) sexp. >> >> (org-link-set-parameters >> "response" >> :export (lambda (keyword desc format) >> (cond >> ((eq 'latex format) >> (format "\\textcolor{red}{%s}" keyword)))) >> :face '(:foreground "red")) >> Doyley, Marvin M. writes: >> >>> Hi John, >>> >>> I make a colored link [[response: comments]], that makes the text following the response keyword red. The only snag is that when I export to latex I get [[response:comment]] rather than \textcolor{red}{comment}. Any thoughts on what I am doing wrong ? >>> >>> Cheers, >>> M >>> >>> PS. Enclose is the code that I wrote based on your blog >>> >>> >>> (org-link-set-parameters >>> "response" >>> :export (lambda (keyword desc format) >>> (cond >>> ((eq 'latex) >>> (format "\\textcolor{red}{%s}" keyword)))) >>> :face '(:foreground "red")) >>> >>> >>>> On Mar 10, 2017, at 4:47 PM, John Kitchin wrote: >>>> >>>> You can .... wait for it... make a colored link ;): https://urldefense.proofpoint.com/v2/url?u=http-3A__kitchingroup.cheme.cmu.edu_blog_2016_11_04_New-2Dlink-2Dfeatures-2Din-2Dorg-2D9_-23org1bc1061&d=DwIBAg&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=s3_3riAscdqtNAzgOuwYB9g0dZVGcp8BNCy_RylYdxU&m=K82CvGdcCIiUxLK-NulYuwGBzRdPZnZ9zByz2od0v9s&s=SVZmNbDCL0B9rvGIDHrFia_f1-mL_I_EmCUR_vcWkxg&e= >>>> >>>> The example there has an html export defined, but you could as easily define a latex exporter. It has some limitations, like it might not reliably work on multiple lines, and you would not want to "highlight" across elements (or the latex will get ugly and probably not work). >>>> >>>> I have been working on some ways to get persistent highlighting using overlays for a similar purpose: https://urldefense.proofpoint.com/v2/url?u=http-3A__kitchingroup.cheme.cmu.edu_blog_2016_11_10_Persistent-2Dhighlighting-2Din-2DEmacs_&d=DwIBAg&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=s3_3riAscdqtNAzgOuwYB9g0dZVGcp8BNCy_RylYdxU&m=K82CvGdcCIiUxLK-NulYuwGBzRdPZnZ9zByz2od0v9s&s=11D132bMNfLVhS6-xXWo1p7tZ8EBpeZMgUvYmtcCD9I&e= >>>> >>>> so far I only can get reliable output to html. Latex seems possible, again if you don't highlight across too many elements. It is a work in progress here: https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_jkitchin_scimax_blob_master_ov-2Dhighlighter.el&d=DwIBAg&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=s3_3riAscdqtNAzgOuwYB9g0dZVGcp8BNCy_RylYdxU&m=K82CvGdcCIiUxLK-NulYuwGBzRdPZnZ9zByz2od0v9s&s=Cz0LeGE0ds46QIsBHJLgKVddn1pKWKlxsO1WpKqk8g4&e= >>>> >>>> Towards the bottom of https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_jkitchin_scimax_blob_master_cm-2Dmods.el&d=DwIBAg&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=s3_3riAscdqtNAzgOuwYB9g0dZVGcp8BNCy_RylYdxU&m=K82CvGdcCIiUxLK-NulYuwGBzRdPZnZ9zByz2od0v9s&s=gIkKQ99iatYU867xq50LnefeG4ehMUlgunqp1tD_H08&e= I was working on some ways to use the criticmarkup in conjunction with git diffs to automatically make these kinds of diffs. >>>> >>>> I can't say I am fully satisified by any of these solutions (that is why there are so many of them ;) >>>> >>>> John >>>> >>>> ----------------------------------- >>>> Professor John Kitchin >>>> Doherty Hall A207F >>>> Department of Chemical Engineering >>>> Carnegie Mellon University >>>> Pittsburgh, PA 15213 >>>> 412-268-7803 >>>> @johnkitchin >>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__kitchingroup.cheme.cmu.edu&d=DwIBAg&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=s3_3riAscdqtNAzgOuwYB9g0dZVGcp8BNCy_RylYdxU&m=K82CvGdcCIiUxLK-NulYuwGBzRdPZnZ9zByz2od0v9s&s=DASaHx5l-WylD2cRXx2j78TSLgKgWa6fpWAJhDW0Pj4&e= >>>> >>>> >>>> On Fri, Mar 10, 2017 at 3:56 PM, Kaushal Modi > wrote: >>>> I use this macro to highlight text in html/latex(pdf): >>>> >>>> #+MACRO: COLOR @@html:$2@@@@latex:\textcolor{$1}{$2}@@ >>>> >>>> This is from https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_fniessen_org-2Dmacros_blob_master_README.org&d=DwIBAg&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=s3_3riAscdqtNAzgOuwYB9g0dZVGcp8BNCy_RylYdxU&m=K82CvGdcCIiUxLK-NulYuwGBzRdPZnZ9zByz2od0v9s&s=nbREPuAqFdouIJ4LBeqzYA7oUI7vapuVV8ybX5__iHc&e= >>>> >>>> Example use: >>>> {{{COLOR(red, This information is important.)}}} >>>> >>>> It doesn't though highlight the text in red in org-mode. >>>> >>>> On Fri, Mar 10, 2017 at 3:49 PM Doyley, Marvin M. > wrote: >>>> Hi there, >>>> >>>> When revising manuscripts, I usually highlight the changes (response to reviewer) in red. I use typically do this as follows: >>>> (1) #+latex_header: \newcommand{\response}[1]{\textcolor{red}{#1}} >>>> (2) \response{changes) >>>> >>>> Is there a more elegant way to do this ? It would be nice if I could change the color of the select text in both org and the exported latex file to red. Seeing the highlighted text in org would be a huge plus. >>>> >>>> Thanks >>>> M >>>> -- >>>> Kaushal Modi >>>> >>>> >> >> >> -- >> Professor John Kitchin >> Doherty Hall A207F >> Department of Chemical Engineering >> Carnegie Mellon University >> Pittsburgh, PA 15213 >> 412-268-7803 >> @johnkitchin >> https://urldefense.proofpoint.com/v2/url?u=http-3A__kitchingroup.cheme.cmu.edu&d=DwIBAg&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=s3_3riAscdqtNAzgOuwYB9g0dZVGcp8BNCy_RylYdxU&m=K82CvGdcCIiUxLK-NulYuwGBzRdPZnZ9zByz2od0v9s&s=DASaHx5l-WylD2cRXx2j78TSLgKgWa6fpWAJhDW0Pj4&e= -- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu