Re: Bug: Exporting internal link to special latex block [9.3.7 (9.3.7-14-gb2b587-elpa @ /home/lobo/.emacs.d/elpa/org-20200720/)]

2020-09-05 Thread Marco Falconi
Dear Bastien,

Thanks for the update. For the moment I have worked around the bug by putting an
html-export block in the org file with the correct href when I have to put a 
link to it.

However, it would be very nice if it was solved in org. Also, my preference 
would be for
the exported id to be the one given in the NAME attribute (as it is now), 
because I use it
in the html file to name the theorem environment. Of course this is just my 
preference,
and I would understand if the solution would work in another manner.

Best regards,
_
Marco


Bastien  writes:

> Hi Marco,
>
> Marco Falconi  writes:
>
>> I am trying to export to html a labeled latex special block (a theorem
>> environment, defined by #+begin_theorem [...] #+end_theorem ). I have named 
>> the theorem with
>>
>> #+NAME: thm:mv (I also tried with #+LABEL: and the behavior described below 
>> does not change).
>>
>> I have a link to such block later in the body, in the form [[thm:mv]]. The 
>> link works
>> perfectly in the org file, however it is exported incorrectly to html.
>>
>> In fact, while the theorem environment gets exported in the html as
>>
>>
>>
>>[...]
>>
>>
>>
>> ,
>>
>> the link does not href to "#thm:mv" as expected, but to an auto-generated 
>> label:
>>
>> 
>> 1
>> 
>>
>> I have tried to play around a bit with export options, but to no avail.
>>
>> Is this a known bug?
>
> I also confirm this bug.  I've had a quick look.  It looks like
> `org-export-get-reference' get fooled by trying to provide with a "new
> reference".  I hope Nicolas can have a look because this area of the
> code is quite complexe.
>
> Thanks,




Bug: Exporting internal link to special latex block [9.3.7 (9.3.7-14-gb2b587-elpa @ /home/lobo/.emacs.d/elpa/org-20200720/)]

2020-08-01 Thread Marco Falconi


I am trying to export to html a labeled latex special block (a theorem
environment, defined by #+begin_theorem [...] #+end_theorem ). I have named the 
theorem with
#+NAME: thm:mv (I also tried with #+LABEL: and the behavior described below 
does not change).

I have a link to such block later in the body, in the form [[thm:mv]]. The link 
works
perfectly in the org file, however it is exported incorrectly to html.

In fact, while the theorem environment gets exported in the html as

   
   
   [...]
   
   

,

the link does not href to "#thm:mv" as expected, but to an auto-generated label:


1


I have tried to play around a bit with export options, but to no avail.

Is this a known bug?

Best regards,
_
Marco



Emacs  : GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20)
 of 2020-05-19
Package: Org mode version 9.3.7 (9.3.7-14-gb2b587-elpa @ 
/home/lobo/.emacs.d/elpa/org-20200720/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-link-shell-confirm-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-export-date-timestamp-format "%B %d, %Y"
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-html-format-inlinetask-function 
'org-html-format-inlinetask-default-function
 org-latex-subtitle-separate t
 org-pretty-entities t
 org-latex-default-packages-alist '(("AUTO" "inputenc" t ("pdflatex" "latex")) 
("" "fontspec" nil ("xelatex" "lualatex")) ("" "amssymb" t nil)
("" "amsmath" t nil) ("" "amsthm" nil nil) 
("" "amscd" t nil) ("" "amsfonts" t nil)
("" "unicode-math" nil ("xelatex" 
"lualatex")) ("" "graphicx" t nil) ("" "grffile" t nil)
("" "wrapfig" nil nil) ("" "rotating" nil 
nil) ("normalem" "ulem" t nil) ("" "textcomp" t nil)
("" "capt-of" nil nil) ("" "longtable" nil 
nil))
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-agenda-files '("~/home.org" "~/postdoc/work.org")
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-reveal-start-hook '(org-decrypt-entry)
 org-format-latex-header 
"\\documentclass[leqno]{article}\n\\usepackage[usenames]{color}\n[PACKAGES]\n[DEFAULT-PACKAGES]\n\\pagestyle{empty}
 % do not remove\n% The settings below are copied from 
fullpage.sty\n\\setlength{\\textwidth}{\\paperwidth}\n\\addtolength{\\textwidth}{-3cm}\n\\setlength{\\oddsidemargin}{1.5cm}\n\\addtolength{\\oddsidemargin}{-2.54cm}\n\\setlength{\\evensidemargin}{\\oddsidemargin}\n\\setlength{\\textheight}{\\paperheight}\n\\addtolength{\\textheight}{-\\headheight}\n\\addtolength{\\textheight}{-\\headsep}\n\\addtolength{\\textheight}{-\\footskip}\n\\addtolength{\\textheight}{-3cm}\n\\setlength{\\topmargin}{1.5cm}\n\\addtolength{\\topmargin}{-2.54cm}"
 org-mode-hook '((lambda nil (local-set-key (kbd "C-l C-e") (function 
LaTeX-environment))) turn-on-visual-line-mode
 my/org-include-img-from-pdf-before-save (lambda nil 
(org-bullets-mode 1))
 #[0 "\301\211\207" [imenu-create-index-function 
org-imenu-get-tree] 2]
 (lambda nil (local-set-key (kbd "C-c p") (function 
mail-org-preamble))) smartparens-mode (lambda nil (setq fill-column 95))
 #[0 "\300\301\302\303\304$\207" [add-hook before-save-hook 
org-encrypt-entries nil t] 5] turn-off-auto-fill
 org-display-inline-images turn-on-org-cdlatex
 #[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-show-all append local] 5]
 #[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-export-with-smart-quotes t
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-agenda-restore-windows-after-quit t
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-preview-latex-default-process 'dvisvgm
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-startup-with-latex-preview t
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-agenda-deadline-faces '((1.0 . org-warning) (0.5 . org-upcoming-deadline) 
(0.0 . org-agenda-calendar-event))
 org-crypt-key nil
 org-babel-pre-tangle-hook '(save-buffer)
 org-latex-compiler "xelatex"
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
 org-agenda-skip-deadline-prewarning-if-scheduled 3
 org-highlight-latex-and-related '(native entities)