Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add [nosep] option to the list command and ability to include a table of contents in the news class. #15

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions classes/custom_classes/news.cls
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,42 @@
}{
\end{multicols}
}

% CONTENTS: --------------------------------------------------------------------
\newrobustcmd{\tocdepth}[1]{%
\IfStrEq{#1}{h}{\setcounter{tocdepth}{1}}
{\IfStrEq{#1}{hh}{\setcounter{tocdepth}{2}}
{\IfStrEq{#1}{hhh}{\setcounter{tocdepth}{3}}}%
{\IfStrEq{#1}{hhhh}{\setcounter{tocdepth}{4}}{\setcounter{tocdepth}{2}}}}%
}

\renewcommand{\usecompacttoc}{
\titlecontents{section}[0em]{}{%
\small\bfseries\thecontentslabel.\hspace*{0.5em}}{\bfseries}{%
\titlerule*[0.5pc]{.}\contentspage%
}
\titlecontents{subsection}[0em]{%
\small\hspace*{0.8em}}{\thecontentslabel.\hspace*{0.5em}}{}{%
\titlerule*[0.5pc]{.}\contentspage%
}
\titlecontents{subsubsection}[0em]{%
\small\hspace*{1.6em}}{\thecontentslabel.\hspace*{0.5em}}{}{%
\titlerule*[0.5pc]{.}\contentspage%
}
\titlecontents{paragraph}[0em]{%
\small\hspace*{2.4em}}{\thecontentslabel.\hspace*{0.5em}}{}{%
\titlerule*[0.5pc]{.}\contentspage%
}
}

\@ifundefined{chapter}{}{
\makeatletter%
\renewcommand\tableofcontents{%
\usecompacttoc
\section*{\contentsname}%
\@starttoc{toc}%
\protect\thispagestyle{front}%
}
\makeatother%
}

Binary file modified classes/custom_classes/news_example.pdf
Binary file not shown.
6 changes: 6 additions & 0 deletions classes/custom_classes/news_example.tex
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@

\begin{document}

% Include a table of contents. Adjust the depth of the headings included in the table of contents
% with the \tocdepth{<option>} command, where <option> is the heading level to include in the contents.
% For example, \tocdepth{hhh} sets the table of contents to include all headings down to the \hhh level.
% The default is \tocdepth{hh}.
\toc

\h{Have You Heard The Latest Good News?}
\by{Name Lastname}{[email protected]}{example-image-a}

Expand Down
6 changes: 3 additions & 3 deletions lix.sty
Original file line number Diff line number Diff line change
Expand Up @@ -555,13 +555,13 @@
\setlist[numbers,1]{leftmargin=8mm}
\setlist[numbers]{leftmargin=*,label*=\arabic*.,labelindent=0mm}

\NewDocumentCommand{\items}{s+m}{%
\NewDocumentCommand{\items}{s+mO{}}{%
\IfBooleanTF{#1}{%
\begin{bullets}%
\begin{bullets}[#3]%
#2
\end{bullets}%
}{%
\begin{numbers}%
\begin{numbers}[#3]%
#2
\end{numbers}%
}
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,9 @@ Add lists to your document. It is possible to nest lists.
\item Something else
\item The final thing.
}
}
}[nosep]
```
`items{...}` will be numbered, and `items*{...}` will be bullet points.
`items{...}` will be numbered, and `items*{...}` will be bullet points. The optional `[nosep]` option will remove the line spacing between the items.

</details>

Expand Down