From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scot Becker Subject: Re: Bug: Impossible to have right bracket in footnotes [7.01trans] Date: Tue, 31 Aug 2010 15:20:47 +0100 Message-ID: References: <4C7CBF7C.5060904@no8wireless.co.nz> <1D6BEB21-B559-469F-996D-F50C3CB0E31E@gmail.com> <83occiq38c.fsf@yahoo.it> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0341701771==" Return-path: Received: from [140.186.70.92] (port=44339 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OqSdS-00047Z-SJ for emacs-orgmode@gnu.org; Tue, 31 Aug 2010 11:20:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OqSEW-0006ea-OE for emacs-orgmode@gnu.org; Tue, 31 Aug 2010 10:54:45 -0400 Received: from mail-ew0-f41.google.com ([209.85.215.41]:51456) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OqSEW-0006eK-DK for emacs-orgmode@gnu.org; Tue, 31 Aug 2010 10:54:44 -0400 Received: by ewy28 with SMTP id 28so4557360ewy.0 for ; Tue, 31 Aug 2010 07:54:42 -0700 (PDT) In-Reply-To: <83occiq38c.fsf@yahoo.it> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Giovanni Ridolfi Cc: emacs-orgmode@gnu.org, Aidan Gauland , Carsten Dominik --===============0341701771== Content-Type: multipart/alternative; boundary=0015174beee40611bc048f1f8968 --0015174beee40611bc048f1f8968 Content-Type: text/plain; charset=ISO-8859-1 Giovanni, Thanks for that. I have the same problem, since I put citations in my footnotes in the format \cite[50]{Ridolfi_2011_Autobiography}. This is great. It's also a nice model for a few other petty troubles I want to postprocess away. Scot On Tue, Aug 31, 2010 at 3:13 PM, Giovanni Ridolfi wrote: > Carsten Dominik writes: > > > unfortunately this is difficult to fix in a good way. > > I do want to go back to footnotes, because I think there are many > > things that do not yet work satisfactorily. And then I also hope to > > address the issue you raised. For the time being, unfortunately, I do > > not have a solution for you. > > I have a workaround. > If the author uses the a special code for [ and ], e.g. > #91; and #93; then the note is exported correctly. > -------------------------------------------------------- > ** example > This is not anymore a broken footnote.[fn:: Some book at #91; 42-24 #93;.] > > Exports to: > This is not anymore broken footnote.[1] > [1] Some book at #91; 42-24 #93;. > ---------------------------------------------------------- > > But then the file have to be post-processed to substitute #91; and #93; > > Place these lines in .emacs, or evaluate them (goto the last ") " and hit > C-x C-e) > for the current session : > ---------------------------------------------------------------------- > (add-hook 'org-export-html-final-hook 'gio/replace-square-brackets) > (add-hook 'org-export-ascii-final-hook 'gio/replace-square-brackets) > > (defun gio/replace-square-brackets () > "Replace #91; with [ and #93; with ] " > (interactive) > (setq a "#91;") ; use "\[" for LaTeX export > (setq a1 "[") > (setq b "#93;") ; use "\]" for LaTeX export > (setq b1 "]") > (ignore-errors (goto-char 1) (setq p (point)) > (while (< p (point-max)) > (re-search-forward a nil nil) (replace-match a1) (setq p (point)) ) ) > ;; > (ignore-errors (goto-char 1) (setq p (point)) > (while (< p (point-max)) > (re-search-forward b nil nil) (replace-match b1) (setq p (point)) ) ) > (save-buffer) ) > ---------------------------------------------------------- > Tested for HTML, ASCII. > > For the LaTeX export the line: > This is not anymore a broken footnote.[fn:: Some book at #91; > 42-24#93;.] > exports to: > > This is not anymore a broken footnote.\footnote{Some book at \[ > 42-24 \]. } > > > So the LaTeX seems to convert directly the #9?; character. > > Not tested for docbook. > > HTH > Giovanni > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > --0015174beee40611bc048f1f8968 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Giovanni,

Thanks for that.=A0 I have the same problem, since I put = citations in my footnotes in the format \cite[50]{Ridolfi_2011_Autobiograph= y}.=A0 This is great.=A0 It's also a nice model for a few other petty t= roubles I want to postprocess away.=A0

Scot



On Tue, Aug 31, 2010 at = 3:13 PM, Giovanni Ridolfi <giovanni.ridolfi@yahoo.it> wrote:
Carsten Dominik <carsten.dominik@gmail.com> writes:

> unfortunately this is difficult to fix in a good way.
> I do want to go back to footnotes, because I think there are many
> things that do not yet work satisfactorily. =A0And then I also hope to=
> address the issue you raised. =A0For the time being, unfortunately, I = do
> not have a solution for you.

I have a workaround.
If the author uses the a special code for [ and ], e.g.
#91; and #93; then the note is exported correctly.
--------------------------------------------------------
** example
This is not anymore a broken footnote.[fn:: Some book at #91; 42-24 #93;.]<= br>
Exports to:
This is not anymore broken footnote.[1]
[1] Some book at #91; 42-24 #93;.
----------------------------------------------------------

But then the file have to be post-processed to substitute #91; and #93;

Place these lines in .emacs, or evaluate them (goto the last ") "= and hit C-x C-e)
for the current session :
----------------------------------------------------------------------
(add-hook 'org-export-html-final-hook =A0'gio/replace-square-bracke= ts)
(add-hook 'org-export-ascii-final-hook 'gio/replace-square-brackets= )

(defun gio/replace-square-brackets ()
"Replace #91; with [ and #93; with ] "
(interactive)
(setq a "#91;") =A0; use "\[" for LaTeX export
(setq a1 =A0"[")
(setq b "#93;") =A0; use "\]" for LaTeX export
(setq b1 =A0"]")
(ignore-errors (goto-char 1) (setq p (point))
(while (< p (point-max))
(re-search-forward a nil nil) (replace-match a1) =A0(setq p (point)) ) =A0)=
;;
(ignore-errors (goto-char 1) (setq p (point))
(while (< p (point-max))
(re-search-forward b nil nil) (replace-match b1) =A0(setq p (point)) ) =A0)=
(save-buffer) )
----------------------------------------------------------
Tested for =A0HTML, ASCII.

For the LaTeX export =A0the line:
=A0 =A0 =A0This is not anymore a broken footnote.[fn:: Some book at #91; =A0 =A0 =A042-24#93;.]
exports to:

=A0 =A0 =A0This is not anymore a broken footnote.\footnote{Some book at \[=
=A0 =A0 =A042-24 \]. }


So the LaTeX seems to convert directly the #9?; character.

Not tested for docbook.

HTH
Giovanni

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

--0015174beee40611bc048f1f8968-- --===============0341701771== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0341701771==--