配置便携式 TeXstudio 以使用 MiKTeX 便携式

配置便携式 TeXstudio 以使用 MiKTeX 便携式

我已经下载并安装了适用于 Windows 的 TeXstudio 和 MiKTeX 的便携版本。我假设现在必须将 TeXstudio 中的命令映射到 MiKTeX 中的二进制文件(或批处理文件)。但是,并非所有命令似乎都有对应的二进制文件(或批处理文件)。例如,dvipdf 显然是 dvipdfm。我不确定 gs 映射到什么,因为还有几个 ghostscript 相关的二进制文件。有人有明确的工作映射吗?

答案1

我有一个完全独立的运行版本,位于 usb clib 上(我为学生设置的也是这个)。我必须参加会议,但您需要的部分是如下所示的配置。请注意相对路径。

在此处输入图片描述

现在了解更多详细信息:

我建议你使用新的(快速)USB 夹(最小 4Gb)来安装 MikTeX。我还建议你不要将任何数据放在夹子上,而是使用另一个夹子来存储数据。(这将使备份数据夹变得容易得多。它运行速度也会更快一些。

  1. http://www.miktex.org/下载并安装 MikTex Portable 到剪辑根目录下的文件夹中(我的文件夹名为 MikTeXPortable)
  2. http://pages.cs.wisc.edu/~ghost/下载最新的 Ghostscript 和 GSview。

    a) 因为这两个安装都需要创建注册表项,所以您需要先将这两个程序安装到您正在使用的计算机的硬盘上。

    b) 安装完成后,您需要转到计算机上的 Program Files,并将两个文件夹(Ghostgum 和 gs)复制到 USB Clip 的根目录。[注意:如果您不想在计算机上安装这些程序,请使用 Windows 工具正确卸载它们。]

  3. http://texstudio.sourceforge.net/下载 TeXStudio USB(.zip) 文件。然后将其解压到根级别的 USB 夹上。

    a) 在剪辑的根目录下创建 TeXStudio.exe 的快捷方式。

    b)现在将本答案末尾的代码保存到名为texstudio.ini保存到 TeXstudio 文件夹。

  4. 如果需要的话,Asymptote 可以以类似的方式安装。

  5. 如果您关闭注册表项、图标和快捷方式,则可以安装 R,并且安装起来非常方便。a) 如果您想运行 Sweave,请使用以下命令发出用户命令:“../Portable-R/R-2.14.0/bin/R.exe”CMD Sweave %.Rnw

  6. 重要的:您需要检查每个软件包以验证选项/命令中引用的版本是否与实际安装的版本相符。

  7. 现在你需要一个便携式的 pdf 阅读器。我用的是 Foxit,不过 Sumatra 也很好用。

  8. 当您打开 TeXStudio 时,您应该会找到如图所示的选项命令。


[General]
IniMode=true

[texmaker]
ToolBar\CentralVisible=true
StructureView\ShowLinenumbers=false
StructureView\Indentation=-1
Files\New%20File%20Encoding=UTF-8
Files\Auto%20Detect%20Encoding%20Of%20Loaded%20Files=true
Files\Max%20Recent%20Files=5
Files\Max%20Recent%20Projects=3
Files\Recent%20Files=M:/!Spring2012/m2800/taylor01.tex, M:/!Spring2012/m2800/taylor01.tes, M:/pauley/analysis.Rnw, M:/pauley/analysis.tex, T:/Math2800.s12/Math2800_S12_Roseberg/PJ/06/rms-pj06_scottroseberg.tex
Files\Recent%20Project%20Files=@Invalid()
Files\RestoreSession=false
Files\Session\Files=@Invalid()
Files\Session\curRows=@Invalid()
Files\Session\curCols=@Invalid()
Files\Session\firstLines=@Invalid()
Files\Session\CurrentFile=
Files\Session\MasterFile=
Files\Last%20Document=M:/!Spring2012/m2800/taylor01.tex
Files\Parse%20BibTeX=true
Files\Parse%20Master=true
Files\Autosave=0
Spell\DictionaryDir=L:/TeXstudio2.3/dictionaries
Spell\Language=<none>
Spell\Dic=L:/TeXstudio2.3/dictionaries/de_DE.dic
Thesaurus\Database=L:/TeXstudio2.3/dictionaries/th_en_US_v2.dat
User\ToolNames=Sweave
User\Tools=\"../Portable-R/R-2.14.0/bin/R.exe\" CMD Sweave %.Rnw
Editor\WordWrapMode=1
Editor\WrapLineWidth=80
Editor\Parentheses%20Matching=true
Editor\Parentheses%20Completion=true
Editor\Line%20Number%20Multiples=1
Editor\Cursor%20Surrounding%20Lines=5
Editor\Auto%20Indent=true
Editor\Weak%20Indent=true
Editor\Indent%20with%20Spaces=false
Editor\Folding=true
Editor\Show%20Line%20State=true
Editor\Show%20Cursor%20State=true
Editor\Real-Time%20Spellchecking=true
Editor\Check%20Spelling=true
Editor\Check%20Citations=true
Editor\Check%20References=true
Editor\Check%20Syntax=true
Editor\Show%20Whitespace=true
Editor\TabStop=4
Editor\ToolTip%20Help=true
Editor\ToolTip%20Preview=true
Editor\Replace%20Quotes=0
Editor\Display%20Modifytime=true
Editor\Close%20Search%20Replace%20Together=false
Editor\Use%20Line%20For%20Search=true
Editor\Search%20Only%20In%20Selection=true
Editor\Auto%20Replace%20Commands=true
Editor\Font%20Family=Courier New
Editor\Font%20Size=12
Editor\Esc%20for%20closing%20log=false
Editor\Mouse%20Wheel%20Zoom=true
Editor\Hack%20Auto%20Choose=true
Editor\Hack%20Disable%20Fixed%20Pitch=false
Editor\Hack%20Disable%20Width%20Cache=false
Editor\Hack%20Disable%20Line%20Cache=false
Editor\Hack%20Disable%20Accent%20Workaround=false
Editor\Hack%20Render%20Mode=0
Editor\Completion=true
Editor\Completion%20Case%20Sensitive=2
Editor\Completion%20Complete%20Common%20Prefix=true
Editor\Completion%20EOW%20Completes=true
Editor\Completion%20Enable%20Tooltip%20Help=true
Editor\Completion%20Use%20Placeholders=true
Editor\Completion%20Prefered%20Tab=0
Editor\Completion%20Tab%20Relative%20Font%20Size%20Percent=100
Dialogs\Last%20Hard%20Wrap%20Column=80
Dialogs\Last%20Hard%20Wrap%20Smart%20Scope%20Selection=false
Dialogs\Last%20Hard%20Wrap%20Join%20Lines=false
Tools\SingleViewerInstance=false
Tools\Show%20Log%20After%20Compiling=true
Tools\Show%20Stdout=1
Tools\Automatic%20Rerun%20Times=5
Tools\Auto%20Checkin%20after%20Save=false
Tools\SVN%20Undo=false
Tools\SVN%20KeywordSubstitution=false
Tools\SVN%20Search%20Path%20Depth=2
GUI\Style=false
GUI\Texmaker%20Palette=false
GUI\Use%20System%20Theme=true
X11\Font%20Family=MS Shell Dlg 2
X11\Font%20Size=8
X11\Style=
Interface\Config%20Show%20Advanced%20Options=false
Interface\Config%20Riddled=false
LogView\Tabbed=true
Interface\New%20Left%20Panel%20Layout=true
Interface\Language=
Preview\Mode=4
Preview\Auto%20Preview=1
Preview\Auto%20Preview%20Delay=300
Geometries\PdfViewerLeft=315
Geometries\PdfViewerTop=9
Geometries\PdfViewerWidth=1280
Geometries\PdfViewerHeight=997
Geometries\PdfViewerState="@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x2\0\0\0\0\0\0\0x\0\0\x3H\xfc\x2\0\0\0\x3\xfb\0\0\0\xe\0o\0u\0t\0l\0i\0n\0\x65\x1\0\0\0<\0\0\x3H\0\0\0\x61\0\xff\xff\xff\xfb\0\0\0\xe\0p\0\x64\0\x66\0i\0n\0\x66\0o\0\0\0\0\0\xff\xff\xff\xff\0\0\0\x61\0\xff\xff\xff\xfb\0\0\0\xe\0o\0u\0t\0l\0i\0n\0\x65\0\0\0\0\0\xff\xff\xff\xff\0\0\0\x61\0\xff\xff\xff\0\0\0\x3\0\0\x5\0\0\0\0;\xfc\x1\0\0\0\x3\xfb\0\0\0\f\0S\0\x65\0\x61\0r\0\x63\0h\x1\0\0\0\0\0\0\x5\0\0\0\x1\x87\0\xff\xff\xff\xfb\0\0\0\n\0\x66\0o\0n\0t\0s\0\0\0\0\0\xff\xff\xff\xff\0\0\0L\0\xff\xff\xff\xfb\0\0\0\n\0\x63\0l\0o\0\x63\0k\0\0\0\0\0\xff\xff\xff\xff\0\0\0L\0\xff\xff\xff\0\0\x4\x81\0\0\x3H\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\xe\0t\0o\0o\0l\0\x42\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0)"
Preview\DPI=96
Preview\Scale%20Option=1
Preview\Scale=100
Preview\Magnifier%20Size=300
Preview\Magnifier%20Shape=1
Preview\Magnifier%20Border=false
Preview\Sync%20File%20Mask=*.tex
Tools\User%20Class=@Invalid()
Tools\User%20Paper=@Invalid()
Tools\User%20Encoding=@Invalid()
Tools\User%20Options=@Invalid()
Quick\Class=article
Quick\Typeface=10pt
Quick\Papersize=letterpaper
Quick\Encoding=latin1
Quick\AMS=true
Quick\MakeIndex=false
Quick\Author=
Quick\Geometry%20Page%20Width=0
Quick\Geometry%20Page%20Height=0
Quick\Geometry%20Margin%20Left=0
Quick\Geometry%20Margin%20Right=0
Quick\Geometry%20Margin%20Top=0
Quick\Geometry%20Margin%20Bottom=0
Quick\Geometry%20Page%20Width%20Unit=cm
Quick\Geometry%20Page%20Height%20Unit=cm
Quick\Geometry%20Margin%20Left%20Unit=cm
Quick\Geometry%20Margin%20Right%20Unit=cm
Quick\Geometry%20Margin%20Top%20Unit=cm
Quick\Geometry%20Margin%20Bottom%20Unit=cm
Quick\Geometry%20Page%20Width%20Enabled=false
Quick\Geometry%20Page%20Height%20Enabled=false
Quick\Geometry%20Margin%20Left%20Enabled=false
Quick\Geometry%20Margin%20Right%20Enabled=false
Quick\Geometry%20Margin%20Top%20Enabled=false
Quick\Geometry%20Margin%20Bottom%20Enabled=false
Tools\Latex="\"../MikTexPortable/miktex/bin/latex.exe\" -src -interaction=nonstopmode %.tex"
Tools\Dvips=\"../MikTexPortable/miktex/bin/dvips\" -o %.ps %.dvi
Tools\Ps2pdf=\"../MikTexPortable/miktex/bin/ps2pdf\" %.ps
Tools\Makeindex=\"../MikTexPortable/miktex/bin/makeindex\" %.idx
Tools\Bibtex=\"../MikTexPortable/miktex/bin/bibtex\" %
Tools\Pdflatex="\"../MikTexPortable/miktex/bin/pdflatex\" -synctex=1 -interaction=nonstopmode %.tex"
Tools\Dvipdf=\"../MikTexPortable/miktex/bin/dvipdf\" %.dvi
Tools\Dvipng=\"../MikTexPortable/miktex/bin/dvipng\" -T tight -D 120 %.dvi
Tools\Metapost="\"../MikTexPortable/miktex/bin/mpost\" -interaction=nonstopmode ?me)"
Tools\Dvi=\"../MikTexPortable/miktex/bin/\\miktex\\bin\\yap.exe\" -1 -s @?c:ame \"?am.dvi\"
Tools\Ps=\"../Ghostgum/gsview/gvwgs32.exe\" %.ps
Tools\Pdf=\"../FoxitReaderPortable-4-3/FoxitReaderPortable.exe\" %.pdf
Tools\Ghostscript=\"../gs/gs8.71/bin/gswin32c.exe\" \"?am.ps\"
Tools\Asy=\"../Asymptote/asy.exe\" ?m*.asy
Tools\Userquick="latex -interaction=nonstopmode %.tex|bibtex %.aux|latex -interaction=nonstopmode %.tex|latex -interaction=nonstopmode %.tex|xdvi %.dvi"
Tools\Precompile=
Tools\SVN="svn                 "
Tools\SVNADMIN="svnadmin                 "
Tools\Quick%20Mode=1
Tools\Dvi2Png%20Mode=0
Files\Save%20Files%20Before%20Compiling=2
Preview\Remove%20Beamer%20Class=true
Preview\Precompile%20Preamble=true
Files\Default%20File%20Filter=All files (*)
User\Templates=@Invalid()
Search\Find%20History=@Invalid()
Search\Case%20Sensitive=true
Search\Whole%20Words=false
Search\Regular%20Expression=false
Search\Highlight=true
Search\Cursor=true
Search\Selection=false
Search\Ask%20before%20Replace=false
Search\Escape%20Sequence=false
Search\Replace%20History=@Invalid()
Preview\GridX=1
Preview\GridY=1
Preview\Single%20Page%20Step=true
Preview\Continuous=true
Preview\Scrolling%20Follows%20Cursor=false
Preview\Cursor%20Follows%20Scrolling=false
Preview\Sync%20Multiple%20Views=true
Editor\Completion%20Files=latex-document.cwl, latex-mathsymbols.cwl, tex.cwl, texmakerx.cwl
qttwp\userwidth=700
qttwp\compil=1
qttwp\tocdepth=2
qttwp\startindex=1
qttwp\navigation=1
qttwp\noindex=false
qttwp\title=
qttwp\address=
qttwp\browser=\"C:/Program Files/Internet Explorer/IEXPLORE.EXE\"
qttwp\contentname=\\contentsname
qttwp\align=center
qttwp\lastdir=C:/Documents and Settings/SCHUMACR
qttwp\dviopt=" -Ppk -V"
InsertGraphics\includeOptions="width=\\textwidth"
InsertGraphics\center=true
InsertGraphics\useFigure=true
InsertGraphics\captionBelow=true
InsertGraphics\placement=htbp
InsertGraphics\spanTwoCols=false
Tools\After%20BibTeX%20Change=tmx://latex && tmx://bibtex && tmx://latex
User\New%20Key%20Replacements%20Created=true
User\Tags=%%, " %%"
User\TagNames=Key replacement: % before word, Key replacement: % after word
User\TagAbbrevs=, 
User\TagTriggers="(?<=\\s|^)%", "(?<=\\S)%"
keysetting\size=0
changedLatexMenus=@Variant(\0\0\0\b\0\0\0\0)
CustomToolBar=@Invalid()
FileToolBar=@Invalid()
EditToolBar=@Invalid()
ToolsToolBar=@Invalid()
MathToolBar=@Invalid()
FormatToolBar=@Invalid()
TableToolBar=@Invalid()
DiffToolBar=@Invalid()
CentralToolBar=@Invalid()
customIcons=@Variant(\0\0\0\b\0\0\0\0)
customHighlighting=@Variant(\0\0\0\b\0\0\0\0)
customCommands=@Invalid()
MainWindowState=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x2\0\0\0\0\0\0\x1\x1b\0\0\x3\x95\xfc\x2\0\0\0\x1\xfb\0\0\0\x12\0l\0\x65\0\x66\0t\0P\0\x61\0n\0\x65\0l\x1\0\0\0\x35\0\0\x3\x95\0\0\0\x61\0\xff\xff\xff\0\0\0\x3\0\0\x3\x35\0\0\0|\xfc\x1\0\0\0\x1\xfb\0\0\0\x14\0O\0u\0t\0p\0u\0t\0V\0i\0\x65\0w\x1\0\0\x1\"\0\0\x3\x35\0\0\0\x81\0\xff\xff\xff\0\0\x3\x35\0\0\x3\x12\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\x2\xfc\0\0\0\x1\0\0\0\x2\0\0\0\b\0\0\0\f\0\x43\0u\0s\0t\0o\0m\0\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\b\0\x46\0i\0l\0\x65\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\b\0\x45\0\x64\0i\0t\x1\0\0\0\x84\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\n\0T\0o\0o\0l\0s\x1\0\0\x1%\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\b\0M\0\x61\0t\0h\x1\0\0\x2^\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\f\0\x46\0o\0r\0m\0\x61\0t\x1\0\0\x3H\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\n\0T\0\x61\0\x62\0l\0\x65\x1\0\0\x3\xdf\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\b\0\x44\0i\0\x66\0\x66\x1\0\0\x4\x1b\xff\xff\xff\xff\0\0\0\0\0\0\0\0)
MainWindowFullssscreenState=@ByteArray()
MainWindow\Maximized=false
MainWindow\FullScreen=false
Geometries\MainwindowWidth=1111
Geometries\MainwindowHeight=1001
Geometries\MainwindowX=50
Geometries\MainwindowY=5
Symbols\Quantity=@Variant(\0\0\0\b\0\0\0\0)
Symbols\Favorite%20IDs=@Invalid()
Symbols\hiddenlists=
StructureView\SingleDocMode=false
Editor%20Key%20Mapping\0=20483

