The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
3answers
118 views

Enclose Code in Latex with single user-defined command

I am using the following to enclose my code in a box and I like the formatting but I have the problem that everytime I have to write a lot of stuff. Before the begin{document} I have defined: ...
0
votes
0answers
29 views

How to center SAS code in Beamer [duplicate]

I wish to give SAS code in my presentation, but the code appears on the left side of the page. Any idea how to center it? \documentclass{beamer} \usepackage{listings} \begin{document} ...
2
votes
1answer
90 views

How to set up listings for use code from Arduino?

Well, I'm creating notes from a course of Arduino in LaTeX and I was reading about the listingspackage and I want to use it with the code of the exercises of the course. I know Arduino uses a language ...
0
votes
0answers
48 views

A problem about typesetting Mathematica code [duplicate]

I want to typesetting the words as below: My code: \documentclass[b5paper,UTF8]{article} \usepackage{graphicx} \usepackage{geometry} \usepackage{fancyhdr} ...
6
votes
1answer
127 views

Weird overful vbox message when code and image are overlaid in beamer

See the following code. The first two frame contents (first one code, second one image) do not produce any overfull vbox message. \documentclass{beamer} \usepackage{filecontents} ...
1
vote
1answer
39 views

'Errors' using the minted VHDL environment

I recently started university, and was annoyed to find out, we had to do our reports and assignments in LaTeX... until I learned how to use it! I went from hating it to loving it in one day. :) But ...
7
votes
2answers
99 views

Reuse command portion in LaTeX

