3
$\begingroup$

I have a notebook and I enter something like

PlotLabel->"my label with dynamic number "<>ToString[strange]

and I get errors like

doubleQuoteMess

However, the double quotes in the input cell were exactly copied and pasted from this posting and they became different on pasting to the notebook: The first one became slanted like a slash, the second like a backslash. There is - as the error message shows - a third type of double quote, a purely vertical one. I am used to Mathematica 4.0 where the vertical one was the one which came when I press Shift-2 and this was the right one to be used for string delimiters.

How do I force Mathematica to always produce the vertical double quote rather than any other flavours of different double quotes - and by the way: what is the significance

- of the double quote slanted like a slash

and

- of the double quote slanted like a backslash

in the *Wolfram Language? (Unfortunately, if I copy them to this posting front end, they all turn to the vertical double quote character).

Addendum (2014-10-17):

If I replace the slanted double quotes by a vertical ones, the plot command works:

this one works (with vertical double quotes)

whereas this one does not, but maybe the error message gives a hint. It seems to me to be be more a problem of input to Mathematica rather than evaluation of the Wolfram Language:

this one does not work

Today, trying around more with it, I found out that it depends on the notebook: in some notebooks, Shift-2 always delivers vertical double quotes, in some they come as slanted ones, sometimes even the first double quote in a line is a back-slanted one whereas all subsequent double quotes become slash-slanted:

different double quotes in an input cell

If this matters: The cell in the notebook with the strange double quote behaviour is an input cell, Cell>Convert To> shows "Input Form", the cell is open, editable and evaluatable, the cell bracket is a simple one without any extra decoration at the ends, just plain hook (see screenshots above).

$\endgroup$
  • $\begingroup$ what OS, version, etc? $\endgroup$ – george2079 Oct 15 '14 at 18:06
  • $\begingroup$ Mathematica 8.0.4.0 on Microsoft Windows 7 (64 Bit). $\endgroup$ – Adalbert Hanßen Oct 17 '14 at 10:23
  • $\begingroup$ this is for sure a front end entry issue that you are getting those slanted quotes at all. Any chance you are running some system level key mapping software, or perhaps some language localization issue? $\endgroup$ – george2079 Oct 17 '14 at 14:15
  • $\begingroup$ There are a lot of quotation marks in Unicode, and Mathematica will treat them as distinct, unless they are translated to the ASCII double quote when copy-pasted. $\endgroup$ – Michael E2 Oct 20 '14 at 14:20
5
$\begingroup$

According to http://forums.wolfram.com/mathgroup/archive/2010/Dec/msg00797.html there is an option under preferences:

Edit > Preferences > Interface

with two checkboxes:

Enable smart quotes for normal text editing and when pasting

As soon as I uncheck them both, the maze is gone: Shift+2 then produces vertical double quotes (the right ones to be used as string delimiters) rather than different slanted ones (are they meant to distinguish between opening and closing some quoted text?)

Bingo!

$\endgroup$
0
$\begingroup$

Unless I misunderstand the question, as the error message indicates, the error is in {x, xa, xa+100}, probably because you didn't assign a value to xa.

The following works just fine:

 Plot[x^2, {x, 5, 10}, 
      PlotLabel -> "my label with dynamic number " <> ToString[strange]]

enter image description here

$\endgroup$
  • $\begingroup$ right, my example was incomplete in not showing the definition of f and the assignment of a value to xa. But if an undefined xa would be the case, I expect an error message Plot::plln: "Limiting value xa in {x,xa,xa+100} is not a machine-sized real number." $\endgroup$ – Adalbert Hanßen Oct 17 '14 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.