Questions tagged [code]

For questions or problems relating to the use of code in questions or answers on a site or the way that markdown works with code/preformatted text.

0
votes
0answers
34 views

Should I make minor edit in the code in the question to make it compilable? [duplicate]

Consider this question: Parallel arrows along a curve with tikz. The OP's code is clearly not compilable. The preamble of the code is not shown. However, we can add a single line \documentclass[...
4
votes
2answers
112 views

Extracting code, uploading code and typeset result

I have difficulties working with TeX.SE. My OP system is Ubuntu and I use Firefox as my browser. Folk ask questions and and supply a MWE but I haven't found a way to get the MWE so I can try it out ...
8
votes
1answer
101 views

A search of a code string within my posts doesn't work

I'm searching my posts which contain \multicolumn{1}. I tried with: code:"\multicolumn{1}" user:me and code:\multicolumn{1} user:me but they both give 0 results, whereas there is at least one ...
9
votes
2answers
99 views

Add button “Select All” [duplicate]

May be it is not really a big problem, but it would be a nice addition to the site features if there was a button over or after the code to select all the code. I think it is useful more in cases you ...
0
votes
0answers
77 views

How to insert basic commands? [duplicate]

Could anyone give me a list of commands which could be useful for people who are new to this site? I don't know how to insert TeX code or any other type of code or any other simple commands, such as ...
4
votes
0answers
342 views

Zero-width non-joiners and and zero-width space inserted in code

Please look at my comments to https://tex.stackexchange.com/a/13716/30810: They cannot be copied and compiled because there are zero-width non-joiners and and zero-width spaces (‌​ ...
6
votes
3answers
293 views

Why can't TeX.SE compile my TeX code?

(This might have been asked before, but I could not find it.) A lot of questions and answers on this site have some piece of code (to be compiled with one of the standard engines) and a screenshot. ...
11
votes
1answer
167 views

‘double backslash + newline’ collapses to ‘single backslash’ when I hit ‘edit’

When I try to edit Thorsten Donig's answer to 'large braces for specifying values of variables by condition', the following happens: Instead of: 0, & \text{if}\ a=1 \\ 1, & \text{...
11
votes
1answer
436 views

Something messed with my answers backslashes and newlines

My answer is not displayed correctly. The internet archive has a correct version of the first revision, see this screenshot from archive. The difference is that now, though I didn't do any changes to ...
14
votes
1answer
189 views

Different code “convention” in questions than in comments

My first question here. Displaying backticks is apparently difficult. But it's not, just surround the inline code by more backticks than those that appear (concatenated) in the code. E.g., If you ...
9
votes
1answer
95 views

Is R syntax highlighting possible on TeX.SX?

I know it is possible to use <!-- language: X --> to get different syntax highlighting in posts for at least some languages, X. For example, this works for LuaLaTeX. It, however, does not seem ...
7
votes
0answers
80 views

