# Start a new discussion

## Not signed in

Want to take part in these discussions? Sign in if you have an account, or apply for one below

## Site Tag Cloud

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

• CommentRowNumber1.
• CommentAuthorTobyBartels
• CommentTimeMar 28th 2010
• (edited Mar 28th 2010)

Here is some code.

Here is more code.

And yet more:

code


Edit: I should have made it clear when I sent people to look at this what it should be. Here is the Markdown source:

Here is some <code>code</code>.

Here is more code.

And yet more:

code


And here is the resulting HTML:

<p>Here is some <code>code</code>.</p>

<p>Here is more <code>code</code>.</p>

<p>And yet more:</p>

<pre><code>code
</code></pre>


So it seems obvious to me that the first two blocks of code-formatted text should appear inline, while only the last block should appear separate.

• CommentRowNumber2.
• CommentAuthorTobyBartels
• CommentTimeMar 28th 2010
• (edited Mar 28th 2010)
• unordered
• list
1. ordered
2. list

Edit: Here, the point is that the latter list should be numbered (although not the former). Again, that's what the HTML says; it's just a question of how the stylesheet says to render that.

• CommentRowNumber3.
• CommentAuthorTobyBartels
• CommentTimeMar 28th 2010
• (edited Mar 28th 2010)

Edit: The text ‘link’ should look somehow special, else how will you recognise that there's a link to follow?

• CommentRowNumber4.
• CommentAuthorHarry Gindi
• CommentTimeMar 28th 2010
• (edited Mar 28th 2010)

The stylesheet on MathOverflow makes this work fine

To do multiline code, do

backtick and then separate lines by single returns as follows:

a a a a a a

but not

a

a

a

a

a

a

• CommentRowNumber5.
• CommentAuthorTobyBartels
• CommentTimeMar 28th 2010

Interesting. Using my stylesheet, your first example there is all one one line! Furthermore, that seems to me to be the only sensible way for a stylesheet to interpret the HTML, which has no linebreaks in it. (Well, it has linebreaks in the sense of ASCII Ctrl-J, but it has no <br> or <p> tags.)

(And yes, the code ‘<br>’ and ‘<p>’ above should all appear on the same line as the surrounding text. Why would a stylesheet want to pull it out???)

Another way to get multiline code —and this way uses HTML that presents multiline code, rather than a stylesheet hack— is by placing four spaces at the front of each line:

no space

one space

two spaces

three spaces

four spaces
five spaces
six spaces
seven spaces


• CommentRowNumber6.
• CommentAuthorTobyBartels
• CommentTimeMar 28th 2010

(For the record again, ‘my stylesheet’ is the last of the four called ‘default’ on the styelsheet settings page. It has trouble with columns but does code and lists sensibly.)

• CommentRowNumber7.
• CommentAuthorAndrew Stacey
• CommentTimeMar 29th 2010

Actually, the story of line-breaks and code is a little complicated. As well as the code tag, there's the pre tag. I think (have to look to check) that Markdown automatically wraps 'code' tags in 'pre' as well. It's the 'pre' that decides how the line breaks work. One can also tell pre to wrap long lines as well as respecting end-of-line characters, so with judicious use of CSS one can get quite a variety of styles.

If there's something weird about one of the stylesheets here that is clearly wrong, then I'm quite happy to modify it. For example, the default stylesheet seems to insist on putting any code on a separate line (display: block), which can be very annoying. My choice of stylesheet (can't remember which off the top of my head) fixes this but doesn't distinguish links (except on mouseover).

When I set up this forum, I just downloaded a load of stylesheets that looked vaguely okay. I seem to remember that I tweaked one of them once and I think it was to do with the ordered vs numbered lists. Also, since this forum started, there will no doubt have been new stylesheets devised. If you follow the link (click on the word "vanilla" somewhere on this page) then you should be taken to a page where you can find more stylesheets. I'm more than happy to install more than we have (and I know that several are just called "default" so I should probably also sort out the names!). If some want a stylesheet tweaked and others don't then it's easy enough to fork one.

• CommentRowNumber8.
• CommentAuthorTobyBartels
• CommentTimeMar 30th 2010

Look at the HTML source of this page; there's no <pre> tag in this comment. Yet the word ‘<pre>’ shows up on a separate line in almost every stylesheet. (Mardown does treat text between backticks something like LaTeX's \verb command, just as HTML's <pre> does. But it doesn't actually put <pre> into the HTML.)

