Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

There is something about strings which doesn't seem to be totally clear for me (for the moment):

When entering "a string", the output, formatted as "Output" gives this string without the quotes. But when changing the "Output" format to "Text" format (which looks better for text as the typewriter font for Output—for my uses at least), the quotes come back!

Why is that and how can I get non-typewriter fonts as output of evaluations, without the quotes coming back?

Thanks for all help, as always!

share|improve this question

1 Answer 1

The first part of your question is answered with the option ShowStringCharacters.

Here with ShowStringCharacters -> True set on the output cell using the Option Inspector:

enter image description here

TraditionalForm does not display string characters by default:

enter image description here

If you want to control the printing of string characters for an entire Notebook you can edit the custom style sheet. If you give a more specific idea of the output that you want and when you want it I can provide more examples.

share|improve this answer
    
Thanks for your interesting comment! The problem is this: given "Compute " <> ToString[HoldForm[#1 (x - #2) = #3] & @@ Table[RandomInteger[{1, 10}], {3}]], I then use SelectionMove[EvaluationNotebook[], Previous, CellContents, 2]; SelectionEvaluate[EvaluationNotebook[]] in the next cell, as this is part of a bigger program. Now, this doesn't look "nice", at all, even when I add //TraditionalForm in the first cell. It's outputted in bold, and I'd love to have it as when you evaluate the first cell using shift-return. Is that possible? Thanks! –  Gabriel Sep 11 '13 at 15:08
    
@Gabriel Please tell me if this prints in the style that you want: ExpressionCell["Compute 8 (x - 6) = 7", "Input"] -- if that is correct we can work out the specifics of what you want to do, which I cannot yet understand from your description. –  Mr.Wizard Sep 11 '13 at 17:41
    
@Gabriel SelectionEvaluate[EvaluationNotebook[]] in your code does exactly what Shift+Return does. What behavior do you expect? –  Alexey Popkov Sep 11 '13 at 18:38
    
@Alexey: SelectionEvaluate[EvaluationNotebook[]] seems to behave differently when a CellContents is selected and when the cell in its entirety is selected. Is that normal? –  Gabriel Sep 11 '13 at 20:23
    
@Mr.Wizard: thanks for the suggestion, but using the code you provided prints the code in bold. I am searching for a Plain font, if possible. Is there any way of doing that? Thanks for all help! –  Gabriel Sep 11 '13 at 20:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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