How to convert .tex files to .doc

Talk about anything at all....
User avatar
fredfred1234567890
Banned
Posts: 124
Joined: Mon Nov 28, 2022 9:14 pm

How to convert .tex files to .doc

Post by fredfred1234567890 »

My book will have some mathematical publications in it. They are fine in their pdf format. But my book's main document is a .odt in Libre Office. So I want my .tex and .pdf files converted into .doc.

One tool I tried was Aspose. It converted the .tex file into a .html file pretty ok. But when I opened the .html file in Libre Office Writer, I was surprised to find out that Libre Office Writer could NOT handle all the fonts and mathematical text (even though it's just a small document). I then decided to see if I could first convert the .tex directly to .doc. Again, it worked but I don't have Microsoft Office so I emailed the doc to my usual machine for writing the book but when I opened it, it looked like all hell. None of the vectors or equations look right. By the way, I did not look at the .html file in Evince - maybe I'l try that. And it looked fine in Web browsers - so the .html file is not the issue. Aspose made an ok .html file. It's something in Libre Office Writer that's the problem. It just looks awful.

So my fundamental questions are:
1) How can I manage the process of converting my pdf files into the .dot environment that I used in Libre Office Writer - is it an issue of fonts or do the converters just stink(my guess).

2) Why don't the tools just do a better job? Why is it so much struggle?

So does anyone know how to back-convert pdf files into .odt, .docx, or .doc files so I can edit the book at the .dot level and not have to wait to include the files as a pdf later. I want the whole book written in .odt, then convert it to .doc and .pdf versions.

Thank you.
Last edited by fredfred1234567890 on Mon Dec 12, 2022 12:49 am, edited 1 time in total.
LibreOffice 5.2.7.2 Linux 4.14
User avatar
Villeroy
Volunteer
Posts: 31282
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: How to convert .tex files to .doc

Post by Villeroy »

The task is copletely unrelated to OpenOffice. No software is able to convert anything into anything else. IMHO, it makes no sense to convert LaTeX files into MS Word formats, particularly not with a third party software.

PDF is an output format. You can convert anything printable into PDF. Converting PDF back into some original document format is like pushing the tooth paste back into the tube.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Zizi64
Volunteer
Posts: 11370
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: How to convert .tex files to .doc

Post by Zizi64 »

Tha native file format of the LibreOffice and Apache OpenOffice is the ODF (Open Document Format), .odt for the textuals files. Use that international standard file format for your important documents in AOO and LO.

The .pdf file format was not developed to reedit the .pdf files with other software than ADOBE. The .pdf is for reading and printing of the documents on various operating sytem/environments.

The .doc, .dot file formats are obsolete (Microsoft Office related) file formats.
Last edited by Zizi64 on Mon Dec 12, 2022 8:00 am, edited 2 times in total.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
RoryOF
Moderator
Posts: 34627
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to convert .tex files to .doc

Post by RoryOF »

If you have access to tex, take high-res screenshots (300/600 dpi) of your equations and paste these into your LibreOffice file as pictures.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
fredfred1234567890
Banned
Posts: 124
Joined: Mon Nov 28, 2022 9:14 pm

Re: How to convert .tex files to .doc

Post by fredfred1234567890 »

Villeroy wrote: Sun Dec 11, 2022 8:34 pm The task is copletely unrelated to OpenOffice. No software is able to convert anything into anything else. IMHO, it makes no sense to convert LaTeX files into MS Word formats, particularly not with a third party software.

PDF is an output format. You can convert anything printable into PDF. Converting PDF back into some original document format is like pushing the tooth paste back into the tube.
I don't know who the retard was who put the textboxes into the pdf file formats but IMHO, .doc and .tex are better than pdf. Adobe's files are at best an output format only, not something easily editable or that I really want to edit. If they could get rid of those crutch-boxes, but my question isn't off-base. Any file format can be converted to any other. You just have to have the fortitude to do it. I need an answer that can solve my problem. Someone probably knows how. I can partially solve the problem already, it just doesn't look nice enough. It doesn't take a PHD to convert a document in one format, to another. Just read the file and convert it, that's all. Just know what you're doing if you write a converter. I have the document already converted from .tex to .html. I just need a tool now that can go from .html to .doc but I don't have a licensed copy of Word. I guess I have the problem half solved. I might have a machine somewhere that has a copy of MS Word - I'll keep looking through my house. Thank you for your opinions, the three of you. I don't think it's an obsolete format to use Word.
LibreOffice 5.2.7.2 Linux 4.14
User avatar
RoryOF
Moderator
Posts: 34627
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to convert .tex files to .doc

