[[TeXworks]] > 使い方

----
#contents
----

*使い方 [#b6337083]

**タイプセット [#h5dac63f]

&ref(https://github.com/TeXworks/texworks/raw/master/res/images/runtool.png,around,nolink,タイプセット); (タイプセットのアイコン) をクリック,または Ctrl+T (Mac では ⌘T (command+T)) を入力すると TeX ファイルがコンパイルされ,エラーがなければ PDF ファイルが表示されます.
エディタのウィンドウ左上にある緑の &color(#8AE234){▶};
ボタンで表示されているタイプセットのアイコンをクリック,または Ctrl+T (Mac では ⌘T (command+T)) を入力すると
TeX ファイルがコンパイルされ,エラーがなければ PDF ファイルが表示されます.
エラーが発生した場合は,間違っている箇所を修正してもう一度タイプセットをしてください.

エラーが発生した場合は,間違っている箇所を修正して,もう一度タイプセットをしてください.
&color(#8AE234){▶}; ボタンの右にあるドロップダウンリストからタイプセットに使う
エンジンの指定ができます.例えば “upLaTeX (ptex2pdf)” を選択すれば uplatex + dvipdfmx で
タイプセットされます.
よくある質問として
[[“! LaTeX Error: This file needs format `pLaTeX2e' but this is `LaTeX2e'.” というエラーが出る>よくある質問#cb7a8a28]]というものがありますが,
原因はこのエンジンの指定が正しくないためです.
pdflatex などしか見つからない場合は,[[TeXworks/設定]]を参照のうえ,
自分で日本語を扱えるエンジンの設定を追加する必要があります.

***upLaTeX (ptex2pdf), pdfupLaTeX, Latexmk-upLaTeX-pdfdvi の場合 [#sf7749bb]
>
&color(Black,#DAE0FE){%%% ファイル  編集  検索  フォーマット  タイプセット  スクリプト  ウィンドウ  ヘルプ                   %%%};&br;
//&ref(https://github.com/TeXworks/texworks/raw/master/res/images/TeXworks.png,around,nolink);
&ref(https://github.com/TeXworks/texworks/raw/master/res/images/runtool.png,around,nolink,タイプセット);
&color(Black,#EEEEEE){[upLaTeX (ptex2pdf) ▼]};
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-new.png,around,nolink,新規作成);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-open.png,around,nolink,開く);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-save.png,around,nolink,保存);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-undo.png,around,nolink,元に戻す);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-redo.png,around,nolink,繰り返す);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-cut.png,around,nolink,切り取り);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-copy.png,around,nolink,コピー);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-paste.png,around,nolink,貼り付け);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-find.png,around,nolink,検索);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-find-replace.png,around,nolink,置換);&br;
&br;
\documentclass[uplatex,dvipdfmx,ja=standard]{bxjsarticle}&br;
\begin{document}&br;
&br;
吾輩は猫である。名前はまだ無い。&br;
&br;
どこで生れたかとんと見当がつかぬ。&br;
何でも薄暗いじめじめした所で&br;
ニャーニャー泣いていた事だけは記憶している。&br;
吾輩はここで始めて人間というものを見た。&br;
&br;
\end{document}&br;
<

>
&color(Black,#DAE0FE){%%% ファイル  編集  検索  フォーマット  タイプセット  スクリプト  ウィンドウ  ヘルプ                   %%%};&br;
//&ref(https://github.com/TeXworks/texworks/raw/master/res/images/TeXworks.png,around,nolink);
&ref(https://github.com/TeXworks/texworks/raw/master/res/images/runtool.png,around,nolink,タイプセット);
&color(Black,#EEEEEE){[upLaTeX (ptex2pdf) ▼]};
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-new.png,around,nolink,新規作成);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-open.png,around,nolink,開く);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-save.png,around,nolink,保存);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-undo.png,around,nolink,元に戻す);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-redo.png,around,nolink,繰り返す);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-cut.png,around,nolink,切り取り);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-copy.png,around,nolink,コピー);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-paste.png,around,nolink,貼り付け);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-find.png,around,nolink,検索);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-find-replace.png,around,nolink,置換);&br;
&br;
\documentclass{jlreq}&br;
\begin{document}&br;
&br;
吾輩は猫である。名前はまだ無い。&br;
&br;
どこで生れたかとんと見当がつかぬ。&br;
何でも薄暗いじめじめした所で&br;
ニャーニャー泣いていた事だけは記憶している。&br;
吾輩はここで始めて人間というものを見た。&br;
&br;
\end{document}&br;
<
***LuaLaTeX, LuaJITLaTeX, Latexmk-LuaLaTeX, Latexmk-LuaJITLaTeX の場合 [#accef197]
>
&color(Black,#DAE0FE){%%% ファイル  編集  検索  フォーマット  タイプセット  スクリプト  ウィンドウ  ヘルプ                   %%%};&br;
//&ref(https://github.com/TeXworks/texworks/raw/master/res/images/TeXworks.png,around,nolink);
&ref(https://github.com/TeXworks/texworks/raw/master/res/images/runtool.png,around,nolink,タイプセット);
&color(Black,#EEEEEE){[LuaLaTeX      ▼]};
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-new.png,around,nolink,新規作成);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-open.png,around,nolink,開く);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-save.png,around,nolink,保存);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-undo.png,around,nolink,元に戻す);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-redo.png,around,nolink,繰り返す);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-cut.png,around,nolink,切り取り);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-copy.png,around,nolink,コピー);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-paste.png,around,nolink,貼り付け);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-find.png,around,nolink,検索);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-find-replace.png,around,nolink,置換);&br;
&br;
\documentclass[lualatex,ja=standard]{bxjsarticle}&br;
\begin{document}&br;
&br;
吾輩は猫である。名前はまだ無い。&br;
&br;
どこで生れたかとんと見当がつかぬ。&br;
何でも薄暗いじめじめした所で&br;
ニャーニャー泣いていた事だけは記憶している。&br;
吾輩はここで始めて人間というものを見た。&br;
&br;
\end{document}&br;
<

>
&color(Black,#DAE0FE){%%% ファイル  編集  検索  フォーマット  タイプセット  スクリプト  ウィンドウ  ヘルプ                   %%%};&br;
//&ref(https://github.com/TeXworks/texworks/raw/master/res/images/TeXworks.png,around,nolink);
&ref(https://github.com/TeXworks/texworks/raw/master/res/images/runtool.png,around,nolink,タイプセット);
&color(Black,#EEEEEE){[LuaLaTeX      ▼]};
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-new.png,around,nolink,新規作成);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-open.png,around,nolink,開く);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-save.png,around,nolink,保存);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-undo.png,around,nolink,元に戻す);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-redo.png,around,nolink,繰り返す);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-cut.png,around,nolink,切り取り);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-copy.png,around,nolink,コピー);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-paste.png,around,nolink,貼り付け);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-find.png,around,nolink,検索);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-find-replace.png,around,nolink,置換);&br;
&br;
\documentclass{ltjsarticle}&br;
\begin{document}&br;
&br;
吾輩は猫である。名前はまだ無い。&br;
&br;
どこで生れたかとんと見当がつかぬ。&br;
何でも薄暗いじめじめした所で&br;
ニャーニャー泣いていた事だけは記憶している。&br;
吾輩はここで始めて人間というものを見た。&br;
&br;
\end{document}&br;
<

