I'm trying to include a .csv file into my LaTeX document in order to plot its data. However, I struggle with setting its path correctly.
This is what I was trying first:
\begin{tikzpicture}
\begin{axis}[
width=0.95\linewidth
]
\addplot+[
mark=*]
table[col sep=comma, x=x, y=y1]{data/Cuba [filter: 10 $\leq$ size $\leq$ 20]_normalized_nodes_a5aa37ded2f2837de689914432ad84f3.csv};
\addlegendentry{some legend};
\end{axis}
\end{tikzpicture}
does not work for obvious reasons.
Then I tried to escape it:
...
table[col sep=comma, x=x, y=y1]{\verb|data/Cuba [filter: 10 $\leq$ size $\leq$ 20]_normalized_nodes_a5aa37ded2f2837de689914432ad84f3.csv|};
...
which also failed:
Missing $ inserted. ...odes_a5aa37ded2f2837de689914432ad84f3.csv| };
I also tried to escape each special character by hand (which is not the solution I am looking for): _ becomes \_, $ becomes \$ and so on. But it still did not work since the \ where still included in the search path.
Lastly, it tired the \url{} package (write path with '$' character in Latex) which did also not work:
line 32: \textfont 0 is undefined (character d). ...2837de689914432ad84f3.csv} };
line 32: \textfont 0 is undefined (character a). ...2837de689914432ad84f3.csv} };
line 32: \textfont 0 is undefined (character t). ...2837de689914432ad84f3.csv} };
line 32: \textfont 0 is undefined (character a). ...2837de689914432ad84f3.csv} };
line 32: \textfont 0 is undefined (character /).
How can I easily fix this issue? Isn't there any verb like command which does not require math mode?
Thanks in advance.
Related
i am compiling some eps graphs with gnuplot using the following terminal line:
set terminal postscript enhanced eps color dashed rounded dl 4 "Times-Roman" 24
An example:
p 'file1' u 5:6 w p t 't=0.5 ms',\
'file2' u 5:6 w p t ' 1 ms',\
'file3' u 5:6 w p t ' 2 ms'
I added extra spaces in the key to have a nice alignment for the labels in the key. This alignment works fine if i open the resulting eps with ghostviewer, but if i compile it within a latex file
$ latex
... pdfTeX, Version 3.14159265-2.6-1.40.15 (TeX Live 2015/dev/Debian) ...
then the text in the key is misaligned. It happens especially if i am using special typesetting like subscripts or superscripts:
p 'file1' u 5:6 w p t 't_{something}=0.5 ms'
then the text will be totally jeopardized, like overlapping text or weird alignments, but only after compiling within latex.
Have you ever seen this before?
Many thanks
edit: add a minimal example
gnuplot script:
set terminal postscript enhanced eps color dashed rounded dl 4 "Times-Roman" 24
set key spacing 1.1 samplen 1.2 top left
set output 'out.eps'
p 3*x w p lc 1 t 't=0.5 ms',\
2*x w p lc 2 t ' 1 ms'
everything fine if I run:
$gv out.eps
i compile the following latex file:
\documentclass[final,5p,times,onecolumn]{elsarticle}
\usepackage{float}
\usepackage{graphicx}
\usepackage{subfig}
\usepackage{fixltx2e}
\usepackage{epstopdf}
\journal{Combustion and Flame}
\begin{document}
\begin{figure*}[]
\centering\includegraphics[width=\textwidth]{out}
\caption{caption.}
\end{figure*}
\end{document}
using the following script ($name=latex file name):
latex $name.tex
latex $name.tex
dvips $name.dvi
ps2pdf $name.ps
using acroread, evince or xpdf, the 't=0.5 ms' label overlaps the corresponding key symbol, while visualizing out.eps on gv shows everything fine, with key text aligned to the right.
FURTHER EDIT:
replacing elsarticle with book solves the problem!
LAST EDIT:
compiling with pdflatex instead of latex solves the problem
2nd post on Stack Exchange, not 100% sure this is the correct place to post, but I'll move it if it needs to be moved.
I've been trying to learn how to type up my Chinese documents in LaTeX (I use ShareLaTeX), but almost nothing seems to work. Although I have all of the proper Chinese fonts installed on the computer, it continues giving me errors, even when I tried to run the document that ShareLateX itself used for an example.
Below are some documents and the errors/problems they cause.
\documentclass{article}
\usepackage{CJK}
\usepackage[utf8]{inputenc}
\begin{document}
\title{Title}
\author{Author}
\date{February 2015}
\begin{CJK}{UTF8}{gbsn}
你好\\
文章内容\\
Something\\
再见\\
\end{CJK}
\end{document}
This gives out a document that is the closest I've had to success, but it doesn't print out in proper formatting (namely, the Title, Author and Date are all absent) and it doesn't have the usual margins.
The next one was also stolen from an example
\documentclass{ctexart}
\setCJKmainfont{simsun.ttf}
\setCJKsansfont{simhei.ttf}
\setCJKmonofont{simfang.ttf}
\begin{document}
\tableofcontents
\begin{abstract}
这是在文件的开头的介绍文字.本文的主要话题的简短说明.
\end{abstract}
\section{ 前言 }
在该第一部分中的一些额外的元素可以被添加。巴贝尔包将采取的翻译服务.
\section{关于数学部分}
在本节中的一些数学会使用数学模型含中文字符显示。
這是一個傳統的中國文字
\end{document}
It returns the following error messages and fails to compile. All issues are in main.tex unless otherwise stated
Compile Error
Undefined Control Sequence (line 3)
LaTeX Error: Missing \begin[document} (line 3)
Undefined Control Sequence (line 5)
Improper Alphabetic Constant (output.toc, line 1)
Missing = inserted for \ifnum (output.toc, line 1)
Missing number, treated as 0 (out..., line 1)
Bad character code (-30). (out..., line 1)
Undefined control sequence (line 12)
Package CJK Error: Invalid Character Code (line 12)
Undefined Control Sequence (line 15)
Undefined Control Sequence (line 15)
Undefined Control Sequence (line 16)
Undefined Control Sequence (line 16)
Undefined Control Sequence (line 19)
Undefined Control Sequence (line 21)
dfTeX error: pdflatex (file simsun.ttc): cannot open TrueType font file for reading
Optimally, I'd like to use the KaiTi font, but for now I'll just settle for being able to created a document in the first place. :)
Im trying to include some R results in a TeX document using RStudio. I have managed to get RStudio to generate, what to me looks to be, a fine tex file but it fails to compile the pdf.
I get errors returned saying ! Undefined control sequence. ' which seems to be returned due to the first lines of str(data) calls and the lines showing significance levels:
"! Undefined control sequence.
<argument> '
data.frame': 1980 obs. of 5 variables:
l.39 'data.frame': 1980 obs. of 5 variables:
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined."
"! Undefined control sequence. <argument>
Signif. codes: 0 '
***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
l.95 ...**' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined."
Files with just the summary(data) for instance work fine
Looking around other mailing lists etc Ive seen that this could be because tex cannot find the Sweave package so have copied it to various locations (the same folder as the Rnw and tex files, and a directory without spaces in the path) and tried to rerun the file. Nothing seems to work.
Similarly, this doesnt work, but using summary(cars) instead of str(cars) does. This suggests to me that its something to do with the ' character.
\documentclass [a4paper]{article}
\usepackage{Sweave}
\title {Sweave Example 1}
\author {Friedrich Leisch}
\begin {document}
\maketitle
In this example we embed parts of the examples from the
\texttt {kruskal.test} help page into a \ LaTeX {} document :
<<>>=
data ( cars )
str(cars)
#
\end{document}
(adapted from the sweave manual)
Any ideas on what Im doing wrong?
Any suggestions would be much appreciated.
Add the [noae] package option to your \usepackage{Sweave} statement.
I try to layout an algorithm in pseudocode with TeX and the package "algorithmic". It gets a mess: no spaces between words, and no linebreaks. Can anyone help me out.
How do I get spacing and linebreaks into algorithmic comments?
Thanks!
Here's my TeX code:
\documentclass{llncs}
\usepackage{algorithmic}
\begin{document}
\begin{algorithmic}
\REQUIRE{ $ Some long text here. Unfortunately this text is a mess. Spaces and line breaks are missing and the text gets weird block layout when setting line breaks manually. $}
\FORALL{$i = 1 \ldots \mid L_{items}\mid $ }
\STATE { $ i miss spaces here, too $}
\ENDFOR
\end{algorithmic}
\end{document}
Well the first problem is that you have your text in dollar signs $ ... $ that means to typest it in math mode. So the spaceing would be way off. Try this
\REQUIRE{ Some long text here. Unfortunately this text is a mess. Spaces and line breaks are missing and the text gets weird block layout when setting line breaks manually. }
\FORALL{$i = 1 \ldots \mid L_{items}\mid $ }
\STATE { i miss spaces here, too But I can get math $x = x +1$ }
I've hit an annoying problem in LaTeX. I've got a tex file of about 1000 lines. I've already got a few figures, but when I try to add another figure, It barfs with:
! Undefined control sequence.
<argument> ... \sf#size \z# \selectfont \#currbox
l.937 \begin{figure}[t]
If I move the figure to other parts of the file, I can get similar errors on different lines:
! Undefined control sequence.
<argument> ... \sf#size \z# \selectfont \#currbox
l.657 \paragraph
{A Centering Algorithm}
If I comment out the figure, all is ok.
%\begin{figure}[t]
% \caption{Example decision tree, from Reiter and Dale [2000]}
% \label{fig:relation-decision-tree}
% \centering
% \includegraphics[keepaspectratio=true]{./relation-decision-tree.eps}
%\end{figure}
If I keep just the begin and end like:
\begin{figure}%[t]
% \caption{Example decision tree, from Reiter and Dale [2000]}
% \label{fig:relation-decision-tree}
% \centering
% \includegraphics[keepaspectratio=true]{./relation-decision-tree.eps}
\end{figure}
I get:
! Undefined control sequence.
<argument> ... \sf#size \z# \selectfont \#currbox
l.942 \end
{figure}
At first, I thought maybe LaTeX has hit some limit, and I tried playing with the ulimits, but that didn't help. Any ideas?
i've got other figures with graphics already. my preamble looks like:
\documentclass[acmcsur,acmnow]{acmtrans2n}
\usepackage{array}
\usepackage{lastpage}
\usepackage{pict2e}
\usepackage{amsmath}
\usepackage{varioref}
\usepackage{epsfig}
\usepackage{graphics}
\usepackage{qtree}
\usepackage{rotating}
\usepackage{tree-dvips}
\usepackage{mdwlist}
\makecompactlist{quote*}{quote}
\usepackage{verbatim}
\usepackage{ulem}
I found, not that it's a problem with \textsuperscript, but that it's with a ^ def I picked up from http://anthony.liekens.net/index.php/LaTeX/SubscriptAndSuperscriptInTextMode . The fix is to put the use of ^ in {}, as in I've put entire sections where I use lots of ^ and _ in {}. Hurrah!
During the end of my Master Thesis I also had the problem that after some amount of figures, I got an error without any special error message. After I read you thread, I also tried something with the packages included and in the end I was successful by taking out the \usepackage{pxfonts} and \usepackage{txfonts}. Yeah, finally.. I almost went crazy.. ;)
If I Google for "latex undefined control sequence" I get this.
I've successfully included a graphic into LaTeX using something like this:
\usepackage{amsmath,amsthm,graphicx}
...
I just wanted to test adding an image to a \LaTeX file:
\includegraphics[scale=0.60]{basic-info.png}
I typeset an entire dissertation of 200 pages with lots of figures in LaTeX and didn't run into a limit like that. I'd bet on a syntax problem first before I'd assume a size issue.
Your error lies elsewhere. I wouldn't be the least surprised if it turned out to be the document class. Try altering your document for \documentclass{article} and see where you get. If that fixes the problem you can complain to the ACM (ROTFLMAO—I've dealth with ACM).
If that doesn't fix, the problem, slip in a \tracingall somewhat before the offending figure or section, put the results into http://pastebin.com/, and let us know.
Please receive the thanks of a (formerly) utterly-confounded graduate student. Quick clarification for other users:
{The quickest ^{way} to put this solution into practice is to bracket all sections of text involving the character ``\^'' as shown here.}