0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

texをpdfにビルドする一方pandocでword化するときにはまった(\maketitle)

Posted at

概要

texをpdfにもビルドしたいし、wordにもしたいときに\maketitleがエラーになったのでそれを極力姑息に修正したかった。

環境

Mac

内容

問題点

main.texをpandocでmain.docxに変換するときに、以下の行でエラーとなった。

\maketitle

コマンド

コマンド
pandoc main.tex -s -o main.docx

エラー

エラー
Error at "main.tex" (line 87, column 1):
unexpected \begin
expecting \end{center} or \end{document}
\maketitle
^
make: *** [build] Error 64

解決策

grepで強引に消した

cat main.tex | grep -v '\maketitle' | pandoc -f latex -s -o main.docx

感想

自分だけ使うスクリプトだからこれでいいのよ
image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?