Adding code in box on the forum

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 3K views
gfd43tg
Gold Member
Messages
949
Reaction score
48
Hello,

I am taking MATLAB this summer and will be having a number of questions on this forum about all my bugged code when I make it. Before I begin, I was wondering how do people add those ''code boxes'' when they make a thread that shows all their code within the post.

Thanks

Example: Post #2 in https://www.physicsforums.com/showthread.php?t=756681
 
Physics news on Phys.org
Just use [noparse]
Code:
[/noparse] tags:

[noparse]
Code:
Matlab
   code
[/noparse]

displays as

Code:
Matlab
   code
 
  • Like
Likes   Reactions: 1 person