Posts

Glossaries-extra without sectioning

Image
0 I'm creating a document with two glossaries (using glossaries-extra and bib2gls). I would like to print each glossary without any automatic sectioning (without creating a new chapter or section), so that I can manually add and manipulate the sectioning i.e using chapter{...} . A MWE is below: NeedsTeXFormat{LaTeX2e} documentclass[11pt]{book} usepackage[utf8]{inputenc} usepackage{CJKutf8} usepackage{graphicx,color} usepackage[record,style=mcoltree,stylemods=mcols,nomain]{glossaries-extra} usepackage[T1]{fontenc} usepackage{lipsum} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Glossaries code % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% newglossary*{japanese}{Japanese to English} newglossary*{english}{English to Japanese} glsnoexpandfields GlsXtrLoadResources[ src={defs-nointerpret}, % bib file ...

Adding two tokens together (integers). Flex/Bison

Image
0 I have a simple Bison file with some simple grammar. I am taking an unending list of expressions, and my goal is to make a single definition for the expression that adds the values of two tokens together. At line 20, there is a grammar rule that shows what I am trying to achieve. Unfortunately, it does not work. How can I achieve this functionality? Bison File %{ #include <stdio.h> #include <stdlib.h> int yylex(); void yyerror(const char* msg); %} %token INT %token PLUS %token END %% expr_list: END { exit(0); } | expr | expr expr_list ; expr: INT PLUS INT { printf("%dn", ($1 + $3)); } ; %% int main(int argc, char** argv) { yyparse(); return 0; } void yyerror(const char* msg) { fprintf(stderr, ...