Skip to content

Instantly share code, notes, and snippets.

@lpfann
Created May 10, 2020 07:44
Show Gist options
  • Save lpfann/39cf2fba45731e8ac8bfc47dc27bced8 to your computer and use it in GitHub Desktop.
Save lpfann/39cf2fba45731e8ac8bfc47dc27bced8 to your computer and use it in GitHub Desktop.
Encoding Vegetables and Fruits as Code 128 to use them in grocy (with additional BarcodeBuddy mode switches at the end)
\documentclass[9pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{forloop}
\usepackage{pstricks}
\usepackage{pst-barcode}
\usepackage{caption}
\usepackage{multicol}
\usepackage{microtype}
\setlength{\columnsep}{3cm}
\newcommand{\mycode}[1]{
\begin{pspicture}(2,0.5in)
\psbarcode{#1}{includecheck height=0.5 width=1.5}{code128}
\end{pspicture}
}
\newcommand{\product}[1]{
\centering
\begin{figure}
\caption*{#1}
\mycode{#1}
\end{figure}
}
\newcommand{\mode}[2]{
\centering
\begin{figure}
\caption*{\underline{Modus: #2}}
\mycode{#1}
\end{figure}
}
\begin{document}
\begin{twocolumn}
\product{Tomaten}
\product{Bananen}
\product{Apfel}
\product{Gurke}
\product{Paprika}
\product{Zitrone}
\product{Chinakohl}
\product{Zucchini}
\product{Aubergine}
\product{Knoblauch}
\product{Zwiebeln}
\product{Salat}
\product{Avocado}
\product{Spinat}
\product{Karotte}
\product{Sellerie}
\product{Lauchzwiebel}
\product{Ingwer}
\product{Ananas}
\product{Kohl}
\product{Kartoffeln}
\product{Broccoli}
\product{Bohnen}
\product{S-Kartoffel}
\product{Pilze}
\product{Blumenkohl}
\product{Spargel}
\product{Rosenkohl}
\product{Chili}
\clearpage
\mode{Verbrauchen}{BBUDDY-C}
\mode{Öffnen}{BBUDDY-O}
\mode{Auf die Einkaufsliste}{BBUDDY-AS}
\mode{Verschimmelt}{BBUDDY-CS}
\mode{Eingekauft}{BBUDDY-P}
\end{twocolumn}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment