Templates, Wizards & ToolsStrange template behavior

Information and discussion about TeXnicCenter document/project templates and wizards and other tools and extensions for TeXnicCenter
steven_nevets
Posts: 9
Joined: Wed Mar 02, 2011 11:51 pm

Strange template behavior

Post by steven_nevets »

I utilize personal templates which I keep in the folder C:\Program Files\TeXnicCenter\Templates\Documents\My Templates. Occasionally, something odd happens - a newly created template won't reproduce properly when opened from within TeXnicCenter - the content appears to be written in Chinese. This seems to happen when the preamble of the template is minimal in content. This notion is reinforced by the experiment to pare down the content of a functional template. Once reduced, it behaves in the same anomalous manner. Does anyone know something about this?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Strange template behavior

Post by Johannes_B »

Hi,

you don't give us much information. Which operating system and which version of TexnicCenter are you using?
Where are the template files coming from? The behaviour you described sounds a bit like an encoding problem. You can also upload whole files to the forum server.

Best regards
Johannes
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
steven_nevets
Posts: 9
Joined: Wed Mar 02, 2011 11:51 pm

Re: Strange template behavior

Post by steven_nevets »

@Johannes_B I am using Windows 7 and TeXnicCenter 2.0 Beta 2. The templates are created by me as simple compilable .tex documents and kept in the location that I indicated.
steven_nevets
Posts: 9
Joined: Wed Mar 02, 2011 11:51 pm

Re: Strange template behavior

Post by steven_nevets »

I've attached two files:

TeXpad.tex - the original file that was saved in C:\Program Files\TeXnicCenter\Templates\Documents\My Templates

when_opened.tex - the corrupted version of TeXpad.tex that opens when called upon from within TeXnicCenter.
Attachments
when_opened_.tex
(254 Bytes) Downloaded 812 times
TeXpad.tex
(167 Bytes) Downloaded 785 times
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Strange template behavior

Post by Johannes_B »

Your file »when_opened.tex« contains a Byte order mark, TexnixCenter seems to be very confused about this. Try opening a new file within Texniccenter and save it there, too.

Btw: Texnicenter 2 is now stable.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
steven_nevets
Posts: 9
Joined: Wed Mar 02, 2011 11:51 pm

Re: Strange template behavior

Post by steven_nevets »

@Johannes_B How can you tell that the document contains a Byte order mark? It is not visible to me. Certainly, I've recreated the document from scratch several times in an effort to start fresh, but the problem persists. Surely, these don't all have byte order marks. When you say "try opening a new file within Texniccenter and save it there, too", you seem to suggest that I create a new template. I have done this many times. Recall that I do have fully functional templates. Can you please clarify your suggestion. Thank you for your time.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Strange template behavior

Post by Johannes_B »

It's hard for me to tell if Texniccenter does something funny, since it is not installed on my linux. Try creating a new file with notepad (or something similar), saving it as .tex (but without the txt) with encoding utf8. You can choose the encoding while saving as.

Concerning the BOM: I ran

Code: Select all

$ file when_opened_.tex 
wich gave me

Code: Select all

when_opened_.tex: UTF-8 Unicode (with BOM) text, with CRLF line terminators
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Strange template behavior

Post by Johannes_B »

You can also choose the encoding while saving as within TXC. Choose utf8 without BOM. A notification to the maintainers would be great though.

Best regards
Johannes
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
steven_nevets
Posts: 9
Joined: Wed Mar 02, 2011 11:51 pm

Re: Strange template behavior

Post by steven_nevets »

Unfortunately, the problem persists even when I've saved the file with the UTF-8 (without BOM) encoding.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Strange template behavior

Post by Johannes_B »

Then i guess you should contact the TexnicCenter Support and state your problems there. They might be more suited to help you.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply