[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] placeholders in latex

From: Karsten Hilbert
Subject: Re: [Gnumed-devel] placeholders in latex
Date: Sat, 20 Aug 2011 09:39:55 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Aug 19, 2011 at 07:18:48AM -0700, Jim Busser wrote:

> > If the box is checked it will
> > not preserve already embedded format codes and still escape
> > not-yet formatted parts. It will do NOTHING to the text.
> > Preserving is a deliberate decision to act or not while this
> > box prevents any action.
> Maybe I misunderstand what GNUmed does (or does not do) depending on the box 
> (non) selection.

If the box is NOT checked GNUmed will run the text through tex_escape_string(text=None):
                """check for special LaTeX characters and transform them"""

                text = text.replace(u'\\', u'$\\backslash$')
                text = text.replace(u'{', u'\\{')
                text = text.replace(u'}', u'\\}')
                text = text.replace(u'%', u'\\%')
                text = text.replace(u'&', u'\\&')
                text = text.replace(u'#', u'\\#')
                text = text.replace(u'$', u'\\$')
                text = text.replace(u'_', u'\\_')

                text = text.replace(u'^', u'\\verb#^#')
                text = text.replace('~','\\verb#~#')

                return text

If the box IS checked it will NOT run this escaping but
rather pass on the text as-is, as pulled from the text
control. That way you can embed, say, raw LaTeX (say, a
mathematical formula).

> For example I inputted $ and _ and % which I think LaTex
> requires to be escaped (but maybe not always)… but GNUmed
> did nothing to them

Oh, it surely did - lest you should have had the
dont-reformat box checked - which you can check in the
replaced .tex file. Only that without checking you would
never see it.

> whereas I was wondering whether or not
> GNUmed was going to beep at me.

It wouldn't.

> Why would checking the box not preserve formatting codes?

"Preserving" carries the connotation of "taking special care
to ensure something does not break". GNUned does not take
any such care. It simply does nothing if the box is checked
(whereas it *would* take something if it wasn't checked,
namely escaping).

GPG key ID E4071346 @
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

reply via email to

[Prev in Thread] Current Thread [Next in Thread]