I am currently writing academic papers in Scrivener. I simply use LaTeX tags in my documents. I want to export my files as LaTeX (with the .tex file extension). Currently I export the documents as plain text (.txt) files, but when I try to open a file, TeXWorks and other LaTeX editors assume that the file extension is .tex so I have to mess around a little before I can open my file, either changing the file extension to .tex manually or by adjusting the file format to .txt.
I would like to export the file as a plain text file with the .tex file extension. Is there any way to do this? As far as I can tell, it’s hard coded into Scrivener and there is no option to modify it.
There is definitely a bug. I want to use Compile for .txt because it simply merges all documents together and preserves all text. But I don’t want the .txt extension because LaTeX is expecting .tex.
It is reproducible as follows:
The file myFile.tex already exists in my directory. I want to replace the file, so I select compile as “txt”, type the name is myFile.tex. Scrivener says, “myFile.tex already exists. Do you want to replace it?”. If I click “Yes”, it saves the file as myFile.tex.txt. Notice that it saved the file with a different name than the file that existed, and also a different extension than the one I want.
If myFile.tex.txt exists in the directory but not myFile.tex, then I select compile as “txt”, Scrivener does not notice that the file already exists. It provides no warning. But it overwrites the file myFile.tex.txt.
This is clearly unintended, because Scrivener checks if a different filename than the file written exists.
Something that often works for me in similar situations is to put quotation marks around the filename in the Save As dialog, e.g., “myFile.tex”. Depending on your Windows version, this should tell it to save using the exact filename specified. Might be worth a try anyway.
I made the same response to your posts in the Bug Hunt forum. Just FYI, it’s generally deprecated to post the same issue in two different forums.
If the file is a text file and a single file, you can just change the .txt extension to .tex. It is not uncommon for conversion programs to export pdf files as pdf and text files as .txt regardless of what the user might specify. However, a rose is a rose and a text file is a text file regardless of name.
As for overwriting, if you always rename it, from .txt to .tex then it will never be overwritten as the name will never be the same. I’d stop trying to force it and just accept that it will add .pdf to pdf files and .txt to text files and .doc to older word files etc.
This is an old thread. It’s over a year old. And it’s not the same issue. I posted in this thread to reported my desire to save with .tex extension over a year ago. Then this week I was compiling different documents and found that there is a bug. I attached the cross reference to reduce any confusion that it might be the same issue, since it’s not. This thread is about wanting to save with a .tex extension so we can discuss the bug in the other thread.
Thanks for your opinion. However, I think it’s interesting that what you said is slightly off. If I rename it from .txt to .tex, the .tex file is erased but the file is saved with a .tex.txt extension. Since I need the extension to be .tex for it to compile in LaTeX, it must be manually changed.
At this juncture, you are correct that I can’t “force it” but it’s extremely annoying to need to manually change the file extension. When compiling for .tex, a single error will halt the compilation. That means I need to go back to Scrivener, fix the error, then compile to .tex.txt, then manually change the extension to .tex, then LaTeX compile again. The step of manually changing the filename gets done numerous times and it’s quite annoying. Although it only takes 10 seconds to do that, when I need to repeat the process 20 times or more for each chapter, it’s wasting several minutes. Plus as I have found, there is a bug.
When scrivener compiles a pdf file, it adds the .pdf extension to the file regardless of what you call the file
When Scrivener compiles a .rtf file it adds the .rtf extension to the file name.
And it follows this procedure for all 8 file types it compiles to.
So compiling august_bills.2017 to pdf will produce the file august_bill.2017.pdf
Are you are saying this procedure ok with pdf, doc, docx, rtf and so forth but not txt? With txt it is a bug? Or are they all bugs?
It seems to me that you are asking for a feature request to either add compiling to .tex or to allow you to override the default extension. I can certainly understand you wanting this additional feature. I’ve been frustrated by programs that didn’t give me as much control as I wanted, as well as being happy when they took care of stuff like file extensions for me.
I have been developing software for decades and I can say for sure that allowing someone to save a file with the file extension of their choice should be the default behavior. It is so easy to make such an interface user-friendly AND flexible I would code it without even thinking of doing it a different way. Such a simple thing to do in code that it does not even qualify as a feature request. You never know exactly how creative people will get with your software, so why force them to do things in a standard way? The standard way is not always the desired way. Besides, a text file has MANY valid extensions, not just .txt. Almost every program I have ever used allows text files to be saved with any extension.
There are several ways it could be coded, each one just as simple. Example:
Before saving the file, check to see if it has an extension added. If so leave it as is. Otherwise, add the appropriate extension. If it is a file type that does not normally have any other valid options for an extension, pop up a dialog and confirm if they really want to change the extension. You never know what they are going to do with it, and it is not really your place to force them to have any particular extension, no matter what the standard. Maybe they have a process that does some other processing first? I have written the code for this many times, have lots of good ideas about implementation, but I am not going to spend time writing it here.
I used Pelican to compile articles and blog posts using either markdown or restructured text. Scrivener can compile markdown, but not restructured text. So I want to compile in text format with the extension .rst. But because this is one place scrivener is trying to be smart but is actually being stupid, it creates a major hassle over something so incredibly SIMPLE! Every time I compile from Scrivener I have to remove the .txt extension because it adds it on even when I save it as .rst.