{"action":"created","issue":{"url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/2231","labels_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/2231/labels{/name}","comments_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/2231/comments","events_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/2231/events","html_url":"https://github.com/sphinx-doc/sphinx/issues/2231","id":125972330,"number":2231,"title":"Invoke latex rules in the files","user":{"login":"ghtmtt","id":2884884,"avatar_url":"https://avatars.githubusercontent.com/u/2884884?v=3","gravatar_id":"","url":"https://api.github.com/users/ghtmtt","html_url":"https://github.com/ghtmtt","followers_url":"https://api.github.com/users/ghtmtt/followers","following_url":"https://api.github.com/users/ghtmtt/following{/other_user}","gists_url":"https://api.github.com/users/ghtmtt/gists{/gist_id}","starred_url":"https://api.github.com/users/ghtmtt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghtmtt/subscriptions","organizations_url":"https://api.github.com/users/ghtmtt/orgs","repos_url":"https://api.github.com/users/ghtmtt/repos","events_url":"https://api.github.com/users/ghtmtt/events{/privacy}","received_events_url":"https://api.github.com/users/ghtmtt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sphinx-doc/sphinx/labels/latex","name":"latex","color":"FFFFFF"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-11T15:45:43Z","updated_at":"2016-01-13T06:55:06Z","closed_at":null,"body":"I hope github's issues is the right place where to add this problem.\r\n\r\nI did not figure out how to call latex *customizations*  in the ``rst`` files.\r\nThe steps are:\r\n\r\n* create a style.tex file and place it in the same folder of ``conf.py``. Example of ``style.tex``:\r\n```\r\n% My personal \"bold\" command\r\n\\newcommand{\\mybold}{\\textbf} \r\n```\r\n\r\n* edit ``conf.py`` and include the new ``style.tex``:\r\n```\r\nf = open('style.tex', 'r+');\r\nPREAMBLE = f.read();\r\nlatex_elements = {\r\n# Additional stuff for the LaTeX preamble.\r\n'preamble': PREAMBLE,\r\n}\r\n```\r\n* try to call **mybold** command in the various ``.rst`` files:\r\n```\r\n:mybold:`my text` #doesn't work\r\n\r\n.. role: mybold\r\n:mybold:`my text` #doesn't work\r\n\r\n```\r\n\r\nI don't know if this is an expected behavior or not."},"comment":{"url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/comments/171195493","html_url":"https://github.com/sphinx-doc/sphinx/issues/2231#issuecomment-171195493","issue_url":"https://api.github.com/repos/sphinx-doc/sphinx/issues/2231","id":171195493,"user":{"login":"ghtmtt","id":2884884,"avatar_url":"https://avatars.githubusercontent.com/u/2884884?v=3","gravatar_id":"","url":"https://api.github.com/users/ghtmtt","html_url":"https://github.com/ghtmtt","followers_url":"https://api.github.com/users/ghtmtt/followers","following_url":"https://api.github.com/users/ghtmtt/following{/other_user}","gists_url":"https://api.github.com/users/ghtmtt/gists{/gist_id}","starred_url":"https://api.github.com/users/ghtmtt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghtmtt/subscriptions","organizations_url":"https://api.github.com/users/ghtmtt/orgs","repos_url":"https://api.github.com/users/ghtmtt/repos","events_url":"https://api.github.com/users/ghtmtt/events{/privacy}","received_events_url":"https://api.github.com/users/ghtmtt/received_events","type":"User","site_admin":false},"created_at":"2016-01-13T06:55:06Z","updated_at":"2016-01-13T06:55:06Z","body":"Hi, thanks for the answer. \r\nI added your suggestions to the code but I get an error during the compilation\r\n```\r\n! Latex error: missing \\begin{document}\r\n```"}}