|
For those of you who don't know what LaTeX (the x i pronounced similar to the "ch" in chicken) here is a (very) short intro. LaTeX is similar to a programming language (like C++) since you have a source file, in which you write your commands, and compiler which puts everything together. The difference is that LaTeX is (mostly) used for producing math/scientific papers and documents. If you haven't tried it, and have use for a fast end easy way (once you have figured everything out) to write math papers, definitely check it out!
Anyway, on to my problem...
I use TeXnicCenter as my editor, MiKTeX as my compiler and Foxit as my pdf reader.
I write my stuff, compile and watch it come out as a .pdf, so far so good. But after I add something to my text and then 'compile and view' a new Foxit window appears but the old one is still there. So after a while I have like 10+ Foxit windows with basically the same stuff on them, but only one containing my latest updates.
I know I can just close the 'old' pdf files, but seems like a waste of time, and I know that there is a solution. Here is my TeXnic config:
In the Build->Define Output profiles/Viewer
Path: .../Foxit Reader.exe View Project's Output: Command line argument, command: "%bm.pdf" Forward search: (same as above) "Do not close"
I've tried fixing this by, instead of giving the path to the FR.exe, giving it to a .bat file which closes FR, and then opens it up again. I've tried several different codes but none of them seems to work the way I want them to. I read about this some (inferior) forum and the solution they posted was create a "foxit_restart.bat" to replace the regular .exe file. Here is the code:
TASKKILL /FI "WINDOWTITLE eq %2.pdf*" START "C:\Programme\Foxit Software\Foxit Reader\Foxit Reader.exe" %1
They also said to change the settings to:
Path: .../foxit_restart.bat View Project's Output: Command line argument, command: "%bm.pdf" %tm Forward search: (nothing) "Do not close" (BTW if anyone knows what "%bm.pdf" %tm means, please tell me)
I've changed the path to the correct one (including making the path swedish, not german). And since I have Win XP home, the commands are a little different in the .bat file (took me a while to figure that out... im not use to the cmd promt/code). My version looks like this:
TSKILL /FI "WINDOWTITLE eq %2.pdf*" START ".......\Foxit Reader.exe" %1
Thats all I know I have to change, don't really know what the '%' , '1' and '2' means... I've also tried a simpler version, just to see if it gets the job done, it does, but with some side effects. But none of them work when i replace the Viewer path to the .bat files. Everything it does is when I press 'view' in TeXnic a window is shown for a split second and then nothing. (I think It's a cmd window). The simple version:
TSKILL FOXITR~1 CD "...\FOXIT READER" "FOXIT READER.EXE"
I'm hoping sure someone out there knows this.
TY in advance
/Marcus
|
I used to use the same setup as you until I switched to Linux.
My suggestion would be to close the reader everytime you want to compile again. Come on, it's not that bad! If this is REALLY too much trouble for you as you claimed, I believe (not 100% sure) Acrobat Reader does not have this problem. Or you can just compile to *.dvi if you are not embedding anything tricky.
|
I use MikTex + TexWorks and the PDF generated always replace the old one. I didnt have to modify anything so that he behavied like that.
TexnicCenter looks very confusing, never used it so I cant really help :/
|
%1 and %2 etc are the first and second (etc) parameter of the batch file call.
for instance -> bla.bat: echo $1
then the call > bla asdf will execute "echo asdf", hence print asdf on your console.
|
On November 21 2010 07:40 fabiano wrote: I use MikTex + TexWorks and the PDF generated always replace the old one. I didnt have to modify anything so that he behavied like that.
TexnicCenter looks very confusing, never used it so I cant really help :/
Or this. Use TeXWorks instead. Or WinEdit, or use Linux . I always find TeXnicCenter lacking in features anyways. Have you even tried other IDEs before? Give other ones a shot, you may actually find something you like. I used to be exclusively on TeXnicCenter too before I decided to explore other options.
|
First reply after 3 min, TL never lets you down.
I've thought about switching editor since i haven't used it very long, I'm not that attached to it. The reason why I chose TC is because one of my friends have used it for a while, so I figured I could ask him. But apparently not. Maybe I should switch, I've heard that WinEdt is good, I'll check that out. Or if you guys have other suggestions.
TY for the replies
|
As was mentioned, %1 and %2 correspond to the first and second arguments passed on the command line when running the batch file (lol windows shell scripting).
More importantly, LaTeX is pronounced "lah-tek" (I've also heard "lay-tek", but I'm pretty sure that only happens when people realize they're mis-pronouncing the word halfway through saying it). The X is pronounced like a hard "k".
If you don't feel like dual booting linux, using a virtual machine (like vmware or virtualbox) to run linux from windows is a good next solution. I do this on my laptop, and it works fine for anything not memory or graphics intensive.
|
I use TeXnicCenter and MiKTeX also but use Adobe Acrobat as the PDF reader. It closes the old PDF everytime you recompile just like you want, so perhaps you could just switch to this.
|
When working on Windows I found LEd (Latex Editor) to be the simplest and best front end to use. And for your problem, I can't see how hard Alt+F4 -> PDFLatex compilation shortcut can be...
@Fibster: AR might do the trick, but it's so slow and bloated compared to Foxit that I'm not sure I'd recommend it to anyone.
|
(sorry for caps lock)
THERE ARE OPTIONS IN FOXIT, LIKE "USE EXISTING WINDOW" AND "DO NOT USE TABBING", YOU JUST NEED TO FIND THEM!
It has nothing to do with Latex and Texniccenter, you just need to make Foxit use existing open windows, so only one .pdf can be open at a time.
In Foxit: Tools -> Preferences -> Documents Uncheck "tabbed documents" and "allow multiple instances" (right there at the top).
Works for me (same setup).
|
I would strongly recommend using linux for LateX stuff, either a dual boot or through a virtual machine like vmware. You can use the plugin for gedit if you want an editor (or even better emacs) and handle all your compiling and file management with simple shell scripts. I used LateX editor when working in windows, which isn't bad, but I much prefer the simplicity of doing all of this in linux.
As for your .bat %# is a command line argument, whereas something in between % is a variable. You can figure out what is being passed to the script by just echoing out the $1 and $2 variables to a text file or something.
|
I use LaTeX occasionally, I can't really help you with your TeXnicCenter program but I use Texmaker if you wanted to try something different. It works pretty well, and it seems more userfriendly.
|
moktira
Ireland1542 Posts
WinEdt requires a license though so it can be a bit of a pain, also when I used it it wouldn't let you compile if you left the .pdf file open but it would for .ps (granted it was a few years ago so maybe the current build isn't like that).
I use TeXnicCenter at the moment and prefer it to LEd, never tried TeXWorks, I must try it.
|
|
|
|