Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [comparison]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
54 views

String equality check [closed]

I want to compare 2 strings and perform different tasks based on their results(using if-else loop) My code is here: \tab• \hyperlink{new}{New Features, Enhancements, and Changes}\linebreak \begin{...
user avatar
  • 23
3 votes
1 answer
52 views

Check if at least one substring in a list can be found in a string

There are several solutions both integrated in TeX and proposed on this side for checking if a substring can be found in a given string (such as IfSubStr, IfStringInList and others). As for example, \...
user avatar
  • 1,657
3 votes
1 answer
35 views

Detection if image path contains string fails

For a project I would like to check if my included image is located in the sub-folder graphs or not. To check that I wrote a small MWE: \documentclass[% reprint, amsfonts, floatfix, amsmath,amssymb, ...
user avatar
  • 1,657
0 votes
1 answer
396 views

Change not equal sign shape Overleaf [closed]

I'm using Overleaf. I want to use ≠ the way it is. A / passign in the middle of =. I checked various links same as their documentation in my document, the / sign starts in the very beginning of = and ...
user avatar
  • 103
1 vote
1 answer
26 views

File name string comparison

Need to show compilation error if "\filename{XYZ-2100011}" and "\include{XYZ-2100011}" input filename mismatch. For example, if \filename{ABC-2100012} and \include{XYZ-2100011} ...
user avatar
  • 809
2 votes
1 answer
79 views

pdfstrcmp problem with newest miktex

I am in need of an string compare function which can be used in various ways. simple compare nested using multicolumn in it as the last line in a tabular, without creating a new line simple compare ...
user avatar
  • 55
0 votes
1 answer
214 views

Literature comparison table in Miktex using TexStudio

How do I remove the horizontal 1st-row border, and secondly, how do I make the horizontal line borders bold? Also, any suggestion on moving the caption on the left and changing it in bold with some ...
user avatar
  • 23
0 votes
2 answers
82 views

How do I compare a specific string to strings from a group using a loop?

I want to compare members of a group of strings to an specific string. Why is this not working ? \documentclass{beamer} \usepackage{tikz} \begin{document} \foreach \n in {x,Enu}{ \begin{frame} \...
user avatar
  • 1
2 votes
2 answers
162 views

TikZ: Dot-comparison table

perhaps I am using the wrong terms in my searchings. Can anybody give me a clue/link/idea how such a dot comparison matrix/grid would be possible? I am not very good in TikZ, so bear with me if my ...
user avatar
0 votes
1 answer
145 views

Compiling speed and output: \includegraphics vs \includepdf - what are the differences?

I made a .tex file and compiled it via pdfLatex in two scenarios: (1200 pages long) \includegraphics*[scale=1]{example.pdf} added some text here and there \newpage (repeating this with example2.pdf, ...
user avatar
2 votes
1 answer
157 views

Am I using etoolbox correctly for string comparison?

I have a little environment to enumerate question statements. Sometimes, I want the label to not be a number but some string instead. In that case, I do not want the counter to be incremented. % ...
user avatar
  • 205
2 votes
0 answers
449 views

Which are the essential differences between LaTeX and ConTeXt? [duplicate]

I know that LaTeX and ConTeXt are extensions of TeX but each is based in a different philosophy. Beyond of its tex engines (ConTeXt works with LuaTeX for example) this question is focused to ...
user avatar
  • 8,478
2 votes
2 answers
173 views

How to typeset a two column parallel poem?

I got this double column poem written by some friends that is meant to be typeset with the stanzas in parallel. Here is a sample: Tiempos en pausa. ...
user avatar
  • 151
1 vote
2 answers
71 views

how to do a horizontal line with "=" between it?

i can not find how to connect 2 variables with a horizontal line with a "=" inbetween.
user avatar
  • 11
2 votes
1 answer
441 views

LaTeX Tikz: Compare two \def arguments

I am writing a macro definition that draws dimensions in the style of technical drawing. I need to perform an inequality of two of the arguments to know which is coordinate is higher up, but the ...
user avatar
2 votes
1 answer
107 views

Why is comparison between number and numeric argument not working in \ifnum and \ifdim conditionals?

I was modifying \@ssect command to edit \section* appearance. First I passed a further argument to \@ssect \def\@ssect#1#2#3#4#5#6{%... then I edited the dependencies in \@startsection by modifying \...
user avatar
  • 1,237
63 votes
4 answers
8k views

When is TeX better than LaTeX? [duplicate]

Is there any situation where it is preferable to use TeX (or perhaps plain TeX) rather than LaTeX to write a document?
user avatar
  • 1,492
2 votes
1 answer
361 views

Expandable case insensitive switch case for string comparison

I have spent the last few hours trying to come up with a good solution for my problem, but alas all solutions falls short. I want to create a switchcase for a function (In reality I need many ...
user avatar
6 votes
2 answers
557 views

Checking if an integer is a member of an integer list

Is there any way to check whether an integer is a member of a list of integer numbers and return a boolean? I found this neat solution, here that does a great job. It checks whether a string exists ...
user avatar
  • 5,180
35 votes
3 answers
4k views

Decide between Polyglossia and Babel for LuaLaTeX in 2019

Which are the key questions one has to ask to decide between Polyglossia and Babel for a LuaLaTeX project in 2019? There has been a similar, more general question in 2012, but the packages have ...
user avatar
  • 8,029
4 votes
2 answers
505 views

Looking for characters within a string

I'm looking for a solution that checks if "alien characters" are contained in a string. I found Check if a string contains a given character, which looks for one character only. However, I can't ...
user avatar
5 votes
1 answer
281 views

Comparison line chart

I want to produce a comparison graph chart like this: I have found information about bar graphs, but not about line comparison graphs as I am trying to do. Any help?. Thanks.
user avatar
  • 353
3 votes
2 answers
158 views

Add tocline depending on string compare

!! Attention !! Because this topic developed some amount of complexity, I tried to restructure the topic considering the newly gathered information. Please see this post to find the latest detail: ...
user avatar
1 vote
0 answers
31 views

Consecutive Comparisons

When I try to do compound comparisons the use of the braces don't seem to work correctly, as tried below? \documentclass [letterpaper, 12pt]{article} \usepackage{etoolbox} \begin {document} \def\...
user avatar
4 votes
1 answer
195 views

comparing substrings

I would like to get the following code running, but the second test fails with ! Argument of \@secondoftwo has an extra }. What do I miss? \documentclass{article} \usepackage{xstring,ifthen} \...
user avatar
  • 41
2 votes
2 answers
140 views

How to compare first letter of a word with other char both defined in macros (case-insensitively)?

The following MWE shows that how I get the first letter of a word and compare it with other character both defined in macros. In my case I need to perform it case-insensitively so I used \uppercase ...
user avatar
  • 2,302
5 votes
3 answers
611 views

Why can't I compare a string read from a file with a predefined one?

I want to read a line of file and compare it to a predefined macro with the aid of \ifx. The following MWE shows my problem, I was expected to get Equal, but I get Not Equal. \documentclass{article} ...
user avatar
  • 2,302
17 votes
6 answers
908 views

check that two tex sources generate the same pdf

I have a problem which is in my opinion quite reasonable and common, still I cannot find an answer anywhere. I have two .tex files and I just want to check whether pdflatex will produce exactly the ...
user avatar
  • 285
1 vote
0 answers
246 views

How to add a little space between comparators and a number using siunitx?

I'm using siunitx package for the numbers and units. When I use a comparator, like \sim, the symbol is placed without any space. I'd like to set siunitx to add a little space like in inline math mode, ...
user avatar
12 votes
2 answers
11k views

What is the difference between ~ (tilde) and \, (backslash comma) for a nonbreaking space? [duplicate]

Regarding tiny nonbreaking spaces, is there a difference between using a ~ (tilde) and using \, (backslash comma)? If so, what is the difference, in terms of length, properties, situations where you ...
user avatar
0 votes
1 answer
91 views

Color in header based on section name

I'm trying to swich color in the header based on what will be typeset in the header (\rightmark or \lastrightmark), but I just can't get it work, the comparison fails everytime. I tried it first with \...
user avatar
45 votes
2 answers
11k views

minted vs. listings: pros and cons

While I'm switching from minted to listings, I would like to ask you for this comparison. The following is what it comes to my mind till now: minted needs Pygments to work, listings does not (this ...
user avatar
  • 53.9k
1 vote
0 answers
90 views

pgfkey as integer for ifnum

I'm sure this has something to do with expansion, and I am quite new to using the pgfkeys package so I'm possibly missing some sort of basic practice, but I cannot find anything that remotely looks ...
user avatar
  • 81
1 vote
1 answer
651 views

Compare two macros as strings in LaTeX (e-TeX)

How do I compare two macros that are one-expansion away from being strings? \def\A{ICT} \newgetenv[\ICT]{\A} % `\newgetenv` from https://tex.stackexchange.com/a/184924 Now I want to check if ...
user avatar
  • 3,821
13 votes
0 answers
310 views

Environment for comparing algorithms [closed]

I am aware of different environments to type algorithms in pseudocode (see f.i. algorithm, algorithmic, algorithmicx, algorithm2e, algpseudocode = confused) Is there any environment that would ...
user avatar
  • 398
1 vote
1 answer
386 views

Correct way to compare macro definitions that contain protected macros, e.g., bibnamedelima

I'm trying to compare the content of \partnamefamily of an author's name in biblatex against a manual definition that is stored in another macro, lets call it \family, using \ifdefequal. So, I have ...
user avatar
  • 10.7k
6 votes
2 answers
712 views

How can I check if the value of a variable is the same as what another variable?

My question is simple but I don't know any simple solution for it. I have an unknown variable namely \unknown and a variable which I want to compare \unknown with it, namely \test. I want a command ...
user avatar
3 votes
1 answer
94 views

Class: Definition of an empty variable: etoolbox: problems of comparison

I'm writing my first class and I'm a bit in trouble with a behaviour of etoolbox macros that I don't understand at all. I tried to read response on the forum but I didn't get a clue. I would like to, ...
user avatar
4 votes
2 answers
83 views

Detect first character in list with macros

I have a comma separated list that I process with \foreach. This has been working for quite some time. Decided to make a minor tweak and that is to allow for an optional leading * in which case I want ...
user avatar
2 votes
2 answers
342 views

Conditional test inside command parameter

I want to call \includegraphics with parameter width= #1\textwidth if the number i have provided thru \mycmd is >= 1 and scale= #1 otherwise. I already saw this: Can I conditionally scale an image ...
user avatar
  • 1,650
4 votes
0 answers
3k views

MikTeX - 64bit vs. 32bit

i have a question concerning the difference between the 64bit and 32bit. Years ago everybody said “use the 32bit, the 64bit is still experimental”, but what changed so far? My “last” update is that ...
user avatar
  • 41
13 votes
4 answers
613 views

How to implement \ifxcase: case equivalent of \ifx

I am looking for a case equivalent of \ifx. So, when I have nested uses of \ifx it would be cleaner to specify it in some sort of syntax similar to: \newcommand*{\ColorSymbol}[1]{% \ifxcase#1{% ...
user avatar
3 votes
1 answer
256 views

How to test if two macros have identical definition

I want to test if two macro have identical definition. My naive attempt to use \detokenize does not seem to work in this simple case. However, I have used a similar approach before and it seems to ...
user avatar
2 votes
1 answer
478 views

Which symbol to use is it is unknown if one side is greater then another? [closed]

How do I write if I have two expressions which I am modifying (? not sure if correct word, not native English speaker) in order to find which is greater. So I write something like this: a \??? b a \??...
user avatar
6 votes
1 answer
535 views

What visual features of typeset plain text are unique to LaTeX compared to InDesign, QuarkXPress and other WYSIWYG typesetting programs?

There are many reasons to like LaTeX over WYSIWYG editors. For example one might like that the need to structure the text in a logical way is very present, it's free, it's consistent over versions et ...
user avatar
0 votes
0 answers
24 views

comparison .tex files and export pdf [duplicate]

I would like to compare two .tex files (before and after modifications) and then edit a .pdf with for instance, the added lines in green and those removed in red. Is there a simple tool to do so?
user avatar
2 votes
1 answer
722 views

Compare Variables

I want to have a macro that checks if the string has been used in the previous call of the macro as well. I found some examples here how to create switch structure comparing strings in latex but I ...
user avatar
4 votes
3 answers
385 views

Define an expandable function for comparing a token list to a string in LaTeX3

In LaTeX3, I could define a function for comparing a token list to a string \cs_generate_variant:Nn \tl_if_eq:nnTF { V } \cs_new_nopar:Npn \module_compare:n #1 { \tl_if_eq:VnTF \g_some_tl { #1 }...
user avatar
  • 3,278
1 vote
0 answers
632 views

Checking if a variable is not null [duplicate]

Please consider the following MWE: \documentclass{article} \usepackage{siunitx, etoolbox} \newcommand{\testa}{Some text} \newcommand{\testb}{40} ...
user avatar
  • 2,345
12 votes
2 answers
593 views

How to compare the output of \ref to a number?

I want to compare the output of \ref to a number in LaTeX. I thought it would be easy but after spending lots of hours surfing the net I still don't know the answer. I found similar questions on this ...
user avatar
  • 121