Questions tagged [data-structures]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
104 views

How to read a file line by regular expression and extract and evaluate the number contained in the matching line?

Can this be generalized to use some kind of regular expression, not just index, and then extract and evaluate the numbers at the beginning or end of the selected line, using some modifiable arbitrary ...
Krantz's user avatar
  • 159
0 votes
1 answer
55 views

Custom data structure for generating TikZ flowchart

I'm trying to visualize and describe the steps of the process with a TikZ flowchart. I would like to make the solution as scalable as possible, it would be perfect to have some data structure ...
Marcin_Wachowiak's user avatar
1 vote
0 answers
244 views

Collect information to render later

I am not sure I am using the right terms for describing what I want to do, so the title may be off. I want to be able to use a custom command like for example \PersonalData{Name}{Some Name} but not ...
Zelphir Kaltstahl's user avatar
5 votes
2 answers
202 views

How can I store and retrieve data for fixed layouts?

My question today is about a suitable way to store data when I want to create a fixed design. So imagine I have a given layout in a TikZ drawing, where I want to have dynamic text. However the user ...
TobiBS's user avatar
  • 5,170
0 votes
2 answers
296 views

How to create 1D array structure using TikZ?

I'm trying to replicate the attached image. However, I'm not really sure what type of command or environment to use.
R Mustang's user avatar
1 vote
0 answers
52 views

Can it make sense to use LaTeX as common (canonical) data format?

Some folk I know are looking for a common (canonical) format for sharing some structured data between different systems & databases. One sub-group, who publish this data in magazines using LaTeX ...
Laska's user avatar
  • 111
2 votes
1 answer
298 views

Draw an empty Data Structure Array

My question is pretty similar to this one with the main difference that I need to create an empty array that has multiple columns merged together as in the following picture How can I merge the ...
LukeTheWolf's user avatar
6 votes
2 answers
124 views

Cells with text are slighlty raised in TikZ

As you can see from the following figure, only the cells with the text are raised slightly than the empty cells. I want all the cells in the same level. How can I do that? Below is my working code: \...
Adnan Quaium's user avatar
0 votes
2 answers
75 views

How to draw adjacency cells with arrows in TikZ?

I want to draw the following diagram. How can I draw this diagram? I did not find any examples to recreate the above image.
Adnan Quaium's user avatar
5 votes
1 answer
1k views

How to plot data from json

Given a json file in the following format: "name":"list_of_xy_values", "data":[[1,2],[2,4],[3,6],[4,3],[5,0]] I'd like to import data to my document to plot it with tikz/...
Sim Son's user avatar
  • 264
0 votes
1 answer
249 views

Translate TOC data to a Lua data-structure, and create custom table of content style

Given nested loops & data-structures are more elegant in Lua (than in TeX), I think plurality of table of contents style would be easier to write in Lua. For that to work, two things would be ...
codepoet's user avatar
  • 1,306
1 vote
1 answer
47 views

How to reuse the output of an environment