Post by RoryOF »

Have a look at www.zamzar.com, who offer a wide range of free format transfers. You would be well advised to do the minimum number of transfers possible - i.e, better from .tex to .odt than via html.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Hagar Delest
Moderator
Posts: 32687
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: How to convert .tex files to .doc

Post by Hagar Delest »

fredfred1234567890 wrote: Sun Dec 11, 2022 9:23 pm Adobe's files are at best an output format only
Indeed, they are digital prints, that's all.
fredfred1234567890 wrote: Sun Dec 11, 2022 9:23 pm Any file format can be converted to any other. You just have to have the fortitude to do it... It doesn't take a PHD to convert a document in one format, to another. Just read the file and convert it, that's all. Just know what you're doing if you write a converter.
Then just do it!
You seem to think that manipulating documents whatever their format is easy game.
PDF is a digital print, converting it again to a source file would be trying to put the toothpaste back into the tube.
Or pay for the Adobe tool that can do it.

If what you think was so easy, there would just be a single document format.
LibreOffice 24.2 on Xubuntu 24.04 and 7.6.4.1 portable on Windows 10
User avatar
RoryOF
Moderator
Posts: 34627
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to convert .tex files to .doc

Post by RoryOF »

It might be as simple to recreate the equations in LibreOffice Math.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: How to convert .tex files to .doc

Post by John_Ha »

fredfred1234567890 wrote: Sun Dec 11, 2022 8:08 pm my book's main document is a .dot in Libre Office. So I want my .tex and .pdf files converted into .doc.
1) How can I manage the process of converting my pdf files into the .dot environment
I think that is a typo. A .dot file is an MS Word template file and I am sure you don't want to use that.

If I am correct then your problem can be stated as:

I have some LaTeX .tex files with mathematical equations. I want to insert the equations into a LO Writer document.

Please upload a small .tex file showing the problem you are having so we can look at it.

Press POSTREPLY and click the Upload attachment tab below where you type (128 kB max); or use a file share site such as mediafire, Dropbox or Google Drive for a larger file.

Also, what is the final format you want for your completed document? Do you need a .doc file? a .docx file? a PDF file? or what? There are different solutions for different output formats.

As an aside, why don't you do it the other way round? Instead of pulling your LaTeX equations into LO, why not pull your LO content into LaTeX as a .tex file? LaTeX files can easily be published.

As RoryOF suggests it may be simpler to enter the equations directly into LO. See the LO Math Guide

LaTeX can produce .dvi files which several web sites claim can be converted to .doc files. Also see LaTeX/Export To Other Formats which offers many options incl;uding:
LaTeX can be converted into an RTF file, which in turn can be opened by a word processor such as LibreOffice Writer or Microsoft Word. This conversion is done through latex2rtf ...
I suggest you read [Tutorial] Differences between Microsoft and AOO/LO files for an understanding of the potential problems you will encounter swapping between file formats.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
Lupp
Volunteer
Posts: 3554
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: How to convert .tex files to .doc

Post by Lupp »

I have to admit that I never used TeX/LaTeX myself though I often was told it's superior - in specific for mathematical formulas.
If the problem here was mine, and I had the TeX source at hand (as the questioner obviously has), I surely would first try the extension TexMaths to LibreOffice. After all it got somehow promising ratings, and is still maintained (last upate v 0.49 for LibO "7.x").
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
User avatar
keme
Volunteer
Posts: 3706
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: How to convert .tex files to .doc

Post by keme »

Let me see if I get this straight:
  • Your main document is stored as a LibreOffice Writer file.
  • Your "mathemathical publications" are PDF files inserted into your document.
    Did you insert entire file, or cut and paste elements from an open pdf?
  • There is some "tex".
    Are your TeX elements "full scale" (like a page or a chapter of your book) or blocks (contained within a page) in your odt file?
    Do you use TeX by ooolatex/texmath plugin, or some other way
