latex

Character spacing in LaTeX with lstlisting package

Hi, I'm trying to get my code snippets to look as good as possible and so far I'm having troubles with the character spacing. Here is an example of the output: While the text in small is perfect, all the keywords that are in capital letters look terrible. Here are the settings I use \lstset{basicstyle=\footnotesize, basewidth=0.5e...

Reference name of description list item in LaTeX

I'd like to refer to a description list item by name instead of number. To that effect, I've added labels to each item, but when referencing them I only get the name of the section, not of the list item. How can I change it to show a custom label for each item? \section{Definitions} \begin{description} \item [Vehicle\label{itm:vehic...

making TeX documents ragged left justified?

Hi, How can I make my entire LaTeX document (using TeXShop in Mac OS X) left justified, in a "ragged left" mode? I don't want to use blocks of \begin{flushleft} everywhere, I just want to declare somewhere in the document header that the whole document should be this way. Right now everything is fully justified (like newspapers) by de...

Improving a Tikz Diagram

I have just finished my first diagram in Tikz. It looks as I wanted it to, but am unhappy with how I have 'coded' it: \begin{tikzpicture} [node distance=14mm, item/.style={rounded corners,rectangle, thick, minimum width=20mm, minimum height=10mm}] \node[item,draw=blue!50,fill=blue!20] (stack) {1394 Stack}; \node[item,left=of sta...

Interface texshop with vim

Hello, Any advice on how you would interface texshop on mac osx with vim? I'm using vim quite a lot lately for coding. I find myself now trying to use vim-commands (replace, search, pattern matching, move, etc) when writing documents for latex with texshop and they obviously don't work. However, I don't want to leave texshop altogether,...

Latex port to the iPad

How hard could It be to have the Tex engine and consequently latex compiling documents on an iPad? Is that a fool idea? Is there something already done? I saw a Latex app on the app store that claims to be able to typeset documents through a link to a home always on dropbox server. This is not the solution I'm thinking to. I'd like to h...

Counts & Percentages in xTable, Sweave, R, cross tabulations

Edit: Building off of aL3xa's answer below, I've modified his syntax below. Not perfect, but getting closer. I still haven't found a way to make xtable accept \multicolumn{} arguments for columns or rows. It also appears that Hmisc handles some of these type of tasks behind the scenes, but it looks like a bit of an undertaking to underst...

I need to specify rows that must be on the same page using longtable. How can I?

I have long table of pictures and descriptions (I use longtable environment to get it in several columns on page). I want this to be splitted past picture, not between middle title and picture. My table is somethink like this: \multicolumn{3}{2}{description} \\ \includegraphics[]{} & \includegraphics[]{} & \includegraphics[]{} \\ \multi...

extra "file://" prefix generated by pdflatex using hyperref package in macro

The latex hyperref package confuses me in several ways. Here's my particular problem. In my document, the command \footnote{ \url{http://www.boston.com/news/science/articles/2010/04/25/new_atlas_shows_the_state_of_nature_as_well_as_the_nature_of_states/} } works just fine - pdflatex generates just the valid link. But the commands \...

help me Sweave a multi-file project

Dear SOers, I am writing my thesis in LaTeX and because things got a bit long for my taste, I had split it into several files. Let's call them thesis.tex, intro.tex, mat_n_met.tex, rslts.tex and discsn.tex. I have linked intro.tex, mat_n_met.tex, rslts.tex and discsn.tex through thesis.tex with \include{intro} (and so on...). I have als...

Searching in Latex for beginning of keywords

Hi everybody, I wanna use listings in LATEX with my own style. Because I don't want to add any keyword in my preset, I want to search for beginning of keywords. Latex should know, that any keyword begins with NS or with UI. For my it is impossible to add all keywords of Cocoa Touch and Objective C to my \lstdefinelanguage{ObjectiveC} .....

Latex: Different pages with different margins

Hello everybody! I'm making a latex template for a document type to use at work. For that document, I have two different "commands" one to make the title page; and other to make the rest of the document. The margins that I need in the title page are different from the ones in the rest of the document. Because of that I have some "\setl...

Swapping odd/even margin in Latex

Hello, I'm writing something that I would like to print in Latex and I'm using the book documentclass. The standard behaviour is to consider odd pages (so the rear of a double sided paper) as the beginning of chapters and document too, I would like to swap them to be able to have correct margins: on an even page right margin is greater ...

Includegraphics problems with a PNG

Hi, I have problems to insert a figure into my .tex file. This is the code: \begin{figure} \includegraphics[width=1\textwidth]{Blockdiagram} \caption{Diagram} \label{figure:BlockDiagram} \end{figure} It says that it cannot find the file! The same with Blockdiagram.png. The figure is in the same folder. The main .tex is outside ...

Integrate minted syntax highlighted code into non-english text?

I believe I am constructing a cannon to hit a mosquito \newcommand{\src}[1]{\selectlanguage{english}{\mint{sh}/ #1 /} \selectlanguage{greek}} everything inside the brackets of a \src{} command would not be shown in the same line as desired but in a verbatim environment. How can I manipulate this? Is it a feature that already exists? ...

Latex editor with good intellisense?

I have tried texmaker, and it has built-in "intellisense" autocompletion, but it fails to find most of the packages because it seems it only recognizes the most basic latex commands. Do you know any intellisense editor with a good base of commands, or better yet an editor that dynamically extracts syntax from yourinstalled packages? th...

Is It possible to compile a latex document via node.js?

I'm new to node.js but I think It could be good for an asynchronous latex compile engine. In other words I'd like to know if could be possible, and how, to compile a document via node.js and pdflatex. The remote application would send the document as a JSON data structure, toghether with a template name for the end document layout. Th...

Is there a way to make a LaTeX environment where indentation is interpreted as itemize levels?

As much as I like LaTeX, I find it rather annoying (and visually noisy) that itemize and enumerate environments always require (1) the begin/end environment declaration statements, and (2) "\item" commands prior to each item. What I'd love to have (or be able to create) is some kind of "autoitemize" environment, where something like \b...

Learn how to create LaTeX styles?

Hi How can I learn how to create LaTeX styles? The normal way when creating a LaTeX document is to start with something like. \documentclass[a4paper]{report} \documentclass[a4paper]{article} \documentclass[a4paper]{letter} And that seems to call a .cls (and a .sty) file like letter.cls, that is controlling the actual layout of the...

Newbie latex question (texshop)

Dear all, I´m completely new to latex and have the mactex 2009 package installed with the intent of having tables from R output into latex-->pdf. I get the following latex code (below) when I run an example in r (renders ok in R, but I´d like to use texshop). However when I paste this into a texshop window I get the following error: ./U...