Questions tagged [latex]

LaTeX is a macro package implemented on Donald Knuth's TeX programming language and is used primarily for creating high quality written documents. The "TeX - LaTeX" community in StackExchange (https://tex.stackexchange.com) is specifically dedicated to questions about LaTeX, TeX and other related technologies.

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

9090 questions
566
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
  • 5,703
  • 3
  • 14
  • 8
512
votes
8 answers

How to wrap text in LaTeX tables?

I am creating a report in LaTeX which involves a few tables. I'm stuck on that as my cell data in the table is exceeding the width of the page. Can I somehow wrap the text so that it falls into the next line in the same cell of the table? Is it…
Arnkrishn
  • 27,376
  • 39
  • 108
  • 127
459
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
  • 23,394
  • 39
  • 132
  • 200
389
votes
6 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
  • 4,307
  • 3
  • 18
  • 21
335
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,737
  • 4
  • 22
  • 23
321
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
  • 499,078
  • 194
  • 614
  • 709
313
votes
14 answers

How to write LaTeX in IPython Notebook?

How can I display LaTeX code in a IPython Notebook?
KostasA
  • 4,174
  • 5
  • 17
  • 26
297
votes
12 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
  • 17,191
  • 17
  • 78
  • 103
282
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
  • 16,448
  • 25
  • 85
  • 133
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
  • 98,937
  • 27
  • 203
  • 258
205
votes
3 answers

Source code highlighting in LaTeX

I need to highlight source code in LaTeX. The package listings seems to be the best choice for most use-cases and for me it was, until now. However, now I need more flexibility. Generally, what I’m looking for is a real lexer. In particular, I need…
Konrad Rudolph
  • 482,603
  • 120
  • 884
  • 1,141
205
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
  • 8,274
  • 18
  • 64
  • 94
203
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 준영
  • 119,377
  • 159
  • 417
  • 655
201
votes
10 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
  • 5,927
  • 7
  • 33
  • 38
200
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,017
  • 2
  • 12
  • 3
1
2 3
99 100