Are we good so far?

Also, why do you target the Microsoft file formats? Do you envision that as the safest path, are you forced to use it for collaboration in a team, or some other reason?

At best, the questions give you an idea of how to proceed. If they do, please give us a note. If they don't, try to answer them here. It helps us to help you.
User avatar
RoryOF
Moderator
Posts: 34627
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to convert .tex files to .doc

Post by RoryOF »

Another question: approximately how many equations are involved?
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: How to convert .tex files to .doc

Post by John_Ha »

fredfred1234567890 wrote: Sun Dec 11, 2022 8:08 pm 2) Why don't the tools just do a better job? Why is it so much struggle?
File formats are designed specifically to match the requirements of the program they are intended to be used with.

An analogy. A baseball bat and a tennis racquet are each used to hit a small ball so are broadly equivalent. Each is designed (has a format) specifically for the game they are used in.

Now try converting a baseball bat into a tennis racquet ...
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
fredfred1234567890
Banned
Posts: 124
Joined: Mon Nov 28, 2022 9:14 pm

Re: How to convert .tex files to .doc

Post by fredfred1234567890 »

keme wrote: Mon Dec 12, 2022 10:45 am Let me see if I get this straight:
  • Your main document is stored as a LibreOffice Writer file.
  • Your "mathemathical publications" are PDF files inserted into your document.
    Did you insert entire file, or cut and paste elements from an open pdf?
  • There is some "tex".
    Are your TeX elements "full scale" (like a page or a chapter of your book) or blocks (contained within a page) in your odt file?
    Do you use TeX by ooolatex/texmath plugin, or some other way
Are we good so far?

Also, why do you target the Microsoft file formats? Do you envision that as the safest path, are you forced to use it for collaboration in a team, or some other reason?

At best, the questions give you an idea of how to proceed. If they do, please give us a note. If they don't, try to answer them here. It helps us to help you.
Yes, my main document, the book I'm writing is stored as an odt file in Libre Office. My mathematical publications are often done in tex and then have pdf file as output (or tex, whichever). I have not yet used Libre Office's math editor, I can try it but I would be surprised if it is as good as tex's but I'm willing to give it a try. As far as how much math will it be? I don't know and cannot yet answer that question. I'm writing a very long autobiography and I DO have to occansionally collaborate with other authors who like to use Word to do editing. So I wanted to just keep the LibreOffice as the tool. I don't have a licensed copy of Word anymore that I'm aware of.

Just a note: I just installed TexLive full packages and ran the command make4ht -f odt myfile.tex and it errored out with error 1. I don't know why. Is it another case of releasing a tool into the public domain that doesn't have intelligence in it? If it takes AI to do the job, USE IT! Just please, write tools that work!

So I'm still not productive. I will try another command today on converting the html version of my tex document (to be inserted into the main, it's brief scientific publication) into a doc. I will try that after I post this brief response. I'veonly written 107 pages of the book so far and it's going to be like 300 or so. I wrote the first 60 pages on my cellphone, then I got over my sickness and started using the computer again. I had been sick for 13 months and now can function normally again. So I have to sort of get the cobwebs out of my mind.

But I don't generally copy and paste from pdf into my odt as I don't want any textboxes in my document other than ones that I specifically authorize to be there. I don't want to insert pdf files into my odt file. I just want to convert the pdf files into an odt compatible document.

If mankind hasn't yet solved these document conversion problems then I might just have to do it myself. Someone has to do these jobs. I generally have a more sophisticated and complex approach to solving problems in software - I worked for 20 different companies in my life in the best software houses in the world. I don't get "scared" at complex designs. But I honestly didn't think that I would have to "geek" to get this book written. The publisher has given me untill May 17th.

Thanks.

PS I'm going to try next what they published at this link:

https://ubuntuforums.org/archive/index. ... 33441.html
However, getting the tex4ht installation set up correctly can be a royal pain, so here's how it worked for me.

Step 1. Install tex4ht from the Ubuntu repositories.
Step 2. Install the upgrade from here:
http://www.cse.ohio-state.edu/%7Egurari ... grade.html
This is not a simple procedure. You need to follow every single step exactly, and it takes a little while, especially if you are approaching it in a gingerly and careful way, as I was - not really understanding what I was doing! But the instructions are very clear and accurate, and do work. The conversion to OpenOffice won't work without this upgrade.

