Skip to content

Instantly share code, notes, and snippets.

@jfbu
jfbu / twoetocs.tex
Created October 29, 2019 20:38
usage of etoc package to handle multiple TOCs, for example one short and one detailed mutually referencing one another
% we use etoc concept of depthtags
% here, it could be simplified but I added some complete
% mark-up in case the location of the TOCs are moved.
% of course, this can be extended easily to >2 TOCs
% with complex rules of listing or not one another
% jfbu Mardi 29 octobre 2019 à 21:38:25
\documentclass{memoir}
\pagestyle{plain}
@jfbu
jfbu / sphinxhighlight.sty
Created January 21, 2019 15:07
typical sphinxhighlight.sty
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{sphinxhighlight}[2016/05/29 stylesheet for highlighting with pygments]
\makeatletter
\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax%
\let\PYG@ul=\relax \let\PYG@tc=\relax%
\let\PYG@bc=\relax \let\PYG@ff=\relax}
\def\PYG@tok#1{\csname PYG@tok@#1\endcsname}
\def\PYG@toks#1+{\ifx\relax#1\empty\else%
@jfbu
jfbu / parskip.sty
Created January 16, 2019 23:06
parskip.sty v2.0a
%%
%% This is file `parskip.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% parskip.dtx (with options: `package')
%%
%% This is a generated file.
%%
@jfbu
jfbu / foremacs2.el
Created January 1, 2019 13:01
some emacs customization (rst mode)
(defun jfbu/rst-mode-hook ()
(electric-indent-mode 0) ; Arrrggh! 6 janvier 2015 pour ReST
(define-key rst-mode-map (kbd "TAB") 'indent-for-tab-command)
(setq tab-width 3); à tester à l'usage.
(setq indent-tabs-mode nil) ; 9 janvier, afin de ne jamais avoir
; d'insertion de TABs par auto-fill. OK ÇA MARCHE. et je n'ai pas l'impression
; que ça pertube indent-for-tab-command
)
(add-hook 'rst-mode-hook #'jfbu/rst-mode-hook t)
@jfbu
jfbu / foremacs.el
Created January 1, 2019 11:57
extract of a configuration file for emacs
(defun jfbu/emacs-lisp-mode-hook ()
(electric-indent-mode 0) ; Arrrggh! 29 novembre 2014
(setq comment-add 0) ; un seul!
(define-key emacs-lisp-mode-map "\C-c;" 'comment-region);
(define-key emacs-lisp-mode-map "\C-c:" 'uncomment-region);
; (define-key emacs-lisp-mode-map "\C-c%" 'comment-region);
(define-key emacs-lisp-mode-map "\C-cu" 'uncomment-region);
)
(add-hook 'emacs-lisp-mode-hook #'jfbu/emacs-lisp-mode-hook t)
\documentclass{article}
\usepackage{showframe} %% <- show boundary of text area
\usepackage{tikz} %% <- To draw the red brackets
\usepackage{tikzpagenodes} %% <- to place them correctly
% variant from the \insertvbox of https://tex.stackexchange.com/a/463739/4686
\newcommand*\unvtop[1]{% #1 is a \vtop !
\par
\begingroup
@jfbu
jfbu / CheckWhetherBlank.tex
Created September 12, 2018 10:19
CheckWhetherBlank.tex
% Time-stamp: <12-09-2018 12:18:27 CEST>
% cf https://tex.stackexchange.com/a/449979/4686
% Rules of the game:
% ------------------
% 1. \CheckFoo{A}{B}{C} expands in two steps to either B or C
% depending on whether A (not expanded in any way) verifies Foo
@jfbu
jfbu / CheckWhetherOnlySpaces.tex
Created September 11, 2018 09:02
CheckWhetherOnlySpaces.tex
% Time-stamp: <11-09-2018 10:59:40 CEST>
% cf https://tex.stackexchange.com/a/449979/4686
\catcode`@ 11
\long\def\@gobble#1{}
\long\def\@gobbletwo#1#2{}
\long\def\JFB@stop@firstoftwo#1#2{\z@#1}
@jfbu
jfbu / CheckWhetherLeadingSpace.tex
Last active September 10, 2018 15:03
CheckWhetherLeadingSpace.tex
% Time-stamp: <10-09-2018 à 17:03:05>
% cf https://tex.stackexchange.com/a/449979/4686
\catcode`@ 11
\long\def\@gobble#1{}
\long\def\@gobbletwo#1#2{}
%\long\def\JFB@stop@firstoftwo#1#2{\z@#1}
@jfbu
jfbu / CheckWhetherNull.tex
Created September 9, 2018 13:47
CheckWhetherNull.tex
% Time-stamp: <09-09-2018 15:45:05 CEST>
% cf https://tex.stackexchange.com/questions/449869/trying-to-get-zapspace-and-lowercase-to-work-on-string-comparison/449979
\catcode`@ 11
\long\def\@gobble#1{}
%\long\def\JFB@stop@firstoftwo#1#2{\z@#1}
\long\def\JFB@stop@secondoftwo#1#2{\z@#2}