Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Does anyone know where to find a tool that converts MathML to a plain text math expression?
For example, I want to input
<math xmlns='http://www.w3.org/1998/Math/MathML'>
<mfrac>
<mrow>
<mi>cos</mi>
<mo></mo>
<mo>(</mo>
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
<mo>)</mo>
</mrow>
<mrow>
<mi>sqrt</mi>
<mo></mo>
<mo>(</mo>
<mrow>
<mi>y</mi>
<mo>+</mo>
<mn>2</mn>
</mrow>
<mo>)</mo>
</mrow>
</mfrac>
</math>
And get as output the string
cos(x^2) / sqrt(y + 2)
I've been unable to find anything that works like this by searching Google.
Any help is appreciated.
It seems that "plain text" is the catch here – there is no clear definition of what format that is when it comes to mathematical expressions. I managed to find AsciiMath which fits the description pretty well.
There appears to be a number of tools for converting MathML to AsciiMath, for example mathml-to-asciimath.
If you have Word or Pages you can download mathpix from the internet and snip the math ml or mathjax equation using it and copy it to Word then there you can finally copy the text version of the equation.
Related
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
I am reading/writing an array to file in Julia. For example:
test_arr=zeros(3,3)
io = open("logs/test","w")
write(io,test_arr)
close(io)
To read the file I do:
load_arr=Array{Float64}(undef,3,3)
io = open("logs/test","w")
read!(io,load_arr)
close(io)
This gives a "read end of file" error.
I am a bit perplexed as this is how I have been writing/reading other arrays to/from binary files without issue. But this time I get an error.
When opening the IOStream again, I think we want a read instead of another write:
io = open("logs/test","r")
For completeness from the comments above, opening a file with just w will truncate the file, so attempting to read from it will lead to an EOF error. More examples of what different modes do can be found here: https://docs.julialang.org/en/v1/base/io-network/#Base.open
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
have a RMarkdown document that I can convert at the command line with Pandoc and the --number-sections switch. The section numbers render 100% in the converted HTML.
However, I want to knit in the R chunks.
When I try and do a Knit to HTML in RStudio on the same file with the YAML header:
the sections numbers are not rendered. What am I doing wrong with the YAML?
Selecting the Knit with parameters option also says there are no parameters, should it not read the YAML header and see them?
Should be an underscore, i.e. number_sections: TRUE. (;
See https://bookdown.org/yihui/rmarkdown/html-document.html
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I have this issue already mentioned by many. My R code worked on a computer at my previous job (with \s), but does not work any more on a new computer
My case is that R is returning this message:
Error: '\U' used without hex digits in character string starting "'C:\U" ,
even when there are actually no "\" in code. I have tried all the options suggested in previous posts (i.e. \, /, //, \\, ////), but it does not work.
I use R version 3.4.1 (2017-6-30) and Office 2016.
Any suggestions are greatly appreciated.
One way to get around file path issues in R is to use forward slashes in your path, e.g.
U:/path/to/file.ext
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I was a bit surprised that this question hasn't been asked before. (If it has, apologies!) I am trying to find a good text editor with support for rmarkdown documents. Here are my criteria (in no particular order):
syntax highlighting (for both R code and markdown syntax)
ability to send code from document to console for evaluation
free & open source
autocompletion for bibtex entries
cross-platform
I can't seem to find anything that fits the bill. Sublime Text can do all of this, but it's neither free nor open source...
I know a lot of people use RStudio, but its support for actually writing is not very good at all (e.g. bad spellcheck, no support for navigating a file, etc)...
The answer to any question involving editors is of course ... Emacs. In all seriousness:
ESS for R
Polymode (by one of the ESS authors) for mixed mode
markdown mode by Jason Blevins (which is IIRC bundled with recent Emacs versions)
work well for me. I still go back to latex for 'real' papers with bibtex, but folks do this with markdown too so there will surely be a mode. And yes, it is cross-platform.
I use these on Ubuntu, and maintain the ESS package for Debian. So that one is always current. For polymode I just go to Github. It all works of course with MELPA and Emacs package archives.
Atom is free, extensible, and open source.
The only thing I can't get it to do is R code syntax inside a code chunk of an Rmd file (similar to Sublime).
If you have experience with Vim, you should check out Vim-R. I use it exclusively; it sends code to R, and has loads of other awesome features. In terms of syntax highlighting, I don't know if there is any specifically for rmarkdown, but there are vim plugins for markdown, and the syntax highlighting for R files is quite good with Vim-R.
I actually never use markdown in any form, but create .Rnw files and use knitr to create PDF's (via pdflatex). Vim-R will also send relevant knitr commands; e.g., if you want to knit pdf, you type (in vim) \kp. If you want to run it through biblatex, you type \kb.
EDIT: I'm not sure if there is autocompletion for bibtex entries, though. There probably is in vim-latex, but of course that isn't R related. However, you might be able to install both plugins and incorporate that command for your own uses.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Consider a user that needs a text of docx document without the headers and footers for processing in R.
If a file.docx is renamed as file.zip and the document document.xml is analyzed - it is a well formed XML document with the text.
Did Microsfot (or other developer) publish a schema for this document.xml subfile in the ZIP package of docx file?
The file looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 wp14">
- <w:body>
- <w:p w:rsidR="00F447D7" w:rsidRPr="00C63308" w:rsidRDefault="00F447D7">
- <w:pPr>
From wikipedia:
The format was initially standardised by Ecma (as ECMA-376) and, in
later versions, by ISO and IEC (as ISO/IEC 29500).
You can find various versions of the XSD in the ECMA-376 downloads
document.xml conforms to the WordprocessingML part of the schemas (look for wml.xsd).
I think this might be the location: http://msdn.microsoft.com/en-us/library/hh643329(v=office.12).aspx
This is version 5.2. On this page you can find a link to version 5.1.