There are various other steps that may be necessary depending on what is in your LaTeX file. If, like me, you are using biblatex, you will need to install Eitan Gurari's bug fixes from here:
http://www.cse.ohio-state.edu/~gurari/T ... fixes.html
I also needed to (re)install an up-to-date version of csquotes from here:
http://www.ctan.org/tex-archive/macros/ ... /csquotes/
For some reason, it seemed to be the case that I needed to install dvipng from the repositories (though I don't really understand why).

At that point, things should be ready. Run the following from the command line as user (not root).

Step 3. latex filename.tex (it may prompt you to do this more than once)
Step 4. bibtex filename.aux
Step 5. mk4ht oolatex filename.tex (again, possibly you may need to do this more than once)

At this point, there will be various files in the directory that contained your original .tex file, but among them should be an .odt (OpenOffice Writer) file, which hopefully contains some decent approximation to what you had in LaTeX.

Worked for me! Hope it works for you.
Last edited by fredfred1234567890 on Mon Dec 12, 2022 4:39 pm, edited 2 times in total.
LibreOffice 5.2.7.2 Linux 4.14
User avatar
RoryOF
Moderator
Posts: 34627
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to convert .tex files to .doc

Post by RoryOF »

A quick search for "convert .tex to .doc" found a number of sites offering online free conversion. I pick just one (not tested)
https://docpose.com/tex-to-doc
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
fredfred1234567890
Banned
Posts: 124
Joined: Mon Nov 28, 2022 9:14 pm

Re: How to convert .tex files to .doc

Post by fredfred1234567890 »

RoryOF wrote: Mon Dec 12, 2022 4:26 pm A quick search for "convert .tex to .doc" found a number of sites offering online free conversion. I pick just one (not tested)
https://docpose.com/tex-to-doc
I just tried the above link, it failed, not even close. Thanks. It's just a short, simple .tex document, only 4 or 5 pages or 6 pages.
The aspose site was able to convert the .tex into html though so I will try a utility in my new TexLive installation next, fingers crossed.
LibreOffice 5.2.7.2 Linux 4.14
User avatar
RoryOF
Moderator
Posts: 34627
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to convert .tex files to .doc

Post by RoryOF »

There are other conversion sites; perhaps you should look for them.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Hagar Delest
Moderator
Posts: 32687
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: How to convert .tex files to .doc

Post by Hagar Delest »

fredfred1234567890 wrote: Mon Dec 12, 2022 4:14 pm Is it another case of releasing a tool into the public domain that doesn't have intelligence in it? If it takes AI to do the job, USE IT! Just please, write tools that work!
[...]
If mankind hasn't yet solved these document conversion problems then I might just have to do it myself. Someone has to do these jobs. I generally have a more sophisticated and complex approach to solving problems in software - I worked for 20 different companies in my life in the best software houses in the world. I don't get "scared" at complex designs. But I honestly didn't think that I would have to "geek" to get this book written.
Please do and keep us updated. I'm eager to see that.
LibreOffice 24.2 on Xubuntu 24.04 and 7.6.4.1 portable on Windows 10
User avatar
fredfred1234567890
Banned
Posts: 124
Joined: Mon Nov 28, 2022 9:14 pm

Re: How to convert .tex files to .doc

Post by fredfred1234567890 »

I started the new process but it has two problems, one a warning, and one an error. They've changed some stuff in Latex. It can't process the graphic because it says it doesn't know what size it is. How dumb can that be? I give it the width of the graphic. And I didn't need a bounding box in TexWorks which is where I created the file. And the other warning is command \underbar has changed. Why didn't they make it backwards-compatible? Rug out from underfoot - now I have to change my tex document somehow and learn yet another technique I didn't really want to know but I guess I have to geek again on tex. I don't mind it but it's slowing me down to do all this troubleshooting.

I do not user the command \underbar anywhere in the document. Ok, Ok, I'll fix the graphic and put a bounding box, latex makes the rules, you are the leader but why does it think I use the command \underbar when I don't? Hmm?
LibreOffice 5.2.7.2 Linux 4.14
User avatar
fredfred1234567890
Banned
Posts: 124
Joined: Mon Nov 28, 2022 9:14 pm

Re: How to convert .tex files to .doc

Post by fredfred1234567890 »

RoryOF wrote: Mon Dec 12, 2022 4:45 pm There are other conversion sites; perhaps you should look for them.
I'll keep trying to use latex approach - just have to do some debugging obviously but as for the online sites - no more because one of them brought my fatdog linux machine completely to it's knees - I had to reboot. Ugh. I'm trying to keep a list of sites so I don't repeat things, but I'm not sure which site it was.

Currerntly, my main editing is on a Linux machine under Libre Office but my Tex work is currently on a Windows laptop. I guess I could try to install Tex on my Linux machines too.
LibreOffice 5.2.7.2 Linux 4.14
User avatar
fredfred1234567890
Banned
Posts: 124
Joined: Mon Nov 28, 2022 9:14 pm

Re: How to convert .tex files to .doc

Post by fredfred1234567890 »

fredfred1234567890 wrote: Mon Dec 12, 2022 6:00 pm I started the new process but it has two problems, one a warning, and one an error. They've changed some stuff in Latex. It can't process the graphic because it says it doesn't know what size it is. How dumb can that be? I give it the width of the graphic. And I didn't need a bounding box in TexWorks which is where I created the file. And the other warning is command \underbar has changed. Why didn't they make it backwards-compatible? Rug out from underfoot - now I have to change my tex document somehow and learn yet another technique I didn't really want to know but I guess I have to geek again on tex. I don't mind it but it's slowing me down to do all this troubleshooting.

I do not user the command \underbar anywhere in the document. Ok, Ok, I'll fix the graphic and put a bounding box, latex makes the rules, you are the leader but why does it think I use the command \underbar when I don't? Hmm?
Here is the run of latex, maybe someone sees the errors? I don't know.

C:\Prj\Rain>latex myfile.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=latex)
restricted \write18 enabled.
entering extended mode
(./Myfile.tex
LaTeX2e <2022-11-01> patch level 1
L3 programming layer <2022-11-02>
(c:/TexLive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2022/07/02 v1.4n Standard LaTeX document class
(c:/TexLive/2022/texmf-dist/tex/latex/base/size11.clo))
(c:/TexLive/2022/texmf-dist/tex/latex/base/inputenc.sty)
(c:/TexLive/2022/texmf-dist/tex/latex/geometry/geometry.sty
(c:/TexLive/2022/texmf-dist/tex/latex/graphics/keyval.sty)
(c:/TexLive/2022/texmf-dist/tex/generic/iftex/ifvtex.sty
(c:/TexLive/2022/texmf-dist/tex/generic/iftex/iftex.sty)))
(c:/TexLive/2022/texmf-dist/tex/latex/graphics/graphicx.sty
(c:/TexLive/2022/texmf-dist/tex/latex/graphics/graphics.sty
(c:/TexLive/2022/texmf-dist/tex/latex/graphics/trig.sty)
(c:/TexLive/2022/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(c:/TexLive/2022/texmf-dist/tex/latex/graphics-def/dvips.def)))
(c:/TexLive/2022/texmf-dist/tex/latex/esvect/esvect.sty)
(c:/TexLive/2022/texmf-dist/tex/latex/tools/bm.sty)
(c:/TexLive/2022/texmf-dist/tex/latex/booktabs/booktabs.sty)
(c:/TexLive/2022/texmf-dist/tex/latex/tools/array.sty)
(c:/TexLive/2022/texmf-dist/tex/latex/paralist/paralist.sty)
(c:/TexLive/2022/texmf-dist/tex/latex/tools/verbatim.sty)
(c:/TexLive/2022/texmf-dist/tex/latex/subfig/subfig.sty
(c:/TexLive/2022/texmf-dist/tex/latex/caption/caption.sty
(c:/TexLive/2022/texmf-dist/tex/latex/caption/caption3.sty)))
(c:/TexLive/2022/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(c:/TexLive/2022/texmf-dist/tex/latex/amsmath/amstext.sty
(c:/TexLive/2022/texmf-dist/tex/latex/amsmath/amsgen.sty))
(c:/TexLive/2022/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(c:/TexLive/2022/texmf-dist/tex/latex/amsmath/amsopn.sty))
(c:/TexLive/2022/texmf-dist/tex/latex/preprint/authblk.sty)
(c:/TexLive/2022/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)
(c:/TexLive/2022/texmf-dist/tex/latex/sectsty/sectsty.sty

LaTeX Warning: Command \underbar has changed.
Check if current package is valid.


LaTeX Warning: Command \underline has changed.
Check if current package is valid.

) (c:/TexLive/2022/texmf-dist/tex/latex/tocbibind/tocbibind.sty

Package tocbibind Note: Using section or other style headings.

) (c:/TexLive/2022/texmf-dist/tex/latex/tocloft/tocloft.sty)
(c:/TexLive/2022/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
(./Myfile.aux)
*geometry* driver: auto-detecting
*geometry* detected driver: dvips
[1]

! LaTeX Error: Cannot determine size of graphic in RainFig1.jpg (no BoundingBox
).

See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...

Note on the above: The resulting .aux and .dvi files are empty files. No output was generated due to an apparently showstopping error with the above.

Check if current package is valid? Perhaps I need to update the packages - why was an invalid package installed on my laptop? Do I need to update? Now I need to figure out how to update my installation?
LibreOffice 5.2.7.2 Linux 4.14
Jan_J
Posts: 167
Joined: Wed Apr 29, 2009 1:42 pm
Location: Poland

Re: How to convert .tex files to .doc

Post by Jan_J »

Here is the run of latex, maybe someone sees the errors? I don't know.

C:\Prj\Rain>latex myfile.tex
The `latex` command calls obsolete TeX format and pipeline. They rely on the .dvi files that are (almost) abandoned today. The cause of the problem above as that bounding box of the jpeg graphics was undetected.
Try pdflatex instead, or even xelatex if you prefer to deal with native os fonts. Beware that xelatex needs utf-8 input.
JJ ∙ https://forum.openoffice.org/pl/
LO (7.6) ∙ Python (3.11|3.10) ∙ Unicode 15 ∙ LᴬTEX 2ε ∙ XML ∙ Unix tools ∙ Linux (Rocky|CentOS)
User avatar
fredfred1234567890
Banned
Posts: 124
Joined: Mon Nov 28, 2022 9:14 pm

Re: How to convert .tex files to .doc

Post by fredfred1234567890 »

The sequence above found the graphic although it might want a more explicit path than just dropping into the local directory. It's not perfect enough yet but some of the document is converting. It's the best so far. I need to keep trying different tools in my TexLive distrubution, including pdlatex or whatever it is.

I'm a little bit hampered right now since I'm doing all the document converting on a Windows laptop but I have to open it up in Libre OFfice on a Linux machine.
LibreOffice 5.2.7.2 Linux 4.14
User avatar
fredfred1234567890
Banned
Posts: 124
Joined: Mon Nov 28, 2022 9:14 pm

Re: How to convert .tex files to .doc

Post by fredfred1234567890 »

Jan_J wrote: Mon Dec 12, 2022 6:57 pm
Here is the run of latex, maybe someone sees the errors? I don't know.

C:\Prj\Rain>latex myfile.tex
The `latex` command calls obsolete TeX format and pipeline. They rely on the .dvi files that are (almost) abandoned today. The cause of the problem above as that bounding box of the jpeg graphics was undetected.
Try pdflatex instead, or even xelatex if you prefer to deal with native os fonts. Beware that xelatex needs utf-8 input.
I believe it IS UTF-8 but I'll try pdflatex, but doesn't that generate a pdf? I'm trying to generate a Word doc, err an odt file.
LibreOffice 5.2.7.2 Linux 4.14
User avatar
fredfred1234567890
Banned
Posts: 124
Joined: Mon Nov 28, 2022 9:14 pm

Re: How to convert .tex files to .doc

Post by fredfred1234567890 »

I have a simple question. Isn't it simple to think of the fonts. If I know which font is used in the original document. Shouldn't I simply make them available in the conversion process somehow? I want the fonts to match EXACTLY - otherwise, it won't work.

These are the fonts used by the file I'm using in Tex. I hit Ctrl-D in Adobe Reader to get at these on the fonts tab, it's an incredibly simple set of fonts. The converter needs to know these fonts and ONLY these fonts - no other!

CMEX10 (Embedded subset), Type 1, Encoding built-in
CMMI10 (Embedded subset), Type 1, Encoding built-in
CMMI8 (Embedded subset), Type 1, Encoding built-in
CMR10 (Embedded subset), Type 1, Encoding built-in
CMR12 (Embedded subset), Type 1, Encoding built-in
CMR17 (Embedded subset), Type 1, Encoding built-in
CMR8 (Embedded subset), Type 1, Encoding built-in
CMSS12 (Embedded subset), Type 1, Encoding built-in
CMSS12 (Embedded subset), Type 1, Encoding built-in
CMSY10 (Embedded subset), Type 1, Encoding built-in

Just those above and no other fonts. Just take each text element, detect it's font, then draw the characters - what could be easier, but each time I open up the documents - the fonts aren't even the same types. Sorry, but it's not difficult. Why do the programs always fail?
Just use the above fonts. I did the whole thing on Windows - the fonts should be there.

Is the problem that the tex file simply has suggestions for fonts, and then substitutes a font opaquely behind the scenes and it only appears on the final pdf file. Should I instead find a tool that works with the final outputted pdf file and tries to convert it, assuming that it would KNOW the fonts. I want a tool that simply makes a list of the fonts in the final pdf file, and errs out to an installer before proceeding. Once it has the Computer Modern fonts ready to go. What else is there? Some carriage returns and linefeeds. So far, the mk4ht doesn't even get the carriage return linefeeds correcty - unbelievable!
LibreOffice 5.2.7.2 Linux 4.14
User avatar
fredfred1234567890
Banned
Posts: 124
Joined: Mon Nov 28, 2022 9:14 pm

Re: How to convert .tex files to .doc

Post by fredfred1234567890 »

Anyone know what this is all about? My latex file runs without errors but has two warnings, I mean the output file looks fine, it's just that I want to make the original file more robust so all the processing I do will work:

LaTeX Warning: Command \underbar has changed.
Check if current package is valid.


LaTeX Warning: Command \underline has changed.
Check if current package is valid.

But I wonder if the only way to get the right fonts, which is a logical way to converrt a document, is to work off the PDF file output of Tex because the fonts are not necessarily specified in the original .tex file. I'll search in there for Computer Modern but I don't rememember seeing it? Hmm?

Which current package and how do I check if a package is valid? Why didn't it mention which package?
LibreOffice 5.2.7.2 Linux 4.14
User avatar
fredfred1234567890
Banned
Posts: 124
Joined: Mon Nov 28, 2022 9:14 pm

Re: How to convert .tex files to .doc

Post by fredfred1234567890 »

fredfred1234567890 wrote: Mon Dec 12, 2022 8:57 pm
Jan_J wrote: Mon Dec 12, 2022 6:57 pm
Here is the run of latex, maybe someone sees the errors? I don't know.

C:\Prj\Rain>latex myfile.tex
The `latex` command calls obsolete TeX format and pipeline. They rely on the .dvi files that are (almost) abandoned today. The cause of the problem above as that bounding box of the jpeg graphics was undetected.
Try pdflatex instead, or even xelatex if you prefer to deal with native os fonts. Beware that xelatex needs utf-8 input.
I believe it IS UTF-8 but I'll try pdflatex, but doesn't that generate a pdf? I'm trying to generate a Word doc, err an odt file.
When I ran pdflatex on the file, it does the same thing as the GUI does, that's all. It generates a perfectly good pdf from the tex file, but I'm trying to generate an .odt file for use in Libre Office. So that's why I used latex and not pdflatex.
LibreOffice 5.2.7.2 Linux 4.14
User avatar
fredfred1234567890
Banned
Posts: 124
Joined: Mon Nov 28, 2022 9:14 pm

Re: How to convert .tex files to .doc

Post by fredfred1234567890 »

fredfred1234567890 wrote: Mon Dec 12, 2022 10:09 pm Anyone know what this is all about? My latex file runs without errors but has two warnings, I mean the output file looks fine, it's just that I want to make the original file more robust so all the processing I do will work:

LaTeX Warning: Command \underbar has changed.
Check if current package is valid.


LaTeX Warning: Command \underline has changed.
Check if current package is valid.

But I wonder if the only way to get the right fonts, which is a logical way to converrt a document, is to work off the PDF file output of Tex because the fonts are not necessarily specified in the original .tex file. I'll search in there for Computer Modern but I don't rememember seeing it? Hmm?

Which current package and how do I check if a package is valid? Why didn't it mention which package?
%%% SECTION TITLE APPEARANCE

\usepackage{sectsty}

\allsectionsfont{\sffamily\mdseries\upshape} % (See the fntguide.pdf for font help)

% (This matches ConTeXt defaults)


I now realize that it's a package that I use for underlining and underbars - the package maintainer does a check-comparison with the kernel version and issues a warning if they are not the same versions. Not sure why - for some reason I suppose. I will try to take the line which refers to sectsty \usepackage{secsty} and not use it or else live with the warnings. I would rather leave it in there in case I DO need to use underlining and underbars. I can live with two simple warnings. I might also try loading the package earlier in the document before all the math stuff - maybe that will turn the warnings off?

Update: I tried moving the \usepackage{sectsty} to before the math but I still get the warnings. Maybe I'll remove the second mention of it and try yet again.

Update 2: I removed the second (redundant) statement but it was issuing warnings on the first one anyway so that doesn't get rid of the warnings.

There's another warning that doesn't mean much to me - perhaps it's a figure that's too big, but what is a "float"?

Latex warning: Float too large for page by 80.40706pt on input line 83. How cryptic can people be? What are we supposed to do, understand what a float is?
LibreOffice 5.2.7.2 Linux 4.14
User avatar
fredfred1234567890
Banned
Posts: 124
Joined: Mon Nov 28, 2022 9:14 pm

Re: How to convert .tex files to .doc

Post by fredfred1234567890 »

I'm going to go in a new direction now. Since the online converter I used CAN take a .tex file and make a beautiful html file out of it, I am going to look now for converters from HTML to DOC OR ODT. The online conversion to html went very, very well. Almost perfect in every aspect.

So I need to do conversions from html to either doc, docx, or odt. I would prefer odt. I'll be looking for such a converter. Perhaps TexLive can do this? Any help appreciated.

Maybe I have an old copy of word on a pc somewhere? Maybe it can do it?
LibreOffice 5.2.7.2 Linux 4.14
Mountaineer
Posts: 318
Joined: Sun Sep 06, 2020 8:27 am

Re: How to convert .tex files to .doc

Post by Mountaineer »

I don't think I can help much, and I'm not even sure you seek help here. It looks more like a rant to vent yourself...
fredfred1234567890 wrote: Mon Dec 12, 2022 9:16 pm...
and no other fonts. Just take each text element, detect it's font, then draw the characters - what could be easier, but each time I open up the documents - the fonts aren't even the same types. Sorry, but it's not difficult. Why do the programs always fail?
Just use the above fonts. I did the whole thing on Windows - the fonts should be there.

Is the problem that the tex file simply has suggestions for fonts, and then substitutes a font opaquely behind the scenes and it only appears on the final pdf file. ...
Anyway: TeX is older than Windows an had to do evereything itself. So you should test your assumption the rest of the world can see/use the fonts TeX uses.
On your Windows-machine open LibreOffice and try to find the cm-fonts, to write something in it. Can you select them for usage?
If not check Windows-fonts folder also.
I remember, when I wanted to use a cm-font outside TeX I had to install it manually.

The next point is what shall a program do, if the requested fonts are not found? One idea would be to tel the user "The two fred and his 10 digits have requested font xxx, wich I can't find. So I will give you nothing but a white page / page in default colour for background." Some people had the idea to substitute fonts to show a readable page. Some even had the idea to call this user-friendly, while you obviously prefer perfect or nothing.

Believe it or not but most pdf-viewers substitute fonts for readability. On the other hand TeX doesn't even use this fonts. In the old times there were tfm-files (tex-font-metrics), wich is all you need for layout and positioning. The actual glyph was only available to render the dvi-file in a specific resolution.
OpenOffice 3.1 on Windows Vista
Locked