You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey there! This isn't so much a request, as an example. Last night I came up with a tcolorbox solution to replace the kaobox that I thought was worth sharing. I've barely used GitHub, so hopefully this is the right way to do this. 😅
Big disclaimer: I've only been using latex for about a week, so I might've overlooked some glaring issue. I've been putting together a business plan for the past few months, and I got fed up with MS Word's inconsistencies, so I converted it to latex.
Details
With the example below, you should be able to create a new box style in one line of code:
If you're interested, later on I can show you the other modifications I'm making to the class, but it's definitely not in a 'typical' latex style anymore. To figure out how it all works, and make it easier for me to modify, I pulled the code apart and reorganised it into packages which are progressively loaded by the class in order by:
style-level (brand colours, fonts, i18n, etc.)
page-level
environment-level
book-level
Example Code
Minimal Example
% Example of tcolorbox boxes\documentclass[10pt]{article}
\RequirePackage[usenames,dvipsnames,table]{xcolor}
\RequirePackage[fixed]{fontawesome5}
\RequirePackage{tcolorbox}
\tcbuselibrary{most}
% Brand Colours\definecolor{primary}{HTML}{124889} % primary blue\definecolor{secp}{HTML}{8E0883} % secondary purple\definecolor{secy}{HTML}{D1CE0C} % secondary yellow\definecolor{tertg}{HTML}{317658} % tertiary green\definecolor{terto}{HTML}{EB8A16} % tertiary orange% General box settings:\tcbset{%
enhanced,
before skip balanced=2mm,
after skip balanced=3mm,
boxrule=0.4pt,
sharp corners,
left=10mm, right=2mm, % control text position
top=1mm, bottom=1mm,
drop small lifted shadow=black,
fonttitle=\bfseries
}
% Command to create new boxes:\newcommand{\tcbcreate}[4]{
\newtcolorbox{#1}[1][]{
colback=#3!10!white,
colframe=#3,
title=#2,
underlay={%\path[fill=#3!80!white,draw=none] (interior.south west) rectangle
node[#3!5!white]{\Large\bfseries#4} ([xshift=8mm]interior.north west);
}
}
}
% Boxes to be used in document:\tcbcreate{boxinfo}{Further Information}{primary}{\faLightbulb[regular]}
\tcbcreate{boxexample}{Practical Example}{tertg}{\faComments[regular]}
\tcbcreate{boxquestion}{Outstanding Question}{terto}{\faExclamationCircle}
\begin{document}
\begin{boxinfo}
hello world
\end{boxinfo}
\begin{boxexample}
hello world
\end{boxexample}
\begin{boxquestion}
hello world
\end{boxquestion}
\end{document}
The text was updated successfully, but these errors were encountered:
Great work, thanks! I am impressed that you could pull apart the code after using LaTeX for only one week :) I think many people would be interested in the other modifications, so definitely feel free to share them!
Summary
Hey there! This isn't so much a request, as an example. Last night I came up with a
tcolorbox
solution to replace thekaobox
that I thought was worth sharing. I've barely used GitHub, so hopefully this is the right way to do this. 😅Big disclaimer: I've only been using latex for about a week, so I might've overlooked some glaring issue. I've been putting together a business plan for the past few months, and I got fed up with MS Word's inconsistencies, so I converted it to latex.
Details
With the example below, you should be able to create a new box style in one line of code:
\tcbcreate{env_name}{box_title}{base_colour}{fontawesome_icon}
Here's an example of what it'll produce:
If you're interested, later on I can show you the other modifications I'm making to the class, but it's definitely not in a 'typical' latex style anymore. To figure out how it all works, and make it easier for me to modify, I pulled the code apart and reorganised it into packages which are progressively loaded by the class in order by:
Example Code
Minimal Example
The text was updated successfully, but these errors were encountered: