Make LaTeX table caption same width as table?

Actually there is a more legal way to do this using captions package option width. For global effect \usepackage[width=.75\textwidth]{caption} For local effect only in current environment: \usepackage{caption} \captionsetup{width=.75\textwidth} More info in caption package doc: https://www.ctan.org/pkg/caption?lang=en http://mirrors.ctan.org/macros/latex/contrib/caption/caption-eng.pdf (direct link to PDF subject to change)

Center Latex lstlisting

Instead of using linewidth you should consider to use xleftmargin and xrightmargin (cf. texdoc listings, Chapter 4.10). The following code works without any center or minipage environment: \lstset{ caption=Descriptive Caption Text, basicstyle=\footnotesize, frame=tb, xleftmargin=.2\textwidth, xrightmargin=.2\textwidth } \begin{lstlisting} printf(“this should be centered!”); \end{lstlisting}

Maximum nesting level of lists in Latex

Solution using enumitem package If you do not have the version 3 of the enumitem.sty installed, then download enumitem.sty manually and place it into your project’s folder. For itemize lists, add the following to the preamble of your document: \usepackage{enumitem} \setlistdepth{9} \setlist[itemize,1]{label=$\bullet$} \setlist[itemize,2]{label=$\bullet$} \setlist[itemize,3]{label=$\bullet$} \setlist[itemize,4]{label=$\bullet$} \setlist[itemize,5]{label=$\bullet$} \setlist[itemize,6]{label=$\bullet$} \setlist[itemize,7]{label=$\bullet$} \setlist[itemize,8]{label=$\bullet$} \setlist[itemize,9]{label=$\bullet$} \renewlist{itemize}{itemize}{9} For the other list … Read more

How do I cite the title of an article in LaTeX?

@Norman, and the various commenters, are correct in that it would be difficult to do this with bibtex and other tools. But, there is an alternative. Biblatex does allow this through the command \citetitle. Also, if you really want to, the formatting drivers in biblatex are easily readable and modifiable, but only if you feel … Read more

Vim syntax highlighting with $ and lstlisting’s lstinline

Let’s finally solve this issue once and for all! I mailed Charles E. Campbell, the maintainer of tex.vim, suggesting he’d add highlighting rules for the listings package. However it turns out lacking support for the listings package in tex.vim is actually intentional. The reasoning can be found :h tex-package. In short, you’re supposed to create … Read more

Adding full page figures in Latex, how?

\begin{figure}[hbtp] h = here b = botom t = top p = page of floats Algorithm will try the current position in document first, then bottom, then top and then on a seperate page. If you just specify ‘h’ you will force placement where the figure command is in the document. The order is encoded … Read more