I defined several new code environments (using listings' lstnewenvironment); they all share the same attributes except one (the language used). For example: \documentclass[a4paper,12pt]{book} ...
2
votes
2answers
50 views

How can a verbatim environment be centered using a basic LaTeX installation?

I want to centre some verbatim text in a reasonable way using only a basic LaTeX installation, i.e. the packages listings and fancyvrb are not available. \documentclass{article} \begin{document} ...
2
votes
1answer
37 views

htlatex inserting environment in verbatim

I want to get htlatex to put some text into my HTML file verbatim. The problem is that it keeps redo-ing my spacing. So, for example, I use a cf.cfg like this. \Preamble{html} \ConfigureEnv{tawny} ...
2
votes
2answers
71 views

Where to find the family code for a custom font

Is there a reference list for the encoding of fonts in LaTeX? A place where one can search for a specific font and get the relevant code that represents it. Some of them are not even logical, for ...
3
votes
1answer
141 views

How can I replicate the syntax-highlighting style of the Kate editor?

I am trying to add a java and c++ code in a LaTeX document. I am using listings package and I will define a different style for each language using \lstdefinestyle{myStyle}{<options>}. What I am ...
1
vote
1answer
59 views

Turning off/on numbering when using mcode

I have an appendix with a full Matlab script, quoted verbatim, numbered and coloured as I want. However, I want to quote about 10 lines of it as a figure in the body of my report, and since I will ...
0
votes
1answer
68 views

How to force wrap MATLAB code

I'm including a MATLAB script as an appendix in a report I'm writing, I'm using mcode to import it, but some of the lines are longer than the width of my paper. In my master document I have: ...
0
votes
1answer
97 views

How can I include the R source code in the appendix?

I really have no idea how to include the R code into latex, so I only can provide my R code. I would like to put it in the appendix. I am really looking forward to your help. Thx! The codes will show ...
1
vote
0answers
95 views

Dummy code box in LaTeX

I am not used to work in TeX and I need to write a dummy code box like in this style. I am not entirely sure how to replicate this style. I found some code boxes, but not in this structure that I want ...
5
votes
1answer
88 views

Apostrophe breaks comments in lstlisting

I defined a command to simplify the writing of code listings of (pseudo-) C code: \lstdefinestyle{c}{ language=C, basicstyle=\small\sffamily, numbers=left, numberstyle=\tiny, frame=L, ...
1
vote
0answers
44 views

How can insert a full-width listing in a two-column document? [duplicate]

I'm new to LaTeX; I'm using IEEE format. How can I effectively add Java code snippets in one full-width column?
5
votes
1answer
109 views

Correctly highlighting custom html tags in listings

Problem statement I have several code listings containing HTML markup in my latex files. These listings contain multiple custom html tags (created in combination with corresponding AngularJS ...
2
votes
1answer
74 views

How to only have similar font in latex to that of a Mathematica codes

After I used the answer posted to this question of mine: How to show similar display of codes of different programming languages in LaTeX, it seems that the package and styles I use have problems with ...
2
votes
1answer
41 views

How to page break a code print in a latex document into more pages instead of one

After this question How to show similar display of codes of different programming languages in LaTeX which prints a code in a standalone pdf document (for instance 1000 lines of code in only one pdf ...
4
votes
2answers
169 views

Saving language preferences for inputing source code

Using the listings package, I am trying to input a Java source file into my document using a specified, user-defined style. This works just fine if I have the specified style definition in the same ...
13
votes
1answer
636 views

How to show similar display of codes of different programming languages in LaTeX

I am very new to LaTeX and I am writing my thesis. In a chapter, I want to show my codes, which are in Mathematica. I use the listings package as follows: \documentclass{article} ...
4
votes
1answer
96 views

Command \color already defined

I have the following code in my latex command . \newcommand{\color}[1]{\lceil (#1+2)^2/2\rceil} After that I have inserted the following command for insertion of code in LATEX documents . ...
4
votes
0answers
54 views

Minted inside tabular

I know this question has been asked before, but it didn't quite solve my issue. (How to embed a minted environment inside a tabular environment?) The described workaround (bringing \end{minted} to a ...
6
votes
1answer
126 views

Macro, new command or new environment for code?

I am using the listings package to typeset code. I have defined a custom style using \lstdefinestyle{verbo} and then typeset code in a lstlisting environment as in the following MWE. ...
2
votes
0answers
300 views

pgf-Tikz code generator for Latex

LatexDraw is a PSTricks code generator for Latex. LatexDraw generates PSTricks codes of any fugure are drawn. Are there any such tools that will generate pgf-tikz code of any figure for latex? If ...
7
votes
3answers
188 views

Simulating a figure-environment

Is it possible to place two figure environments evenly side-by-side at the same horizontal height with some text between them ? In this question of mine, a partial solution has been provided to me, ...
2
votes
1answer
188 views

How to achieve short journal names in this bibliography style using Biblatex package?

I use Zotero to get references from the web, and then export them into LaTeX using biblatex format using this workflow. I am fine with the style of bibliography and its output as shown below , but I ...
2
votes
0answers
66 views

Different colours for each argument and value in listings

This recent question (Print blue brackets in one language and black in another) made me come up with (up to) two more questions regarding the listings package: Is there an option similar to opstyle ...
4
votes
1answer
75 views

Print blue brackets in one language and black in another

In addition to that question i wonder if it is possible to have that settings for one language and default settings for another ? How to highlight operators and brackets in a C listing? ...
7
votes
3answers
207 views

How to construct the following table with title in LaTeX?

I would like to construct a table look like the picture below: The code below represents my best attempt so far (the words in the table don't really mean anything): \resizebox{9cm}{!} { ...
0
votes
1answer
96 views

Latex Listing Source shift right side?

I am using Latex listings package to add the source code in my document, but the problem is on the left side some character is missing as showing in the picture. \usepackage{listings} Source ...
1
vote
1answer
74 views

Code not wrapping in listings even though breaklines=true [closed]

I read that enabling breaklines in listings will make the included code wrap, but it does not in my case. Maybe something is interfering with this function? Full code is shown below: ...
1
vote
0answers
31 views

How to format a large text containing special Characters and breaklines? [duplicate]

I have this rather long text which is the output of a several console inputs. I'd like to have the text as it is as of right now. Here a link to the raw text since I didn't want to include it in this ...
5
votes
1answer
83 views

How to exclude code from spell-checking in LyX?

I'm writing a technical document in LyX (version 2.0.5.1 for Windows) and I'm using Hunspell for spell checking. Throughout the text, there are code snippets which I've formatted with the "Code" text ...
3
votes
1answer
83 views

Color of comments affects frame color in listings [duplicate]

I use listings package with single frame around it, when i place long comments in my code color of comments affects frame color. Frame around lines with comments are green. I want frame to be black, ...
3
votes
2answers
65 views

“Extra” unwanted first page

I've got a problem that creates an extra first page, that contains one sentence... I can't find the problem to this. \documentclass[a4paper,onecolumn]{report} \setlength{\parskip}{4pt} ...
3
votes
1answer
39 views

How can I put an environment within a subsection?

I have this code, but the environment is put at the top of the page above the sections. \documentclass[a4paper,11pt]{article} \usepackage[utf8]{inputenc} \usepackage[italian]{babel} ...
9
votes
3answers
3k views

Writing source code in LaTeX as text

Is there a package that allows source code in LaTeX as text? I rather not use listings package because the code takes too much space. Copy/paste is tedious because the spaces are not preserved.
2
votes
0answers
48 views

Page could not be rendered error while viewing YAP using listings package [closed]

I cannot view the DVI output in YAP, as it shows the below error (The page could not be rendered) if I use the listings package. Could any one suggest me how to solve this error?
1
vote
0answers
194 views

Get TeX to work with jsPdf [closed]

jsPdf is a Javascript library that creates pdf documents on the fly. This is very useful to me as I have a familiarity with Javascript and I want to be able to do this operation server-side. ...
2
votes
0answers
76 views

Latex makes some characters big [closed]

Tried out the package for color coding Python code and when I did, the fonts in the entire document suddenly started acting weird. s, a, o and some other letters are typeset larger than others and the ...
1
vote
0answers
79 views

Separate LaTeX 3 code from 'normal' \newcommand [closed]

Consider the example from here: \documentclass{article} \usepackage{amsmath} \usepackage{siunitx} \ExplSyntaxOn \newcommand*\calculation[1]{% \dfrac{\SI{#1}{\g}}{\SI{\total}{\g}} \cdot ...
3
votes
1answer
631 views

Rendering VHDL in latex

I have a VHDL code which I want to insert into my latex document. I need a package that takes care of syntax highlighting, indentation etc. Is there a package which serves this purpose?
0
votes
0answers
91 views

Indented Code Blocks Have no Background Color When Generating PDF

As the title says, when I run: pandoc -o book.pdf book.md The code blocks show up in monotype font but with no background color. I've also tried all styles using --highlight-style with no success. ...
1
vote
0answers
31 views

How to organise code [duplicate]

At the moment I write macros without breaking them up, like so: \NewDocumentCommand{\HC}{ o }{\IfNoValueTF{#1} {\emph{HC}\xspace}{\emph{HC}, p.#1\xspace}} This obviously gets pretty hard to follow ...
24
votes
2answers
909 views

How to understand and write LaTeX code?

LaTeX is like a language. In order to write LaTeX code I have to understand the "word" and the "sentences structure". I have searched on wiki, some LaTeX books, but they just give the LaTeX command, ...
2
votes
0answers
157 views

Show vertical line for indentation of LaTeX code listing [closed]

Is it possible to enable a continuous vertical line on code to show indentation? I am trying to use the following code from a stackoverflow question. Originally, the documentation suggests using ...
6
votes
1answer
83 views

What is faster? To \RequirePackage{foo} or to check if the user has actually request it and \Require it if so?

I'm asking this because the package lineno has a thing that leaves a lot of commands in the .aux file (see here)... and I'm not sure if I should \newcommand these to empty or if I should just load the ...
1
vote
0answers
475 views

Change font style for \texttt [closed]

I am afraid if this is a repeat question. I have checked the following links for any hints: Change font size of \texttt globally? Using same font for \texttt and \Verb The question is simply. I ...