Vertically align LaTeX preview in org mode
up vote
0
down vote
favorite
I would like to vertically align org mode latex previews at the same level than the surrounding text, that is I want the bottom of the surrounding text to be at the same level than the bottom of the preview. Is that possible?
The following screenshot shows the default behavior which is to align the center of the image with the top (or center?) of the surrounding text:
org-mode
add a comment |
up vote
0
down vote
favorite
I would like to vertically align org mode latex previews at the same level than the surrounding text, that is I want the bottom of the surrounding text to be at the same level than the bottom of the preview. Is that possible?
The following screenshot shows the default behavior which is to align the center of the image with the top (or center?) of the surrounding text:
org-mode
2
Welcome to TeX.SE! I didn't really understood what org mode is, but found out that has to do with emacs. Thus, I suppose that the page emacs.stackexchange.com will give you more possibilities to get an answer. If I am wrong and your question is more relevant with LaTeX than with emacs, please ask me to delete this comment
– koleygr
Sep 17 at 2:11
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I would like to vertically align org mode latex previews at the same level than the surrounding text, that is I want the bottom of the surrounding text to be at the same level than the bottom of the preview. Is that possible?
The following screenshot shows the default behavior which is to align the center of the image with the top (or center?) of the surrounding text:
org-mode
I would like to vertically align org mode latex previews at the same level than the surrounding text, that is I want the bottom of the surrounding text to be at the same level than the bottom of the preview. Is that possible?
The following screenshot shows the default behavior which is to align the center of the image with the top (or center?) of the surrounding text:
org-mode
org-mode
asked Sep 17 at 2:02
memeplex
101
101
2
Welcome to TeX.SE! I didn't really understood what org mode is, but found out that has to do with emacs. Thus, I suppose that the page emacs.stackexchange.com will give you more possibilities to get an answer. If I am wrong and your question is more relevant with LaTeX than with emacs, please ask me to delete this comment
– koleygr
Sep 17 at 2:11
add a comment |
2
Welcome to TeX.SE! I didn't really understood what org mode is, but found out that has to do with emacs. Thus, I suppose that the page emacs.stackexchange.com will give you more possibilities to get an answer. If I am wrong and your question is more relevant with LaTeX than with emacs, please ask me to delete this comment
– koleygr
Sep 17 at 2:11
2
2
Welcome to TeX.SE! I didn't really understood what org mode is, but found out that has to do with emacs. Thus, I suppose that the page emacs.stackexchange.com will give you more possibilities to get an answer. If I am wrong and your question is more relevant with LaTeX than with emacs, please ask me to delete this comment
– koleygr
Sep 17 at 2:11
Welcome to TeX.SE! I didn't really understood what org mode is, but found out that has to do with emacs. Thus, I suppose that the page emacs.stackexchange.com will give you more possibilities to get an answer. If I am wrong and your question is more relevant with LaTeX than with emacs, please ask me to delete this comment
– koleygr
Sep 17 at 2:11
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
I ended up advicing an internal function since there is no clean extension hook nor customization option for this:
(defun my-org-latex-preview-advice (beg end &rest _args)
(let* ((ov (car (overlays-in beg end)))
(img (cdr (overlay-get ov 'display)))
(new-img (plist-put img :ascent 90)))
(overlay-put ov 'display (cons 'image new-img))))
(advice-add #'org--format-latex-make-overlay
:after #'my-org-latex-preview-advice)
No quite nice but it does the work.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
I ended up advicing an internal function since there is no clean extension hook nor customization option for this:
(defun my-org-latex-preview-advice (beg end &rest _args)
(let* ((ov (car (overlays-in beg end)))
(img (cdr (overlay-get ov 'display)))
(new-img (plist-put img :ascent 90)))
(overlay-put ov 'display (cons 'image new-img))))
(advice-add #'org--format-latex-make-overlay
:after #'my-org-latex-preview-advice)
No quite nice but it does the work.
add a comment |
up vote
0
down vote
I ended up advicing an internal function since there is no clean extension hook nor customization option for this:
(defun my-org-latex-preview-advice (beg end &rest _args)
(let* ((ov (car (overlays-in beg end)))
(img (cdr (overlay-get ov 'display)))
(new-img (plist-put img :ascent 90)))
(overlay-put ov 'display (cons 'image new-img))))
(advice-add #'org--format-latex-make-overlay
:after #'my-org-latex-preview-advice)
No quite nice but it does the work.
add a comment |
up vote
0
down vote
up vote
0
down vote
I ended up advicing an internal function since there is no clean extension hook nor customization option for this:
(defun my-org-latex-preview-advice (beg end &rest _args)
(let* ((ov (car (overlays-in beg end)))
(img (cdr (overlay-get ov 'display)))
(new-img (plist-put img :ascent 90)))
(overlay-put ov 'display (cons 'image new-img))))
(advice-add #'org--format-latex-make-overlay
:after #'my-org-latex-preview-advice)
No quite nice but it does the work.
I ended up advicing an internal function since there is no clean extension hook nor customization option for this:
(defun my-org-latex-preview-advice (beg end &rest _args)
(let* ((ov (car (overlays-in beg end)))
(img (cdr (overlay-get ov 'display)))
(new-img (plist-put img :ascent 90)))
(overlay-put ov 'display (cons 'image new-img))))
(advice-add #'org--format-latex-make-overlay
:after #'my-org-latex-preview-advice)
No quite nice but it does the work.
answered Dec 2 at 21:25
memeplex
101
101
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f451184%2fvertically-align-latex-preview-in-org-mode%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Welcome to TeX.SE! I didn't really understood what org mode is, but found out that has to do with emacs. Thus, I suppose that the page emacs.stackexchange.com will give you more possibilities to get an answer. If I am wrong and your question is more relevant with LaTeX than with emacs, please ask me to delete this comment
– koleygr
Sep 17 at 2:11