Latex 从 Okular 中的 pdf 到 TexMaker 的反向搜索

发布于 2024-08-27 05:52:10 字数 314 浏览 6 评论 0原文

我正在使用 Karmic Ubuntu 的 TexMaker 和 Okular。我使用 pdfLatex 进行编译并在 Okular 中查看 PDF。如何配置 Okular 以使用 TexMaker 进行反向搜索?我尝试过以下代码:

texmaker %f -line %l

但它不起作用。我尝试过双击、ctrl+单击、shift+单击、ctrl+shift+单击、ctrl+alt+单击、alt+shift+单击,仍然没有任何效果。也许我只是不知道从 Okular 内部启动反向搜索的操作是什么。

如何配置 Okular 以使用 TexMaker 进行反向搜索?

I am using TexMaker of Karmic Ubuntu with Okular. I use pdfLatex to compile and I view the PDFs in Okular. How can I configure Okular to inverse search with TexMaker? I have tried the following code:

texmaker %f -line %l

but it does not work. I have tried double clicking, ctrl+click, shift+click, ctrl+shift+click, ctrl+alt+click, alt+shift+click, still nothing. Perhaps I simply don't know what the action is to initiate the inverse search from within Okular.

How can I configure Okular to inverse search with TexMaker?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

淡水深流 2024-09-03 05:52:10

okular 中的反向搜索是通过按 shift+left_mouse_button 启动的。在使用它之前,您需要在 LaTeX 编辑器中启用synctex 或 pdfsync(synctex 的前身)。 Synctex 可以通过扩展 pdflatex 命令行“-synctex=1”来启用。

此外,您需要支持synctex的适当版本的okular,例如0.11.1。 Niall Murphy 提到的 0.10.2 版本似乎仅支持正向搜索的synctex,但不支持反向搜索。

很难说反向搜索是在哪个版本中添加的,因为即使是官方网站也声称它尚未实现:

The inverse search in okular is initiated by pressing shift+left_mouse_button. Before you can use it you need to enable synctex or pdfsync (predecessor of synctex) in your LaTeX editor. Synctex can be enabled by extending the pdflatex command line by "-synctex=1".

Furthermore, you need an appropriate version of okular that supports synctex, e.g. 0.11.1. Version 0.10.2 as mentioned by Niall Murphy seems to support synctex only for the forward search, but not for the inverse search.

It is very hard to say in which version the inverse search was added, since even the official websites claim that it is still not implemented:

饭团 2024-09-03 05:52:10

如果您未处于浏览模式,则 Shift 单击在 Okular 中不起作用(如果鼠标指针是箭头或十字,则表示您未处于浏览模式)。

解决方案:首先选择工具栏中的浏览(设置|显示工具栏)
鼠标指针变为手形,并且 Shift 单击应该可以工作。

Shift click does not work in Okular if you are not in Browse mode (if the mouse pointer is an arrow or a cross you're not in Browse mode).

Solution: first select Browse in the toolbar (Settings | Show Toolbar)
the mousepointer changes to a hand, and Shift click should work.

一梦浮鱼 2024-09-03 05:52:10

Okular 的页面称它只支持 pdfsync,这是两种反向搜索技术中较旧的一种。转到 Okular 中进行配置,并确保您的编辑器设置为 texmaker。然后确保 pdfsync 处于活动状态。

Okular's page says it only supports pdfsync, which is the older of the two inverse search technologies. Go to configure in Okular, and make sure your editor is set to texmaker. Then ensure that you have pdfsync active.

哽咽笑 2024-09-03 05:52:10

尝试在 okular 的编辑器菜单中使用此代码:

texmaker -use -line %l -column %c

对我来说效果很好。

Try using this code in okular's editor menu:

texmaker -use -line %l -column %c

Works for me perfectly well.

长不大的小祸害 2024-09-03 05:52:10

Okular 0.10 还支持synctex,这显然工作得更好。

然而 Karmic 仍然使用 Texlive 2007,它有一个错误且损坏的synctex。
http://itexmac.sourceforge.net/SyncTeX.html

Lucid 将拥有 TexLive 2009,它应该使逆向搜索变得更加容易。

Okular 0.10 also supports synctex which apparently works much better.

However Karmic still uses Texlive 2007 which has a buggy and broken synctex.
http://itexmac.sourceforge.net/SyncTeX.html

Lucid will have TexLive 2009 which should make inverse search a lot easier.

一生独一 2024-09-03 05:52:10

我在 VirtualBox 中运行 Ubuntu,您必须按住单击片刻(不要立即放开)才能正常工作。

也许这是因为 VirtualBox 的行为,或者可能是 Okular 检测 Shift+Left-Mouse-Button 方式的怪癖

I'm running Ubuntu in a VirtualBox, and you have to hold the click for an instant (don't let go right away) for this to work.

Perhaps this is because of the VirtualBox behavior, or perhaps it's a quirk of Okular in the way it detects the Shift+Left-Mouse-Button

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文