[[Notepad++]] > NppExec

----
#contents
----

*[[NppExec:https://sourceforge.net/projects/npp-plugins/files/NppExec/]] → 問題が発生する場合は [[jN]] を使用する [#n297fed5]

NppExec を使うと LaTeX 環境を簡単に作ることができます.~
https://sourceforge.net/projects/npp-plugins/files/NppExec/NppExec%20Plugin%20v0.5.9.9%20dev/ から NppExec の 64-bit プラグイン(NppExec20160628_dll_x64-2.zip)あるいは 32-bit プラグイン(NppExec20160628_dll.zip)がダウンロードできます.~
https://sourceforge.net/projects/npp-plugins/files/NppExec/ から NppExec の 64-bit プラグインあるいは 32-bit プラグインがダウンロードできます.~
[プラグイン]-[NppExec]-[Show Console Dialog] にチェックをいれた場合は,NPP_CONSOLE 1 の処理は書かなくても OK です.~
[プラグイン]-[NppExec]-[Follow $(CURRENT_DIRECTORY)] にチェックをいれた場合は,cd /d "$(CURRENT_DIRECTORY)" && の処理は書かなくても OK です.~
[プラグイン]-[NppExec]-[Execute...] または F6 キーで設定および実行ができます.~
コマンドを設定して名前を付けて保存します.~
設定した後で [プラグイン]-[NppExec]-[Advanced Options...] の Menu item から設定した項目を登録します.~
[設定]-[ショートカット管理...]-[Plugin commands] から登録した項目のショートカットの設定をします.~

-[[NppExec (コマンドの実行) - Notepad++のプラグイン解説:http://www.crystal-creation.com/software/technical-information/tool/editor/notepad-plus/plug-in/nppexec/]]

**License [#b6f13e16]

GPLv3

**pdfupLaTeX [#i86b16de]

----
&color(#94CE18,#94CE18){%%%                            &color(Black){''Execute...''};                         &color(#DD4444,#DD4444){%%%[ &color(White){''🗙''}; ]%%%};%%%};&br;
&br;
  Command(s):&br;
   NPP_SAVE&br;
   NPP_CONSOLE 1&br;
   cmd /c cd /d "$(CURRENT_DIRECTORY)" && ptex2pdf -u -l -ot "-synctex=1 -no-guess-input-enc -kanji=utf8 -sjis-terminal" "$(NAME_PART)"&br;
&br;
&br;
&br;
&br;
  &color(Black,#EEEEEE){ Script name:                     };&br;
    %%%[&color(White,#1188FF){pdfupLaTeX};                  ''ᐯ'']%%%&br;
----
&color(#94CE18,#94CE18){%%%             &color(Black){''Shortcut''};             &color(#DD4444,#DD4444){%%%[&color(White){''🗙''};]%%%};%%%};&br;
&br;
      Name : %%%pdfupLaTeX%%%&br;
   ☑CTRL&br;
          + ☐SHIFT  +  &color(Black,#EEEEEE){[J         ''ᐯ'']};&br;
   ☑ALT&br;
&br;
      &color(Black,#DAEAFF){[   OK   ]};     &color(Black,#EEEEEE){[  Cancel  ]};&br;
&br;
----

**LuaLaTeX [#fa30dbb3]

----
&color(#94CE18,#94CE18){%%%                            &color(Black){''Execute...''};                         &color(#DD4444,#DD4444){%%%[ &color(White){''🗙''}; ]%%%};%%%};&br;
&br;
  Command(s):&br;
   NPP_SAVE&br;
   NPP_CONSOLE 1&br;
   cmd /c cd /d "$(CURRENT_DIRECTORY)" && lualatex -synctex=1 "$(NAME_PART)"&br;
&br;
&br;
&br;
&br;
  &color(Black,#EEEEEE){ Script name:                     };&br;
    %%%[&color(White,#1188FF){LuaLaTeX};                   ''ᐯ'']%%%&br;
----
&color(#94CE18,#94CE18){%%%             &color(Black){''Shortcut''};             &color(#DD4444,#DD4444){%%%[&color(White){''🗙''};]%%%};%%%};&br;
&br;
      Name : %%%pdfupLaTeX2%%%&br;
   ☑CTRL&br;
          + ☐SHIFT  +  &color(Black,#EEEEEE){[K         ''ᐯ'']};&br;
   ☑ALT&br;
&br;
      &color(Black,#DAEAFF){[   OK   ]};     &color(Black,#EEEEEE){[  Cancel  ]};&br;
&br;
----

*SumatraPDF との連携 [#jbc79e5b]

**forward and inverse search (SumatraPDF を前面に表示したい場合) [#qbc5204b]

***SumatraPDF [#ld44000d]

----
&color(#94CE18,#94CE18){%%%                            &color(Black){''Execute...''};                         &color(#DD4444,#DD4444){%%%[ &color(White){''🗙''}; ]%%%};%%%};&br;
&br;
  Command(s):&br;
   NPP_CONSOLE 1&br;
   cmd /c cd /d "$(CURRENT_DIRECTORY)" && set CURRENT_LINE=$(CURRENT_LINE) && set /a CURRENT_LINE=CURRENT_LINE+1 && echo rundll32 shell32,ShellExec_RunDLL SumatraPDF -reuse-instance "$(NAME_PART).pdf" -inverse-search "\"$(#0)\" \"%f\" -n%l -c%c" -forward-search "$(FILE_NAME)" %CURRENT_LINE% | cmd&br;
&br;
&br;
&br;
&br;
  &color(Black,#EEEEEE){ Script name:                     };&br;
    %%%[&color(White,#1188FF){SumatraPDF};                  ''ᐯ'']%%%&br;
----
&color(#94CE18,#94CE18){%%%             &color(Black){''Shortcut''};             &color(#DD4444,#DD4444){%%%[&color(White){''🗙''};]%%%};%%%};&br;
&br;
      Name : %%%SumatraPDF%%%&br;
   ☑CTRL&br;
          + ☐SHIFT  +  &color(Black,#EEEEEE){[O         ''ᐯ'']};&br;
   ☑ALT&br;
&br;
      &color(Black,#DAEAFF){[   OK   ]};     &color(Black,#EEEEEE){[  Cancel  ]};&br;
&br;
----

**forward search (SumatraPDF を前面に表示したくない場合) [#dfc0b616]
[[SumatraPDF/fwdsumatrapdf]] の fwdsumatrapdf.exe を使用します.~

***fwdsumatrapdf [#b6351a6e]
以下のように設定します.~

----
&color(#94CE18,#94CE18){%%%                            &color(Black){''Execute...''};                         &color(#DD4444,#DD4444){%%%[ &color(White){''🗙''}; ]%%%};%%%};&br;
&br;
  Command(s):&br;
   NPP_CONSOLE 1&br;
   cmd /c cd /d "$(CURRENT_DIRECTORY)" && fwdsumatrapdf.exe "$(NAME_PART).pdf" "$(FILE_NAME)" $(CURRENT_LINE)&br;
&br;
&br;
&br;
&br;
  &color(Black,#EEEEEE){ Script name:                     };&br;
    %%%[&color(White,#1188FF){fwdsumatrapdf};                 ''ᐯ'']%%%&br;
----
&color(#94CE18,#94CE18){%%%             &color(Black){''Shortcut''};             &color(#DD4444,#DD4444){%%%[&color(White){''🗙''};]%%%};%%%};&br;
&br;
      Name : %%%pdfLaTeX%%%&br;
   ☐CTRL&br;
          + ☑SHIFT  +  &color(Black,#EEEEEE){[H         ''ᐯ'']};&br;
   ☑ALT&br;
&br;
      &color(Black,#DAEAFF){[   OK   ]};     &color(Black,#EEEEEE){[  Cancel  ]};&br;
&br;
----

**inverse search [#fe81f375]
[[Notepad++#SumatraPDF との連携>Notepad++#ted60cbe]] を参照.

*TeXworks との連携 [#f405549d]

**forward search [#h0f139e4]
***TeXworks [#d203fe0e]

----
&color(#94CE18,#94CE18){%%%                            &color(Black){''Execute...''};                         &color(#DD4444,#DD4444){%%%[ &color(White){''🗙''}; ]%%%};%%%};&br;
&br;
  Command(s):&br;
   NPP_CONSOLE 1&br;
   cmd /c cd /d "$(CURRENT_DIRECTORY)" && set CURRENT_LINE=$(CURRENT_LINE) && set /a CURRENT_LINE=CURRENT_LINE+1 && echo synctex view -i "%CURRENT_LINE%:0:$(FILE_NAME)" -o "$(NAME_PART).pdf" -x "texworks --position=%{page+1} "%{output}"" | cmd&br;
&br;
&br;
&br;
&br;
  &color(Black,#EEEEEE){ Script name:                     };&br;
    %%%[&color(White,#1188FF){TeXworks};                   ''ᐯ'']%%%&br;
----
&color(#94CE18,#94CE18){%%%             &color(Black){''Shortcut''};             &color(#DD4444,#DD4444){%%%[&color(White){''🗙''};]%%%};%%%};&br;
&br;
      Name : %%%pLaTeX-ng%%%&br;
   ☑CTRL&br;
          + ☐SHIFT  +  &color(Black,#EEEEEE){[N         ''ᐯ'']};&br;
   ☑ALT&br;
&br;
      &color(Black,#DAEAFF){[   OK   ]};     &color(Black,#EEEEEE){[  Cancel  ]};&br;
&br;
----

*Adobe Acrobat Reader DC との連携 [#wbbe918a]

**forward search [#safe0b18]
***pdfupLaTeXA [#w63fc0bc]

----
&color(#94CE18,#94CE18){%%%                            &color(Black){''Execute...''};                         &color(#DD4444,#DD4444){%%%[ &color(White){''🗙''}; ]%%%};%%%};&br;
&br;
  Command(s):&br;
   NPP_SAVE&br;
   NPP_CONSOLE 1&br;
   cmd /c cd /d "$(CURRENT_DIRECTORY)" && tasklist /fi "IMAGENAME eq AcroRd32.exe" /nh | findstr "AcroRd32.exe" > nul && pdfopen --file "$(NAME_PART).pdf" && pdfclose --file "$(NAME_PART).pdf" & ptex2pdf -u -l -ot "-no-guess-input-enc -kanji=utf8 -synctex=1 -sjis-terminal" "$(NAME_PART)" && set CURRENT_LINE=$(CURRENT_LINE) && set /a CURRENT_LINE=CURRENT_LINE+1 && echo synctex view -i "%CURRENT_LINE%:0:$(FILE_NAME)" -o "$(NAME_PART).pdf" -x "pdfopen --file "%{output}" --page %{page+1}" | cmd&br;
&br;
&br;
&br;
&br;
  &color(Black,#EEEEEE){ Script name:                     };&br;
    %%%[&color(White,#1188FF){pdfupLaTeXA};                 ''ᐯ'']%%%&br;
----
&color(#94CE18,#94CE18){%%%             &color(Black){''Shortcut''};             &color(#DD4444,#DD4444){%%%[&color(White){''🗙''};]%%%};%%%};&br;
&br;
      Name : %%%LuaLaTeX%%%&br;
   ☐CTRL&br;
          + ☑SHIFT  +  &color(Black,#EEEEEE){[J         ''ᐯ'']};&br;
   ☑ALT&br;
&br;
      &color(Black,#DAEAFF){[   OK   ]};     &color(Black,#EEEEEE){[  Cancel  ]};&br;
&br;
----


***LuaLaTeXA [#j6d6a21e]

----
&color(#94CE18,#94CE18){%%%                            &color(Black){''Execute...''};                         &color(#DD4444,#DD4444){%%%[ &color(White){''🗙''}; ]%%%};%%%};&br;
&br;
  Command(s):&br;
   NPP_SAVE&br;
   NPP_CONSOLE 1&br;
   cmd /c cd /d "$(CURRENT_DIRECTORY)" && tasklist /fi "IMAGENAME eq AcroRd32.exe" /nh | findstr "AcroRd32.exe" > nul && pdfopen --file "$(NAME_PART).pdf" && pdfclose --file "$(NAME_PART).pdf" & lualatex -synctex=1 "$(NAME_PART)" && set CURRENT_LINE=$(CURRENT_LINE) && set /a CURRENT_LINE=CURRENT_LINE+1 && echo synctex view -i "%CURRENT_LINE%:0:$(FILE_NAME)" -o "$(NAME_PART).pdf" -x "pdfopen --file "%{output}" --page %{page+1}" | cmd&br;
&br;
&br;
&br;
&br;
  &color(Black,#EEEEEE){ Script name:                     };&br;
    %%%[&color(White,#1188FF){LuaLaTeXA};                  ''ᐯ'']%%%&br;
----
&color(#94CE18,#94CE18){%%%             &color(Black){''Shortcut''};             &color(#DD4444,#DD4444){%%%[&color(White){''🗙''};]%%%};%%%};&br;
&br;
      Name : %%%LuajitLaTeX%%%&br;
   ☐CTRL&br;
          + ☑SHIFT  +  &color(Black,#EEEEEE){[K         ''ᐯ'']};&br;
   ☑ALT&br;
&br;
      &color(Black,#DAEAFF){[   OK   ]};     &color(Black,#EEEEEE){[  Cancel  ]};&br;
&br;
----

*関連リンク [#l148aa58]

-[[餅と輪 » Windows環境でLaTeX2εをインストール:http://blog.mochiring.net/archives/550]]