Questions tagged [latex]

LaTeX is a programming language used primarily for creating high quality academic written documents, slideshows and posters. LaTeX questions are often a better fit for the sister site "TeX - LaTeX" (https://tex.stackexchange.com). This includes questions on tools and other languages producing LaTeX code. The JavaScript libraries MathJax and KaTeX are off-topic on "TeX - LaTeX" and should be asked on Stack Overflow instead (and tagged accordingly).

LaTeX is a macro package implemented on Donald Knuth's TeX programming language and is used primarily for creating high quality written documents. The underlying TeX system is Turing complete and LaTeX inherits this property, making it possible (but rarely advisable) to perform arbitrary computations in LaTeX; more interestingly it makes it possible to get any layout scheme you can describe precisely.

Which site to use for LaTeX questions?

As LaTeX is primarily used for simply writing documents many people characterize it as a "markup language" (like HTML) and site selection criteria have been discussed several times. See:

The Stack Exchange site dedicated to LaTeX is tex.stackexchange.com, which is probably a better place to ask any LaTeX-related questions than here on Stack Overflow. The other site also covers TeX and other related technologies.

Other resources

11140 questions
681
votes
6 answers

Inserting a PDF file in LaTeX

I am trying to insert a PDF or doc file as an appendix in my LaTeX file. Do you know how I can do this?
Guido
  • 6,853
  • 3
  • 16
  • 9
625
votes
9 answers

How to wrap text in LaTeX tables?

I am creating a report using LaTeX, however, the cell data in the table is exceeding the width of the page. How can I wrap the text so that it falls into the next line within the same cell of the table? Is the solution somehow related to specifying…
Arnkrishn
  • 29,828
  • 40
  • 114
  • 128
512
votes
9 answers

Inserting code in this LaTeX document with indentation

How do I insert code into a LaTeX document? Is there something like: \begin{code}## Heading ## ... \end{code} The only thing that I really need is indentation and a fixed width font. Syntax highlighting could be nice although it is definitely not…
sixtyfootersdude
  • 25,859
  • 43
  • 145
  • 213
459
votes
5 answers

Is there any way I can define a variable in LaTeX?

In LaTeX, how can I define a string variable whose content is used instead of the variable in the compiled PDF? Let's say I'm writing a tech doc on a software and I want to define the package name in the preamble or somewhere so that if its name…
Andrea Giovacchini
  • 5,027
  • 3
  • 21
  • 23
381
votes
13 answers

How to order citations by appearance using BibTeX?

By default (using the plain style) BibTeX orders citations alphabetically. How to order the citations by order of appearance in the document?
Brendan
  • 18,771
  • 17
  • 83
  • 114
369
votes
4 answers

How do you change the document font in LaTeX?

How do you change the font for the whole document to sans-serif (or anything else)?
nickf
  • 537,072
  • 198
  • 649
  • 721
354
votes
15 answers

How to write LaTeX in IPython Notebook?

How can I display LaTeX code in a IPython Notebook?
KostasA
  • 5,204
  • 6
  • 23
  • 29
343
votes
8 answers

LaTeX source code listing like in professional books

How should a latex source code listing look like to produce an output like in known books, for example one for the Spring Framework? I've tried with the latex listings package but wasn't able to produce something that looked as nice as the one…
Mork0075
  • 5,895
  • 4
  • 25
  • 24
301
votes
4 answers

git + LaTeX workflow

I'm writing a very long document in LaTeX. I have my work computer and my laptop, and I work on them both. I need to keep all the files synchronized between the two computers, and also would like to keep a revision history. I chose git as my DVCS,…
Ivan
  • 19,560
  • 31
  • 97
  • 141
268
votes
8 answers

Tools for making latex tables in R

On general request, a community wiki on producing latex tables in R. In this post I'll give an overview of the most commonly used packages and blogs with code for producing latex tables from less straight-forward objects. Please feel free to add any…
Joris Meys
  • 106,551
  • 31
  • 221
  • 263
259
votes
3 answers

Set margin size when converting from Markdown to PDF with pandoc

I have created an RMarkdown file in RStudio and managed to knit it with knitr into an HTML and .md file. Next, I used pandoc to convert the .md file into a PDF file (I get an error if I try and convert from the .html file). However, the PDF that…
mchangun
  • 9,814
  • 18
  • 71
  • 101
245
votes
4 answers

How to write URLs in Latex?

How do you write a URL in Latex? The subscripts and everything else make the font look very strange when it compiles.
danzig
  • 2,467
  • 2
  • 15
  • 3
225
votes
18 answers

Latex rendering in README.md on Github

Is there any way to render LaTex in README.md in a GitHub repository? I've googled it and searched on stack overflow but none of the related answers seems feasible.
user90593
  • 2,465
  • 3
  • 14
  • 11
225
votes
1 answer

Referring to a table in LaTeX

How can you refer to a table number such that you get Table 7 for instance? Sample data Table \ref{table:questions} lorem lorem ipsun. \begin{table} \label{table:questions} \begin{tabular}{| p{5cm} | p{5cm} | p{5cm} |} -- cut…
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
220
votes
11 answers

Getting the error "Missing $ inserted" in LaTeX

I try to write the following in latex: \begin{itemize} \item \textbf{insert(element|text)} inserts the element or text passed at the start of the selection. \item \textbf{insert_after(element|text)} inserts the element or text passed at the…
Espen Herseth Halvorsen
  • 6,175
  • 7
  • 36
  • 38
1
2 3
99 100