Skip to main content

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.

Filter by
Sorted by
Tagged with
1 vote
0 answers
48 views

Code in comment overflows page horizontally

Look at my comment under this answer. My OS is an up-to-date Archlinux, and the browser is qutebrowser.
Enlico's user avatar
  • 2,612
5 votes
1 answer
145 views

How to properly edit code blocks when going from “4 spaces” to “3 backticks”?

As you all know, there are two ways to format blocks of code, four leading spaces in every line vs. three backticks around the code. Many new users know about the first method, but not the second. ...
Ingmar's user avatar
  • 6,700
0 votes
0 answers
71 views

Run the codes in posts with a button [duplicate]

Recently I saw a post on StackOverflow in which a code snippet could be run by pressing a button. https://stackoverflow.com/questions/44380104/c-drawing-scatter-plot-on-ms-charts It was indeed really ...
enthu's user avatar
  • 3,795
4 votes
1 answer
63 views

Problem writing the sequence \@ in inline <code>...</code>-blocks

When typing answers in an edit-box of the TeX-LaTeX-StackExchange website, which is based on markdown, then from time to time I introduce control-sequence-tokens/sequences of inline-code not via ...
Ulrich Diez's user avatar
  • 29.6k
0 votes
0 answers
89 views

Using this interface [closed]

I am unable to copy and paste a block of code from MikTex here. It shows up when I copy, then disappears when I click post your question. Is that supposed to be what happens. It's kind of long to ...
user34241's user avatar
  • 421
18 votes
2 answers
441 views

The CommonMark diary

Friends, The StackExchange network decided to switch to CommonMark. The last time SE decided to make some changes, we experienced a lot of problems. Worse, any official position from the Powers That ...
Paulo Cereda's user avatar
  • 44.3k
0 votes
0 answers
38 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[...
user avatar
4 votes
2 answers
120 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 ...
Peter Wilson's user avatar
  • 28.2k
7 votes
1 answer
102 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 ...
CarLaTeX's user avatar
  • 64.4k
10 votes
2 answers
156 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 ...
koleygr's user avatar
  • 20.2k
0 votes
0 answers
82 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 ...
Moltimor 's user avatar
5 votes
0 answers
766 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 (&zwnj;&#8203; ...
bers's user avatar
  • 5,444
8 votes
4 answers
391 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. ...
Gaussler's user avatar
  • 12.9k
11 votes
1 answer
425 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{...
yo''s user avatar
  • 51.5k
11 votes
1 answer
545 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 ...
bodo's user avatar
  • 6,258
14 votes
1 answer
193 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 ...
Manuel's user avatar
  • 27.2k
9 votes
1 answer
113 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 ...
Adam Liter's user avatar
  • 12.7k
7 votes
0 answers
101 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 ...
barbara beeton's user avatar
6 votes
1 answer
96 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 ...
math's user avatar
  • 3,185
13 votes
1 answer
223 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 ...
Denis Bitouzé's user avatar
11 votes
1 answer
237 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 ...
barbara beeton's user avatar
3 votes
1 answer
226 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 ...
ppr's user avatar
  • 9,054
4 votes
0 answers
64 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 ...
Forkrul Assail's user avatar
3 votes
1 answer
49 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 ...
dustin's user avatar
  • 18.7k
5 votes
0 answers
70 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] ...
Scott H.'s user avatar
  • 11.1k
16 votes
4 answers
190 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. ...
yo''s user avatar
  • 51.5k
31 votes
4 answers
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 ...
Ignasi's user avatar
  • 137k
0 votes
1 answer
687 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 \...
Jonas Stein's user avatar
  • 8,929
6 votes
1 answer
79 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 ...
barbara beeton's user avatar
4 votes
1 answer
171 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 ...
Maesumi's user avatar
  • 9,109
10 votes
2 answers
127 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 ...
Brent.Longborough's user avatar
14 votes
1 answer
464 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 ...
Holle's user avatar
  • 5,354
23 votes
0 answers
207 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.
yannisl's user avatar
  • 118k
9 votes
2 answers
255 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 {...
Yossi Farjoun's user avatar
0 votes
0 answers
56 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 ...
Tobi's user avatar
  • 56.6k
6 votes
1 answer
173 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 ...
Stéphane Gimenez's user avatar
20 votes
1 answer
239 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{...
Display Name's user avatar
  • 47.1k
31 votes
1 answer
12k 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
3 answers
491 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....
Martin Scharrer's user avatar
23 votes
1 answer
9k 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?
33 votes
2 answers
1k 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"?
Seamus's user avatar
  • 73.6k
3 votes
2 answers
185 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 ...
user avatar
7 votes
1 answer
189 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 ...
Konrad Rudolph's user avatar