Hot answers tagged

27

I think we could get a useful addition, requiring only few work and without a security risk to our site, which is always to consider for online compilers. What we would get: One-click preview Fast testing and solving problems without a local TeX installation Actually working with site's TeX code on mobile devices, such as tablets and phones Additionally, ...


21

You could insert a piece of invisible HTML code: 1. This is the first item. 2. This is the second item <!-- code follows --> \documentclass{article} \begin{document} \end{document} Output: This is the first item. This is the second item \documentclass{article} \begin{document} \end{document}


19

I would say that it's up to the owner of the post to decide whether they feel editing the code formatting is okay or not, not a third party. When someone's answer is edited, they are notified and can make the call themselves. Maybe they think of the new code formatting as an improvement and are happy about it; if not they can undo the changes themselves.


16

I'd be against this really. Apart from any technical issues about setting it up, I post a lot of answers and a lot of those have images but almost never do I post a complete document. For a multipage document I take a conscious decision which page or pages to show, and for a single page I usually crop to the area that I want to highlight in the answer. I ...


13

I edited the code. The indentation was positively misleading, as nested functions are always indented further than the function they are nested in. Indeed, the original poster used this convention in most of their code, so clearly the incorrect indentation was in error. I also moved the closing parentheses so that the code was in a more conventional lisp ...


12

According to the help on Markdown, StackExchange has programmed "[comments to] support only bold, italic, code and links; in addition, a few shorthand links [...]". Comments, in general, should be used only or limited interaction between posters and other contributors. As such, providing the same markdown capabilities has (most likely) been decided as not ...


11

We used to have Mathjax in the very first days of TeX.sx, but not anymore. See this discussion and also the first answer to this question for some rationale. I'm almost sure there have been other discussions previously, but wasn't able to find them currently. In a nutshell -- there's no real benefit of having TeX rendering here. Discussions on TeX.sx are ...


11

R is listed as one of the supported list of languages; available as <!-- language: lang-r -->. In general, new scripting languages won't be implemented by StackExchange directly. However, there is hope... The following is taken verbatim from What is syntax highlighting and how does it work?: How does it work? Stack Exchange does not have its own ...


10

This all has to do with the fact that SE uses markdown in posts and comments (similar to setting some character's catcode to \active), and markdown uses the following set of characters that have special meaning: [, ] Used with links/internal references/tags (, ) Used with links/internal references # Headings ! Images, language syntax formatting and spoilers ...


9

You can highlight the block of code and press the {} button or use Ctrl+K: Note that code formatting requires additional formatting when used in conjunction with a list. For more on this, see Is there a problem with code formatting? Why do code snippets not work after lists? In short, Insert an additional 4 spaces for each level inside the list that you ...


9

Markdown can be "too aware" sometimes. When you typed 1., the parser automatically treated the current line as a list. If there's a list going on the line above, a new line starting with at least one space will make it part of that list: 1. This is a list. I'm not part of the list. 1. This is another list. Now I'm part of the list. which will render as:...


9

After I removed and added the four spaces at the begin of every line it got formatted correctly. Maybe there were some Unicode spaces or line breaks included which confused the system. Note that code blocks which are part of a list element you need to be indented with 8 spaces, not just with 4. If the code block directly follows a list, but should not be ...


9

Going from the situation that provoked this, I'd like to point out the dangers of being the third man in. This is a well-known phenomenon from rugby: since a rugby match is essentially a pitched battle, it is often hard for a referee to see when a maul turns into a brawl and they might well miss the start of it and see only the retaliation or the third man ...


8

co-founder of http://SpanDeX.io here, an online LaTeX platform. We have a similar integration with http://LaTeXTemplates.com (Here's an example of our setup there). If there's interest in this kind of integration with TeX.SE, we'd be more than happy to offer our platform up. We have shell escape enabled within secure LaTeX sandboxes, so all TeX live packages ...


8

References: Code block is not properly formatted when placed immediately after a list item Why do code snippets not work after lists? This is because any indented text immediately following a list is seen as part of the list, as Joseph mentions. Hence, if you have * list item some text some more text this is printed as list item some ...


7

This is something that has been (feature) requested back in 2011 on Meta.SE: Formatting Keyboard Shortcuts for Comments and is truly something that will have to be implemented network-wide. The only automated suggestion is a web-script that you can install via Tampermonkey or Greasemonkey.


7

In most cases, the specific name of a file doesn't matter, but even if it does, there's no need for a heading outside of the code. If the file name does matter, there usually are several files involved with one main file accessing the other(s) (e.g. a .bib file). In those cases, I'd recommend using a filecontents environment in order to enable user to create ...


7

You'll have to route your query through SEDE. I think the reason here is the difference between the stored content of the post (what you actually typed) and the baked content (what is visualized through the browser). This difference is needed because of Stack Exchange accepting Markdown as input. This query hopefully provides what you're looking for: ...


6

IMHO, reindenting other people's code is a big no-no, unless the code is a complete mess. (Sometimes I am tempted to add linebreaks in those looooong horizontal scrollboxes, but refrain because, well, see my first sentence.) This particular instance, however, has another angle: the edit added an apropriate language code, which clearly was an improvement. ...


6

I'm a little late to the conversation here, sorry, but I think it's worth pointing out the Common LaTeX Service Interface (CLSI). This is an open source API that I developed with Bobby Soares and it powers the online editors ScribTeX, ShareLaTeX and LaTeXLab (in a slightly different implementation). I've been pushing for a wider adoption of this at every ...


6

Not a bug: a feature :-) The code was marked up not using Markdown (4 space indent) but using <pre> tags. That turns off the automatic syntax highlighting: I've edited and all should be fine now.


6

How to use a MWE from a question Simply select the code using your mouse and copy/paste it into your TeX editor to work on. How to put code into your answer Select the code from your TeX editor, copy it, and then paste it into the editor box of the answer. To format it as code, select it all and type Control-K or click on the {} icon above the editor ...


5

I do not know a site solution, but you can try to solve his on your own: For Windows there is PhraseExpress, a text expander for Windows (free for personal use), and I guess there are alternatives for Linux and MacOSX, for Windows I know there are. I use this myself for instance to get typographical quotes like “” and ‘’ (also in German „“ or with ...


5

The linked question has now been fixed (along with ~11,000 similarly corrupted postings) see Community effort in fixing the double backslashes issue For a summary of how this got fixed in the end.


5

We could have a {+} button to add spaces (4 at a time), and a {-} button to remove them.


5

Syntax highlighting is provided, when available (not all sites are enabled), by google-code-prettify, and is thus limited to the languages handled by this highlighter. I bumped into the problem myself recently when writing up a Fortran 95 code question on another SE. If you add the necessary code to do this highlighting to prettify, then the chances are that ...


5

There are already many online LaTeX compilers when you need them. Introducing our own one would necessarily introduce its own bugs and errors, which only drive the site away from its real purpose.


4

This is fixed now. We had placed an arbitrary limit on the number of links that would be automatically rewritten with their full question titles (40, on meta sites). This limit was apparently too low, so we bumped it up to a much higher (still arbitrary) number. Hopefully you won't run into it again any time soon.


Only top voted, non community-wiki answers of a minimum length are eligible