7/20/2023 0 Comments Texworks word countIn the meantime, the fix is to, well, stick to file and directory names that have no spaces in them. I hope a future release of MikTeX will resolve the issue, because I do occasionally use spaces in file names. If anyone has experience with this, please let me know in the Comments.īottom line: this is a Windows- and MikTeX-specific, back-end problem that unfortunately I cannot fix. Since MacTeX generates correct sync info with or without spaces in file names, I suspect that TeXlive under Windows does, too. One way to test this would be to run the TeXlive distribution on Windows it, too, includes synctex, and the standard Mac TeX distribution, aptly named MacTeX, is essentially just TeXlive compiled under OSX, with some additional apps. The synctex code is largely cross-platform, so the problem must be in the way MikTeX incorporates or adapts it on Windows. However, on Mac OSX, synchronization works fine with file names that include spaces. Now, in principle, the problem may be with the synctex library itself. Incidentally, the TeXworks test exonerates SumatraPDF, because TeXworks and SumatraPDF use different libraries to render PDF files (although they both use synctex for backward and forward searches). Google says it fails with WinEdt, TeXmaker and other editors as well. I double-checked this two ways: first, if there are no spaces in the path name, ST2 SumatraPDF work just fine second, if there is a space in the file name, then synchronization also fails in TeXworks. Unfortunately, if the LaTeX source file name (more precisely, its full path name) contains a space, the generated sync information is incorrect. Like many other TeX distros, MikTeX relies on a library called “synctex” to generate the synchronization information (the “.synctex.gz” files that get created whenever you pass the “-synctex=1” option to pdflatex). (In fact, MacTeX's stats option may be using texcount under the hood.) If you don't have it, you can download it here. It's a perl script () that comes with texlive, which I believe is what MacTeX is built on, so you should have it. Rather, the failure of synchronization is a well-known issue that affects the (otherwise excellent) MikTeX distribution. Check out the command-line program texcount. Still, one can never rule out new bugs with updates to both ST2 and SumatraPDF this is the reason why I occasionally take a trip to the Win7 side, as I did today.Įnds up the problem is not with ST2 or with the LaTeXTools plugin: the sync infrastructure is still solid on Win7. This was both surprising and worrisome: I have been developing the LaTeXTools plugin for ST2 under Mac OSX lately, but my focus has been on cross-platform features I assumed that the sync infrastructure, which is very platform-specific, was in a stable state by now. jumping from the LaTeX source to the PDF output and conversely) kept failing with the particular file I was working on. After a long hiatus, I fired up a Parallels 7 virtual machine and decided to use SumatraPDF and Sublime Text 2 under Win7 for my day’s work (which is, as usual, LaTeX-heavy). Ps - A nice alternative would be to send a DDE command ("open("%bm.wc")") to TeXnicCenter itself, but I wasn't able to get this to run, neither by commandline argument with "/ddecmd" nor by a DDE Open command.In three words: it doesn’t work (does “doesn’t” count as 1 or 2 words though?).Ī bit more detail. To display the results, in the Viewer tab simply put your favourite text editor (e.g., "notepad .exe") with appropriate argument (for notepad , it's simply "%bm.wc"). In detail: Define a new TeXnicCenter output profile (e.g., "LaTeX => word count") with LaTeX, BibTeX and MakeIndex disabled, and set the Postprocessor to run Perl with argument "\ %pm" and redirection to "%bm.wc". This is much more than what you get using approaches based on untex | wc. That is, you get word counts for each hierarchical level (total, per chapter, per section, down to subsubsections). The best solution seems a perl script called that counts words through the logical structure of a latex document or project. Regarding word counting in TeXnicCenter: Defining an output profile with a word counting script works absolutely smoothly for me.
0 Comments
Leave a Reply. |