For example, the default stylesheet seems to insist on putting any code on a separate line

That's the thing: they all do that, with three exceptions (my choice of stylesheet, your choice cloud6, and vaneablack). That's why the choices are kind of limited.

If some want a stylesheet tweaked and others don't then it's easy enough to fork one.

I would like vanilla (the one at the top of the list) if you copy its handling of <code> from vaneablack or the last one named ‘default’. (Perhaps these could be named ‘default0’ through ‘default3’?)

• CommentRowNumber9.
• CommentAuthorTobyBartels
• CommentTimeMar 30th 2010

Where do you keep the CSS files? I can't find them by poking around with URIs.

• CommentRowNumber10.
• CommentAuthorAndrew Stacey
• CommentTimeMar 30th 2010

The stylesheets are:

~stacey/Vanilla/nForum/themes/vanilla/styles/X/vanilla.css


where X is the name of the stylesheet. The names are:

• AquaLounge
• cloud6
• default
• Dizzy
• quik_blue
• quik_red
• sky
• tonka
• vaneablack

(there are a few other files, images and minor stylesheets, but the 'vanilla.css' is the main one)

• CommentRowNumber11.
• CommentAuthorTobyBartels
• CommentTimeMar 31st 2010
• (edited Mar 31st 2010)

That folder list doesn't really match the list of options (each of which does produce a different style when I try it). One of the options (sky) doesn't actually do anything (so it looks very ugly, thanks to the header and sidebar), although its name does match one of the 9 in the file folder. I'd most like to see the one called ‘vanilla’ in the options, but that name doesn't match anything in your file folder.

• CommentRowNumber12.
• CommentAuthorAndrew Stacey
• CommentTimeMar 31st 2010

Over on the test forum I've modified the names of the styles slightly. It seems that the extension that presents the list of styles picks up everything that looks like a style in a certain folder. The problem is that styling the forum takes place at two levels. There are "themes" (which only I can change) and then "styles" which apply to themes. It is easily possible that a certain style can be reasonably applied to more than one theme, but the idea is that the hierarchy is obeyed. I downloaded a variety of themes when I originally set this up, but stuck with the default one in the end. However, the default styles that come with each of those themes persists.

I've just realised that the test forum was the wrong place to modify those names! The problem being that I didn't install the extra themes in the test forum so those extra stylesheets just aren't there. However, as the software saves a list of the styles, it hasn't noticed that they aren't there! Bother.

The one called "vanilla" is the original default style and is located in the folder "default".

• CommentRowNumber13.
• CommentAuthorAndrew Stacey
• CommentTimeMar 31st 2010

Okay, I've changed the names on this forum as well.

• CommentRowNumber14.
• CommentAuthorDavidRoberts
• CommentTimeApr 1st 2010
I just tried the stylesheet 'default (tabled)', and it gave me on the 'discussions' page a whole bunch of nested ordered and unordered lists instead of anything sensible. Maybe I was picking a naughty style that won't behave, but the picture presented by the option looked good.
• CommentRowNumber15.
• CommentAuthorAndrew Stacey
• CommentTimeApr 2nd 2010

Yes, that was a "naughty style". Technically, that style is meant to be associated with a particular theme. Since we don't use that theme, the stylesheet may or may not fit too well with our theme. Many of the elements across the themes will be the same so some styles may well work with different themes, but there's no guarantee.

