2

While I went through the tutorial on Latex I couldn't get how to print "Hello World" using command tex as illustrated in wikibooks.The command I would like to execute in terminal is:

tex '\empty Hello world!\bye'.

But the error I'm getting is:

! I can't find file Hello

<*> \empty Hello

Could anyone tell me is there anything else needed to print this(Hello World) statement in the terminal using the command tex.

justin
  • 145
  • There is some misunderstanding: tex '\empty Hello World!\bye' does not print the Hello World string on the terminal itself, but uses the standard output file texput.dvi then. Are you using the correct ' characters? (If pdftex is used, the file is called texput.pdf then) –  Dec 09 '14 at 06:07
  • @ChristianHupfer:that's right.But I can't get the standard output file textput.dvi.I first tried using the ' character then tried using the backslashcharacter but still can't get the output file.Could you help me. – justin Dec 09 '14 at 06:11
  • I entered the command on a terminal and there was no error, I just copied the command from the screen and inserted it on the command line, there was no error. I imagine some strange encoding on your terminal or another typo –  Dec 09 '14 at 06:23
  • @ChristianHupfer:Thanks.I'm using Windows 7.I'm typing from command prompt and I'm using TEX live package.So does these specifications means a change in the command statement said in wikibooks?.It's also an system used from a library(restricted access by admin). – justin Dec 09 '14 at 06:25
  • Windows 7... some important information ... I think you should use " instead of ', but I don't use Windows at all, so it's just a guess –  Dec 09 '14 at 06:28
  • @ChristianHupfer:yeah that really worked.Thanks. – justin Dec 09 '14 at 06:29
  • 1
    run only tex and you are in TeXs interactive mode. Insert now hello World <enter> and then \bye. –  Dec 09 '14 at 09:13
  • @Herbert:When I entered hello World <enter> after entering tex in command prompt in Windows 7 it says !I can't find file 'hello'.Even before entering \bye it produces the mentioned error and it ask to type another input file. – justin Dec 09 '14 at 09:29
  • You have to start TeX with tex <enter> and then input Hello World –  Dec 09 '14 at 10:32
  • @Herbert:I got the result and the problem was that \relax wasn't specified for the tex command anyway I think that's a better method than the one specified in wikibooks. – justin Dec 09 '14 at 11:28

1 Answers1

9

The command

tex '\empty {Hello World!}\bye'

only works on a Unix-like terminal, for Windows command prompt, the ' characters has to be replaced by " double quotes, it is

tex "\empty {Hello World!}\bye" 

In either case, a file called texput.dvi is generated, if pdftex is used, the file will be called texput.pdf then.

This is basically a test whether the tex installation was successful.