Skip to content

Commit

Permalink
Merge pull request #48 from JanikkinaJ/master
Browse files Browse the repository at this point in the history
added :frame-color and :title-background-color to `box` defblock
  • Loading branch information
alhassy authored Dec 22, 2024
2 parents 18d754d + 80b1415 commit 9f674dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions org-special-block-extras.el
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ it may be prudent to expose more aspects as arguments.
%s
</details>" background-color title-color title contents))))

(org-defblock box (title "" background-color nil shadow nil)
(org-defblock box (title "" background-color nil shadow nil frame-color nil title-background-color nil)
"Enclose text in a box, possibly with a title.
By default, the box's COLOR is green for HTML and red for LaTeX,
Expand Down Expand Up @@ -1089,7 +1089,8 @@ In the future, I will likely expose more arguments."
(apply #'concat
`("\\begin{tcolorbox}[title={" ,title "}"
",colback=" ,(pp-to-string (or background-color 'red!5!white))
",colframe=red!75!black, colbacktitle=yellow!50!red"
",colframe=" ,(pp-to-string (or frame-color 'red!75!black))
",colbacktitle=" ,(pp-to-string (or title-background-color 'yellow!50!red))
",coltitle=red!25!black, fonttitle=\\bfseries,"
"subtitle style={boxrule=0.4pt, colback=yellow!50!red!25!white}]"
,contents
Expand Down
5 changes: 3 additions & 2 deletions org-special-block-extras.org
Original file line number Diff line number Diff line change
Expand Up @@ -3516,7 +3516,7 @@ Requires: src_latex[:exports code]{#+latex_header: \usepackage{tcolorbox}}

#+begin_details Implementation
#+begin_src emacs-lisp
(org-defblock box (title "" background-color nil shadow nil)
(org-defblock box (title "" background-color nil shadow nil frame-color nil title-background-color nil)
"Enclose text in a box, possibly with a title.

By default, the box's COLOR is green for HTML and red for LaTeX,
Expand Down Expand Up @@ -3550,7 +3550,8 @@ In the future, I will likely expose more arguments."
(apply #'concat
`("\\begin{tcolorbox}[title={" ,title "}"
",colback=" ,(pp-to-string (or background-color 'red!5!white))
",colframe=red!75!black, colbacktitle=yellow!50!red"
",colframe=" ,(pp-to-string (or frame-color 'red!75!black))
",colbacktitle=" ,(pp-to-string (or title-background-color 'yellow!50!red))
",coltitle=red!25!black, fonttitle=\\bfseries,"
"subtitle style={boxrule=0.4pt, colback=yellow!50!red!25!white}]"
,contents
Expand Down

0 comments on commit 9f674dd

Please sign in to comment.