LaTeX output not copied to FILE Why?

In summary: So, it becomes:\begin{tabular}{|l|l|l|}\hlineBiased Voltage & \multicolumn{1}{c|}{Recorded data}\\\cline{2-3}& Voltage drop across diode(mV) & Voltage drop across resistor(mV)\\\hline0.00 & 0.006432 & -0.006394\\5.01 & 4.5550 & 0.691\\10.01 & 9.0899 & 1.023\\15.03 & 13.
  • #1
JamesJames
205
0
I am just getting started on LateX and here is what I have done

I typed in this trial file and saved it. Then at the prompt typed latex myfile where myfile is the name of the file...
\documentclass{article}
\begin{document}
psi\mapsto 1/2\,m{\omega}^{2}{x}^{2}\psi
\end{document}

A whole bunch of stuff came up and then it said "No output pages" and then "Transcript copied to myfile.log."

I am using XP.

What do I have to do to see the following output in a file?

[tex]
H:=psi\mapsto \frac{1}{2}\,m{\omega}^{2}{x}^{2}\psi
[/tex]


I am getting the hang of the coding..

[tex]
shro:=-\frac{1}{2}\,{\frac {{h}^{2}{\frac {d^{2}}{d{x}^{2}}}\psi \left( x \right) }{
m}}+\frac{1}{2}\,m{\omega}^{2}{x}^{2}\psi \left( x \right) =E\psi \left( x
\right)
[/tex]

[tex]
-\frac{h \omega\}{2}\,left( {\frac {d^{2}}{d{y}^{2}}}\psi \left( y \right)
\right) +\frac{1}{2}\,\omega\,{y}^{2}h\psi \left( y \right) =E\psi
\left( y \right)
[/tex]

James
 
Last edited:
Physics news on Phys.org
  • #2
WOW, that really does look nice eh ?

Man, I wish it would just work on my system :cry:
 
Last edited:
  • #3
Try \documentclass[12pt, letterpaper]{article}

Just a shot in the dark.

Edit make sure you denote any math by $-delimiters.

You have a few choices: (I'll list a few)

$x^2$
\begin{displaymath}x^2\end{displaymath}


Make sure your read some of the LaTeX documentation, plenty of it on the internet. Any TeX distribution will come with a short introduction to LaTeX (it's a PDF file), along with the AMS Math documentation (very well written).
 
  • #4
Where would I put this?

$x^2$
\begin{displaymath}x^2\end{displaymath}

why? and what does it do?
 
  • #5
JamesJames said:
Where would I put this?

$x^2$
\begin{displaymath}x^2\end{displaymath}

why? and what does it do?

In order to have text formatted as math, you have to put LaTeX into either math or displaymath mode. $ ... $ puts LaTeX into math mode (it's actually the same as \begin{math} ... \end{math}). This mode is used when you want the math to be placed inline into text.

The other mode is \begin{displaymath} ... \end{displaymath}, which I think can also be written in shorthand as \[ ... \]. This mode places the math onto a separate line.

When writing LaTeX on this board, these modes are implicitly already in use; math mode produces the same formatting as using "itex" tags here, and displaymath mode produces the same formatting as using "tex" tags.

If you aren't in either of these modes then a lot of the math symbols are not defined and so will generate errors when you try to compile the document. This would explain why you aren't getting any output.
 
  • #6
I am trying to get the output on more than one line...how do I split it up?

[tex]
\\shro1:=-1/2\,{\frac {{h}^{2}{\frac {d^{2}}{d{x}^{2}}}\psi \left( x \right) }{
m}}=E\psi \left( x \right)\\1/2\,{\frac {{h}^{2}{k_{{1}}}^{2}}{m}}
[/tex]

[tex]
-1/2\,{\frac {{h}^{2}{\frac {d^{2}}{d{x}^{2}}}\psi \left( x \right) }{
m}}+{\it V0}\,\psi \left( x \right) =E\psi \left( x \right)
[/tex]

I can do it on here but in latex, separating the lines using \\ does not seem to work

\documentclass{article}
\begin{document}
\begin{displaymath}
\\shro1:=-1/2\,{\frac {{h}^{2}{\frac {d^{2}}{d{x}^{2}}}\psi \left( x \right) }{
m}}=E\psi \left( x \right)\\1/2\,{\frac {{h}^{2}{k_{{1}}}^{2}}{m}}\\-1/2\,{\frac {{h}^{2}{\frac {d^{2}}{d{x}^{2}}}\psi \left( x \right) }{
m}}+{\it V0}\,\psi \left( x \right) =E\psi \left( x \right)
\end{displaymath}
\end{document}
 
Last edited:
  • #7
I am trying to produce equations one line after another rather than side by side but it won't work. Is the class type wrong? AM I giving the wrong begin and end commands?

This is really frustrating !

[tex]
\begin{eqnarray}
f(x) & = & \cos x \\
f’(x) & = & -\sin x \\
\int_{0}^{x} f(y)dy &
= & \sin x
\end{eqnarray}
[/tex]
 
Last edited:
  • #8
Put the equations you want on two different lines into two separate displaymath sections.
 
  • #9
Got it..thanks again !
 
  • #10
One last question for now...how do I put tables into latex. Here is what I got...I would want the actual table to be left aligned but the table itself(not the columns) are center aligned on the page...ALL of THE TABLES ! :confused:

Here is what I am using
\begin{center}
\begin{tabular}{|c|c|c|}
\hline
Biased Voltage & \multicolumn{2}{c|}{Recorded data}\\
\cline{2-3}
& Voltage drop across diode(mV) & Voltage drop across resistor(mV)\\
\hline
0.00 & 0.006432 & -0.006394\\
5.01 & 4.5550 & 0.691\\
10.01 & 9.0899 & 1.023\\
15.03 & 13.648 & 1.744\\
20.00 & 18.166 & 1.939\\
25.06 & 22.752 & 1.984\\
30.00 & 27.235 & 3.813\\
35.04 & 31.810 & 2.979\\
40.00 & 36.353 & 3.859\\
\hline
\end{tabular}
\end{center}

Also, once I haev created a .dvi file is there some special way to print or can it be done just by file print?
 
Last edited:
  • #11
It won' t print a .dvi file! :cry: :cry: How do I print? This is urgent.
 
  • #12
If you're using MiKTeX, it comes with a DVI previewer called Yap. If you're not, then get Yap. Another option that you should be aware of is you can render to PDF files by using pdflatex. Depending on the TeX editor you are using, it should be easy to choose how you would like to render.
 
  • #13
James, your sourcecode is good!, however the command:
\begin{tabular}{|c|c|c|}

means three columns that are center 'c' aligned. I believe you want to substitute this command:
\begin{tabular}{|l|l|l|}

'l' for left aligned, instead of 'c' centered.

Reference:
http://www.astro.ku.dk/help/LaTeX/ltx-68.html
 
Last edited by a moderator:
  • #14
GOT it...PDF LATEX works ! That is one big relief !

Now, I have tried the |l|l|l rather than |c|c|c| but this not only moves the table to the left as I want but it ALSO realigns the headings thus MOVING them also to the left which is what I don' t want.
 
  • #15
Is there some way to remove the center "indent" that seems to exit for the tables?

And also, the first line of page 1 seems to start with two or three blank spaces before the first word appears. Is that customary?
 
  • #16
James, try these substituted commands:
\begin{tabular}{|l|l|l|}

& \multicolumn{1}{c|}{Voltage drop across diode(mV)} & \multicolumn{1}{c|}{Voltage drop across resistor(mV)}\\

Let me know if these commands work.

Reference:
http://www.informatica.us.es/~calvo/prog/in/p4.htm#C%F3digo%20ejemplo%203.-
 
Last edited by a moderator:
  • #17
I played around with the l(left) and the c(center) and it worked for this one.

\begin{tabular}{|c|c|c|}

& \multicolumn{1}{l|}{Voltage drop across diode(mV)} & \multicolumn{1}{c|}{Voltage drop across resistor(mV)}\\
 
  • #18
Ok, I am trying to type up a math document but the font is incredibly small. Is there some way to enlarge it..I tried [25pt] but it does not change a thing. Even {\Large and then the math stuff} does not change a thing.

I need help please :cry: !
 

1. Why is my LaTeX output not being copied to the specified file?

There could be several reasons for this issue. One possibility is that there is an error in your LaTeX code which is preventing the output from being generated. Another possibility is that the file path for the output file is incorrect, so the output is being saved in a different location. It is also possible that the file permissions for the specified file do not allow for writing, so the output cannot be copied. Make sure to check for any errors in your code and verify the file path and permissions.

2. How can I specify the file path for the output in LaTeX?

You can specify the file path for the output in LaTeX by using the \output{filepath} command. Make sure to include the file extension in the filepath as well. It is also important to double check the filepath to ensure the output will be saved in the correct location.

3. What is the default location for LaTeX output files?

The default location for LaTeX output files is the same location as the .tex file that is being compiled. If no filepath is specified, the output file will be saved in this location. It is recommended to specify a filepath to ensure the output is saved in a specific location.

4. Can I change the output file name in LaTeX?

Yes, you can change the output file name in LaTeX by using the \output{filepath/filename.extension} command. Make sure to specify both the filepath and the desired file name, including the file extension. This will save the output file with the specified name in the specified location.

5. How can I check for errors in my LaTeX code?

You can check for errors in your LaTeX code by compiling your document and checking the log file. Any errors or warnings will be listed in the log file, along with the line number where the error occurred. You can also use a LaTeX editor or online compiler that will highlight any errors in your code as you type. Additionally, there are several online resources and forums available for troubleshooting common LaTeX errors.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
906
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Advanced Physics Homework Help
Replies
10
Views
543
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
Replies
3
Views
363
  • Calculus and Beyond Homework Help
Replies
6
Views
984
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
5K
  • Advanced Physics Homework Help
Replies
24
Views
767
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
926
  • Advanced Physics Homework Help
Replies
1
Views
859
Back
Top