[formats]
version=1.0

答案2

更新答案:2012 年 1 月 6 日

本教程基于外部博客文章使用 MiKTeX Portable 配置 Texmaker USB

与旧版本相比,版本 2.5.1(便携版本 2.9.4250)的用户界面有一些细微的变化。

使用 MiKTeX Portable 2.9.4250 设置 TeXStudio。

现在打开 TeXStudio USB 文件夹并查找文件texstudio.exe。双击该文件以启动 TeXStudio 便携式电脑。现在,单击以下菜单:

选项 > 配置 TeXStudio... > 命令

你应该看到类似这样的内容:

在此处输入图片描述

请注意,与 R. Schumacher 的答案(旧版本)中略有不同。要设置 TeXStudio portable 查找驱动程序的位置,请单击文件夹图标(我的情况是蓝色)并浏览到 USB 设备中相应驱动程序的位置。但请确保将其放在..输出文件夹驱动程序位置之前。

您现在应该看到类似这样的内容。

在此处输入图片描述

这是我在配置中所写内容的摘要Commands

LaTeX > "../MikTexPortable/miktex/bin/latex.exe" -src -interaction=nonstopmode %.tex
PdfLaTeX > "../MikTexPortable/miktex/bin/pdflatex.exe" -src -interaction=nonstopmode %.tex
XeLaTeX > "../MikTexPortable/miktex/bin/xelatex.exe" -src -interaction=nonstopmode %.tex
LuaLaTeX > "../MikTexPortable/miktex/bin/lualatex.exe" -src -interaction=nonstopmode %.tex
DviPs > "../MikTexPortable/miktex/bin/dvips" -o %.ps %.dvi
DviPng > "../MikTexPortable/miktex/bin/dvipng" -T tight -D 120 %.dvi
Ps2Pdf > "../MikTexPortable/miktex/bin/ps2pdf" %.ps
DviPdf > "../MikTexPortable/miktex/bin/dvipdfm" %.dvi
BibTeX > "../MikTexPortable/miktex/bin/bibtex" %.aux
BibTeX8 > "../MikTexPortable/miktex/bin/bibtex8" %.aux
Biber > "../MikTexPortable/miktex/bin/biber" %
Makeindex > "../MikTexPortable/miktex/bin/makeindex" %.idx
Texindy > "../MikTexPortable/miktex/bin/texindy"
Makeglossaries > "../MikTexPortable/miktex/bin/tmakeglossaries"
Metapost > "../MikTexPortable/miktex/bin/mpost" -interaction=nonstopmode ?me
Latexmk > "../MikTexPortable/miktex/bin/latexmk" -pdf -silent -pdflatex="pdflatex -synctex=1 %%O %%S" %

