[O] accessing ATTR_HTML and CAPTION from custom

2018-03-09 Thread Seong-Kook Shin

Hello,

I'm using Nikola (https://getnikola.com/) with its orgmode plugin to 
write blog posts.  Their script contains following custom link for HTML 
export:


(defun org-custom-link-img-url-export (path desc format)
  (cond
   ((eq format 'html)
(format "" path desc
(org-add-link-type "img-url" nil 'org-custom-link-img-url-export)


And I have org-mode contents like this:

#+CAPTION: some caption for the image
#+ATTR_HTML: width="60%"
[[img-url:/img/a.jpg]]

I found that somehow DESC parameter passed to above 
org-custom-link-img-url-export function contains all information 
regarding CAPTION and ATTR_HTML but unable to retrieve it properly.  Is 
there any org utility functions to retrieve them?  For example, I want 
to access 'width' parameter from ATTR_HTML like this:


(defun org-custom-link-img-url-export (path desc format)
  (cond
   ((eq format 'html)
(let ((width (SOME-FUNCTION desc :width)))
  (if (null width)
  (format "" ... width)
(format "" ...))

Could you help me how to do that?

Thank you.



Re: [O] what settings would make original export to pdf as good as pandoc conversion?

2018-03-09 Thread Samuel Wales
On 3/9/18, Eric S Fraga  wrote:
> Type C-h v org-latex-classes RET for the full description.  The
> header-string can include those particular indent and skip settings
> along with other bits.

i consulted the docstring and the manual.  the description was greek
to me and there was no reference to qa term you used afaict.

but i figured out that article is the default and now know that you
want me to change header-string in that.  so i did this:

(with-eval-after-load 'org-latex
  (setf (second (assoc "article" org-latex-classes))
;; non-idempotent is undesirable
(concat "\\setlength{\\parindent}{0pt}\\setlength{\\parskip}{6pt}"
;; repeating this form is undesirable
(second (assoc "article" org-latex-classes)

which seems to set the variable correctly but has no effect.

it's ok to drop this.  i am limited in computer use and cannot sustain
more debugging cycles.

thanks for your help.



Re: [O] what settings would make original export to pdf as good as pandoc conversion?

2018-03-09 Thread Eric S Fraga
On Friday,  9 Mar 2018 at 13:26, Samuel Wales wrote:

[...]

> in any case, greek to me.  this was my best guess.
>
> (with-eval-after-load
> (add-to-list org-latex-classes
> '("org-latex" "\setlength{\parindent}{0pt}\setlength{\parskip}{6pt}")))

No, this won't work.  You need to check the documentation for the
variable to see the structure that is expected:

org-latex-classes is a variable defined in ‘ox-latex.el’.
Its value is shown below.

Documentation:
Alist of LaTeX classes and associated header and structure.
If #+LATEX_CLASS is set in the buffer, use its value and the
associated information.  Here is the structure of each cell:

  (class-name
header-string
(numbered-section . unnumbered-section)
...)

(continues)

Type C-h v org-latex-classes RET for the full description.  The
header-string can include those particular indent and skip settings
along with other bits.

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-191-g90607d


signature.asc
Description: PGP signature


Re: [O] [SOLVED]

2018-03-09 Thread Thorsten Jolitz
Uwe Brauer  writes:

>> Uwe Brauer  writes:
>
>> When I do M-# # writing this mail I see:
>> ,
>> | [ *unsent followup to Uwe Brauer on gmane.emacs.orgmode* ] Exit
>> | with M-#
>> | (Meta-Key and #)
>> | * --text follows this line--
>> | Uwe Brauer  writes: ...[]
>> `
>
>
> I found the culprit
>
> (setq message-yank-prefix "   > ")
>
> No idea why I had this, but may be it is ages there. Just moving it out
> my init files and everything worked as expected. Thanks

Ok, good ... ;-)

-- 
cheers,
Thorsten




Re: [O] how do you compose mails in Gnus with org-mode

2018-03-09 Thread Thorsten Jolitz
Uwe Brauer  writes:

>> Uwe Brauer  writes:
>
>> When I do M-# # writing this mail I see:
>> ,
>> | [ *unsent followup to Uwe Brauer on gmane.emacs.orgmode* ] Exit
>> | with M-#
>> | (Meta-Key and #)
>> | * --text follows this line--
>> | Uwe Brauer  writes: ...[]
>> `
>
> I almost see the same but indented since I user supercite.

Isn't that the problem already?

In an org file, this:

,
| * headline
|  * headline
| hello
`

has only one headline, indentation for the * is not allowed.

-- 
cheers,
Thorsten




[O] [SOLVED] (was: how do you compose mails in Gnus with org-mode)

2018-03-09 Thread Uwe Brauer

   > Uwe Brauer  writes:

   > When I do M-# # writing this mail I see:
   > ,
   > | [ *unsent followup to Uwe Brauer on gmane.emacs.orgmode* ] Exit with M-#
   > | (Meta-Key and #)
   > | * --text follows this line--
   > | Uwe Brauer  writes: ...[]
   > `


I found the culprit

(setq message-yank-prefix "   > ")

No idea why I had this, but may be it is ages there. Just moving it out
my init files and everything worked as expected. Thanks

Uwe 




Re: [O] Adding an item to the agenda from the agenda view

2018-03-09 Thread Shérab
Dear Nick,

Nick Dokos (2018/03/09 16:27 -0500):
> IMO, you should bite the bullet and define a capture template: it
> gives you flexibility that you cannot get any other way. Sooner or
> later, you are going to go that way anyway, so why not start now?

Yeah I fully agree. As soon as I'll have the time I'lldo it,taking
inspiration of the responsesreceived here.

I jsut wanted to try the solutions from the "easiest" to the more
elaborated ones.

Cheers!

Shérab.



Re: [O] Adding an item to the agenda from the agenda view

2018-03-09 Thread Nick Dokos
Shérab  writes:

> Dear all,
>
> Many, many thanks for all your responses!
>
> I tried the diary one which seemed like the simplest to set-up. It
> indeed adds an entry, but in a strange way:it adds a level 1 headingfor
> the year, a level 2 heading for the month, a level 3 heading for the day
> and a level 4 heading for the event, that has the actual time-stamp.
>
> I guess it's not very important e.g. if you never read the agenda file
> itself but I may still prefer the capture solution which as I understand
> it requires a bit more customization but also brings greater
> flexibility.
>
> Thanks again for all the solutions you guys provided!
>
> Shérab.
>
>

IMO, you should bite the bullet and define a capture template: it
gives you flexibility that you cannot get any other way. Sooner or
later, you are going to go that way anyway, so why not start now?

-- 
Nick




Re: [O] what settings would make original export to pdf as good as pandoc conversion?

2018-03-09 Thread Samuel Wales
On 3/8/18, Eric S Fraga  wrote:
> On Thursday,  8 Mar 2018 at 12:55, Samuel Wales wrote:
>> On 3/3/18, Eric S Fraga  wrote:
>>> #+latex_header: \setlength{\parindent}{0pt}\setlength{\parskip}{6pt}

>> are there settings in .emacs that will do the same thing?
>
> Yes, you can put such commands in the definition of the org-latex
> class.  Check org-latex-classes.

just feedback on the manual and the docstring, but i found nothing
about an org-latex class.  perhaps i wasn't supposed to?  in my latex
ignorance i think a class is probably like article, etc.  maybe
org-latex is a generic thing that gets put in front of article or
something.

in any case, greek to me.  this was my best guess.

(with-eval-after-load
(add-to-list org-latex-classes
'("org-latex" "\setlength{\parindent}{0pt}\setlength{\parskip}{6pt}")))

this isn't critical enough for me to pursue it further as i can use
html export and then pandoc, but maybe the doc could say what
org-latex class is.

>>> A table of contents will probably only be generated if you have not
>>> turned of heading numbering.

this is interesting.  i wonder why.

>> interesting.  i have 2 tables of contents for the same document.  [1
>> level at front and complete at end.]  i have num:t in properties
>> drawer.
>>
>> in html, both export.  in pdf, only the first exports.
>
> Cannot help here.  Sorry.

ok.  :].  thanks.



Re: [O] Adding an item to the agenda from the agenda view

2018-03-09 Thread Shérab
Dear all,

Many, many thanks for all your responses!

I tried the diary one which seemed like the simplest to set-up. It
indeed adds an entry, but in a strange way:it adds a level 1 headingfor
the year, a level 2 heading for the month, a level 3 heading for the day
and a level 4 heading for the event, that has the actual time-stamp.

I guess it's not very important e.g. if you never read the agenda file
itself but I may still prefer the capture solution which as I understand
it requires a bit more customization but also brings greater
flexibility.

Thanks again for all the solutions you guys provided!

Shérab.



Re: [O] how do you compose mails in Gnus with org-mode

2018-03-09 Thread Uwe Brauer

   > Uwe Brauer  writes:

   > When I do M-# # writing this mail I see:
   > ,
   > | [ *unsent followup to Uwe Brauer on gmane.emacs.orgmode* ] Exit with M-#
   > | (Meta-Key and #)
   > | * --text follows this line--
   > | Uwe Brauer  writes: ...[]
   > `

I almost see the same but indented since I user supercite. I will
deactivate it for the moment being, but I doubt this is the problem
since your function also should work for a new mail buffer not just a
reply one, am I right? So supercite should be irrelevant there.

I tried to do what I always do in such cases (at least if memory serves
me right). I put all outorg startup code in a file
start emacs -q and then load that file.

However when I do that, emacs tells me he does not find outshine and
outorg, although they are in $HOME/.emacs.d/elpa


So does emacs -q not ready anymore those files installed via the package
system. I am confused.

My outorg_init file is

,
| 
| (defvar outline-minor-mode-prefix "\M-#")
| 
| (require 'outline)
| (require 'outshine)
| 
| (add-hook 'outline-minor-mode-hook 'outshine-hook-function)
| (add-hook 'message-mode-hook 'outline-minor-mode)
| 
| (require 'outorg)
|  
| (when (require 'outline)
|  (add-hook 'emacs-lisp-mode-hook 'outline-minor-mode)
|  (add-hook 'message-mode-hook 'outline-minor-mode))
|  
|  ;; outorg-export
|  (require 'outorg-export)
|  (require 'navi-mode)
|  ;; outshine
| 
| 
|  
|  (setq outshine-use-speed-commands t)
|  
|  ;; navi-mode
| (add-hook 'outline-minor-mode-hook 'outshine-hook-function)
| 
| (provide 'outorg_init)
`


   > I suggest edebug then, as written, this must run successfully:

   > ,[ C-h f outorg-prepare-message-mode-buffer-for-editing RET ]
   > | outorg-prepare-message-mode-buffer-for-editing is a Lisp function in
   > | ‘outorg.el’.
   > | 
   > | (outorg-prepare-message-mode-buffer-for-editing)
   > | 
   > | Prepare an unsent-mail in a message-mode buffer for outorg.
   > | 
   > | This function assumes that ’--text follows this line--’ (or
   > | whatever is found inside variable ‘mail-header-separator’) is the
   > | first line below the message header, is always present, and never
   > | modified by the user. It turns this line into an ‘outshine’
   > | headline and out-comments all text below this line - if any.
   > `


   > Only available via github I think 




Re: [O] bibliographystyle in scimax

2018-03-09 Thread Joseph Vidal-Rosset
Leven.   09mars2018   à08:16:22,   SimonyiAndrás
 a envoyé ce message:
> Dear Joseph,
>
> I'm not familiar with scimax, but if it uses org-ref to handle
> citations then you might give a try to citeproc-orgref
> (https://github.com/andras-simonyi/citeproc-orgref) which is able to
> format BibTeX citations in html exports according to any CSL style
> (Chicago author-date is the default).
>
> best wishes,
>
> András

Dear Andras,

Many thanks  for this  help. I  just succeeded  this morning  to install
citeproc   and   citeproc-orgref   (Iignored   the   Emacs   command
/package-install-file/, thanks to  you, I know it now!).  Of course, I'm
using org-ref that is the best  program that I know to manage references
(again, many thanks to John Kitchin for this amazing tool).

I am going to test citeprog-ref soon and I will inform you.

We stay in touch,

Best wishes,

Jo