byorgey / BlogLiterately

Command-line tool for formatting and publishing blog posts.
GNU General Public License v3.0
19 stars 4 forks source link

wplatex minus signs #12

Closed chrisreade closed 10 years ago

chrisreade commented 10 years ago

I tracked down a WP issue with latex failing to be parsed by WP. It seems that minus signs generated in the $latex …$ sections are actually em-dashes (or en-dashes) which WP can't then process. Changing them to minus signs in the WP editor fixed the problem. Not sure if this is blogLiterately or pandoc issue.

byorgey commented 10 years ago

Thanks for the report! I'd be happy to look into this but it would be helpful to have some specific instructions for reproducing it, e.g. a small input file and the precise BlogLiterately configuration/options you used (except, of course, I'll use a different WP blog to test).

chrisreade commented 10 years ago

OK - here are some more details. To upload I used BlogLiterately --ghci --wplatex --blog=… Local testing was fine (no observable problems) with BlogLiterately file.lhs --math=mathjax --ghci > local.html

The (corrected) blog is at http://readerunner.wordpress.com/2014/04/30/multigrid-methods-with-repa/

I have not yet tried more experiments with small blogs to narrow down the combination but the main lines giving problems are below (tried with both single dollar and double dollar). I also noted that indenting some of the haskell code but omitting bird feet (>) for non-final code was causing some problems so this may be part of the issue.

(extract below) Finite difference analysis with the central difference operator leads to the following (five point difference) formula approximating Poisson's equation

$$u{i−1,j}+u{i+1,j}+u{i,j−1}+u{i,j+1}-4u{ij}= −h^2f{ij}$$

Rewriting the above as

$$u{ij}= \frac{1}{4} { u{i−1,j}+u{i+1,j}+u{i,j−1}+u{i,j+1}+h^2f{ij} }$$

gives us an algorithm (approxOp) for the approximating iteration step. This is known as the the Jacobi method.

byorgey commented 10 years ago

In the extract you pasted, all the subtraction signs are actually the codepoint 0x2212, MINUS SIGN. Do you actually have that character in the source file you're passing to BlogLiterately as input, or is it a hyphen? I am trying to figure out whether Pandoc or BlogLiterately are introducing that character, or if it is already present in your input file.

chrisreade commented 10 years ago

That should be a regular hyphen typed into Textmate editor but you are right. It looks like something Textmate may be doing with .lhs scripts. When I cut and pasted the extract into this email I could see it is not a regular hyphen.

Chris


Poisson's equation

$$u{i−1,j}+u{i+1,j}+u{i,j−1}+u{i,j+1}-4u{ij}= −h^2f{ij}$$

Rewriting the above as

$$u{ij}= \frac{1}{4}{ u{i−1,j}+u{i+1,j}+u{i,j−1}+u{i,j+1}+h^2f{ij} }$$

gives us an algorithm (approxOp) for the approximating iteration step. This is known as the the Jacobi method.

On 13 May 2014, at 17:22, Brent Yorgey wrote:

In the extract you pasted, all the subtraction signs are actually the codepoint 0x2212, MINUS SIGN. Do you actually have that character in the source file you're passing to BlogLiterately as input, or is it a hyphen? I am trying to figure out whether Pandoc or BlogLiterately are introducing that character, or if it is already present in your input file.

— Reply to this email directly or view it on GitHub.

chrisreade commented 10 years ago

Sorry for wasting your time. I had not noticed the problems were in the source file. The two symbols are indistinguishable in the editor view.

Chris

On 13 May 2014, at 17:22, Brent Yorgey wrote:

In the extract you pasted, all the subtraction signs are actually the codepoint 0x2212, MINUS SIGN. Do you actually have that character in the source file you're passing to BlogLiterately as input, or is it a hyphen? I am trying to figure out whether Pandoc or BlogLiterately are introducing that character, or if it is already present in your input file.

— Reply to this email directly or view it on GitHub.

byorgey commented 10 years ago

No worries! Glad I could help. Hope you are able to get things sorted out with Textmate.