(There are plenty more themes and styles over at the main vanilla website. I'm quite happy to install more styles. I don't know if it's possible to install different themes for use by different users.)

• CommentRowNumber16.
• CommentAuthorTobyBartels
• CommentTimeApr 2nd 2010
• (edited Apr 2nd 2010)

OK, so default(tabled) is the one that I use. As I said, it has some problems with columns (basically, there's a glitch that comes in when the sidebar on the left ends), but it's the only one that handles code, lists, and links well (and actually styles things) IMO.

I don't know why it didn't work for David. Because of the column glitch, it doesn't quite match the picture for me either, but I still see something sensible.

• CommentRowNumber17.
• CommentAuthorTobyBartels
• CommentTimeApr 23rd 2010

Hey Andrew, I see that default (tabled) now no longer has the column glitch. (Now the worst that I can find to criticise about is the small font size.) Did you edit it?

• CommentRowNumber18.
• CommentAuthorAndrew Stacey
• CommentTimeApr 24th 2010

I did edit it slightly. I altered the theme slightly and that made all the different stylesheets break so I did the minimum to fix them. In doing so, I had to actually look at them and did what I had to do to make them look reasonable. That included fixing the column glitch as it looked horrible! I think I also fixed the boldface mathematics as well: $\mathbf{X}X$. However, that was just “bug fixes”. I haven’t done the Major Work that I intend to do on the CSS.

• CommentRowNumber19.
• CommentAuthorTobyBartels
• CommentTimeApr 24th 2010

Well, it looks much better! Although please take a look at http://www.math.ntnu.no/~stacey/Vanilla/nForum/comments.php?DiscussionID=1121&page=2#Item_19 and tell me if that comment is deleted (hidden), because I can’t see the difference.

• CommentRowNumber20.
• CommentAuthorAndrew Stacey
• CommentTimeApr 26th 2010

Something’s gone wrong with the javascript that deletes (hides) comments. I managed to delete one of your comments by calling the correct URL directly, but for some reason the javascript that is meant to do it is failing dismally. Bleugh.

• CommentRowNumber21.
• CommentAuthorAndrew Stacey
• CommentTimeApr 26th 2010

Fixed (obscure or what! It was down to a &nbsp; that the system didn’t like in its new “strict” mode). And I deleted your comments as you seemed to want.

• CommentRowNumber22.
• CommentAuthorEric
• CommentTimeApr 26th 2010

Did someone edit the font size of the nLab? It appears bigger now. Not uncomfortably bigger, but noticeable. Just curious.

• CommentRowNumber23.
• CommentAuthorAndrew Stacey
• CommentTimeApr 26th 2010

Yes, me (who else?).

Actually, it’s (probably) a completely different font. If you have the STIX fonts installed then you’re seeing those. I wanted to see if having a uniform choice of font for mathematics and text worked better. So that when you write something like: “let $x$ be the horizontal co-ordinate and $y$ the vertical, then the radius of the circle can be written as $\sqrt{x^2 + y^2}$” then the text and mathematics look well together. I haven’t had the opportunity to decide whether or not it works, though.

• CommentRowNumber24.
• CommentAuthorAndrew Stacey
• CommentTimeApr 26th 2010

Oh, oops. You said “nLab”. I misread that.

Not me, then. Jacques sometimes tweaks the CSS in the source, but I don’t know if he did this time.

• CommentRowNumber25.
• CommentAuthorEric
• CommentTimeApr 26th 2010

I think the n-Forum looks great. The math and text render together nicely. I didn’t feel there was a problem with the nLab before though. Maybe it is just that I became accustomed to it, but I think I liked the nLab better before.

• CommentRowNumber26.
• CommentAuthorEric
• CommentTimeApr 26th 2010

Yeah, I knew you were tweaking the CSS here and it looks great, so asked my question here thinking maybe you also changed the nLab :)

• CommentRowNumber27.
• CommentAuthorTobyBartels
• CommentTimeApr 28th 2010

Thanks, Andrew, and that makes me notice another bug (since I was on another computer and not logged in when I first check this): If you follow a link to a comment that is hidden from you, then you get an error message. It might be better to go to the right page and just get to the part where the comment would be but isn’t; that can be debated. What is undeniable, however, is that the error message does not validate as XHTML. (Possibly it is just missing a <p> tag.)

• CommentRowNumber28.
• CommentAuthorIan_Durham
• CommentTimeApr 28th 2010

My only complaint about the forum font change is that, at least in my browser (maybe I need to change a setting?), the tabs I’m not on (notices, etc.) are in white and very difficult to see.

• CommentRowNumber29.
• CommentAuthorAndrew Stacey
• CommentTimeApr 28th 2010

Do you mean the lettering of those tabs?

• CommentRowNumber30.
• CommentAuthorHarry Gindi
• CommentTimeApr 28th 2010
• (edited Apr 28th 2010)

@Andrew:

Yeah, meanwhile, is there any way to use better mathML fonts on the lab itself? For some reason, stuff here renders much better for me for some reason. If you saw the fonts that were in that mathjax preview that Anton linked over on MO, output as MathML, they looked surprisingly good. I wonder if that's mathjax actually manually making things look nicer, or if they were just using very good fonts.

• CommentRowNumber31.
• CommentAuthorAndrew Stacey
• CommentTimeApr 28th 2010

In a nutshell, that’s the point of MathML! I, as tech-support for the nForum and nLab, can make a suggestion as to which fonts you use but you can choose to completely ignore that suggestion and use whatsoever you like. Of course, I would like to make the best suggestion that I can.

At the moment, on the nForum, I am “suggesting” that you use:

STIXSize5, ’Trebuchet MS’, Verdana, Tahoma, Arial, sans-serif

but what I am actually using are:

STIXGeneral, DejaVu Serif, DejaVu Sans, Cambria, Cambria Math, Times, Lucida Sans Unicode, OpenSymbol, Standard Symbols L, serif

on the nLab, I am “suggesting” that you use:

Verdana, Arial, Helvetica, sans-serif

but what I am actually using are:

STIXGeneral, DejaVu Serif, DejaVu Sans, Cambria, Cambria Math, Times, Lucida Sans Unicode, OpenSymbol, Standard Symbols L, serif

meanwhile, Anton (or whoever set up that MathJax beta) is making no “suggestions” at all, with the result that I am using:

STIXGeneral, DejaVu Serif, DejaVu Sans, Cambria, Cambria Math, Times, Lucida Sans Unicode, OpenSymbol, Standard Symbols L, serif

(These are all for MathML, not text; and the way these lists work are that the browser starts with the first and goes through looking for a font with the right character.)

So as far as MathML is concerned, my “suggestions” are getting completely ignored!

For comparison, here’s the first part of the MathML on that beta page essentially just copied over (one minor edit to make it validate):

$\begin{array}{ccc}\stackrel{˙}{x}& =& \mathit{\sigma }\left(y-x\right)\\ \stackrel{˙}{y}& =& \mathit{\rho }x-y-xz\\ \stackrel{˙}{z}& =& -\mathit{\beta }z+xy\end{array}$

Here we go with typesetting that as itex

\begin{aligned} \dot{x} &= \sigma(y - x) \\ \dot{y} &= \rho x - y - x z \\ \dot{x} &= -\beta z + x y \end{aligned}

Okay, rant over! Seriously, I would like to make the best suggestion that I can, but clearly trying to figure that out using my browser is pointless! I’ll take a look at those sites using Opera when I get a moment.

• CommentRowNumber32.
• CommentAuthorHarry Gindi
• CommentTimeApr 29th 2010
• (edited Apr 29th 2010)

Wait, how did you set it up to use those fonts? By the way, opera respects the font choices, so if you change them on the nLab, everything will look much nicer for us.

• CommentRowNumber33.
• CommentAuthorAndrew Stacey
• CommentTimeApr 29th 2010

Firefox also respects font choices, by default. However, if you explicitly tell it to use certain fonts for certain things, then it respects your choices and gives them priority. I suspect that Opera is exactly the same, just that you haven’t explicitly told Opera to use certain fonts. In firefox, you go to ’about:config’ (click on the “Yes, I know that this voids the warranty” button) and search for (or create) the key “font.mathfont-family” then the fonts you list there are the defaults used for mathematics. I would guess that Opera has some similar facility, but I only use Opera about once a month so don’t have much familiarity with its configuration.

• CommentRowNumber34.
• CommentAuthorAndrew Stacey
• CommentTimeMay 28th 2010

a b c d e f

a
b
c
d
e
f

a
b
c
d
e
f


Some code a b c d e f is nice.

a b c d e f

 a b c d e f