Questions tagged [text]
Questions relating to working with textual information: textual analysis, data mining, etc.
346
questions
44
votes
5
answers
21k
views
How to import all files of a folder at once?
I know how to import one textfile by calling its name
filestring = Import["myfile.tex", "Text"];
Then "filestring" is a string with the myfile content.
How do ...
42
votes
4
answers
2k
views
Is there a convenient way to copy/paste text-interspersed SE code snippets into Mathematica?
Is there a way to copy and paste code snippets from SE to Mathematica if these snippets are interspersed with text?
Like e.g. in Morphing Graphics, color and location in both the question and answer, ...
35
votes
2
answers
3k
views
How do I extract the contents of a selected cell as plain text?
My aim is to extract the contents of an Input cells as plain text. Ideally I would like to be able to select one or more Input cells and press a button which would then extract the text from these ...
33
votes
6
answers
5k
views
How can I wrap text around a circle?
How can I wrap text around a circle?
For example: the text in the sectors of this chord plot.
Perhaps one could use FilledCurve[] and then apply a ...
33
votes
4
answers
2k
views
Movable text on a curve
Having an arbitrary curve defined as InterpolatingFunction, what is the best way to place a text on this curve? The text generally has two rows, for example: ...
32
votes
3
answers
3k
views
Is there a way to outline text?
If I have:
Graphics[
{Red, EdgeForm[Directive[White, Thick]],
Inset[Style[Text@"Hi!", 44], {0, 0}]}, Background -> Black
]
I unfortunately get:
...
30
votes
3
answers
3k
views
"Covering up" text in Graphics
Consider the following code:
...
29
votes
1
answer
389
views
How to speed up TextJustification in Mathematica 10
Based on this question: - Version 7 print environment - I set up two 10 page test documents in version 7.0.1 and version 10.1. The version 7 document exported to PDF in 4.18 seconds whereas the ...
25
votes
2
answers
34k
views
Placing text within a plot
I want to place text within a plot. The text is always centered relative to the coordinates. How can I left-align or right-align the text relative to the coordinates? For example:
...
21
votes
4
answers
14k
views
Skip header lines on import
When importing a data file what are the comment symbols for Mathematica?
That is, given a file like this
blabla
bulbul
1 2 6 54 7 ...
..
what symbol do I have ...
20
votes
6
answers
3k
views
Determine the Number of Lines in a Text File
I have looked and looked but I do not see a simple efficient way to get Mathematica to return the number of lines in a text file?
I thought about reading the file until it returned the EOF marker, ...
19
votes
3
answers
632
views
Parenthesize what I have highlighted
I want to highlight a piece of equation, click a button and have that part taken into parentheses.
19
votes
4
answers
942
views
How to call Mathematica from $ \rm\LaTeX $?
The sagetex package for $ \rm\LaTeX $ allows you to embed Sage code into a $ \rm\LaTeX $ document, have that code evaluated during the ...
19
votes
2
answers
2k
views
Lexicographic ordering of strings in Mathematica
I recently realized that Mathematica seems incapable of comparing strings in the "normal" expected lexicographic order. Indeed, for some simulations, I need to process text directly, without fiddling ...
18
votes
3
answers
1k
views
Highlighting pattern strings in a large text
I would like to apply Style to strings that are matched, for example, with one or more specified patterns or regular expressions, a string or a list of both, ...
18
votes
1
answer
347
views
Intelligent text search on large directories of notebooks?
I have a (deeply nested) directory containing 10s of thousands of wolfram files (mostly notebooks (nbs), but also scripts (.wls), packages (.m, .q
wl), my and wxf data) and many subfolders each with a ...
17
votes
4
answers
1k
views
How to determine the convex hull of some text?
How can I get the co-ordinates of the convex hull of a piece of Text?
17
votes
3
answers
535
views
Grabbing a number of characters around a string pattern
If I have some string data:
text = StringTake[ExampleData[{"Text", "DeclarationOfIndependence"}], 400]
"When in the Course of human events, it becomes ...
17
votes
3
answers
1k
views
Apply an image as a texture to text
I have the following equation
eq = Sum[x^2, {x, 0, 10}]
and an image ...
16
votes
2
answers
1k
views
Backslash commands in strings?
I discovered by playing around that
Text[DisplayForm@SubscriptBox["λ", "k"]]
produces the same result as
...
16
votes
1
answer
627
views
Automatic edX Pdf Handout creator
I am trying to make an automatic handout creator for my courses on edX.
It took me a long time to do it...
(If you don't know edX: https://www.edx.org/)
I wrote a program that adds to each slide ...
15
votes
4
answers
2k
views
What stopwords list is the Wolfram language using?
The documentation of DeleteStopwords only says that it "uses a standard, built-in list of stopwords".
So what is it exactly?
Update
Now that it is said "standard"...
15
votes
4
answers
19k
views
subscripts in plot axis labels
Superscripts can be included in axis labels by the use of the caret symbol (e.g., Plot[x^2, {x, -1, 1}, AxesLabel -> {x, x^2}]).
How does one include subscripts ...
15
votes
2
answers
2k
views
Computing the bounding boxes for Text objects
Regardless of AspectRatio, the Text boxes overlap.
...
15
votes
1
answer
758
views
Accessing figure style (oldstyle or lining) of TrueType fonts
Most professional fonts come with at least two figure styles: old style (or text) figures and lining figures. In plots and most other figures I prefer to use lining figures. This is no problem with ...
14
votes
2
answers
2k
views
How to position text labels automatically to not overlap other graphics elements?
I was plotting reciprocal frame projection using Locators for a point to be expressed in terms of both the original basis (also specified with ...
14
votes
1
answer
651
views
How to type text with an underbrace underneath it like: $\underbrace{g...g}_{n-times}$?
I want to use the underbrace "esc u{ esc" but have it placed underneath text. Like $$\underbrace{g...g}_{n-times}$$
in a mathematica text cell. Is it possible? Thanks
14
votes
2
answers
1k
views
Dimensions of the results of Text[] within Graphics[]
Is there a way to get the dimensions that the results of a Text[] will occupy within a Graphics[]? Specifically, if I run ...
14
votes
2
answers
507
views
Haiku Extractor
Inspired by the cool Tumblr Haiku Times that searches for accidental haiku in New York Times articles, I tried my hand at implementing such a search in Mathematica for my own text samples.
I'm still ...
13
votes
3
answers
577
views
Word Squares and Beyond
A word square is a set of words which, when placed in a grid, read the same horizontally and vertically. For example, the following is an English word square of order 5:
...
13
votes
2
answers
6k
views
How to dynamically name and date a file for export?
I have various functions that export Excel and text files, and need to have them named with a name based on the content of some variables in the function and the time and date. How can this be done ...
13
votes
1
answer
414
views
Wolfram Neural Net Repository Questions
I am a research scientist in the machine learning team, and mostly involved with the neural net repository. One of the discussions with my group raised these question in my mind, and these might be ...
12
votes
4
answers
2k
views
How to remove unknown zero-width character from string?
I have text that contains a zero-width character that I am not able to remove. A minimum example is in str below where the character is at the start of the text.
<...
11
votes
3
answers
16k
views
Import selected columns from a tab delimited text file
I have a very huge file (1GB) from which I desire to import only the 5th column. It is a tab delimited text file with a .txt extension. Can you please help me with ...
11
votes
2
answers
306
views
Pasting "rectangles" of text side-by-side
In Emacs/Xemacs, there is a rectangle feature, such that you can delete, copy, etc., "rectangles" of text.
Now suppose I have two text files, each containing one column of numbers. Is it possible to ...
11
votes
1
answer
1k
views
Poor anti-aliasing in Rotated text with ClearType on
There is a problem on my system that occurs when text is rotated 90 degrees as it is in frame labels. This only happens when ClearType is turned on, and only around 90 degrees of rotation.
I am ...
10
votes
3
answers
859
views
ROT13 and upside-down text (flip text)
How can we transform text in order to achieve ROT13 and flip text using Wolfram Mathematica?
1. ROT13
2. Flip text
10
votes
1
answer
4k
views
Is it possible to type equations as text in Mathematica?
I was wondering if I could write an equation, symbolically, but only as part of a text in Mathematica. So I don't want Mathematica to consider anything inside that equation as a variable, nor equate ...
10
votes
2
answers
341
views
Pasting monospaced text into Mathematica notebook destroys aligment
I drew the little ASCII-art electronics schema below in vim.
When i try to paste it into a Mathematica notebook, with:
A) A code cell
B) A monospaced font (Courier New)
Mathematica insists on ...
10
votes
3
answers
441
views
DeleteStopwords in other languages?
I saw that in new version of Mathematica there is an interesting function: DeleteStopwords that deletes stopwords from a list of words, but this function is only ...
10
votes
2
answers
243
views
Inline TeX Input renders wrong characters / symbols
Bug introduced in 12.2, fixed in 13.0.
As you may know, you can write TeX within a cell with CTR+$ and press ...
10
votes
0
answers
161
views
How to run GrammarApply offline?
It is a question regarding formal grammar. I have a grammar rule addition as below:-
...
9
votes
2
answers
467
views
Apply 2 Styles within Text[]
Please consider :
...
9
votes
3
answers
18k
views
Label points in plot with a text
I'm a newbie at Mathematica and I couldn't find how to label the maximum and the zero of a simple function in Plot with their names:
...
9
votes
5
answers
1k
views
How to resize the text content of a grid with it?
I am in a resizing mood these days. This code works quite well, up to a point.
...
9
votes
2
answers
1k
views
Convert quoted printable aka PrintableASCII characters to UTF-8
I have several .eml email files to import. Some of them were saved as quoted-printable 7-bit encoded.
I skipped through the Mathematica documentation and found ...
9
votes
1
answer
1k
views
How can I replace the Greek symbols in an expression with their plain text names?
Suppose I have an expression with Greek symbols in it. How would I convert that expression to another expression where the Greek symbols have been replaces with their names in plain text? I've ...
9
votes
1
answer
735
views
Can not edit font on drawing tool
I am simply trying to add some text to a plot via the drawing tool, but it seems the text style options are fixed at some default setting and will not change. You can see in the following picture that ...
8
votes
3
answers
1k
views
Working with text in 3D graphics
I'd like to add text to the surfaces of a cuboid. I have tried Text and Epilog, and neither of them worked.
Consider the ...
8
votes
2
answers
2k
views
rotating 3d text
Is it possible to create a 3D rotating text like this:
animation here.
Here is my try so far:
...