latex

LaTeX sometimes puts too much or too little space after periods.

LaTeX tries to guess whether a period ends a sentence, in which case it puts extra space after it. Here are two examples where it guesses wrong: I watched Superman III. Then I went home. (Too little space after "Superman III.".) After brushing teeth etc. I went to bed. (Too much space after "etc.".) Note that it doesn't matter ho...

How to create own and fancy \sub<float> command

I'm using packages subfigure and float to create figures and tables that I want to create and I'm trying to create my own environment graph with its own counter and caption (solved there, thanks to dmckee). Now I'd like to create \subgraph command which will do exactly the same as \subfigure command. I tried create my own command with p...

Convert LaTeX to mediawiki syntax

I need to convert LaTeX into mediawiki syntax. The formulas should stay the same, but I need to transform, for example \chapter{something} into = something =. Although this can be obtained with a bit of sed, things get a little dirty with the itemize environment, so I was wondering if a better solution can be produced. Anything that ca...

Latex new command

I would like to define a new command like this \newcommand{\bob}[1]{\excerpt \begin{lstlisting} {#1} \end{lstlisting}} and then use it like this \bob{abcd} but i get the following error in latex. text dropped after begin of listing latex EDIT: I tried the following \newcommand{\boy}[1] {{% \begin{Verbatim} % { #1 } % \end{Verb...

Writing a LaTeX document with Python code snippets

I am using LaTeX to write a document about Python. This document will contain code snippets (examples). I could use the verbatim environment, but before I embark onto it, I'd like to know if you are aware of any LaTeX style file which provides an environment for Python code. Syntax highlight would be a plus. Thanks. Edit: I must poin...

how does one Indent the body text of a latex document, but not sections?

For accessibility reasons, I would like to indent the body text of my document, but not the sections. How would I go about doing this? I would like the result to be: Chapter 1. Section 1.1 Some body text here Some more body text Section 1.2 Some more body text... ...

Specifying the destination for the pdf output when using pdflatex, from gVim

I am generating a pdf output with pdflatex with the following command in gVim: :!pdflatex % This command in turns executes the following in the Command Prompt: cmd.exe /c pdflatex /testvim.tex Now, the problem I'm having with this is that the pdf is outputted to the system32 folder: C:\windows\system32\testvim.pdf How can I in...

LaTeX: Adding an Enumerate environment to a Tabular environment

I am trying to add an ordered list (enumerate) to a table (tabular) in LaTeX with the following: \begin{tabular}{|l|l|} \hline Event Flow & \begin{enumerate} \item This is item 1 \item This is item 2 \end{enumerate} \\ \hline \end{tabular} But I am getting the following error: ! LaTeX Error: Something's wr...

Passing command-line arguments to LaTeX document

Hello there, I have a LaTeX file, 'myfile.tex' say, that sometime in the middle of the code an ASCII file with LaTeX macros has to be input, 'macrofile.tex, say, through an '\input{macrofile}' command. Actually, there are more than one 'macrofiles', so every time I have to edit 'myfile' and change the name of 'macrofile'. I can avoid th...

LaTex - how to create boxes with fixed heights and widths, with enclosed text that is vertically and horizontally aligned?

This is for creating flashcards in LaTeX. My printer doesn't support duplex printing - which packages like flashcards and flacards seem to require - so I am trying to create a two-column arrangement as follows on each page: [Col1: Front side of the card] [Col2: Back side of the card] Each row would correspond to a single flashcard. The...

When using pdfpages in LaTeX, how to avoid page breaks before the first page ?

I am creating a large LaTeX document, and my appendix has reproductions of several booklets that I have as PDFs. I am trying to create a section header and then include the pages at a slightly lower scale. For example: \section{Booklet about Yada Yada Yada} \includepdf[pages={-}, frame=true, scale=0.8]{booklet_yadayada.pdf} However, ...

How do I control the width of a \caption{} in a float? (LaTeX)

I am looking for a simple way to control the width of a \caption{} inside a float in LaTeX without using the {caption} package. Any clues? (EDIT): The problem I am having is that the built-in captions are too narrow. ...

Multilanguage document in Latex

Hi, how do you prepare Latex document with a translation... I need 1 multilanguage document. It should be something like: \section{pl:Costam; en:Something} Then I'd like to render it in Polish or English... Thanks in advance, Etam. ...

Changing the numberings of nested lists in an Enumerate environment, in LaTeX

I want to produce the following in LaTeX: 1. Item 2. Item 3a. Item 3b. Item 4. Item 5. Item Basically I have already tried using nested enumerate environments, but I have a problem with implementing the different numberings. How can I do the above in LaTeX? ...

Latex: reset font style

Is there a way I can reset the style of a certain character sequence? I'm using the listings package to display source code and the prebreak property to display a escape character \ to indicate that the current lines was broken. The problem is that sometimes the backslash is colored because of the syntax highlighting used. So I need bas...

Latex: Using Minted package - how do I make it wrap the text (linebreaks=true)

Im using the Pygments for a lot of things, and I'd like to also use this in my latex report. I found the package Minted which interacts with Pygments, but some of the comments and some of the code overflows the right margin. I have used lstlistings' breaklines=true in the past, but I don't see a way to get that functionality using the Mi...

Latex: \usepackage{setspace}

Hi, I'm new to Latex. I've beean able to install it and to compile some pdf files. My problem appears when using the following source code: \documentclass[11pt]{book} \usepackage{graphics} \usepackage{graphicx} \usepackage[latin1]{inputenc} \usepackage{epstopdf} \usepackage{epsfig} \usepackage{anysize} \usepackage{setspace} \begin{doc...

Best font size for Latex Beamer

Hi Stackoverflow - I am preparing a presentation in latex using the beamer package. I am wondering what font size "pros" who give a lot of presentations use to make sure people in the back of the room can see. The default font size seems a bit small to me. Thanks, Setjmp ...

Latex command with line break

Hello all, I am trying to create a command in latex that, when invoked such as \test{\ab}{TEST}, will create a new command defined as \ab[1]{\raggedright TEST: \\ \hspace{0.5in} #1}. What I am trying to do is something along these lines: \newchar{\ab}{TEST} \ab{This is a line TEST says.} That would execute to yield TEST: This ...

Relative section specification

Is it possible to specify the \section \subsection \subsubsection etc. level relative to the previous level? What I'm thinking of is something like \thissection The top level \pushsection \thissection The next level down \thissection One more \pushsection \thissection Deeper \popsection \this...