Mac OS 中的 Word2Tex

Mac OS 中的 Word2Tex

如果我的问题之前已经得到解答,我提前表示歉意,但在相关主题中搜索后,我没有找到任何具体内容。我的问题是:

我在 Mac OS X Yosemite 10.10.4 上运行我的 TeX,不幸的是,我有一些带有数学运算的 word 文件,我需要关于如何在 MAC 中将我的 word 文件转换为 tex 的分步说明。不幸的是,我没有 Windows 电脑,手头只有 Macbook Air。

附言:我只找到了一些关于如何使用终端做一些奇妙的事情的说明,但我只是一个计算机用户,希望能为初学者提供一些建议。

答案1

我第一次尝试 Pandoc,经过 2 分钟的调试并删除一些 latex 无法翻译的内容后,我得到了一个从 docx 到 tex 的完美转换文档。它对我来说很有用。

  • 我使用最新的 Mac MS Word
  • 已经安装 MacTex
  • 将 .docx 转换为 .tex
  • 如果你需要这些数字,请确保在“panic-test”文件夹中创建“media”文件夹,按照pandoc 入门说明

答案2

我在 Windows 电脑上进行了测试pandoc,我认为结果应该类似Mac OS。我有两个用创建的 word 文件MS Word 2010。其中一个是:
在此处输入图片描述
在 Windows 命令窗口中使用以下命令将其转换为乳胶:

pandoc test.docx -s -o test.tex

给出结果:

\documentclass[]{article}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  \usepackage[T1]{fontenc}
  \usepackage[utf8]{inputenc}
\else % if luatex or xelatex
  \ifxetex
    \usepackage{mathspec}
    \usepackage{xltxtra,xunicode}
  \else
    \usepackage{fontspec}
  \fi
  \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
  \newcommand{\euro}{€}
\fi
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
% use microtype if available
\IfFileExists{microtype.sty}{%
\usepackage{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\ifxetex
  \usepackage[setpagesize=false, % page size defined by xetex
              unicode=false, % unicode breaks when used with xetex
              xetex]{hyperref}
\else
  \usepackage[unicode=true]{hyperref}
\fi
\usepackage[usenames,dvipsnames]{color}
\hypersetup{breaklinks=true,
            bookmarks=true,
            pdfauthor={},
            pdftitle={},
            colorlinks=true,
            citecolor=blue,
            urlcolor=blue,
            linkcolor=magenta,
            pdfborder={0 0 0}}
\urlstyle{same}  % don't use monospace font for urls
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
\setlength{\emergencystretch}{3em}  % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{0}

\date{}

% Redefines (sub)paragraphs to behave more like sections
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi

\begin{document}

\begin{itemize}
\item
  pwd (or echo \%cd\% on Windows) to see what the current working
  directory is.
\item
  cd foo to change to the foo subdirectory of your working directory.
\item
  cd .. to move up to the parent of the working directory.
\item
  mkdir foo to create a subdirectory called foo in the working
  directory.
\item
  up-arrow to go back through your command history.
\item
  tab to complete directories and file names.
\end{itemize}

http://www.bleepingcomputer.com/tutorials/windows-command-prompt-introduction/

\end{document}  

在 latex 中运行代码,你将获得以下 pdf
在此处输入图片描述
另一个word文件比较复杂,虽然没有完全转换,但是还是令人满意的。这不仅仅是复制粘贴
在此处输入图片描述
转换成 latex 然后运行 ​​latex 代码后得到以下结果。(因为 word 文件是用于文章的,所以我无法提供整个 latex 代码)
在此处输入图片描述
在此处输入图片描述

实际上还是有一些缺点的。我并不是说它是完美的。我只是说它不仅仅是复制粘贴,而且是有用的。在我的第二个例子中,我在文本中有一个完全转换的参考书目。表格也转换得当,但我的照片没有转换。对于图表,我认为你应该使用另一个答案。因为文本是我的一篇未发表的文章,所以我无法为你提供完整的代码。事实上,你会在数学公式方面遇到一些麻烦。根据我的实验,pandoc 在转换复杂冗长的数学方程式方面并不是很好。

我的书目是用 endnote 创建的,并且完全完美地转换

答案3

该网站目前处于测试阶段,但正在不断改进。如果您遵循所有指南,那么您可以获得相当不错的“.tex”代码和“.pdf”。如果您遇到任何问题,请给他们留言,他们会解决的。

试一试https://www.docx2latex.com/

相关内容