Skip to content

Instantly share code, notes, and snippets.

@ezgranet
Last active August 31, 2020 20:40
Show Gist options
  • Select an option

  • Save ezgranet/184765126d0693bada5c40e11cdaff74 to your computer and use it in GitHub Desktop.

Select an option

Save ezgranet/184765126d0693bada5c40e11cdaff74 to your computer and use it in GitHub Desktop.
Pseudonyms with LaTeX, including automatic warning messages
%%%%%%%
%% ALL CREATED BY ME IS LICENSED CC0 (IE PUBLIC DOMAIN)
%%%% THIS IS A MODIFIED VERSION OF THE CODE OF
%%% TEX STACKEXCHANGE USER @musarithmia's answer to this question
%%%%https://tex.stackexchange.com/questions/267724/effective-way-to-anonymise-interviewee-identities-for-academic-research/267741#267741
\documentclass[12pt,a4paper]{article}
\usepackage[margin=2.55cm]{geometry}
\usepackage{xcolor}
\usepackage{psvectorian}
\definecolor{brickred}{rgb}{0.8, 0.25, 0.33}
\title{Pseudonyms Using \LaTeX}
%%%%%%%%%%%%%%%%%%%%%
\newif\ifpseud
\pseudtrue
%%%%%
\newcommand{\newperson}[5]{
%1) MACRO NAME %%%%
%%% ^ PRODUCES SHORT NAME
%FOR FULL NAME TYPE
% $MACRONAMEfull --ie if macro is elijah,
%one produces the short name by
%%% typing \elijah and the full name by
%%%% typing \elijahfull
%2) REAL FULL NAME
%3) PSEUD FULL NAME
%4) REAL SHORT NAME
%5) PSEUD SHORT NAME
\expandafter\newcommand\csname #1full\endcsname{\ifpseud #2
\else #3 \fi}
\expandafter\newcommand\csname #1\endcsname{\ifpseud #4 \else #5 \fi}}
%\usepackage{etoolbox}
%\newcommand\createlist{%
%\let\do\newperson
%\docsvlist
%}
\newperson{father}{Robert Arthur Johnson}{[The Father]}{Mr Johnson}{[The Father]}
\newperson{mother}{Jane Catherine Martins}{[The Mother]}{Ms Martins}{[The Mother]}
\newcommand{\textwarn}{This document is \textbf{\underline{NOT}} redacted. It contains private and confidential personal data, and may \textbf{\underline{NOT}} be distributed, published, or shown to those without the right to view such information. The publication o f the information in this document may constitute a contempt of court, punishable by a term of imprisonment.
}
\newcommand{\textsafe}{This document has been altered to remove sensitive personal data. It is cleared for publication
}
\usepackage{graphicx}
\newcommand{\warnword}{WARNING}
\newcommand{\confwarning}{%
\ifpseud \begin{center}
\hrule width \hsize height .7pt\vskip2pt\hrule width \hsize height .7pt \vskip12pt%
\Large\stncl\warnword\quad\warnword\quad\warnword}\\\normalsize\normalfont\smallskip \textwarn\\\smallskip {\color{red}%
\Large\stncl\warnword\quad\warnword\quad\warnword}
\vskip12pt\hrule width \hsize height .7pt\vskip2pt\hrule width \hsize height .7pt
\end{center}
\else \begin{center}
\hrule width \hsize height .7pt\vskip2pt\hrule width \hsize height .7pt \vskip12pt
\ \normalsize\normalfont \textsafe
\vskip12pt\hrule width \hsize height .7pt\vskip2pt\hrule width \hsize height .7pt
\normalfont
\end{center} \fi
%
}
\AtBeginDocument{\confwarning{\let\newpage\relax\maketitle}}
\pseudtrue
\begin{document}
\maketitle
This is a dispute between \motherfull and \fatherfull about a sensitive matter relating to custody of their child. \mother makes a claim to revoke the court's order awarding joint custody to \father.
\pseudfalse
\confwarning
This is a dispute between \motherfull and \fatherfull about a sensitive matter relating to custody of their child. \mother makes a claim to revoke the court's order awarding joint custody to \father.
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment