简体   繁体   English

DDE控制TeXnicCenter

[英]DDE control TeXnicCenter

I use TeXnicCenter for LaTeX and would like to have the DDE controls working to easily view the pdf versions. 我使用TeXnicCenter for LaTeX,并希望DDE控件能够轻松查看pdf版本。 Acrobat X seems to have changed the servername and this is breaking things. Acrobat X似乎更改了服务器名称,这是破坏事情。 I tried "AcroViewR10" or "acroviewR10" and other combination, but still it does not work. 我试过“AcroViewR10”或“acroviewR10”等组合,但仍然无法正常工作。

As a work around, using command line argument "%bm.pdf" works, but I manually need to close the pdf everytime before recompiling. 作为一种解决方法,使用命令行参数“%bm.pdf”可以工作,但我需要在重新编译之前每次都手动关闭pdf。 So, it takes an extra click or so. 因此,需要额外点击左右。

Can anyone give some insight to solve the problem either by fixing DDE or how to close the pdf automatically when it is recompiled? 任何人都可以通过修复DDE或如何在重新编译时自动关闭pdf来解决问题吗?

Actually, the answers from Martyn and Adam Nellis solved this problem. 实际上,Martyn和Adam Nellis的答案解决了这个问题。 Thanks a lot, folks. 非常感谢,伙计们。 I am just putting it step by step, so someone else can use it. 我只是一步一步地把它,所以其他人可以使用它。

Step1: Adobe ReaderX In Adobe Reader X, go to Edit>Preferences>General and uncheck "Enable Protected Mode at startup". 步骤1:Adobe ReaderX在Adobe Reader X中,转到编辑>首选项>常规,然后取消选中“启动时启用保护模式”。

Step2: TeXnicCenter Go to Build->Define Output Profiles-> choose "Latex to PDF" -> Viewer tab 步骤2:TeXnicCenter转到构建 - >定义输出配置文件 - >选择“Latex to PDF” - >“查看器”选项卡

2.1. 2.1。 For "View Project's Output" & "Forward Search" 对于“查看项目的输出”和“前向搜索”

  • Command: [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")] 命令:[DocOpen(“%bm.pdf”)] [FileOpen(“%bm.pdf”)]
  • Server: AcroViewR10 Topic: control 服务器:AcroViewR10主题:控制

2.2. 2.2。 For "Close Document" 对于“关闭文档”

  • Command: [DocClose("%bm.pdf")] 命令:[DocClose(“%bm.pdf”)]
  • Server: AcroViewR10 Topic: control (use this option even if you use Adobe Reader 11) 服务器:AcroViewR10主题:控制(即使您使用Adobe Reader 11也使用此选项)

For the newer version of Adobe [DocClose] doesn't work anymore. 对于较新版本的Adobe [DocClose]不再适用。 So you have to make updates. 所以你必须进行更新。 In texnicCenter hit Alt+F7, go to Viewer TAB and follow the example accordingly (works on Win7 with Adobe11): 在texnicCenter中按Alt + F7,转到Viewer TAB并相应地按照示例(适用于Win7和Adobe11):

in Executable path you have to have something like "C:\\Program Files (x86)\\Adobe\\Reader 11.0\\Reader\\AcroRd32.exe" 在可执行文件路径中,你必须有类似“C:\\ Program Files(x86)\\ Adob​​e \\ Reader 11.0 \\ Reader \\ AcroRd32.exe”的内容

View Project's Output >>> Choose "command line argument" and enter "%bm.pdf" in command 查看项目的输出>>>选择“命令行参数”并在命令中输入“%bm.pdf”

Forward Search >>> Choose "command line argument" and enter "%bm.pdf" in command 正向搜索>>>选择“命令行参数”并在命令中输入“%bm.pdf”

And finally * THE MOST IMPORTANT OPTION * Close Document Before Running (La)Tex >>> Choose "DDE" and enter "[AppExit]" in command "AcroViewR11" in Server "control" in Topic 最后* 最重要的选项 *运行前关闭文档(La)Tex >>>选择“DDE”并在主题“服务器”控件中的“AcroViewR11”命令中输入“[AppExit]”

对于使用Acrobat X pro的用户,服务器应为AcroviewA10,而excecutable应为Acrobat.exe

I realise this question is a little old, but I have just been struggling with this problem (not used TeXnicCenter for a wile, so hadn't noticed the problems when upgrading Adobe) and this thread is the only one that solved the problem for me. 我意识到这个问题有点老了,但我一直在努力解决这个问题(没有使用TeXnicCenter进行诡计,因此在升级Adobe时没有注意到问题)这个线程是唯一能解决问题的线程。 I had to use a combination of the above answers, though, so I thought I would document what worked for me. 我不得不使用上述答案的组合,所以我想我会记录对我有用的东西。

I am using Windows Vista Business edition, TeXnicCenter 1.0, and Adobe Reader 10.0 我使用的是Windows Vista商业版,TeXnicCenter 1.0和Adobe Reader 10.0

Go to Build->Define Output Profiles-> choose "Latex => PDF" 转到Build-> Define Output Profiles->选择“Latex => PDF”

1) In the viewer tab, change the executable location to point to 1)在查看器选项卡中,将可执行位置更改为指向

