Questions tagged [comparison]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
6
votes
2answers
274 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 ...
13
votes
2answers
705 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 ...
0
votes
0answers
41 views

What are some differences between the exam class and the examdesign class?

The exam class and examdesign class are both intended for exam designing typesetting. What are some unique features of theirs? What are some advantages and disadvantages of one over the other?
4
votes
2answers
216 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
89 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
67 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
29 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
95 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
67 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
569 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
774 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
128 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
4k 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
71 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 \...
35
votes
2answers
4k 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
54 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
325 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
217 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
179 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
301 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
71 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
68 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
186 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 ...
2
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
465 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
125 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
384 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
432 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
17 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
385 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
176 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
90 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} ...
11
votes
2answers
358 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 ...
14
votes
1answer
31k 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
43k 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
266 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
120 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
103 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
884 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
107 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
208 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
3k 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
2k 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 ...
30
votes
3answers
8k 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
205 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 ...
5
votes
1answer
944 views

What is the difference between the scalefnt and anyfontsize packages?

What is the difference between the scalefnt and anyfontsize packages? Even though I use scalefnt, I get font size substitutions of up to "2.30002pt" in a document I am currently editing. The ...
9
votes
3answers
417 views

How to compare two dvi files?

Is there any tool that compares two dvi files. I would like to check if they are identical after I make some changes with source tex file.
12
votes
2answers
828 views

Availability of LaTeX packages' functionality in ConTeXt, XeTeX, and LuaTeX

I am considering trying out ConTeXt, XeTeX, and LuaTeX, but one concern of mine is the fact that I am using a large number of LaTeX packages. There are a number of questions comparing these TeX ...
40
votes
2answers
16k views

What is the difference between \nobreak and \nolinebreak?

What is the difference between \nobreak and \nolinebreak? I noticed that a lot of solutions in TeX.SE use the former, but I thought the latter is LaTeX while the former is plain TeX. And LaTeX macros ...