General ⇒ Texnic generates blank PDF
Texnic generates blank PDF
I'm trying to use Texnic along with Miktek 2.7 to write my thesis. When it's set to "Latex=>PDF" and I click on "Build Current File" (I don't know why but "Build Output" is disabled) it says that it found no errors, some "bad boxes" and some warnings. It generates a PDF file with 78 pages but they are all blank and as I scroll down a message saying "An error was found in this file" is displayed. After I click OK on this message box, another one pops up saying "Wrong operand type".
If I change the setting to "Latex=>DVI", the file is correctly generated.
Any suggestions?
Thanks a lot in advance!
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Texnic generates blank PDF
The "Build Output" button (or pressing F7) is only active when working with a project. So you can make sure that always the main file of the project is processed. You must not neglect the warnings. In most cases they are very useful to explain why things are going wrong. I suggest to attach the log file here.bcfla wrote:[…] When it's set to "Latex=>PDF" and I click on "Build Current File" (I don't know why but "Build Output" is disabled) it says that it found no errors, some "bad boxes" and some warnings. […]
Choose the build profile "LaTeX => PS => PDF" and check the log file as well as the resulting PDF. If necessary, provide a minimal working example (MWE) that reproduces the undesired behaviour or attach the critical source file here. Alternatively you should post at least the preamble of your document. Sometimes that's enough to find causes of errors.bcfla wrote:[…] It generates a PDF file with 78 pages but they are all blank and as I scroll down a message saying "An error was found in this file" is displayed. After I click OK on this message box, another one pops up saying "Wrong operand type".
If I change the setting to "Latex=>DVI", the file is correctly generated. […]
Best regards and welcome to the board
Thorsten¹
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Texnic generates blank PDF
Thank you very much for your reply.
I'm a complete newbie to Texnic (actually, to Latex as a whole) and I'm not sure of what to look for in the log file. Nothing in the file caught my eye as something that might be the cause of the problem or that I would be capable of solving.
I tried setting up an example of my file that replicates the condition I described, which is attached along with the .cls file. If anyone is able to take a look at this I would greatly appreciate it.
Once again, thanks a lot for all the help!
Best regards
- Attachments
-
- Dissertation.zip
- (8.63 KiB) Downloaded 160 times
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Texnic generates blank PDF
Supplement:
I'm not sure but I probably found the cause. The custom class file requires the graphicx package.
Code: Select all
\RequirePackage[dvipdfm]{graphicx}
Code: Select all
\RequirePackage{graphicx}
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Texnic generates blank PDF
I have tried the piece of code you posted but got an error saying "Unknown graphics extension: .ps".
I am now attaching the log file for both cases (with and without the modification of the .cls file) and also the brhyphen.tex just in case.
Hope I have done things right this time

Best regards!
- Attachments
-
- Files.zip
- (10.92 KiB) Downloaded 145 times
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Texnic generates blank PDF
Code: Select all
! Undefined control sequence.
\puc@setmargins@front ->\setpage
{\csname puc@textheight@front\endcsname }{\...
l.63 \begin{document}
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Texnic generates blank PDF
I have absolutely no idea of what to do but if I get an answer to this I'll post here.
Best regards.
Texnic generates blank PDF
The command which yielded the error reported by localghost is \setpage. I conjectured that it was related with fixing the page layout, so I took a look to one of the packages loaded by ThesisPUC.cls, specifically, to chngpage.sty. I opened this file located somewhere in my TeX-Live 2007 distribution. I found there a quite similar command, \changepage, which fitted with the usage and number of arguments that ThesisPUC.cls assigns to \setpage. When I downloaded the zip file from the above link, I understood the whole matter: Thomas Lewiner has adapted chngpage.sty, introducing \setpage and more commands, but unfortunately he did not change the file name. The package that he distributes together with ThesisPUC.cls is unproperly named chngpage.sty, leading to confusion.
ThesisPUC.cls also loads the graphic file puc.ps, with the logo of the university. Since it is a ps file, the class forces to follow the path LaTeX->PS->PDF. I've converted that file to PDF format and changed puc.ps by puc.pdf in ThesisPUC.cls, since I prefer the direct way from LaTeX to PDF. But then I found a new error: hyperref is loaded with an unexisting option pdflatex. After replacing pdflatex by pdftex, I managed to compile.
Re: Texnic generates blank PDF
http://cuca.mat.puc-rio.br/~tomlew/thesis_puc.zip
Thank you for the comment!!
Re: Texnic generates blank PDF
I'll try to make it work right now!
Best regards,
Bruno