Line break between backslash and opening brace { in in-line code

in Necessity of nested \text within math mode for proper \mathchoice-based scaling, there are a couple of instances where in-text code strings have a backslash at the end of one line and the next line ...
5
votes
1answer
67 views

Code formatting after itemize only with some text?

why is code formatting in answer https://tex.stackexchange.com/a/169741/5328 disabled when I remove the period between itemization and the code? Edit: I changed the answer by inserting a HTML comment ...
13
votes
1answer
164 views

Enable Ctrl+K shortcut in comments for inline code

It is frequent to have to write macros or packages names in comments of questions or answers. Because the Ctrl+K shortcut is disabled in such comments, it is necessary to manually surround with the ...
11
votes
1answer
153 views

why do some backslashes disappear in a quote?

in this answer, one of the quotes contains some latex code: For example: $x^2$ vs (^2) ... by which is meant For example: $x^2$ vs \(^2\) ... the original input doesn't use backticks to ...
3
votes
1answer
143 views

Is there a way to change markdown shortcuts?

I am using a keyboard with a French layout (azerty). With this layout, some shortcuts for markdown syntax are not convenient. For example inline code like this (this in between two `) is generated by ...
4
votes
0answers
57 views

Would a raw icon for code sections that allows for direct download of raw code as a file be a good idea? [duplicate]

A lot of code websites have a little icon in code sections that allows a raw dump of the code section content. Maybe even name the file with the question ID, or some reference, so MWEs downloaded in ...
3
votes
1answer
45 views

Syntax highlighting not working on a post

I went to Multipart nodes with multipart subparts — style issue and the questions syntax never colorized (if that is even a term to use). I then went to another post and the syntax there was fine. I ...
5
votes
0answers
67 views

Adding images changes code block indices

I encountered some strange behaviour when posting this answer The problem: The inclusion of images altered code in the code block. Specifically, my code contained double indices of the form [i][1] ...
15
votes
4answers
172 views

Modifying code formatting when editing

The motivation for this question is this post: https://tex.stackexchange.com/posts/94206/revisions In one of recent edits, the editor decided to change the code formatting in a piece of lisp code. ...
30
votes
4answers
1k views

Link to online LaTeX compiler

Today, a cooperation between LaTeX-community.org and writeLaTeX.com has been announced in TeXblog. According to it: By a single click on a link above a code box, the reader will land in the editor ...
0
votes
1answer
341 views

Filename code formatting

I suggest to enhance the code formatting with an optional argument for a filename. ===test.tex=== \documentclass{} \begin{} \end{} Nice workaround suggested in comments to use 3 #: test.tex \...
6
votes
1answer
71 views

“blog” entry with additional url in “creation of new package” list messes up formatting

in the list for Which questions led to the creation of a new package?, the listing for tqft contains a reference to a "Blog: The TQFT Package", which in turn contains an additional (and apparently ...
4
votes
1answer
138 views

How to move a block of code by 4 spaces [duplicate]

Possible Duplicate: How do I mark code blocks? What is the shortcut for spacing a block of code, picked from some TeX editor, so that they are spaced four spaces? (as opposed to moving each line ...
10
votes
2answers
124 views

Is there a problem with code formatting?

This answer appears not to be formatting correctly. (Its current version is correctly formatted in a different approach.) Could someone have a look and tell me what I've done wrong? I've tagged this ...
12
votes
1answer
306 views

Syntax-highlighting for LuaLaTeX

Is there a syntax-highlighting for LuaLaTeX on this site? I think it would be necessary to color the Lua commands in the LaTeX code, because Lua is a integral part of (Lua)LaTeX. I think it would ...
22
votes
0answers
167 views

Color coding of LaTeX3 code

Is it possible for the JavaScript syntax highlighter to be extended to color code LaTeX3 code? With the current color coding scheme the code is very difficult to follow.
9
votes
2answers
248 views

Markdown of code blocks still doesn't work after numbered lists? [duplicate]

Possible Duplicate: Why do code snippets not work after lists? When a code block is directly after a list (bullet, or numbered) it doesn't work unless you have 8 spaces: bullet FUNCTION {...
0
votes
0answers
55 views

Code following a list doesn’t work [duplicate]

Possible Duplicate: Why do code snippets not work after lists? If I add code listings directly after a list it doesn’t work, I guess this is a bug … cause if theres some other text between it ...
6
votes
1answer
165 views

Automatic rendering of code provided in questions/answers?

Do people here compile/render/upload images themselves? Would it be possible to have an automatic rendering engine? (Something like the MathJax stuff they have on Math.SX, but with some real TeX ...
19
votes
1answer
218 views

Why do code snippets not work after lists?

I want to insert a code snippet after a list but the code snippet is not a part of the list item. This is the first item. This is the second item \documentclass{article} \begin{document} \end{...
29
votes
1answer
7k views

How do I mark code blocks?

How do I mark code blocks, and how do I adjust syntax highlighting? Can I emphasize pieces of my code block? And how do code blocks in lists and blockquotes work?
5
votes
3answers
407 views

Text immediate following double backslashes is highlighted as Macro inside a code block

I just saw this at Herbert answer to this question: if a code block contains \\ directly followed by a text then the syntax highlighting marks it as macro. This is quite irritating and should be fixed....
22
votes
1answer
6k views

How do I mark inline code?

How do I mark my inline code in questions and answers, and how can I mark code in comments?
30
votes
2answers
973 views

Easy way to copy code block?

Wouldn't it be cool to right click anywhere in a code block and have the option "copy code block to clipboard"?
3
votes
2answers
181 views

Absurd “code markup” behavior…

Can anyone explain how does this silly code markup behave? Help is insufficient, because I'm absolutely unable to create a line break in marked code block, whether in regular 4 spaces indent, whether ...
6
votes
1answer
158 views

Markdown adds redundant empty lines to listings in lists

Markdown seems to duplicate empty lines in listings that appear inside a list: Single empty line is duplicated Single empty line below: Single empty line above. Two empty lines display correctly ...