查看器

请注意,我还没有对观众做任何事情。

PDF

TeXStudio 有一个内置的 PDF 查看器。要配置,请单击

选项 > 配置 TeXStudio... > 构建 > PDF 查看器 > 内部 PDF 查看器(窗口)

内部 PDF 查看器还有一个嵌入式版本。

DVI 查看器

关注 R. Schumacher 的帖子。

PS 查看器

您可以按照 R. Schumacher 的答案中的第二步进行操作。或者,您也可以使用使用 MiKTeX Portable 配置 Texmaker USB。以下是摘要:下载并安装便携式应用程序插入 USB 设备,然后启动程序并打开菜单。点击“应用,' 然后 '获取更多应用。' 在下面 '实用工具' 找到 Ghostscript,选中复选框,然后单击 '下一个'PortableApps.com 平台将自动将 Ghostscript 安装到您的 USB 驱动器(在 PortableApps/CommonFiles 下)。

您的 USB 文件结构现在应如下所示:

USB Drive
    |_____GSView
        |_____gsview % from R. Schumacher's answer
    |_____MikTexPortable
    |_____TeXStudio
    |_____PortableApps
        |_____CommonFiles
            |_____GhostScript

然后点击

选项 > 配置 TeXStudio... > 命令

并浏览到USB 文件夹中的/PS Viewer位置。gswin32gswin64