>
&color(Black,#DAE0FE){%%% ファイル  編集  検索  フォーマット  タイプセット  スクリプト  ウィンドウ  ヘルプ                   %%%};&br;
//&ref(https://github.com/TeXworks/texworks/raw/master/res/images/TeXworks.png,around,nolink);
&ref(https://github.com/TeXworks/texworks/raw/master/res/images/runtool.png,around,nolink,タイプセット);
&color(Black,#EEEEEE){[LuaLaTeX      ▼]};
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-new.png,around,nolink,新規作成);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-open.png,around,nolink,開く);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-save.png,around,nolink,保存);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-undo.png,around,nolink,元に戻す);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-redo.png,around,nolink,繰り返す);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-cut.png,around,nolink,切り取り);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-copy.png,around,nolink,コピー);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-paste.png,around,nolink,貼り付け);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-find.png,around,nolink,検索);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-find-replace.png,around,nolink,置換);&br;
&br;
\documentclass{jlreq}&br;
\begin{document}&br;
&br;
吾輩は猫である。名前はまだ無い。&br;
&br;
どこで生れたかとんと見当がつかぬ。&br;
何でも薄暗いじめじめした所で&br;
ニャーニャー泣いていた事だけは記憶している。&br;
吾輩はここで始めて人間というものを見た。&br;
&br;
\end{document}&br;
<
***XeLaTeX, Latexmk-XeLaTeX の場合 [#f211a81a]
>
&color(Black,#DAE0FE){%%% ファイル  編集  検索  フォーマット  タイプセット  スクリプト  ウィンドウ  ヘルプ                   %%%};&br;
//&ref(https://github.com/TeXworks/texworks/raw/master/res/images/TeXworks.png,around,nolink);
&ref(https://github.com/TeXworks/texworks/raw/master/res/images/runtool.png,around,nolink,タイプセット);
&color(Black,#EEEEEE){[XeLaTeX       ▼]};
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-new.png,around,nolink,新規作成);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-open.png,around,nolink,開く);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-save.png,around,nolink,保存);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-undo.png,around,nolink,元に戻す);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-redo.png,around,nolink,繰り返す);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-cut.png,around,nolink,切り取り);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-copy.png,around,nolink,コピー);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-paste.png,around,nolink,貼り付け);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-find.png,around,nolink,検索);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-find-replace.png,around,nolink,置換);&br;
&br;
\documentclass[xelatex,ja=standard,precisetext]{bxjsarticle}&br;
\begin{document}&br;
&br;
吾輩は猫である。名前はまだ無い。&br;
&br;
どこで生れたかとんと見当がつかぬ。&br;
何でも薄暗いじめじめした所で&br;
ニャーニャー泣いていた事だけは記憶している。&br;
吾輩はここで始めて人間というものを見た。&br;
&br;
\end{document}&br;
<
***pdfLaTeX, Latexmk-pdfLaTeX の場合 [#a69c4d4c]
>
&color(Black,#DAE0FE){%%% ファイル  編集  検索  フォーマット  タイプセット  スクリプト  ウィンドウ  ヘルプ                   %%%};&br;
//&ref(https://github.com/TeXworks/texworks/raw/master/res/images/TeXworks.png,around,nolink);
&ref(https://github.com/TeXworks/texworks/raw/master/res/images/runtool.png,around,nolink,タイプセット);
&color(Black,#EEEEEE){[pdfLaTeX       ▼]};
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-new.png,around,nolink,新規作成);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-open.png,around,nolink,開く);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/document-save.png,around,nolink,保存);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-undo.png,around,nolink,元に戻す);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-redo.png,around,nolink,繰り返す);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-cut.png,around,nolink,切り取り);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-copy.png,around,nolink,コピー);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-paste.png,around,nolink,貼り付け);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-find.png,around,nolink,検索);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-find-replace.png,around,nolink,置換);&br;
&br;
\documentclass[pdflatex,ja=standard]{bxjsarticle}&br;
\begin{document}&br;
&br;
吾輩は猫である。名前はまだ無い。&br;
&br;
どこで生れたかとんと見当がつかぬ。&br;
何でも薄暗いじめじめした所で&br;
ニャーニャー泣いていた事だけは記憶している。&br;
吾輩はここで始めて人間というものを見た。&br;
&br;
\end{document}&br;
<
***プレビュー [#h91f565b]
>
&color(Black,#DAE0FE){%%% ファイル  編集  検索  表示  タイプセット  スクリプト  ウィンドウ  ヘルプ                       %%%};&br;
//&ref(https://github.com/TeXworks/texworks/raw/master/res/images/TeXworks.png,around,nolink);
&ref(https://github.com/TeXworks/texworks/raw/master/res/images/runtool.png,around,nolink,タイプセット);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/go-first.png,around,nolink,最初のページ);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/go-previous.png,around,nolink,前のページ);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/go-next.png,around,nolink,次のページ);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/go-last.png,around,nolink,最後のページ);
&ref(https://github.com/TeXworks/texworks/raw/master/res/images/actualsize.png,around,nolink,実際のサイズ);
&ref(https://github.com/TeXworks/texworks/raw/master/res/images/fitwidth.png,around,nolink,ウィンドウ幅に合わせる);
&ref(https://github.com/TeXworks/texworks/raw/master/res/images/fitwindow.png,around,nolink,ウィンドウサイズに合わせる);
&ref(https://github.com/TeXworks/texworks/raw/master/res/images/zoom.png,around,nolink,拡大);
&ref(https://github.com/TeXworks/texworks/raw/master/modules/QtPDF/icons/hand.png,around,nolink,スクロール);
&ref(https://github.com/TeXworks/texworks/raw/master/modules/QtPDF/icons/select-text.png,around,nolink,テキストの選択);
&ref(https://github.com/TeXworks/texworks/raw/master/res/tango/edit-find.png,around,nolink,検索);&br;
&br;
&br;
&br;
&br;
 吾輩は猫である。名前はまだ無い。&br;
 どこで生れたかとんと見当がつかぬ。何でも薄暗いじめじめした所でニャーニャー泣いていた事だけは記憶&br;
している。吾輩はここで始めて人間というものを見た。&br;
&br;
&br;
&br;
&br;
<

**エラー箇所にジャンプ [#cfcb69f9]

''注意: macOS の TeXworks は現時点 (TeXworks 0.6.2) では,エラー箇所にジャンプする機能はサポートされていません.''--&gt; https://github.com/TeXworks/texworks/blob/release-0.6.2/src/TeXDocument.cpp#L2649-L2656 と [[Support the TEXEDIT environment variable · Issue #195 · TeXworks/texworks · GitHub:https://github.com/TeXworks/texworks/issues/195]] を参照

エラーが発生した場合に e を入力して Enter キーを入力するとエラー箇所にジャンプします.

**補完 [#a494cf9a]
''注意: macOS の TeXworks は現時点 (TeXworks 0.6.9) では,エラー箇所にジャンプする機能はサポートされていません.''

-[[CodeCompletion:https://github.com/TeXworks/texworks/wiki/CodeCompletion]]
-[[TeXworksでautocomplete:http://qiita.com/matyapiro31/items/338b1293fddb6b922479]]
-https://github.com/TeXworks/texworks/blob/release-0.6.9/src/Engine.cpp#L125-L131
-[[Support the TEXEDIT environment variable · Issue #195 · TeXworks/texworks · GitHub:https://github.com/TeXworks/texworks/issues/195]]

を参照してください.
**補完 [#a494cf9a]

TeXworks にはコマンドの補完機能があります.
TeXworks にはコマンドの補完機能があります.一部を入力して Tab キーを押すと候補が表示されます.Tab キーを押しても候補が表示されない場合は[[TeXworksの補完が起動しない>forum:2864]]を参照して設定を行ってください.

コマンド補完は,一部を入力してタブを押すと候補が表示されます.
-\ (バックスラッシュ) から始まるキーワードの一部を入力した後 Tab キーを入力するとキーワードの補完を行います.
-\alpha などは xa と入力した後 Tab キーを入力する方法で補完を行います.

W32TeX では補完対象となるコマンドのリストは
 $TEXMF\share\texworks\twdata\completion
の中にテキストファイルで保存されています.

このファイルを編集して,カスタマイズすることも可能です.

\ (バックスラッシュ) から始まるキーワードの一部を入力した後 Tab キーを入力するとキーワードの補完を行います.

\alpha などは xa と入力した後 Tab キーを入力する方法で補完を行います.

bite と入力した後 Tab キーを入力すると

 \begin{itemize}
 \item
 

 \end{itemize}•

と補完されます.

\end{itemize}• のように "•" (placeholder) が表示され,Ctrl+Tab (Mac では ⌥Tab (option+Tab)) を入力すると "•" にジャンプします.
このデフォルトの補完の仕方が気に入らない場合は TeXworks の completion フォルダーの tw-latex.txt の

-[[[texworks] Completion changes...:http://tug.org/pipermail/texworks/2008q4/000417.html]]

デフォルトの補完の仕方が気に入らない場合は TeXworks の completion フォルダの tw-latex.txt の

 bite:=\begin{itemize}#RET#\item#RET##INS##RET#\end{itemize}•

を例えば

 bite:=\begin{itemize}#RET#  \item #INS##RET#\end{itemize}•

に修正します.

**forward and inverse search [#ded2619d]
-[[[texworks] Completion changes...:http://tug.org/pipermail/texworks/2008q4/000417.html]]

TeXworks は SyncTeX をサポートしています.
W32TeX では補完対象となるコマンドのリストは
 $INSTALLDIR\share\texworks\twdata\completion
の中にテキストファイルで保存されています.
このファイルを編集してカスタマイズすることが可能です.

SyncTeX に関しては [[SyncTeX - TeX Wiki>SyncTeX]] を参照してください.
-[[CodeCompletion:https://github.com/TeXworks/texworks/wiki/CodeCompletion]]
-[[TeXworksでautocomplete:http://qiita.com/matyapiro31/items/338b1293fddb6b922479]]

forward search は エディタ上で Ctrl+左クリック または 右クリック → PDFの該当箇所へジャンプ
も参照してください.

inverse search は PDF ビューア上で Ctrl+左クリック または 右クリック → ソースの該当箇所へジャンプ

[ウィンドウ] &gt; [マウスフォーカスを追従する] を ON にするとエディタ上をクリックしたときに PDF ビューアを自動的に forward search します.
**forward and inverse search [#ded2619d]

TeXworks は [[SyncTeX]] をサポートしています.

-forward search は エディタ上で Ctrl+左クリック または 右クリック → PDFの該当箇所へジャンプ
-inverse search は PDF ビューア上で Ctrl+左クリック または 右クリック → ソースの該当箇所へジャンプ

[ウィンドウ] &gt; [マウスフォーカスを追従する] を ON にすると,エディタ上をクリックしたときに PDF ビューアを自動的に forward search します.

**構文の色付け [#p53d7e6e]

[フォーマット] &gt; [構文の色付け] &gt; [LaTeX] を選択します.

**自動インデント [#f7198d43]

[フォーマット] &gt; [自動インデント] から

-なし
-Whitespace only
-TeX Comments
-dtx prefixes

のうちのどれかを選択します.

**スペルチェック [#cb9bbbb2]

TeX Live でスペルチェックできない場合は [[TeXworks/設定#スペルチェックの辞書の設定>TeXworks/設定#vd0f0d24]] を参照してください.
スペルが間違っていると思われる単語の下に赤い点線が表示されます.
日本語の文章を作成するときなど,この機能を無効にしたい場合は [編集] &gt; [スペルチェック] &gt; [なし] を選択します.

[編集] &gt; [スペルチェック] &gt; [English - UnitedStates (en-US)] にチェックをするとスペルが間違っていると思われる単語の下に赤い点線が表示されます.
スペルチェックが働かない場合は,辞書が設定されていない可能性があります.
[[TeXworks/設定#スペルチェックの辞書の設定>TeXworks/設定#vd0f0d24]]を参照してください.

日本語の文章を作成するときに赤い点線を表示したくない場合は [編集] &gt; [スペルチェック] &gt; [なし] を選択します.

**ルートドキュメント [#x9e02ec7]

[[Defining a root file:https://github.com/TeXworks/texworks/wiki/TipsAndTricks]] を参照してください.
例えばファイルの先頭に

ファイルの先頭に

 % !TEX root = main.tex

を記述すると main.tex をルートドキュメントに設定してタイプセットの対象ファイルにしてくれます.

**TeX エンジンの選択 [#ca3d17a8]
[[Defining a root file:https://github.com/TeXworks/texworks/wiki/TipsAndTricks]] も参照してください.

ファイルの先頭に

**TeX エンジンの自動選択 [#ca3d17a8]

例えばファイルの先頭に TeX のコメント文字列として

 % !TEX program = LuaLaTeX

を記述すると LuaLaTeX でタイプセットしてくれます.
と記述しておくと、タイプセットのときに使用するエンジンとして LuaLaTeX を選んでくれます.

**指定したエンコーディングで再読み込み [#of3f4176]

TeXworks は指定したエンコーディングで再読み込みができます.
TeXworks のエディタの画面の一番下にあるステータスバーのエンコーディングが表示されている部分をクリックすると,エンコーディングのリストが表示されます.
一番上の 『選択した文字コードで再読み込みする』 をクリックすると,指定したエンコーディングで再読み込みを行います.

TeXworks のエディタの画面の一番下にあるステータスバーのエンコーディングが表示されている部分をクリックするとエンコーディングのリストが表示されます.

エンコーディングを指定して,一番上の 『選択した文字コードで再読み込みする』 をクリックすると指定したエンコーディングで再読み込みを行います.

**目次・PDFの情報・フォントの表示 [#ldabe964]

TeXworks の PDF ビューアの [ウィンドウ] &gt; [表示] から 目次・PDFの情報・フォント を表示することができます.
TeXworks の PDF ビューアの [ウィンドウ] &gt; [表示] から目次・PDFの情報・フォントを表示することができます.

**TeXworks を PDF ファイルプレビューアとして使用する [#s646d4ef]

TeXworks はコマンドラインで PDF ファイルを指定すると PDF ビューアが起動します.

 texworks "hoge.pdf"
 texworks "file.pdf"

この機能を使うと PDF ファイルプレビューアとしても利用できます.
自動更新もしてくれます.

ファイルの自動更新もしてくれます.

SyncTeX を使用して forward search をすることも可能です.
例えば,TeX ファイルの 30 行目に対応する PDF ファイルの該当するページにジャンプしたい場合は

TeX ファイルの 30 行目に対応する PDF ファイルの該当するページにジャンプしたい場合は
 synctex view -i "30:0:file.tex" -o "file.pdf" -x "texworks --position=%{page+1} '%{output}'"

 synctex view -i "30:0:hoge.tex" -o "hoge.pdf" -x "texworks --position=%{page+1} '%{output}'"

のように実行します.
&#x2d;&#x2d;position= オプションで指定された値は,コマンドラインオプションで TeX ファイルが指定された場合は行番号,PDF ファイルが指定された場合はページ番号になるようです.

&#x2d;&#x2d;position= オプションで指定された値はコマンドラインオプションで TeX ファイルが指定された場合は行番号,PDF ファイルが指定された場合はページ番号になるようです.