How is it possible to write "anni '90" in LaTeX?
If your goal is to write the backtick ` before the decade, just use it (no escaping is required):
anni `90
This is the result:
Related
I do have one large text file with lot of the following patterns;
because of,this
or that,has
or,not
Of course I want to change the following
because of, this
or that, has
or, not
To make myself clear: i would like to insert a space after each ,
How can i do that with BBEdit Find/Replace/Grep?
Find works ok with
[\,](\w)
but i can't figure out the coresponding part for replace.
Find: (\,)(\w)
Replace: \1 \2
Note: You need to hit the spacebar between \1 and \2. Works on my computer with BBedit v13
I complicates matters.
Pattern like Letter,Letter can also be found with ,\b.
\b is at the beginning or end of a word. \b in a regular expression means "word boundary".
The replacement is then done with ,_
Nota Bene: _ is a "Space" after ,
you could just replace all commas with a comma-space and then replace all space-space with space
I'm trying to write a regex which allows alphabets, dot . and dashes - (for validation)
But couldn't find a valid regex which would do so, please help!
Thanks in advance
I think this will work for you
^[a-zA-Z-.]*$
any lowercase letter of the alphabet, any uppercase letter of the alphabet, dash as a group in any combination appearing 1 or many times
This character class should work for you:
[a-zA-Z.-]
Must Read: http://regular-expressions.info
Use this regex ([A-Za-z.-]) and test here http://www.rubular.com/r/H3Axvol13b
(?i)[a-z.-]
(?i) Will find any character no matter what case
Here is my sample string.
[echo] The SampleProject solution currently has 85% code coverage.
My desired output should be.
The SampleProject solution currently has 85% code coverage.
Btw, I had this out because I'm getting through the logs in my CI using Jenkins.
Any help? Thanks..
You can try substText parameter in BUILD_LOG_REGEX token to substitute the text matching your regex
New optional arg: ${BUILD_LOG_REGEX, regex, linesBefore, linesAfter, maxMatches, showTruncatedLines, substText} which allows substituting text for the matched regex. This is particularly useful when the text contains references to capture groups (i.e. $1, $2, etc.)
Using below will remove prefix [echo] from all of your logs ,
${BUILD_LOG_REGEX, regex="^\[echo] (.*)$", maxMatches=0, showTruncatedLines=false, substText="$1"}
\[[^\]]*\] will match the bit you want to remove. Just use a string replace function to replace that bit with an empty string.
Andrew has the right idea, but with Perl-style regex syntaxes (which includes Java's built-in regex engine), you can do even better:
str.replaceAll("\\[.*?\\]", "");
(i.e., use the matching expression \[.*?\]. The ? specifies minimal match: so it will finish matching upon the first ] found.)
Is there an alternative way to enter multiple arguments to LaTex newcommand constructions? I have defined
\newcommand{\nuc}[2]{\ensuremath{^{\text{#1}}\text{#2}}}
and I would like to call the command through
\nuc{12,C}
and not
\nuc{12}{C}.
I have created other commands with even more arguments and my poor pinky can't handle all the brackets.
Thanks!
Maybe you will like it.
\def\nuc #1,#2.{\ensuremath{^{\text{#1}}\text{#2}}}
Sample of using:
\nuc 12,C.
Note. Use the dot at the end.
I like to praise perltex for defining complicated functions. This isn't complicated, but you can extend it quite impressively.
%myfile.tex
\documentclass{article}
\usepackage{perltex}
\perlnewcommand{\commafrac}[1]{
$input = shift;
#inputs = split(/,/, $input);
return "\\ensuremath{\\frac{$inputs[0]}{$inputs[1]}}";
}
\begin{document}
One half is $\commafrac{1,2}$.
\end{document}
Compile with perltex --latex=pdflatex myfile.tex. I know that \frac wasn't your example, but I find it a visually appealing one.
Use plain TeX \def:
\makeatletter
\newcommand*{\nuc}[1]{\nuc##1\#nil}
\newcommand*{\nuc#}{}
\protected\def\nuc##1,#2\#nil{\ensuremath{^{\text{#1}}\text{#2}}}
\makeatother
As fas as I know \nuc{12}{c} is the only way. If you don't want to put all the "}{"s, let the editor do it. Write \nuc{12,c} first, then replace all commas with "}{"s.
I'm using LyX to write some Relational Algebra queries.
I'm using the \bowtie symbol for the join operation but when I try to put a text in subscript directly under the symbol, I get the following error:
...a_{\t{pId}}\t{person}\right)\bowtie\limits
{\t{pId}{1}=\t{pId}_{2}... I'm ignoring this misplaced \limits or
\nolimits command.
Anyone knows how to do what I want? Preferably in LyX, but ERT code snippets will also be appreciated. Thanks!
Edit: \t is a macro for \text.
Better use
\Join
It works fine for me
Your problem is that \bowtie is not math operator such as \int, \sum etc.
Try this in preamble:
\usepackage{amsmath}
\DeclareMathOperator*{\btie}{\bowtie}
and this in document:
\(\btie\limits_{subscript}^{superscript}\)
I hope it's what you're looking for.
From http://en.wikibooks.org/wiki/LaTeX/Advanced_Mathematics#Above_and_below:
In preamble:
\usepackage{amsmath}
In equation:
\underset{your_subscript_here}{\bowtie}