latex

xelatex Invalid fontname

I want to use the openoffice chinese fonts, eg AR PL SungtiL GB, but the xelatex tells me that it is an invalid name (as shown below). It seems like the font name has spaces and so it doesn't recognize it? How should I get around this? (/usr/share/texmf-texlive/tex/latex/base/syntonly.sty)kpathsea: Invalid fontname `AR PL SungtiL GB', ...

Problem with adding Appendix in Latex

Hi all, I tried the first time to add an appendix to my thesis, here are the commands that I used. \appendix \chapter{Appendices} \input{appendix} The output looks than as follows: Appendix A Appendices A.1 My first appendix ..... It does not look to bad, but what is irritating is the Appendices entry after Appendix A. Is ther...

How can I determine a file extension given a file path in LaTeX?

I am attempting to write a LaTeX package which leverages the minted package's \inputminted command. My \mycommand command takes two parameters, the first being a path to a file, and I want to pass the file's extension to the \inputminted command: \newcommand\mycommand[2]{ \inputminted{#1}{...} } Note that the above won't work since ...

How to strike out inside LaTeX equations?

Please see the snippet below and tell me how can I achieve the same strike-out effect as in the main text. I am using the version of LaTeX from the latest Ubuntu repositories. \documentclass{article} \usepackage{ulem} \begin{document} The sout tag works perfect in the \sout{main text area} but not inside the equations. $$ list = [1, \so...

LaTeX: remove spaces in French

I write LaTeX docs in French, and babel package puts extra spaces before colons (:). It is usefull, but I don’t want it in URLs: http ://docbook.org/ns/docbook Any thoughts how to solve problem? Thanks! ...

vim-latex config

Hello: I have installed vim-latex package using my ubuntu's synaptic package manager. I followed the instructions here to edit my .vimrc file. However, when I open up a .tex file in vim, nonw of the new menu options appear and I can't seem to compile documents using \ll. What did I do wrong? ...

Defining an environment shorthand in Latex using \newcommand

I'd like to define a shorthand command for \begin{align*} and \end{align*}. When I write \newcommand{\ba}{\begin{align*}} it works fine. But when I write \newcommand{\ea}{\end{align*}} latex complains. It looks like it's interpreting it as part of the environment and is not happy with that. Anyone know how to fix this? ...

Latex: Listing all figures (tables, algorithm) once again at the end of the document

Hi all, I have been writhing a rather large document with latex. Now I would like to list all the figures / tables / algortihms once again at the end of the file so that I can check if they all look the same. For example, if every algorithm has the same notation. How can I do this? I know about \listofalgorithms and \listoffigures b...

How can I save shell output to a variable in LaTeX?

I need to be able to execute a shell command through LaTeX [*] and have the resulting output available for use later on in the form of a LaTeX 'variable' (e.g., via a subsequent \newcommand command). If necessary a temporary file could be used to hold the output, although I would like to avoid this. I have been able to use \immediate\wr...

How to pass an option containing a space to a package in LaTeX/XeLaTeX

When I declare an option containing a space, LaTeX/XeLaTeX eats it. In the main .tex, I have : \usepackage[test font]{test} In my .sty file I have : \DeclareOption*{\newfontfamily\testfont[Scale=1]{\CurrentOption}} \ProcessOptions But the Tex engine passes to the package testfont option and not test font. So the question is how ...

Compare floating point numbers in Latex

I am trying to use \ifthenelse to do a floating point comparison. This is the pgf/tikz code, which works if \y is integer only, but not otherwise: \foreach \y in {3,3.5,...,6} { ifthenelse{\y<3}{ ... }{ ... } } ...

LaTeX printing only first two pages of a document

I am working in LaTeX, and when I create a pdf file (using LaTeX button or pdfLaTeX button or using yap) the pdf has only the first two pages. No errors. It just stops. If I make the first page longer by adding text, it still stops at end of 2nd page. Any ideas? OK, responding to first comment, here is the code \documentclass{artic...

Vim script to compile TeX source and launch PDF only if no errors

Hi, I am switching to using Vim for for my LaTeX editing environment. I would like to be able to tex the source file from within Vim, and launch an external viewing if the compile was successful. I know about the Vim-Latex suite, but, if possible, would prefer to avoid using it: it is pretty heavy-weight, hijacks a lot of my keys, and ...

Consecutive Tables in Latex

Hi, I wonder how to place several tables consecutively in Latex? The page with the text right before the first table has a little space but not enough for the first table, so the first table is to be placed on the top of the next page, although I use "\begin{table}[!h]" for it. The second table does not fit into the place in the res...

Is it possible to include a Sexpr before the expression has been evaluated in Sweave / R ?

Hello, I'm writing a Sweave document, and I want to include a small section that details the R and package versions, platofrms and how long ti took to evalute the doucment, however, I want to put this in the middle of the document ! I was using a \Sexpr{elapsed} to do this (which didn't work), but thought if I put the code printing ela...

Gap after table in LaTex

Hi, I notice that there is some gap after my table. See the following snapshot: My Latex code is: \begin{table}[htb] \caption{Error rates VS training size in AdaBoosted stump, SVM and kNN. \label{tab:examplecount8000errerrplot}} \begin{center} \begin{tabular}{c c} \includegraphics[scale=0.4]{../boost.eps} & \includegraph...

Caption in longtable

Hi, I find that the caption in my longtable takes two lines but it seems that it can fit in one line. See the figure below: My code is: \begin{longtable}{|c|c|c|c||c|c|c|} \caption{Testing error for training size 100000 and 8000 random counts}\\ \hline \multicolumn{2}{|c|}{Concept} & \multicolumn{2}{c||}{Negative Class} & \mult...

How to put a newline into a column header in an xtable in R

I have a dataframe that I am putting into a sweave document using xtable, however one of my column names is quite long, and I would like to break it over two lines to save space calqc_table<-structure(list(RUNID = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), ANALYTEINDEX = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), ID = structur...

backslashbox is too wide

Hi I feel the first column in my longtable is too wide. Please see the figure below My code is: \begin{center} \begin{longtable}{|c|c|c|c|c|c|} \caption{Error rates for SVM and 100 random counts. \label{tab:2}}\\ \hline \backslashbox{Concepts}{Train sizes} & 10 & 100 & 1000 & 10000 & 100000\\ \hline 1 & 0.49 (0.00) & 0.49...

Multiple lines in a cell of a table

I have a table as shown in this figure: The latex code for the table is: \begin{table} \begin{tabular}{ | c | c | } \hline \includegraphics[scale=0.45]{../0_1.eps} & 1.10 2.20 3.30 4.40 \\ \hline \end{tabular} \end{table} I would like to make the four numbers appear in different lines inside the second cell, in o...