Skip to main content

Questions tagged [code]

{code} is about using LaTeX to format and display source code. For questions about TeX itself as a programming language, use the {programming} tag.

Filter by
Sorted by
Tagged with
0 votes
2 answers
115 views

so on Math Stack Exchange when you compile $\rlap \smile {\dot{}\dot{}}$ it shows up as a smiley (it doesn't work here too) something like this one: but if I try to use this code in overleaf it ...
T﹏T's user avatar
  • 135
3 votes
1 answer
88 views

My latex file reads \documentclass[stu]{apa7} \usepackage[american]{babel} \author{student name} \title{How to cite references in \LaTeX} \begin{document} \maketitle The article body includes \cite{...
Ali Olaikhan's user avatar
4 votes
3 answers
323 views

I want to obtain the table in the first image but i don't know how to. All I could do is in image I use overleaf to write the code. I am writing a on a two columns page and want to center the table on ...
Alexandra Spiridon's user avatar
6 votes
1 answer
250 views

Minted loads code from a file. The file contains code in two languages ​​TeX and Lua. I found this but it doesn't work: minted - how to highlight html also, when language "twig" is selected ...
Youra_P's user avatar
  • 1,640
0 votes
0 answers
50 views

WinEdt is (as far as I detected) the only LaTeX-Editor for Windows which may really be called the (in many regards more advanced) successor of the outdated King of Editors (= TeXnicCenter). For ...
user avatar
2 votes
1 answer
66 views

There exists an extra space behind the framed box if I type in an Enter behind the \fbox{}. Here are two MWEs. Code 1: \documentclass{article} \begin{document} \fbox{Demo}This is a sample. \end{...
SparseMatrix's user avatar
0 votes
1 answer
57 views

I'm quite new to latex, and lately I started to have some problems with apa citing. here is the code of my preamble and the portrait of the article. %DISEÑO Y FORMATO DE DOCUMENTO \documentclass[...
LFA C.C's user avatar
  • 15
0 votes
1 answer
336 views

I am new to LATEX and I am writing a presentation in it. I am using overleaf subscription and I have searched the symbol there and also on detexify kirelabs but I couldn't find the code of this symbol....
Avenger's user avatar
  • 225
1 vote
2 answers
67 views

The following code \left[\begin{smallmatrix}a&a\\p&q\end{smallmatrix}\right] gives 2 by 2 matrix where the first row is a a and the second row is p q. How to have only a in the first row and ...
Ali Olaikhan's user avatar
1 vote
0 answers
23 views

I have some python code that I cannot center in the middle of the page as if you would do \centering. But none of the center commands work. this is my code. Apologies for the long preamble, whenever I ...
user avatar
4 votes
1 answer
141 views

I use lstlisting to show my code in the appendix of my rapport. I have problems with changing the color of the functions and types of data types. I hope to get the following result. But I get the ...
Egelund48's user avatar
0 votes
1 answer
139 views

Ever since March, I've been redefining \FancyVerbFormatLine and passing that as formatcom= in order to change the default text color for minted. Here is a minimal example that does so: \documentclass{...
The Compiler's user avatar
0 votes
1 answer
77 views

I know that (\x)^n means '\x raises to the power of n', but I have just found at least two alternative ways of coding this thing, they are the following, [pow(\x, n)] and [\x*\x*...*\x for n times]. I ...
Hector Lai's user avatar
2 votes
2 answers
193 views

I am using cryptocode package to write some games in Cryptography. My question is if we can actually write a line of the code without numbering, but being alligned just above the numbers of the ...
Chris's user avatar
  • 347
1 vote
1 answer
64 views

PROBLEM / QUESTION I want to type code with lstlisting and tcolorbox, which I can do by having 2 enviornments, but I would rather have only 1 environment. I know that I could probably imitate a ...
Agente 156's user avatar
0 votes
1 answer
598 views

I am trying to compile and test a file in Latex/Domino using a text file in Notepad that has a script/code in it. Is it possible to convert the notepad txt file to tex somehow? Could a txt file be ...
Sierra's user avatar
  • 1
0 votes
0 answers
39 views

I can't figure out a way to incorporate colored dot notation methods into my custom Python theme with the listings package of LaTeX. For example, consider the following code: 1 import matplotlib....
Lii's user avatar
  • 1
1 vote
1 answer
87 views

So I have some code blocks like the followings \begin{lstlisting}[language=Python, caption={Ejecución de prueba}] altura_lista = altura.tolist() peso_lista = peso.tolist() w, b = train(altura_lista, ...
6Cript's user avatar
  • 11
0 votes
0 answers
25 views

The latex code shown below is not running for me. Error : Extra alignment tab has been changed to \cr \begin{equation}\nonumber {\small G=\begin{pmatrix} \sqrt{\phi X_{1}X_{3}} & -\...
DHIVYADHARSHINI B RA2333001011's user avatar
12 votes
3 answers
3k views

Consider Gabriel's Horn: which, mathematically speaking, is the curve y=1/x over the interval [1,∞] revolved about the x-axis. It is interesting because though it contains a finite volume, its ...
DDS's user avatar
  • 11.1k
3 votes
1 answer
285 views

I came across a scientific article that features beautifully formatted code, as shown in the image below. I'm interested in using a similar style for my own article, but I'm not sure how to achieve ...
drobilc's user avatar
  • 161
-3 votes
1 answer
106 views

How to write the image below in latex?:
muzan muzan's user avatar
1 vote
0 answers
58 views

I have the MWE below. However, the keyword \getit is not highlighted. How to turn it blue? \documentclass[12pt]{memoir} \usepackage{xcolor} \usepackage{listings} \lstset{ basicstyle=\...
Brasil's user avatar
  • 1,502
3 votes
1 answer
61 views

I have been trying to insert an Octave function in my paper but when I build the pdf the letters are all turned into greek.(The rest of the paper is written in greek). What is even weirder is that ...
I Like Algebra's user avatar
0 votes
1 answer
134 views

I am following the format used by this answer to color a json listing on my document, but I noticed that in a list of strings and a list of numbers, only the first element gets colored properly. Is ...
nottelling's user avatar

1
2 3 4 5
16