latex

Latex \tableofcontents command always shows blank Contents on first build

When I generate a .pdf file from a .tex file using pdflatex, only the "Contents" title is shown with no actual TOC. If I run pdflatex my.tex once more, it generates the TOC just fine. I can reproduce this simply by removing the .toc file. What I think is happening is that my .toc file is being generated too late -- so how can I make the ...

Using a single count for figures and tables in LaTeX

Hello I've been given a LaTeX document to edit with the following code for using a single count for figures and tables. \makeatletter \newcounter{unisequence} \def\ucaption{ \ifx\@captype\@undefined \@latex@error{\noexpand\ucaption outside float}\@ehd \expandafter\@gobble \else \refstepcounter{unisequ...

write newline to file in TeX/LaTeX

I have a latex document that I want to use to write text to a plain text file. I want macros to be expanded, so I can't use \filecontents (which just saves input verbatim to a file) So far I have \newwrite\metadatafile \immediate\openout\metadatafile=\jobname-meta.txt \immediate\write\metadatafile{Title: \jobname\string Tags: \cours...

Converting a python numeric expression to LaTeX.

I need to convert strings with valid python syntax such as: '1+2**(x+y)' and get the equivalent LaTeX: $1+2^{x+y}$ I have tried sympy's latex function but it processes actual expression, rather than the string form of it: >>> latex(1+2**(x+y)) '$1 + 2^{x + y}$' >>> latex('1+2**(x+y)') '$1+2**(x+y)$' but to even do this, it requ...

Should I buy a book on both LaTeX and MetaPost, or just MetaPost?

I feel that the LaTeX syntax is quite easy to use. However, I'm starting to include diagrams in my document. I've discovered the exciting world of MetaPost! The thing is, the MetaPost syntax looks a little more intense than LaTeX... So I figured I'd buy a book on it. I'm wondering though, whether it's better to buy a generalised book tha...

Long Negation Bar in LaTeX

Hi, how can I produce long negation lines in latex. It should look like on the left of the following equations I used \[ \bar{(A \land B)} \] but that just added a bar over the \land Thank you for your help ...

how to perform automated Unix input?

How can you set a string to be used instead of standard input? For example, when running the latex command in Unix it will always find some trivial errors, to skip through all errors you have to enter "r" into the command line (I now know that with latex specifically you can use -interactionmode nonstopmode, but is there a more general s...

How to use tab stops in underlines sections in LaTeX?

How can I use tab stops and underline at the same time? I need to draw something like: X Y Z ----- A B C ----- P Q R ----- My first thought was tabbing and underline, but putting tab stops in an underline section seems to break the stops: \begin{tabbing} \underline{X \= Y Z} \\ \> \underline{A \= B C} \\ \> \> \underline{...

LaTeX ignoring tabs in verbatim

Hi, I need to write a whole bunch of pseudo code and I got annoyed using all the "\ >\=" with the \begin{tabbing} command, so I decided to use \begin{verbatim} instead. This was working fine for me until I got to a point in which I had to indent 4 times in a row. When I get to 4 tabs in a row it puts the "character" >> at the beginning ...

LaTeX template for technical reference manual?

Hello, I'm looking to use LaTeX for my technical documentation needs (such as reference manuals, user guides, etc). Could I use your template to quickly get started in order to avoid being overwhelming by the LaTeX world... tons of packages and control sequences. At minimum, I will need Table of Contents, figures, tables, Index, Glossar...

How to extract the size of PDF? (Dimensions, not file size)

I have many hundreds of small PDF images (created in Adobe Illustrator) which will be inserted into a Latex document. I need to know the size of these images in real-world dimensions (e.g. 20mm x 14mm), or at least something that Latex can understand. Is there a command line tool that can produce these dimensions? (I am running Mac OS...

Latex - \multicolumn within an align* environment

Hello everyone, I would like to have a \multicolumn like effect within an align* environment, as shown in the code snippet (which doesn't work) below. I.e., I want the text to be aligned with the leftmost column, but it shouldn't affect the alignment characteristics of the equation otherwise. \intertext{...} unfortunately flushes everyt...

How do I get rid of the "Release 1" in the Page Header of the Sphinx Latex Output?

I'm using the "manual" document class of Sphinx and I'm quite happy with how the Latex Output looks like, except for the page header. It contains the title of my paper, as well as a "Release 1". Since I'm writing a paper and not a documentation, I clearly don't need the release information. Unfortunately, it is very hard to find inform...

Converting newlines to spaces in Latex

I'm writing a document and I have a few chapter titles that I would like to appear as 2 lines for a chapter title, but only one line in the table of contents. Is there a simple command I to filter out the newline character like this? Chapter Title First Line: Second more informative line ToC: First Line: Second more infor...

Draw chemical laboratory equipment

I need to draw some chemical laboratory equiment setups. It will include Erlenmeyer flask, Bunsen burner and so on. Does TikZ provide support for such drawings? ...

Latex \newcommand for \end{verbatim} et.al not working

I'm trying to make Latex usable, by introducing some timesavers, but I'm having trouble with defining new commands that terminate environments, completely at random. This works: \newcommand{\bcv}{\ensuremath{\begin{smallmatrix}}} \newcommand{\ecv}{\ensuremath{\end{smallmatrix}}} \newcommand{\be}{\begin{enumerate}} \newcommand{\ee}{\end...

How to set title of TOC in Latex hyperref package.

The latex hyperref package makes a really nice, linked table of contents, named according to section name. However, the top level category is by default, the file name. It seems I should be able to change this to the actual title, but I'm not finding any information on how. ...

Tutorials/manuals for writing class and style files in LaTeX?

I've searched the net and stackoverflow and found a number of great LaTeX sources, but I couldn't find any decent manual about writing your own class and style files. Some issues I have is which part of the code should be in a class file and which in a style file, how to finetune macros, how to define and use variables,... I figured so...

Code listing in LaTeX beamer presentation frames

Hi, everyone, I'm trying to create a LaTeX beamer presentation that has several Java code listings. However, I encountered a very bizarre problem - my listing snippet causes a compilation failure when in the presentation, but works just fine in some other document. \begin{frame}[Fragile] \frametitle{Test} \begin{lstlisting} publ...

Is there a tool for previewing both LaTeX and MetaPost files?

I'm trying to find a tool for Windows that I can use to preview .tex and .mp files as they are saved. Does such a tool exist? I have TeXworks installed which has a handy build button (this displays the result in another window), but I'd rather use Emacs. Also, TeXworks does not compile .mp files. Perhaps there's a more elegant way to pr...