@egreg +1 for not using tikz to insert a tabular (and bothering to answer the question when the OP couldn't be bothered to use less than half a million packages)
You can vote to close with the other duplicate and the one that gets the most close votes of the 5 wins, I think. But the best duplicate to link to is the one that seems like the best answer overall, I think.
@ Speravir I think the duplicate link is actually the better one in this case, since it does give a direct answer, and then links people to how to look up any symbol, which in our collective naïveté we think people will pay attention to. :)
I'm trying to use \dot{P} in a math environment.
MWE:
\documentclass{scrartcl}
\usepackage[no-math]{fontspec}
\usepackage{libertineotf}
\usepackage[libertine]{newtxmath}
\begin{document}
\begin{equation}
\dot{P}(t) + 1234567890
\end{equation}
\end{document}
Without the command...
@dexterity Not a predefined one; you can look for \DeclareMathOperator on the site; essentially, you can do \DeclareMathOperator{\Mat}{Mat} and then using \Mat as you would use \sin. Requires amsmath
Anyone have an opinion on whether or not I should delete my answer in tex.stackexchange.com/a/99054/86 ? When I answered the question seemed to be about tracking whether or not a command had been used but it would appear that the issue is more complicated so I don't think my answer is really relevant and could be said to be just adding noise.
@AndrewStacey It's the fault of the qner for being unclear. I'd leave it, with the comment you have made, as an advertisement to the nuisance of having effectively communicated requirements change in this way.
Wrt that question: I have the leanest implementation of the updated requirements and have no upvotes...
Maybe I should add a linje \uspackage{expl3} to make it more bloated
@CharlesStewart two unexpandable tokens yes but \def\a{} \def\b{aabb} \if\a\b 1 \else 2 \fi makes bb1 as the two a compare true, which isn't usually what you want
but at least the tex stuff should behave similar in luatex pdftex etc. So the IE guys didn't even try to catch up with the standard (in the past... when i did more html than today. I was told that even IE got better)
but for html good news came form scandinavia. At least one hasn't to care about presto any more ;)
@topskip Hixie grabs that list from my sources anyway so just use this file (which is also the file firefox uses internally as well, or at least I think it is I had long enough conversations with their lawyers confirming they could use it)
I've found a small error there: "Please report any errors to David Carlisle via the public W3C list www-math@w3.org." should be "Please report any errors to David Carlisle via the tex.stackexchange chat" :)
@topskip could be useful... my forecast is that if luatex will have a certain performance it will become #1 plotting tool in the whole round world. (maybe even in the univers)
@bloodworks Thanks for the feedback, I've fixed the answer. It's leaner and more readable just to \edef the \csnames, rather than use \expandafter, though it does cost a line of code. See tex.stackexchange.com/a/99159/175
@bloodworks Ah, a bug: there's a spurious "analyze" at the end. So how come gobbling an argument with \def\endanalyze#1 causes junk to appear? I guess I've gobbled a gobbler cs.
And it is now not interestingly different from Peter Grill's answer: it uses \ifx to compare csnames rather than \IfStrEq on macro contents. Is it easier to understand? If not, should I keep it anyway?
@CharlesStewart The code is wrong: \edef\analyzename{\csname#1\endcsname} with #1 equal to eddy, just defines \analyzename to expand to \relax (unless you give a definition to \eddy). And two tokens defined in this way will always be equivalent.
If you do \def\analyzename{#1} then the thing is different.
@CharlesStewart Look at this
\documentclass[12pt]{article}
\usepackage{ulem}
\usepackage{color}
\newenvironment{analyze}[1]
{\def\analyzename{#1}}
{}
\newcommand{\deleteline}[2]{%
\def\test{#1}%
\ifx\test\analyzename % Check name (\1) matches \analyzename
\textsuperscript{\textcolor{black}{ #1}}%
\textcolor{red}{\sout{#2}}%
\fi
}
\title{Latex Document}
\author{Eddy}
\begin{document}
\maketitle
\begin{analyze}{Margret}
As part of this project, we intend to study the complex structures of Latex.
\deleteline{eddy}{This line will be stroked through.}
@egreg @egreg if the names passed in correspond to let equivalent macros the test will be true but if they are undefined they wont \edef\a{\csname zzzz\endscsname} and \edef\b{\csname xxxxx\endscsname} aren't ifx equivalent even though both the inner tokens are let to relax. (The code's wrong anyway but for different reasons:-)
@DavidCarlisle Oh, yes! There's an \else that does exactly the contrary (and a spurious spaces that I didn't see. But using \csname seems very risky for no real gain.
@egreg well yes, just because the code is wrong, doesn't mean you are right though:-) So I'm still feeling rotten but can cheer myself up knowing someone's bound to star a comment saying I found an egreg bug.
@egreg I can't remember if we considered making hspace use \setlength. I know I spent quite some time searching the sources to find all primitive length register assignments and deciding if they should use setlength, but of course that isn't an assignment so might have missed the net, or we might have decided it was too slow or risky a change
@DavidCarlisle There are better ways for this: \hphantom{text}; I don't think somebody really wants a \hspace{\widthof{text}} that disappears at page breaks.
@egreg well true but they may want \hspace{\textwidth-6cm} of course they can have that now anway with \dimexpr but in general I think we claim that user-facing length arguments in latex should take calc syntax
I'm trying to improve the input syntax of this matrix-ball answer. There's no reason why the location needs to be specified as an (x,y) coordinate instead of a single index from 1-9 corresponding to the cells of the matrix read left-right/top-bottom. But TikZ's picture origin is in the lower left corner, which makes the conversion a real pain. Is there some clever method I'm missing?
@AlanMunn why is the indexing 0 based in one axis and 1 based in the other? As my day job involves translating between fortran 1 based and C 0 based arrays I'm used to either convention but having both in the same array hurts:-)
@AlanMunn can't 1,1 be top left and 3,3 be bottom right?
@AlanMunn well if it's really a "matrix" having 2 indices is probably more natural but matrices are always indexed from 1 starting top left. If it's just an arbitrary data layout then of course whatever indexing scheme works works:-)
@AlanMunn well you just need the linear relation between documented index and whatever tikz need here at (#1.5,#2.5) but I don't know what constructs you can put at that point in tikz syntax. I could ask @egreg I suppose.
Psmith, the TeX bot, in fixed font mode: Let's take a look at the last fencing results:
- Oh dear, nothing happened so far.
Our fencing expert Alan might explain these results later on.
@AlanMunn My last discrete-mathematical problem to solve was a polynomial bijection between $N^k$ and $N$, for a fixed $k$ of course. Despite it was couple weeks ago, I'm still a bit tired from that ;)
@AlanMunn Do I understand that right, for a given number between 1 and 9 in the first scheme you want to get the equivalent number in the second scheme? Or the x and y indices in a grid?
@Jake Well I want to convert a number in the first scheme to the indexes used in the matrix-ball answer. In its current state (because TikZ uses the lower left as an origin) the natural indexing is the second matrix. So if I could convert from one indexing to the other I think that would also work.
@JosephWright Is it a good idea to nest the \si declarations with per-mode=fraction? Example; if I want to write Newton meters per rad/s, I've tried \si[per-mode=fraction]{\newton\meter\per\si[per-mode=fraction]{\radian\per\second}}. I don't know if it's a feature, but then I get the first fraction turned into a slash which is quite nice. Is that dependent on the size of the denominator?
Now a TeX question. The commands are going to be of the form \single(index){value} or \double(index){value}{value}. I can implement this with () to delimit the index or I could use (or abuse) the optional argument, so that the syntax would be \single[index]{value}. The latter uses `\newcommand` instead of a delimited argument, but the index isn't really optional, so I feel like I'm abusing the syntax. Comments?
@egreg But I'd like to separate the index from the content in the actual command syntax. So I don't like \single{index}{value} as a syntax (although obviously that would work.)
@DavidCarlisle I'm trying to separate visually the index from the value(s).
@AlanMunn Oh, hang on. I missed the fact that there's only 9 squares so you could just do \def\single#1#2{...} (also got confused between \single and \double in number of arguments) and call it as \single 9 {value}.
Maybe I should just go for the standard \single{index}{value} and \double{index}{value}{value}. But I like the idea of separating the two types of argument in the markup.
Psmith, the TeX bot, in fixed font mode: Here's the output from texdef:
\bibliography:
macro:#1->\if@filesw \immediate \write \@auxout {\string \bibdata {#1}}\fi \@input@ {\jobname .bbl}
@PauloCereda First up, you used the word in a right way, IMHO. :) And, thanks for sharing, sounds interesting. I have come across quite a few recorded by a guy in US on lord Krishna.
@egreg "using \csname seems very risky for no real gain." - Oh, quite, but a most pernicious excuse to waste time. I've run into a quite surprising error hacking csnames.
longtable man, longtable man
Doing the things longtable can
What's he like? it's not important
longtable man
Does the package have a \dot, or even a spec?
If there's a conflict, is longtable a threat?
Or should we remove the package instead?
Nobody knows, longtable man
@N3buchadnezzar So the columns don't have really a significant meaning?
I would say it's good. If it was a timetable, some more vertial "leaders" would be probably ok (timetable is not really a table). And I would not be afraid of making some information bold
I've seen quite a few questions here on how to use enumitem with descriptions and bullets. I couldn't however find a solution where they created a newlist and that's where I have my problem:
I defined in the preamble
\usepackage{enumitem}
\newlist{codescription}{description}{1}
\setlist[codescr...
I am preparing a presentation on the compiler Texmaker "documentclass" in "beamer". I was fascinated with the package
"multimedia" which is a solution to include movies in the presentation.
Question: Is there any solution to include Java Applets in presentations/beamers or a link to webpage?
Th...
@Andrew I have been meaning to ask you, how do you remap Caps lock key to, say tab? I did it with the xmodmap tool and wrote the output so that it is saved for all sessions. It still does not seem to have changed.
The behaviour gets mixed. The first tap is taken for a tab but also mistaken for Caps Lock and it gets toggled.
I remember a recent (one or two weeks) question which used lua to generate a latex table, if I recall correctly, but I can't locate it now. It would be interested in finding some examples which use lua to implement loops which generate tex output, in order to translate to lualatex my answer to the question: tex.stackexchange.com/questions/99256/…
I'm seeking of a list of quotation marks used in different language. So far I found only this wiki-page. But there is only the marks itself in Unicode.
I know about csquotes package. I just want to find a list of all this marks as a LaTeX "commands", like ,,, << etc.
@tohecz I mean that when changing the width, it interprets {1-3} as {1-all} as in it does not only make the specific lines wider, it makes all the rows wider!
@N3buchadnezzar if you can change \arrayrulecolor between the \cmidrules, and if \arrayrulecolor doesn't bring problem to \halign, \noalign and friends, yes, you can ;)
Editor Sign Up List
Texmaker: doncherry (Win7), hpesoj626 (linux)
TeXworks: Joseph Wright, tohecz (linux)
TeXnicCenter: Werner
TeXStudio: hpesoj626 (linux)
TeXShop: Alan Munn
Vim: Psirus
Emacs: Charles Stewart (OSX, linux), Tyler Smith
Please add yourself with your favorite editor(s) here. In...
Don't forget to sign up!
I'm hoping @ulrikefischer will take WinEdt (I used to use it, so can if required)
Any other obvious people to take particular editors?
@topskip Thanks, feel free of commenting any improvement you can see. As I said, this is my first attepmt at LuaLatex, and even at Lua, so it must be plenty of begginer's pitfalls
I'd also use \luaexec{ dofile('luafunctions.lua') } and just put the lua code from the tex file in there. That way you keep TeX from doing bad things to your lua code
@JLDiaz don't know what a=b[:]does, but you do need a loop to copy a table.
@topskip : is the "slice" operator in python, you can get a copy of part of an array with: new_aray = old_array[start:end], but if you omit the start and end, it copies the whole array. I missed this feature in lua
@JLDiaz There are many functions that you'll miss if you come from Python. Lua has such a small standard library that you have to code everything yourself (or take some 3rd party library)
@topskip yes, of course, but I was refering to features in the core language, not to the "included batteries" :-) At least Lua has a very powerful table type which allows to implement almost any other datatipe required
@topskip Ok, I've implemented those changes, removed "table" requirement and used dofile to load the external functions. Apparently I didn't broke anything...
@CharlesStewart I don't have any problems with the built in selene unicode library
(except for the part that some functions operate on bytes, others operate on utf8 characters - multiple bytes. It's easy to mix up byte positions and character positions)
@topskip if luatex has \def and \ifx then yes that's about all it uses:-) Although actually it would probably take some un-documented tweaks so it stopped trying to decode utf8 itself and let lua/xe-tex do it.
@DavidCarlisle I was thinking about UTF-8 compatibility
@DavidCarlisle The question I ask when I see an XML implementation (including my own ones): Does it handle utf16? xinclude? DTD's? (utf-8-)BOM? How fast is it? Does it handle 100mb XML easily without too much memory consumption?
@topskip well I think it would in luatex in classic tex it "handles" it by taking every other byte and hoping it is latin 1. Nothing else you can do as it assumes a delimited argument #1< looking for the next tag fins that not a random character with that as one of its bytes. but in luatex that would be handled before the nacro tokenizer so it should all work, I may set that up one day. The only other thing it fails on is that tex removes white space from ends of lines and you can't stop it.
it parses every construct allowed in the local subset of a dtd, and does full namespace processing. it doesn't really have any memory footpriint it just reports start/end although has hooks to grab element content as a macro so you just have to be careful what it grabs
@topskip but I'd never use it myself, just more convenient to use xslt at the front and just pass to tex something more easily digested by tex.
@DavidCarlisle But that doesn't work when you want to read XML during TeX's run (unless you start expensive XSLT processors)
The point is, I'd like to have an xml parser that works even with things like UTF-16. And when you get UTF-16 and try to parse it by looking at 8bit bytes you're screwed when you read for example ȼ (which is 0x023C and < is 0x3C)
@topskip true, and for smalish xml fragments nid document it's fine. I've never found the need to process 100mb of xml mid document if I didn't know in advance that it needed to be parsed though. I've not actually run xmltex this century but some people use it
@topskip yep it uses utf8 internally and has hooks for any 8bit encoding, but it's a documented feature that utf16 is a lost cause. But as I say that shouldn't be a problem in luatex.
@topskip couldn't you write a reasonable parser in lua (it must be easier than writing it in TeX:-)
@DavidCarlisle "reasonable" can be stretched :) - I work now with a very small one (written myself), but I know it will explode if something unusual happens (like encoding != UTF-8)
@topskip oh do you have to handle the unicode yourself? I don't know lua but I'd have hoped it could give you a stream of Unicode data handling the external file encoding using some central libraries.
@DavidCarlisle Well, there is the selene unicode library which does that. But still I must read the bom(if present) and the encoding="..." whatever char. I don't do that at the moment.
(Just found out that the unicode library is only utf-8/latin-1/ascii. Would need to convert utf16 to utf8 before parsing the file)
@topskip - Fully fledged utf16 is kind of rare - ucs2 is much easier to parse and from what I've heard pretty much covers the texts that are around.
@topskip Restricting an xml parser to handle only utf8 seems good to me: I should think you can always handle character class conversion with external tools.
@tohecz Hmm, he (?) wrote, he had found this wiki page. I understood, he had searched for (cite:) “a list of all this marks as a **LaTeX ‘commands’**” (markup by me). That’s why I voted as duplicate, see also my comment. There are, of course, the basic ligatures `` and '', and also babel shorthands.