Talk:LaTeX

From PrattWiki
Jump to navigation Jump to search
  • When I try to view lab1 in its processed (.dvi) format, it said it cant open the file because it has type application/x-zerosize. Last night I had the same problem, but after 5 or so tries it changed its mind and worked. Today, not the case. I'm using Leopard 10.5. Devontownsend 12:05, 28 August 2008 (EDT)
    • Make sure that latex lab1.tex actually completed - usually a zerosize means the .dvi file wasn't even created. DukeEgr93 14:34, 28 August 2008 (EDT)
  • How do I make it so that a command, such as \hat{a} shows up in the actual text of what I'm writing? Everytime I tried, it gave me an error... Rasesh.joshi 23:24, 26 August 2009 (EDT)
    • If you want literal text, you can either use the verbatim environment, or you can use the $\backslash$ command to do backslash\[\hat{a} \mbox{ vs. } \backslash hat\{ a\}\]DukeEgr93 10:48, 27 August 2009 (EDT)
  • How do I get a new .dvi file to run for lab3? I typed stuff into emacs and saved it, but I could not get the file to load as an okular and such. What do I do?Asc35 11:24, 6 September 2009 (EDT)
    • Did you make your own copy? That is, in your ~/EGR53/lab3 directory, did you type
      cp Lab3Sample_F09.tex lab3.tex
      
      first? DukeEgr93 16:15, 7 September 2009 (EDT)
  • When I run latex blah.tex command in PuTTy, I get the error
    !LaTeX error: Missing \begin{document}
    
    although there is clearly the begin command in my file. When I ignore the error and run it, the first page goes blank and the actual first page goes to the second page. RickyPark 16:56, 10 October 2009 (EDT)
    • Questions that are this specific are probably best e-mailed to a TA -- be sure to include your NET ID and what file to check so the TA can figure out where to go. In your specific case, however, the first few lines of your document are:

      7%% IMPORTANT: Once working, run latex 3 times to get listoffigures to work
      
      %% Be sure to check spelling!
      

      which means you inadvertently put a "7" in front of the first comment. That confuses LaTeX :) DukeEgr93 17:31, 10 October 2009 (EDT)
  • How can I prevent LaTeX from moving my inserted .eps and .ps files all over the document? I'd like to keep them in the order I specify. Ajw27 20:48, 15 February 2010 (EST)
    • Alas - that's one of the harder things to do in LaTeX, which is why the EGR 103 labs have the figures all at the end :) If you really want a figure to (try to) go to a particular location, you can put in:
\begin{figure}[h!]
BLAH
\end{figure}
where the h! says "Here! Do it! If at all possible." DukeEgr93 00:23, 16 February 2010 (EST)

kdvi fail (8/27/2012: note kdvi is now okular)

  • Someone seems to have had a similar problem, but when I try to run my .dvi file for lab3, it shows this message. >> File /afs/acpub.duke.edu/users/m/w/mwc11/EGR53/lab3a/lab3.dvi does not exist. << The "lab3a" is because I already tried setting up a new directory and recopying the material from your data. I also have already made a copy from Lab3Sample... to lab3.tex. When I type in "ls", this is what I get

>>[mwc11@hudson9 lab3a]$ ls gzoom.m Header1s.m Lab3Sample_F10.tex lab3.tex lab3.tex~ RunKitchen.m <<
Thanks for your help—Preceding unsigned comment added by mwc11 (talkcontribs)

  • That usually means the lab3.dvi is 0 bytes - i.e. that latex lab3.tex did not work; you have to have a good dvi file for kdvi to work. DukeEgr93 22:43, 15 September 2010 (EDT)
    • Sorry for being a pain, but I've been trying on and on to make this work and I can't figure out exactly how to get a "good" dvi file. I've tried re-copying your files using the cp -i etc. command, making new personal copies from your lab skeleton, I've tried running just the lab skeleton, I've tried running the lab skeleton from your public page. All say that the kdvi file either doesn't exist or is x-zerosize. However, emacs DOES work. Is there something I'm missing? Should I talk to a TA? Thanks—Preceding unsigned comment added by mwc11 (talkcontribs)
    • Ok so it just magically started working by itself, hopefully it's not just messing with my head. Thank you!—Preceding unsigned comment added by mwc11 (talkcontribs)
  • How does an error with math environment, tabulars, and things that have nothing to do with the first page of a .dvi file cause nothing but the first page to appear? How does this cause the contents on the first page sometimes not appear? Debugging fixes it but I'm not sure how the code for one part affects other parts of the file so significantly. Rl104 19:40, 29 January 2012 (EST)
    • Environments are Big Deals in LaTeX - a fail in an environment can wreck the whole document. Also, when you escape out of a run of LaTeX, the .dvi file ends up being incomplete. If you hit return...a great deal...then LaTeX might be able to cobble something together for you and you can view it in kdvi. DukeEgr93 12:06, 30 January 2012 (EST)
  • When working on Lab 2, the figure diagram of the graph shows up sideways when I preview it. How can I fix that? Ls183 21:20, 30 January 2012 (EST)
    • You can put an angle=90 or angle=-90 in the epsfig command. Which figure is showing up sideways, though? DukeEgr93 17:21, 1 February 2012 (EST)
  • Anyone know the best way to display a number in scientific notation in LaTeX?Mrt19 15:43, 9 February 2012 (EST)
    • For EGR 103 labs, and many other classes, you can use the MATLAB format of 1.234e+04. If you want to make it nice - like \(1.234\times 10^{4}\) you can use 1.234\times 10^{4} DukeEgr93 14:31, 11 February 2012 (EST)