From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: New markup for revising manuscripts Date: Sun, 12 Mar 2017 14:16:50 -0400 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]:58700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cn83A-0000Ux-F4 for emacs-orgmode@gnu.org; Sun, 12 Mar 2017 14:17:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cn837-0001wK-96 for emacs-orgmode@gnu.org; Sun, 12 Mar 2017 14:17:00 -0400 Received: from mail-qk0-x22c.google.com ([2607:f8b0:400d:c09::22c]:34273) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cn837-0001sk-3r for emacs-orgmode@gnu.org; Sun, 12 Mar 2017 14:16:57 -0400 Received: by mail-qk0-x22c.google.com with SMTP id p64so209315963qke.1 for ; Sun, 12 Mar 2017 11:16:54 -0700 (PDT) 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 probably no lisp required. See the post I referenced. It is all done in the org-file there. Doyley, Marvin M. writes: > Hi John, > > I like the idea of special block that definitely solve the multi-line problem. But I would need to write an latex exporter for the block, how challenging would that be ? I am still learning lisp :) > > Cheers, > M >> On Mar 11, 2017, at 1:22 PM, John Kitchin wrote: >> >> 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: https://urldefense.proofpoint.com/v2/url?u=http-3A__kitchingroup.cheme.cmu.edu_blog_2013_11_30_Custom-2Ddirectives_&d=DwIBAg&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=s3_3riAscdqtNAzgOuwYB9g0dZVGcp8BNCy_RylYdxU&m=HR848Kl27487mBHnj6hZWqJ4zVzwnz8yn_CYsmstLLc&s=CgaellrR4m7Y4Quba00w0ekyLA_np6lkrXxoWv4awZQ&e= >> >> 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 >> https://urldefense.proofpoint.com/v2/url?u=http-3A__kitchingroup.cheme.cmu.edu&d=DwIBAg&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=s3_3riAscdqtNAzgOuwYB9g0dZVGcp8BNCy_RylYdxU&m=HR848Kl27487mBHnj6hZWqJ4zVzwnz8yn_CYsmstLLc&s=tzkgz4BW5dLySosHfzr7-xRCDyIG4RuaQbMrhZswNuw&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