Questions tagged [conversion]

Questions on changing Mathematica expressions of one type or format to another, for example date formats, Boxes and other typesetting representations, or different units of measurements.

Filter by
Sorted by
Tagged with
4
votes
0answers
148 views

Boxes in EPS output after PDF -> EPS conversion in Mathematica 11

When I used Mathematica 9, I used to Export to .eps using a .pdf Export, followed by import like the following: ...
17
votes
1answer
5k views

How to convert the $\LaTeX$ format to Mathematica input?

How to convert the $\LaTeX$ format to Mathematica input? For example, if I have a formula: $$ \sum_{m_{i}=0}^M\sum_{n_{j}=0}^N \frac{(z_{i}/2)^{m_{i}}(z_{j}/2)^{n_{j}}}{m!n!} $$ in terms of $\...
4
votes
1answer
323 views

Integer to ordinal number string (words only)

I am trying to create a function that does: f[1] (* "first" *) f[27] (* "twentyseventh" *) f[50] (* "fiftieth *) There need not be a hyphen or space in ...
2
votes
3answers
296 views

How to convert numbers to currency values?

I am trying to create a way to convert some values of numbers into currency (dollars). The example I display below takes in three random numbers between -4 and 4, and rounds them to the second decimal ...
4
votes
1answer
317 views

Conversion between Piecewise[] and Abs[] representations [duplicate]

Is there a utility in Mathematica that can convert between two representations of an expression? The simplest example I can think of is Abs[x] Which I'd like to ...
2
votes
0answers
60 views

Is there a substitute for the “Show” function to use within the Mathematica kernel?

I needed to implement a function to convert an object from Graphics3D to Image3D, basically a 3D version of rasterisation (I need the geometry in a discretised form). I used the method suggested by R....
4
votes
1answer
165 views

How to restore a Notebook saved as Package?

A Notebook I was working on was saved as "Package" (with the extension ".m"). Upon opening this file, everything is unreadable. How do I convert this file back to ...
2
votes
1answer
601 views

Circle to Hexagon Conversion [closed]

I have a set of circles defined by a Middlepoint and a radius e.g. Circle1: x = 10, y = 10, r = 3 Circle2: x = 15, y = 2, r = 10 etc... But I want to have them ...
9
votes
1answer
738 views

How to use an image as a number?

How to define an image as a number? for instance I want to do something like this where but there is an error massage ...
15
votes
3answers
1k views

Display grayscale image as 3d plot

How to build 3d plot of grayscale image where x,y - pixel coordinates, z - pixel intensity? I tried ListPlot3D[ImageData[image]], but ...
7
votes
1answer
162 views

Problem with conversion of UI controllers' boxes to expressions

Bug introduced in V10 and partially fixed in V11.1.1 TLDR Various of expressions which have fancy typeset form or are designed as UI elements won't survive ...
13
votes
1answer
122 views

What types of string patterns can't be translated into regexes and hence do not work?

In a comment to related question Oleksandr R. made an interesting remark: ... because string patterns are converted into regular expressions and matched using PCRE, they are subject to some ...
8
votes
1answer
160 views

Convert expression to string in a reversible manner

What is the best way to convert an expression to a string in a reversible manner? I need a toStr function so that it is always true that ...
10
votes
2answers
434 views

How to copy formatted numbers as MathML without quotation marks?

I have the following code: a = 6.08717*10^6; b = a/3; c = a*1.5; d = a^2; matrix={{a, b, c, d},{b, c, d, a},{c, d, a, b},{d, a, b, c}}; matrix // EngineeringForm ...
8
votes
2answers
174 views

How to open and explore the codes of the system Palettes files

The built in Palettes of Mathematica are simply .nb files which can be found in the following place: ...
2
votes
2answers
282 views

How can I re-create the original Graph object from Graphics object into which that Graph was converted previously?

We can convert a Graph into Graphics very easily like it is shown in this answer. My question is: how to convert a ...
8
votes
1answer
346 views

How to convert arbitrary raw boxes directly into String?

This question is motivated by the recent question about searching inside of the NB files. According to the Documentation, ToString expects a high-level WL ...
5
votes
1answer
224 views

How to get “one Cell - one line” code format inside of NB files?

The PageWidth option controls the way the Cell's content is displayed, not the manner it's written in a ...
20
votes
2answers
509 views

Understanding evaluation and typesetting

Background So, one could be surprised by the fact that: Hold @ Grid[{{1, 2}}] (*or*) Hold @ Graphics @ Disk[] This issue and methods of prevention are ...
8
votes
2answers
182 views

Reading Cells or Boxes expression by expression

Let's say we have a cell: (*newline*) (*newline*) Plot[ x, {x, 0, 1} ] (*newline*) Plot[x, {x, 0, 2}] How to read it expression by expression? So e....
1
vote
2answers
366 views

How to convert Image3D object into Graphics3D object and vice versa?

There are some rendering options (for example, Lighting) which are associated with the Graphics3D objects. I cannot apply these ...
6
votes
2answers
593 views

How convert old version 2.2 .ma files to .nb notebooks?

I have a lot of old Mathematica version 2.2 .ma files that simply crash the current (10.4.1) version of Mathematica if I try to open them. Is there some way to ...
12
votes
2answers
238 views

ToExpression and ToBoxes aren't inverses of each other?

Applying ToExpression and ToBoxes repeatedly to Hold[1/1] gives many ...
3
votes
1answer
343 views

Can one prevent $\TeX$ conversion from changing form of expressions?

This is similar to my previous question Can one prevent operators like `Factor` or `Apart` from changing full form of some algebraic expressions? but concerns $\TeX$ and I cannot figure out whether I ...
3
votes
1answer
109 views

$CellContext issue while trying to export the current output of a Manipulate

Having just read this question Getting variables out of Dynamic Modules after restoring the program and the Kuba's answer I'm trying to optimize my workflow. I'm writing a Mathematica notebook to ...
21
votes
1answer
321 views

Can Mathematica convert a RegularExpression into a StringExpression or vice-versa?

I know that Mathematica can perform string comparison using either StringExpression or RegularExpression. Although regular ...
3
votes
1answer
83 views

An issue regarding the use of CopyToClipboard with dynamic content

Please, consider the following code: ...
13
votes
1answer
230 views

Arrows from GraphicsComplex not converted to Normal form correctly

Bug introduced in 7.0 or earlier and persisting through 12.1 Show @ Graph[{1 -> 2, 2 -> 3}, Frame -> True] Normal @ % Is this a pure bug, or have I ...
6
votes
2answers
222 views

How can DateObject handle calender weeks

I have dates given for a TimeLinePlot. These dates are in {year,week} format. DateObject ...
9
votes
0answers
274 views

Wolfram Data Framework specification?

Motivated by a recent question on the meaning of all sorts of W* acronyms, I would like to get more information about the Wolfram Data Framework (WDF). On its web page http://www.wolfram.com/data-...
5
votes
1answer
145 views

Custom rules for expressions in export to HTML(Fragment)

ExportString[Grid[{{a, b}}], "HTMLFragment"] ...
1
vote
0answers
393 views

Convert large KML coordinate datasets to UTM [closed]

I was wondering if there are ways to convert massive amounts of KML coordinates into UTM coordinates using Mathematica. Other programs would also be acceptable. Thanks. I have the KML file from ...
4
votes
1answer
342 views

convert MeijerG to form Standard Functions in Mathematica

I'd like to convert MeijerG[{{}, {1., 1.}}, {{0., 0., 4.}, {}}, -1. T λ] to its Standard Functions (For example Bessel function or ...). Any suggestion?
6
votes
3answers
330 views

Looking for PostScriptForm or ForthForm to print expressions as RPN code

Mathematica has very useful functions CForm and FortranForm. I want the same for a different language: ...
0
votes
1answer
137 views

Electromagnetism units conversion in Mathematica 10 (possible bug)

Is this a bug in Mathematica 10? Why can't I convert Amps/m to Gauss? ...
7
votes
1answer
6k views

Why Base64 ends with a newline? (\n)

Why everything converted to Base64 has a newline at the end? It isn't one of base characters, is it? ...
4
votes
1answer
94 views

Whitespace is lost during MathML -> XMLElement conversion

ImportString["<mtext> </mtext>", {"MathML", "XMLElement"} ] XMLElement["mtext",{},{}] while I'd expect: ...
6
votes
1answer
113 views

Cell ► Convert To ► Bitmap: FrontEndToken for a specific menu item?

I've seen good discussions about the full list of FrontEndTokens. But I could not figure out how to find a specific ...
4
votes
0answers
441 views

Export Mathematica to $\LaTeX$ properly

I am simply trying to convert an existing sample in Mathematica to $\LaTeX$. For example, if I open a new Mathematica notebook using styled templates such as Journal article and save it as $\TeX$. ...
14
votes
3answers
479 views

How to extract something from DelaunayMesh and similar family of functions

I was looking at this question here and I tried the suggested idea by Anton Antonov to use DelaunayMesh It will look like this: ...
10
votes
1answer
254 views

A bug in Rasterize and Graphics: diagonal line is under-diagonal

I plot a straight diagonal line and then simply rasterize it. Consider what happens (Mathematica 8.0.4, 10.2, 11.1.1 and 12.0 on Windows 7 x64): ...
1
vote
1answer
113 views

FromDigits gives “not a list of digits” error for integer string in StringExpression rule of StringCases

I have large StringExpression that is used in StringCases. Some of the parts being pulled out are integer strings. These pull ...
11
votes
2answers
776 views

Does Mathematica have an equivalent of Python's float.as_integer_ratio?

The Python programming language has a float.as_integer_ratio(x) function which exactly converts an IEEE 754 floating-point number into a numerator/denominator pair ...
0
votes
0answers
47 views

Possible bug of Exporting as HTMLFragment at Linux

This is the result of Mathematica 10.0.2 of Linux Version. There are two style inside one tag, and this fragment cannot be Imported as XML by Mathematica. This is the result of Mathematica 10.1 of ...
3
votes
0answers
77 views

How to convert a list of polynomials into a list of equations and plug into Contourplot? [duplicate]

Given a list q of polynomials (output of GroebnerBasis) in two variables I want to transform the list into a list of equations and plug it into CountourPlot. For ...
7
votes
3answers
559 views

Converting between AbsoluteTime and Unix time

By trial and error, I've found that the following gives the current Unix time: AbsoluteTime[] - UPOCH where UPOCH can be defined in any of the following ways: <...
4
votes
5answers
322 views

How can I convert a Piecewise into a nested If?

For later conversion into a programming language where if is the only conditional construct, I would like to convert a Piecewise ...
3
votes
2answers
246 views

What's real analogue for FromDigits?

FromDigits only works for integer strings. What's its real-number analogue?
3
votes
1answer
119 views

Converting path list to the nested list

I'm trying to convert the plain path list to the nested tree list like the following codes. ...
8
votes
2answers
734 views

How to convert expression with Subscript to string

I've tried ToString[], but it doesn't work properly with subscripts: How to convert expr containing subscript to a string with ...