latex

Latex: center text within listing

How do I center text within a listing in Latex? Or another way not using listing. (Need a box with monospace font) ...

How do I make multi-page landscape tables in LaTeX

...

Is there a LaTeX command that will log to the output/error console?

I have created a LaTeX \todo{} command which outputs todo notes in the margin (following the [nice marginpars example here][1]): \newcommand\todo[1]{\marginpar{#1}} However, I'd really like to output a list of all my todo notes to the output console. I had written a trivial python script to parse .tex files to do so, but have since sw...

Force a maximum number of pages in LaTeX

Is there a way to give LaTeX a hint on the maximum number of pages I would like the document to have, so LaTeX at least tries to not exceed this maximum if possible? ...

write c++ in latex, noob latex question

maybe is a noob question but i can't find the solution in the web, i need to write C++ in Latex. I write C$++$ but the result is like crap, the signs are too big and there is too much space between C and the first plus sign. Previously i needed to write the sharp symbol for C#....c$\sharp$ it also looks like crap but with a escape chara...

Algorithm that spans two pages in Latex

i have a long algorithm that i need to put in a report. i am using latex for this report. but due to the length of the algorithm it is more than one page but i cannot get it to fit into the next page. i am new to latex. can someone tell me how to do this? i am new to latex. ...

Undefined control sequence at first line of a document

\documentclass{book} \usepackage{amsmath} \usepackage[german]{babel} \usepackage{amssymb} \usepackage{amsxtra} \usepackage[dvips]{epsfig,psfrag} \usepackage{listings} \newcommand{\refchapter}[1]{Kapitel~\ref{#1}} \newcommand{\refsec}[1]{Sektion~\ref{#1}} \newcommand{\refeqn}[1]{Gleichung~(\ref{#1})} \newcommand{\reffig}[1]{Abbildung~\r...

Why does Tex/Latex not speed up in subsequent runs?

I really wonder, why even recent systems of Tex/Latex do not use any caching to speed up later runs. Every time that I fix a single comma*, calling Latex costs me about the same amount of time, because it needs to load and convert every single picture file. (* I know that even changing a tiny comma could affect the whole structure but o...

Resize matrix in LaTeX beamer

Hi I was wondering how to resize matrices in a beamer environment. Currently I am writing the following code: \begin{align*} \left( \begin{array}{ccccccc} 0 & 1 & & & & & \\ -1 & 0 & & & & & \\ & & 0 & 1 & & & \\ & & -1 & 0 & & & \\ & & & & \ddots & & \...

Latex multicolumn problems

Hi I am trying to build a table in latex where five columns have a common title centered above the columns. But the generated table does not appear as expected. (the common title is left justified instead of centered above the columns) The code looks like \documentclass{article} \begin{document} \begin{table} \centering \begin{tabul...

How to include multiple tables programmaticaly into a Sweave document using R

Hello, I want to have a sweave document that will include a variable number of tables in. I thought the example below would work, but it doesn't. I want to loop over the list foo and print each element as it's own table. % \documentclass[a4paper]{article} \usepackage[OT1]{fontenc} \usepackage{longtable} \usepackage{geometry} \usepac...

How do I find latex source-code?

Good morning (PST). Does anyone know where I could find the code that LaTeX uses to typeset inside the tabular environment? In the past I have looked in style files but I don't know where to find intrinsic LaTeX commands. -Thank you so much. ...

Publishing toolchain

Hello all, I have a book project which I'd like to start sooner than later. This would follow an agile-like publishing workflow, i.e: publish early and often. It is meant to be self-publsihed by me and I'm not really looking to paper-publish it, even though we never know. If I weren't a geek, I'd probably have already started writting ...

Custom command for '\begin{environment}...\end{environment}'

To enter a bit of dialogue using the screenplay package, I have to use \begin{dialogue}{Johnny} Some dialogue. \end{dialogue} \begin{dialogue}{Jane} I see. \end{dialogue} It gets a bit tedious after a while. Is it possible to specify a custom command so that I can use something like \dialogue{Johnny} Some dialogue. \dialogue{Jane} I...

Need opinions on LaTeX and ever upgrading

Hi, I've been using LaTeX since 2005 with the TeXLive distribution and I've been upgrading as each new TeXLive distribution comes out. In the recent years I noticed an increase in new packages, updated packages and in one instance a new package bearing a different name replacing an old one by the same package author. A LaTeX document whi...

Hide caption in wrapfigure

\begin{wrapfigure}{l}{0.3\textwidth} \begin{center} \includegraphics[width=0.2\textwidth]{one} \end{center} \caption{} \end{wrapfigure} How can I hide label 'Figure 1:' below inserted image? ...

Best method of including an abstract in a latex 'book'?

Hello there. I've been looking for the answer to this question for a while now but can't seem to find it, so I'm hoping someone on here can help me. I'm writing up a thesis in Latex, and really like the \frontmatter, \mainmatter and \backmatter ability when using the "book" environment. However I need to add an abstract and the \begin...

How to make last row of each table's part unfinished in latex longtable?

I have a table that automatically stretched over several pages by longtable package. \begin{longtable}{| l | l |} \hline A & B \\ \hline \endfirsthead \multicolumn{3}{l}{Table \thetable{} -- finishing} \\ \hline \endhead a1 & b1 \\ \hline a1 & b2 \\ \hline ........ \end{longtable} Suppose that table was broken (automatically) ...

What is a simple way to combine two Emacs major modes, or to change an existing mode?

In Emacs, I'm working with a file that is a hybrid of two languages. Question 1: Is there a simple way to write a major mode file that combines two major modes? Details: The language is called "brew" (not the "BREW" of "Binary Runtime Environment for Wireless"). brew is made up of the languages R and Latex, whose modes are R-mode and...

Suppress indentation after environment in LaTeX

I'm trying to create a new environment in my LaTeX document where indentation in the next paragraph following the environment is suppressed. I have been told (TeXbook and LaTeX source) that by setting \everypar to {\setbox0\lastbox}, the TeX typesetter will execute this at the beginning of the next paragraph and thus remove the indentat...