I have created an environment with \NewEnviron that processes some input. For the sake of the discussion, it is something like \NewEnviron{myworkingenvironment}[1] { \BODY % BODY is expected to ...
guest_user's user avatar
0 votes
1 answer
327 views

extract different parts of a document

I'm doing my phd right now and I want to prepare a dummy folder for new research projects. I have one problem where I don't know how to start: For a journal submission I need several slightly ...
Martin's user avatar
  • 101
0 votes
0 answers
50 views

Properly layering/structuring a document

I'm creating a kind of convoluted document. The idea is that I begin with a certain concept, say section 1 Food Food can then be then divided into many categories section 1 subsection 1 Meat ...
Michał Kuczynski's user avatar
1 vote
0 answers
78 views

Is there a LaTeX editor which supports two-way data binding with external data sources?

Context: We produce reports by using scripts to pull data from files and spreadsheets and render them into LaTeX. Problem: Editing the content requires editing the underlying files and re-running the ...
Nicholas Morley's user avatar
1 vote
1 answer
127 views

Plot multi-column file row-wise as one long column with pgfplots

I have a data file of the form date 1 2 3 4 2019-10-28 120 40 55 100 2019-10-29 100 45 30 80 2019-10-30 90 65 100 70 i.e. with four consecutive values per date. ...
Benedikt Bauer's user avatar
1 vote
1 answer
316 views

Modeling a mapping from strings to lists of strings in LaTeX3

I'd like to work on a data structure using expl3. This data structure would be read from and written to the .aux file in the following format (this is my proposal—I'm open to better suggestions, of ...
frougon's user avatar
  • 24k
0 votes
2 answers
228 views

How to draw this picture?

Hello. How can I get a picture like this? It's a part of a bubble sort algorithm. Thanks in advance.
Salvador's user avatar
7 votes
3 answers
3k views

Heatmaps, matrix plots, imagesc and data structure

If one has a matrix, say: 16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1 This is possibly stored in a .dat file as shown above, and possible to have thousands of ...
Thorbjørn E. K. Christensen's user avatar
2 votes
0 answers
816 views

writing a data structure in an algorithm [closed]

I am trying to write up a data structure in my algorithm. \documentclass[]{IEEEtran} \usepackage{algorithm,algpseudocode} \begin{document} \begin{algorithm} \caption{Algorithm1} \begin{algorithmic}[...
eht1994's user avatar
  • 21
3 votes
3 answers
168 views

How to make compact data structure without parsing in Latex

Say I have 100 nodes that I want to draw with slight varations 100 times. I don't want to copy/paste all the code each time, that would be a lot of duplication and a lot of boilerplate. So instead I ...
Lance's user avatar
  • 1,767
1 vote
0 answers
298 views

Subfiles not working when different folder levels exist between main and component parts

I have the following folder structure Project | 00Main | | | | Main.tex | 01Components | | IntroFolder | | | Introduction.tex | | DataChapterFolder | | | Data.tex | | ...
Nertskull's user avatar
  • 167
3 votes
2 answers
539 views

Record-like data structure?

I would need something like this: \setfield{record1}{field1}{alpha} \setfield{record1}{field2}{beta} \setfield{record2}{field1}{gamma} \setfield{record2}{field2}{delta} \assign{record3}{record2} \...
Lasse Kliemann's user avatar
1 vote
1 answer
140 views

Roll my own footnote command for new environment based minipage/tabular/etc

I thought I'd solved the footnotes-in-tables problem with \makesavenoteenv but it interacts badly with the minted package so I thought, since my problem is really "make footnotes work in my box ...
spraff's user avatar
  • 1,471
5 votes
2 answers
3k views

How to generate a 2D array data structure in tikz?

I need to illustrate a 2D array data structure in my document. This is a picture I found on the internet. I want something similar. I also want to show the memory layout in the illustration. ...
progammer's user avatar
  • 433
0 votes
0 answers
36 views

how to make the architecture for the auto-generated doc? [duplicate]

I need to generate LaTeX automatically. The user can consider to paste an element to any place of the document and then the TeX version is generated. Now I considered to describe a document as a ...
user453575457's user avatar
1 vote
1 answer
1k views

Drawing a diagram of a data structure (`std::vector` from C++)

I'm looking for a way to show data structures in my slides (Beamer). My first task is to show something that looks like a C++ vector. Something like this: Note that the final arrow points "one ...
Marshall Clow's user avatar
2 votes
1 answer
249 views

use of \noexpand in tikz/math associative arrays

The following does not work in tikz/math : \documentclass[tikz]{standalone} \usetikzlibrary{math} \begin{document} \tikzmath { let \a = my black string ; let \b = my red string ; let \c{1} = \a{...
marsupilam's user avatar
  • 6,343
0 votes
2 answers
574 views

escape backslashes from tikz/math string variable

Using tikz/math, I'm trying to define a string variable containing LaTeX commands, and thus backslashes. The goal is to be able to concatenate such strings. The following doesn't work : \...
marsupilam's user avatar
  • 6,343
5 votes
3 answers
313 views

How to apply a do function to two lists?

Suppose that two lists of identical length have been defined with e.g., etoolbox. Is it possible to have a function \do taking two parameters that will process both lists simultaneously, taking one ...
Denis Cousineau's user avatar
10 votes
7 answers
4k views

How to read a file line by line and store each line into an array?

As said in the title, I am looking for a way to read a file line by line (done!) and store each line, each string, in an array. I have searched the web and stackexchange for a while but I cannot find ...
hringriin's user avatar
  • 171
1 vote
0 answers
119 views

PgfPlots - Data in one column to be plotted into separate graphs [duplicate]

I have a large amount of measured data, that I would like to plot. Data are organized into three columns where the first column provides a frequency, the second and third column are values measured at ...
nmy2015's user avatar
  • 505
5 votes
1 answer
570 views

Recommended database to handle large amounts of text for LaTeX automation [closed]

I am automating the production of LaTeX files but am noticing that depending on the selected database and scripting language there can be length limitations on the character strings being retrieved. ...
EngBIRD's user avatar
  • 3,975
6 votes
1 answer
285 views

Does expl3 have arrays?

There is \seq_item:Nn to get an arbitrary item from a sequence. As far as I understand, this works by iterating the sequence items, discarding until the requested item is found, which seems not very ...
XZS's user avatar
  • 2,933
1 vote
1 answer
1k views

Visualization of data structures and indexes

How can I make a similar visualization of data structures and indexes? I went through the documentation of TikZ and could not find a way.
zvisofer's user avatar
  • 137
9 votes
3 answers
311 views

Store several values in an array-like way and then access them

I am building a kind of dictionary that consists of two parts: in the first one there are words, and in the second, roots. I would like to automatically keep track of which words are related to which ...
djsp's user avatar
  • 660
4 votes
1 answer
4k views

How to draw adjacency array with TikZ?

I will draw a graph representation as adjacency array, also something like that: How to make it? I didn't found any examples like the picture above.
Max's user avatar
  • 628
4 votes
1 answer
366 views

Action lists sorted by person

I am creating a class for meeting minutes as I have some quite specific demands —minutes.sty doesn't seem to meet all of my requirements. There's some good progress, but I'm completely stuck on ...
Duijf's user avatar
  • 143
5 votes
1 answer
4k views

How to typeset data structures with algorithm2e?

The question How to typeset data structures? gives create answers for how to type set simple data structures with the lstlistings package. In particular, I like the following look (taken from Mico's ...
mort's user avatar
  • 1,661
4 votes
2 answers
578 views

Is it a convenient way to write longer program codes in LaTeX?

Before I only used ifthenelse and for loops, but not complicated data structures. I don't know what is the convenient way to write longer codes. As an example I would like to generate a random ...
user3058699's user avatar
16 votes
2 answers
4k views

How to use booktabs in REVTex4 / REVTex4-1

I wish to type this table in REVTeX; however, the code below does not work for \documentclass{revtex4}. (It does work for the article document class, though.) \documentclass{revtex4} \usepackage{...
wonderich's user avatar
  • 2,367
2 votes
1 answer
2k views

Extending a line in the Table

I wish to have a Table setting like the following graph with an extra line inserted between a and b. Namely, I wish to extend the line separating 1, 4 and 2, 5 to the line separating a and b. The ...
wonderich's user avatar
  • 2,367
4 votes
1 answer
138 views

How do you define a command to select nested groups?

Assuming a pair structure (2-tuple) is defined using groups {{<tokens1>}{<tokens2>}} is it possible to define a command \first#1{...} (and \last#1{...}) taking the surrounding group as ...
FK82's user avatar
  • 683
5 votes
1 answer
455 views

What conventions or packages are appropriate for formatting records, algebraic data types in LaTeX?

LaTeX formatting practice is well-established and well-supported by existing packages for three common cases relevant in computer science: Source code listings Established, conventional mathematical ...
jrk's user avatar
  • 545
5 votes
1 answer
197 views

naive dictionary datastructure using \csname ... \endcsname; problem with nesting

With the following I tried to implement a naive dictionary data structure. All works fine, except when trying to nest two such dictionaries. In the last line in the following code the result is "key2",...
Miek Messerschmidt's user avatar
48 votes
3 answers
2k views

How to implement (low-level) arrays in TeX

Update: I have revised my question based on the comment by Bruno Le Floch and some further research. As some may know, I'm implementing a huge TeX macro package which has to do a lot of internal ...
Stephan Lehmke's user avatar
13 votes
2 answers
726 views

Can I store sequences in sequences with expl3

The documentation for l3seq states LaTeX3 implements a “sequence” data type, which contain an ordered list of entries which may contain any balanced text . but for many programming tasks it ...
Joachim Breitner's user avatar
21 votes
1 answer
565 views

Using \fontdimen as an array to store data

Reading through pi.tex, I discovered the trick of using \fontdimen as an array of dimensions (which is equivalent to storing integers between ±(2^31-1)sp). Namely, \font\x=cmr10 at 1sp % or whatever ...
Bruno Le Floch's user avatar
16 votes
1 answer
10k views

Designing packet structure of a protocol

I'm writing a small manual for our self-developed protocol. To show the packet structure we like to include a table like it's shown on this Wikipedia page: http://en.wikipedia.org/wiki/...
Pitt Wellan's user avatar
7 votes
1 answer
2k views

Typesetting classical data structures in tikz

During this discussion an example image generated with TikZ was given by Christian R. but no code was provided: It would be great to have the code snippet that implements it, because I think it has ...
Marco A.'s user avatar
  • 173