{"action":"created","issue":{"url":"https://api.github.com/repos/asciidoctor/asciidoctor-latex/issues/44","repository_url":"https://api.github.com/repos/asciidoctor/asciidoctor-latex","labels_url":"https://api.github.com/repos/asciidoctor/asciidoctor-latex/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/asciidoctor/asciidoctor-latex/issues/44/comments","events_url":"https://api.github.com/repos/asciidoctor/asciidoctor-latex/issues/44/events","html_url":"https://github.com/asciidoctor/asciidoctor-latex/issues/44","id":162506383,"number":44,"title":"`macros.tex` ignored when using HTML backend","user":{"login":"gpyh","id":6893840,"avatar_url":"https://avatars.githubusercontent.com/u/6893840?v=3","gravatar_id":"","url":"https://api.github.com/users/gpyh","html_url":"https://github.com/gpyh","followers_url":"https://api.github.com/users/gpyh/followers","following_url":"https://api.github.com/users/gpyh/following{/other_user}","gists_url":"https://api.github.com/users/gpyh/gists{/gist_id}","starred_url":"https://api.github.com/users/gpyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpyh/subscriptions","organizations_url":"https://api.github.com/users/gpyh/orgs","repos_url":"https://api.github.com/users/gpyh/repos","events_url":"https://api.github.com/users/gpyh/events{/privacy}","received_events_url":"https://api.github.com/users/gpyh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-06-27T17:35:34Z","updated_at":"2016-06-28T03:53:23Z","closed_at":"2016-06-27T19:44:53Z","body":"The README states:\r\n\r\n> The contents of a file named `macros.tex` will be read and used by `asciidoctor-latex` if it is in the same directory as the file being rendered.  This is the case regardless of the output format -- HTML or tex.\r\n\r\nHowever, it is not the case for the HTML format.\r\n\r\nTested with the versions 1.5.0.11.dev and 1.5.0.8.dev.\r\n\r\n# Steps to reproduce\r\n\r\n## Setup\r\n\r\nCreate a `test.adoc` file:\r\n\r\n```\r\n= Basic document\r\n\r\nThis is just to show that `macros.tex` isn't being used for the HTML output.\r\n```\r\n\r\nIn the same directory, create a `macros.tex` file:\r\n\r\n```\r\n\\dummymacro\r\n```\r\n\r\n## Latex backend: no problem\r\n\r\nDo:\r\n\r\n```\r\nasciidoctor-latex test.adoc\r\n```\r\n\r\nThe command `\\dummymacro` shows up in the preamble of `test.tex`, under the line `%User defined macros`.\r\n\r\n## Html backed: no macro\r\n\r\nDo:\r\n\r\n```\r\nasciidoctor-latex -b html test.adoc\r\n```\r\n\r\nThe string `dummymacro` in `test.html` is nowhere to be found.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/asciidoctor/asciidoctor-latex/issues/comments/228941509","html_url":"https://github.com/asciidoctor/asciidoctor-latex/issues/44#issuecomment-228941509","issue_url":"https://api.github.com/repos/asciidoctor/asciidoctor-latex/issues/44","id":228941509,"user":{"login":"gpyh","id":6893840,"avatar_url":"https://avatars.githubusercontent.com/u/6893840?v=3","gravatar_id":"","url":"https://api.github.com/users/gpyh","html_url":"https://github.com/gpyh","followers_url":"https://api.github.com/users/gpyh/followers","following_url":"https://api.github.com/users/gpyh/following{/other_user}","gists_url":"https://api.github.com/users/gpyh/gists{/gist_id}","starred_url":"https://api.github.com/users/gpyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpyh/subscriptions","organizations_url":"https://api.github.com/users/gpyh/orgs","repos_url":"https://api.github.com/users/gpyh/repos","events_url":"https://api.github.com/users/gpyh/events{/privacy}","received_events_url":"https://api.github.com/users/gpyh/received_events","type":"User","site_admin":false},"created_at":"2016-06-28T03:53:23Z","updated_at":"2016-06-28T03:53:23Z","body":"Final words: By inspecting the commit 0b7cd88, I concluded that I missed the actually bug because of the omission of the undocumented `include_macros` attribute.\r\nBy using it, it would have indeed added the `div` to the HTML backend, and only the HTML backend.\r\n\r\nTwo problems would be remaining:\r\n\r\n. Macros would be included in the `tex` file regardless of the `include_macros` attribute\r\n. The innocent error message above would be printed when using the HTML backend\r\n\r\nThis is of course what would have happened if I used `include_macros` with a version prior to the 0b7cd88 commit.\r\n\r\nIn light of this, I think the final fix would be to directly inject the `div` into the HTML tree in place of the `MacroInsert` processor. I don't know if or how this is feasible though. I'll be happy to hack a solution if I ever find time to dig into it.\r\n"}}
{"actor":{"display_login":"gpyh"}}