答案3

我不确定这个功能是在哪个版本引入的,但 TeXstudio 现在允许输入命令的附加搜索路径。这样做的好处是它还允许 TeXstudio 找到“texdoc.exe”,从而允许用户从 TeXstudio 内部访问包文档。

此解决方案不适用于 DVI、PS 和外部 PDF 查看器以及 Aymptote 和 Ghostscript。请参阅上面的优秀答案来解决这些问题。

选项 > 配置 TeXStudio...

激活“显示扩展选项”。然后转到

选项>配置 TeXStudio...>构建

并且在页面底部,编辑行“命令($PATH)”以包含包含可执行文件(即 pdflatex.exe)的目录的相对路径。

对于我的文件夹结构来说,这将是

../MiKTeXPortable/texmfs/安装/miktex/bin/

“构建”设置包括添加的相对路径。

然后您可以简单地使用默认命令,例如在 pdflatex 的情况下:

  • pdflatex.exe -synctex=1 -interaction=nonstopmode %.tex

如果您已经在家用电脑上配置了永久系统,并打算在工作机器上使用便携式 MiKTeX 版本,这将特别有用。只需将“texstudio.ini”文件从相应的 AppData 文件夹复制到 USB 记忆棒上“texstudio.exe”所在的目录中,然后添加路径以保存所有宝贵的设置。

答案4

是的,所有文件都有绝对路径。我在转换过程中遇到了两个困难:(对我有用的映射)

  1. Ps2Pdf

    H:\PortableLyx2\MiKTeX\texmf\miktex\bin\mgs -sDEVICE=pdfwrite -o %.pdf %.ps

  2. DviPdf

    H:\PortableLyx2\MiKTeX\texmf\miktex\bin\dvipdfm %.dvi

    注意:我例如更改\includegraphics{a.ps}\includegraphics{a}将该图像打印在 pdf 文件中。

相关内容