I'm new to LaTeX. I am trying to include a PDF file using Overleaf and I don't know why I got several errors: "undefined control sequence", "PDF not found". I think I have uploaded the PDF file right, I don't know what might be the problem.
I don't know how to copy the exact text of the error so I have attached some images.
I have read some posts about updating something in MiKTeX. I don't know what MiKTeX is and I don't know if I am using it.
This is the structure of my document:
\documentclass{article}
% General document formatting
\usepackage[margin=0.7in]{geometry}
\usepackage[parfill]{parskip}
\usepackage[utf8]{inputenc}
\usepackage[final]{pdfpages}
% Related to math
\usepackage{amsmath,amssymb,amsfonts,amsthm}
\begin{document}
Name, date, Exercise X
\section*{Part a}
\section*{Part b}
\includepdf[pages=1-2]{ProblemasPNG.pdf}
\end{document}
So as hinted by #samcarter_is_at_topanswers.xyz in the comment, you named the file wrong. Though you may use \includepdf[pages=1-2]{filename.pdf}, I think its best practice to use \includepdf[pages={1-2}]{filename.pdf}. This will also allow you to skip certain pages using \includepdf[pages={1-2,5}]{filename.pdf}, thus skipping pages 3 and 4.
Related
I am trying to customise the position of the page number to make them all appear at the bottom centre in Lyx. I plan to use the fancyhdr package in the preamble section of the document, but I get the following error msg:
'LaTex Error: Command /footruleskip already defined'
I guess it has something to do with me forcing a footnote formatting which may already be defined by fancyhdr package, as i have the following in my preamble:
\setlength{\skip\footins}{0.8cm}
Any suggestion how I get around this problem and set the page number position together with the footnote setting? Many thanks.
This link should help: http://en.wikibooks.org/wiki/LaTeX/Page_Layout#Customising_with_fancyhdr. You can use the lhead, chead, rhead, lfoot, cfoot and rfoot commands to tell it what you what where (section names, page numbers, custom text, etc). I think you still need to specify them even if they are empty. For only a page number at the bottom center, that would be:
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\lhead{}
\chead{}
\rhead{}
\lfoot{}
\cfoot{\thepage}
\rfoot{}
Perhaps your error could be fixed by using \renewcommand instead of trying to define an already existing value.
I'm trying to do my thesis with LyX and small problems like this are killing me because of having to adhere to the strict format of my school. Anyhow, this page came up as I searched for over an hour for the answer to your question. I'm using the memoir layout (kind of, I've already had to edit it) because my school's latex .cls file is supposedly based on memoir.cls (which I couldn't get to work correctly with LyX despite hours of persistence). I ended up putting this code into my preamble and it displayed the page numbers in the bottom-center per my formatting requirements.
\makeevenfoot{headings}{}{\thepage}{}
\makeoddfoot{headings}{}{\thepage}{}
\makeevenhead{headings}{}{}{}
\makeoddhead{headings}{}{}{}
Hope this helps anyone else that finds this page. Now if I can just figure out how to tell LyX that I have no chapters and I want sections to be 1 instead of 0.1. I'll probably just use section* and call my sections "Section" #. Anyway, I hope this helps someone who is as close to punching themselves in the face for using LyX as I am.
I'm trying to include a simple glossary to my LaTeX document,
I already searched for something like that on google, but never got it running.
I would like to use glossary or glossaries.
how to write it in the text?
how to print it?
what to execute on which position?
Well, there is a glossaries package on CTAN. Read the pdf documentation.
Check if you already have it in your installation, if not install it, and put \usepackage{glossaries} in the preamble of you document and it will be available to you.
It looks like you need \usepackage{glossaries} and \makeglossaries in the preamble, and some number of \newglossaryentry and \newacronym calls (it is not immediately clear to me if these only go in the premble or can go in the document text). Finally, you will need one or more \printglossary calls in the text. Use \gsl to connect glossary entries on the argument with the pages they occur on.
Processing the file will have to include a call to makeglossaries followed by at least one more invokation of latex.
In addition to the samples mentioned in the documentation there is a Stack Overflow question which includes a minimal file making use of glossaries. You may be particularly interested in the acronym glossary.
There is a nice blog for beginners: LaTeX glossary and list of acronyms
Here is an example:
\documentclass{article}
% Load the package
\usepackage{glossaries}
% Generate the glossary
**\makeglossaries**
\begin{document}
%Term definitions
\newglossaryentry{utc}{name=UTC, description={Coordinated Universal Time}}
\newglossaryentry{adt}{name=ADT, description={Atlantic Daylight Time}}
\newglossaryentry{est}{name=EST, description={Eastern Standard Time}}
% Use the terms
\gls{utc} is 3 hours behind \gls{adt} and 10 hours ahead of \gls{est}.
%Print the glossary
\printglossaries
\end{document}
I was using \documentclass{amsmath} for awhile with no issues, but I recently wanted to switch to the normal \documentclass{article} because I thought it looked nicer. However, now my \tableofcontents command produces this error:
! Undefined control sequence.
<argument> \tocsection
{}{1}{Purpose}
l.1 ...ne {section}{\tocsection {}{1}{Purpose}}{4}
?
I'm writing a research paper with latex, and Purpose is the first section (the command I'm using is \section{Purpose}). It's saying line 1 has the error, which is \documentclass{article}. Can anyone help me with this error?
1) Most probably "l.1" refers to the first line of the TOC file, not of the TEX file. It's impossible to tell for sure from the little snippet you've shown.
2) First thing to try in this situation will be to delete (or better to move to some temp. place) all the TeX-generated files in your working folder. Usually this means that only TEX and BIB files should remain (and any figures if you have them). Then run the usual latex; bibtex; latex; latex sequence.
3) If you still get the same error, there is probably some package conflict. To diagnose that, we'll need all of your preamble.
I'm using Lyx to produce a Latex document, and when i try to convert to pdf, it complains of the error: "there's no line to end", and description is "//".
My Latex document is like 200 lines without many line breaks. How am I supposed to debug this and get this darned pdf converted. I literally am stuck on this for hours, can't submit this pdf. And for 90% of the time while writing this document, the convert to pdf works fine, I don't know know since what point did it start to fail.
Someone give me a quick way to get rid of this error? Otherwise this Latex document is useless.
Thanks.
That may sound stupid, but sometimes Latex needs a sign before the \, therefore:
~\\
That very much depends on the distribution you chose. LyX btw. is kind of crazy, when it comes to LaTeX export. Try auctex if you've got a month or two to spare ;)
IMO this is the problem with LyX; when things go wrong it's hard to know where to look to fix the problem. This is a minimal document that shows an example of the error:
\documentclass{article}
\begin{document}
\\ there
\end{document}
I suggest exporting your LyX document to LaTeX, then compiling it "by hand" (with pdflatex mydoc or whatever) and see where in the document the error is appearing. You should then be able to correlate it with some misbehaving piece of the LyX document.
Do a binary search. Delete half the document, if it compiles then the problem was in the part you deleted. If not, then it's in the half you kept. Repeat the procedure on the offending portion and you should soon find which line is causing it.
Dear Saobi, please post the offending line. Probably you have a "\" in a single-line math environment. If you post the code for the complete environment, I can try to indicate how to prevent this error.
You can go to View -> View Source and click around until you find the offending line. In latex, line break is \\.
After doing that I realized the problem is you can't put a line break (Ctrl+Enter) at the start of a line (or cell). You can cheat by forcing a space (Ctrl+Space) before the line break. :)
My approach for locating compilation errors in LaTeX documents is based on a binary search approach. I suppose that a similar approach can be used in LyX.
The key idea is to divide your document in two parts of approximately the same size. At the boundary between these two parts a line containing \end{document} is inserted. If the document now can compile with no problems, the problem were located in the second half part of the document (otherwise it were in the first half part).
\documentclass{article}
\begin{document}
% First half part of the document
\section{Hello}
% Location for inserting \end{document}
% Second half part of the document
% in which the error is located
\section{World
\end{document}
In addition, check out that your LaTex lines already have content. I wrote an empty line, and It also causes error, from my experience.
\vspace{1cm}{ }\\
I just created a LaTeX document and compile it to a PDF using pdftex. Every time I make a reference using the \ref command, the reference is put on a new line. Why does this happen and how do I prevent this?
Are you by any chance using \\ in URLs instead of //? \\ is used as a linebreak in TeX.
Try to localize the problem: create a new file which initializes hyperref the same way, uses no other packages, and has some text and a reference. Check if references still start on new lines. If they do, you can show it here (and on LaTeX forums); if not, add more of your report's preamble until you get a file which exhibits the problem.
Can you prepare a minimum example demonstrating your problem?
I've tried with:
\documentclass{report}
\usepackage[pdftex,breaklinks=true,bookmarks=true,bookmarksopen= true,pdfpagemode=UseNone,plainpages=false,pdfpagelabels,pdfstartview=FitH,olorlinks=true,citecolor=blue]{hyperref}
\begin{document}
Test \url{http://test.com} \ref{http://someother.com}.
\end{document}
And the whole output is a single line in PDF.
BTW \ref is used to produce internal document links (like in "As described in chapter \ref{chapter:second}...").
It was my own fault, I used \par for the paragraph sign instead of \P. This is one of my first LaTeX documents, so I overlooked it. Thanks for the quick responses/answers though.