Questions tagged [comparison]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
2answers
56 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.
0
votes
1answer
108 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 ...
2
votes
1answer
57 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 \...
63
votes
4answers
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?
2
votes
1answer
130 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 ...
6
votes
2answers
371 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 ...
21
votes
2answers
1k 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 ...
4
votes
2answers
248 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 ...
5
votes
1answer
132 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.
3
votes
2answers
113 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: ...
1
vote
0answers
30 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\...
4
votes
1answer
130 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} \...
2
votes
2answers
81 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 ...
5
votes
3answers
583 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} ...
17
votes
6answers
818 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 ...
1
vote
0answers
174 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, ...
5
votes
2answers
6k 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 ...
0
votes
1answer
78 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 \...
37
votes
2answers
6k 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 ...
1
vote
0answers
58 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 ...
1
vote
1answer
427 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 ...
13
votes
0answers
241 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 ...
1
vote
1answer
233 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 ...
6
votes
2answers
397 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 ...
3
votes
1answer
80 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, ...
4
votes
2answers
77 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 ...
2
votes
2answers
213 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 ...
4
votes
0answers
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 ...
13
votes
4answers
508 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{% ...
3
votes
1answer
159 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 ...
2
votes
1answer
435 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 \??...
6
votes
1answer
468 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 ...
0
votes
0answers
23 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?
2
votes
1answer
571 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 ...
2
votes
1answer
201 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 }...
1
vote
0answers
194 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} ...
12
votes
2answers
403 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 ...
17
votes
2answers
38k views

ifthenelse equal string comparison fails

I am trying to fix some problems with the accessibility.sty package from www.babs.gmxhome.de There is one string comparison which always results to false, i.e. the language code definition will not ...
19
votes
0answers
46k views

Texmaker vs TeXstudio (comparison) [closed]

I would like to use either Texmaker or TeXstudio in Ubuntu 14.04 LTS. I want to use the latest version available via some PPA (not something installed "by hand" or even compiled!). I would like to use ...
0
votes
1answer
354 views

Inequality operators of both directions aligned vertically in one expression? [duplicate]

I would like to put inequality operators of both directions, i.e. < and >, aligned vertically in one expression. Can anyone help?
3
votes
1answer
123 views

Conditional structure based on \rand value comparison

I have a simple code that inserts a complex layout for figures and I would like to randomly alternate the position options (for instance, alternating between top and bottom positioning: begin{figure}[...
3
votes
0answers
170 views

What are the differences between mdframed vs. tcolorbox [duplicate]

I am familiar with the mdframed package and its usefulness when content crosses page boundaries. But lately, I have seen quite a few questions about the tcolorbox package and don't know much about it ...
8
votes
1answer
935 views

Why does amsmath define \mspace? \mskip seems fine and simple enough

amsmath.sty defines \mspace as follows: \newcommand{\mspace}[1]{\mskip#1\relax} What is the purpose of this definition? amsmath.pdf says that \mspace is the "equivalent of \hspace for math mode use"...
1
vote
0answers
119 views

Best compiler for writing a thesis? [duplicate]

Which LaTeX compiler supports best writing a thesis? Which one provides the best compatibility with commonly used classes and packages? The compilers that I frequently use are: latex pdflatex ...
11
votes
2answers
213 views

Document equivalence

What is the best way to determine, for two arbitrary input files, if they will result in the same compiled document (disregarding timestamp information and external files)? Context I'm attempting to ...
19
votes
4answers
4k views

How to compare numbers with decimal point and logical OR operation?

I'm reading five values from external CSV file as [\sone, \stwo, \sthree, \sfour, \sfive]. Sample values could be [55.3, 89.0, 33.5, 40, 0.10]. Question : How to compare number with decimal points. ...
6
votes
0answers
3k views

Using Latexdiff math-markup for not comparing equations [closed]

I am using Latexdiff to compare 2 Latex files. I can do it successfully for text but it gives me problem with equations which I have a lot. I do not want to compare the equations. If I understand ...
7
votes
2answers
5k views

How to compare two TeX codes and mark differences with color

I would like to find easy tool, which compares two TeX codes and generates a PDF file of the first code, in which the differences from the second code are marked by a given color. I use winedt 7.0 ...
32
votes
3answers
9k views

Difference between \mskip and \mkern

What are the differences between \mskip and \mkern? The TeXbook writes the following (ch. 18): You can insert math glue into any formula just by giving the command ‘\mskip⟨muglue⟩’. [...] ...
6
votes
2answers
210 views

Ignoring Punctuation during Comparison

I am trying to compare two strings and ignore punctuation during the comparison. I thought that catcode redefinition would be a good way to proceed. But, obviously, the use of \catcode has a great ...