C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe

2) View project's output: Select DDE command and enter 2)查看项目的输出:选择DDE命令并输入

[DocOpen("%bm.pdf")][FileOpen("%bm.pdf")]
Server: arcroviewR10    Topic: Control

3) Forward search: Select DDE command and enter 3)前向搜索:选择DDE命令并输入

[DocOpen("%bm.pdf")][FileOpen("%bm.pdf")]
Server: arcroviewR10    Topic: Control

4) Close document before running (La)TeX: Select DDE command and enter 4)运行前关闭文档(La)TeX:选择DDE命令并输入

[AppExit]
Server: arcroviewR10    Topic: Control

In particular, it was point 4 that I needed to do, and despite searching a while, this is the only place I have found advice to switch the DDE command to [AppExit] and it worked a treat. 特别是,我需要做的是第4点,尽管搜索了一段时间,但这是我找到建议将DDE命令切换到[AppExit]的唯一地方,并且它起了作用。 Thanks Claudia! 谢谢克劳迪娅!

I have not needed to change the Adobe Reader settings at all (ie it is still in Protected Mode at Startup). 我根本不需要更改Adobe Reader设置(即它在启动时仍处于保护模式)。

I use Acrobat Pro XI and have the following settings: 我使用Acrobat Pro XI并进行以下设置:

Path of Executable: 可执行路径:
C:\\Program Files (x86)\\Adobe\\Acrobat 11.0\\Acrobat\\Acrobat.exe (for 32bit version) and C:\\ Program Files(x86)\\ Adob​​e \\ Acrobat 11.0 \\ Acrobat \\ Acrobat.exe(适用于32位版本)和
C:\\Program Files\\Adobe\\Acrobat 11.0\\Acrobat\\Acrobat.exe (for 64bit version) C:\\ Program Files \\ Adob​​e \\ Acrobat 11.0 \\ Acrobat \\ Acrobat.exe(适用于64位版本)

View Project's Output & Forward Search 查看项目的输出转发搜索
"command line argument" and "%bm.pdf" “命令行参数”和“%bm.pdf”

Close document 关闭文件
"DDE" and enter "[AppExit]" in command "AcroviewA11" in Server "Control" in Topic “DDE”并在主题服务器“控件”中的命令“AcroviewA11”中输入“[AppExit]”

My settings are: 我的设置是:

  • Path of Executable: C:\\Program Files\\Adobe\\Reader 10.0\\Reader\\AcroRd32.exe 可执行路径:C:\\ Program Files \\ Adob​​e \\ Reader 10.0 \\ Reader \\ AcroRd32.exe

For "View Project's Output" & "Forward Search" 对于“查看项目的输出”和“前向搜索”

  • Command: [DocOpen("%bm.pdf")][FileOpen("%bm.pdf")] 命令:[DocOpen(“%bm.pdf”)] [FileOpen(“%bm.pdf”)]
  • Server: AcroViewR10 服务器:AcroViewR10
  • Topic: control 主题:控制

For "Close document" 对于“关闭文档”

  • Command: [DocClose("%bm.pdf")] 命令:[DocClose(“%bm.pdf”)]
  • Server: AcroViewR10 服务器:AcroViewR10
  • Topic: control 主题:控制

That works for me except for two things: 这对我有用,除了两件事:

  1. When Acrobat Reader is closed and I press F5 it will open Acrobat Reader but will not open the document and will bring up an error message. 当Acrobat Reader关闭并按F5时,它将打开Acrobat Reader,但不会打开文档并显示错误消息。 If I close the error message and press F5 a second time (with Acrobat Reader now open) then it will open the document. 如果我关闭错误消息并再次按F5(现在打开Acrobat Reader),它将打开文档。
  2. When I press F5, and the document opens, Acrobat Reader does not become the top window (the focus stays with TexnicCenter). 当我按F5,文档打开时,Acrobat Reader不会成为顶部窗口(焦点保留在TexnicCenter中)。

So not major problems but just small annoyances. 所以不是主要问题,只是小烦恼。


Edit: 编辑:

Not sure if it makes a difference but in the windows registry the keys: 不确定它是否有所作为,但在Windows注册表中的键:

  • HKEY_CLASSES_ROOT\\acrobat\\shell\\open\\ddeexec\\application HKEY_CLASSES_ROOT \\杂技\\壳\\开放\\ ddeexec \\应用
  • HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\acrobat\\shell\\open\\ddeexec\\application HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Classes下\\杂技\\壳\\打开\\ ddeexec \\应用

Both have values set to "AcroviewR10" (no quotes). 两者都将值设置为“AcroviewR10”(无引号)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM