Is there a macro telling which OS we're using?LaTeX OS recognitionDoes InputIfFileExists not work anymore?Is...

Can an earth elemental drown/bury its opponent underground using earth glide?

How does insurance birth control work?

Create chunks from an array

Script that counts quarters, dimes, nickels, and pennies

Is there a way to find out the age of climbing ropes?

How will Occam's Razor principle work in Machine learning

PTIJ: Mordechai mourning

Are small insurances worth it

Are there other characters in the Star Wars universe who had damaged bodies and needed to wear an outfit like Darth Vader?

Is there a frame of reference in which I was born before I was conceived?

Giving a talk in my old university, how prominently should I tell students my salary?

Is there a math equivalent to the conditional ternary operator?

Misplaced tyre lever - alternatives?

How can neutral atoms have exactly zero electric field when there is a difference in the positions of the charges?

Book about a time-travel war fought by computers

Is there a full canon version of Tyrion's jackass/honeycomb joke?

Can I solder 12/2 Romex to extend wire 5 ft?

I've given my players a lot of magic items. Is it reasonable for me to give them harder encounters?

Why did the Cray-1 have 8 parity bits per word?

A bug in Excel? Conditional formatting for marking duplicates also highlights unique value

I encountered my boss during an on-site interview at another company. Should I bring it up when seeing him next time?

Is divide-by-zero a security vulnerability?

The need of reserving one's ability in job interviews

Convert an array of objects to array of the objects' values



Is there a macro telling which OS we're using?


LaTeX OS recognitionDoes InputIfFileExists not work anymore?Is there a way to detect from inside a package that MiKTeX is used?Getting started with latex and conditional typesetTelling LaTeX where to compile to from inside your document?How to automatically skip leading white spaces in listingsUsing checksums to determine completion of compilationDiagram / Infographic of TeX & friends?Meaning of “Macro packages”, “TeX engines” and “Distributions” of TeXWhat does the output of TeX/LaTeX depend on (in the sense of version and distribution)Is there a way to know how often latex has already run?LaTeX for automatic report generationModerncv template.tex is not compilable after MikTex and moderncv updateConditional plotting by position in pgfplots groupplot













19















I got some LaTeX documents that I have to compile them under different TeX Live, such as MacTeX or TeX Live. But in different OS, the font seems different too, for example, while in Windows, I prefer to use Cambria, but in Mac, I like Lucida Grande more.



Is there was a macro to differentiate between OS?





Answer Update



As the accepted answer, We need to add more comments on this question, As I read the package manual, we need more settings to use these macros:



% packages we need
usepackage{pdftexcmds}
usepackage{catchfile}
usepackage{ifluatex}
usepackage{ifplatform}


Then we use these macros like that



ifwindows
% add settings
fi
iflinux
% add settings
fi
ifmacosx
% add settings
fi % This needs to be fi, not if


now, it works well, the point is you need more packages not only ifplatform.



one more thing, compile your tex file with option -shell-escape is required:



xelatex -shell-escape file.tex









share|improve this question















migrated from stackoverflow.com Nov 28 '12 at 15:22


This question came from our site for professional and enthusiast programmers.














  • 4





    Related question, which doesn't provide a way for detecting MacTeX though: Is there a way to detect from inside a package that MikTeX is used?

    – doncherry
    Nov 28 '12 at 15:33
















19















I got some LaTeX documents that I have to compile them under different TeX Live, such as MacTeX or TeX Live. But in different OS, the font seems different too, for example, while in Windows, I prefer to use Cambria, but in Mac, I like Lucida Grande more.



Is there was a macro to differentiate between OS?





Answer Update



As the accepted answer, We need to add more comments on this question, As I read the package manual, we need more settings to use these macros:



% packages we need
usepackage{pdftexcmds}
usepackage{catchfile}
usepackage{ifluatex}
usepackage{ifplatform}


Then we use these macros like that



ifwindows
% add settings
fi
iflinux
% add settings
fi
ifmacosx
% add settings
fi % This needs to be fi, not if


now, it works well, the point is you need more packages not only ifplatform.



one more thing, compile your tex file with option -shell-escape is required:



xelatex -shell-escape file.tex









share|improve this question















migrated from stackoverflow.com Nov 28 '12 at 15:22


This question came from our site for professional and enthusiast programmers.














  • 4





    Related question, which doesn't provide a way for detecting MacTeX though: Is there a way to detect from inside a package that MikTeX is used?

    – doncherry
    Nov 28 '12 at 15:33














19












19








19


2






I got some LaTeX documents that I have to compile them under different TeX Live, such as MacTeX or TeX Live. But in different OS, the font seems different too, for example, while in Windows, I prefer to use Cambria, but in Mac, I like Lucida Grande more.



Is there was a macro to differentiate between OS?





Answer Update



As the accepted answer, We need to add more comments on this question, As I read the package manual, we need more settings to use these macros:



% packages we need
usepackage{pdftexcmds}
usepackage{catchfile}
usepackage{ifluatex}
usepackage{ifplatform}


Then we use these macros like that



ifwindows
% add settings
fi
iflinux
% add settings
fi
ifmacosx
% add settings
fi % This needs to be fi, not if


now, it works well, the point is you need more packages not only ifplatform.



one more thing, compile your tex file with option -shell-escape is required:



xelatex -shell-escape file.tex









share|improve this question
















I got some LaTeX documents that I have to compile them under different TeX Live, such as MacTeX or TeX Live. But in different OS, the font seems different too, for example, while in Windows, I prefer to use Cambria, but in Mac, I like Lucida Grande more.



Is there was a macro to differentiate between OS?





Answer Update



As the accepted answer, We need to add more comments on this question, As I read the package manual, we need more settings to use these macros:



% packages we need
usepackage{pdftexcmds}
usepackage{catchfile}
usepackage{ifluatex}
usepackage{ifplatform}


Then we use these macros like that



ifwindows
% add settings
fi
iflinux
% add settings
fi
ifmacosx
% add settings
fi % This needs to be fi, not if


now, it works well, the point is you need more packages not only ifplatform.



one more thing, compile your tex file with option -shell-escape is required:



xelatex -shell-escape file.tex






compiling conditionals automation distributions ifplatform






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 20 hours ago









TheSodesa

1239




1239










asked Nov 27 '12 at 14:42









coanorcoanor

29317




29317




migrated from stackoverflow.com Nov 28 '12 at 15:22


This question came from our site for professional and enthusiast programmers.









migrated from stackoverflow.com Nov 28 '12 at 15:22


This question came from our site for professional and enthusiast programmers.










  • 4





    Related question, which doesn't provide a way for detecting MacTeX though: Is there a way to detect from inside a package that MikTeX is used?

    – doncherry
    Nov 28 '12 at 15:33














  • 4





    Related question, which doesn't provide a way for detecting MacTeX though: Is there a way to detect from inside a package that MikTeX is used?

    – doncherry
    Nov 28 '12 at 15:33








4




4





Related question, which doesn't provide a way for detecting MacTeX though: Is there a way to detect from inside a package that MikTeX is used?

– doncherry
Nov 28 '12 at 15:33





Related question, which doesn't provide a way for detecting MacTeX though: Is there a way to detect from inside a package that MikTeX is used?

– doncherry
Nov 28 '12 at 15:33










1 Answer
1






active

oldest

votes


















23














the ifplatform package provides ifwindows, iflinux, ifmacosx and ifcygwin conditionals. i would think that would be enough; the package requires shell escape to be enabled.






share|improve this answer



















  • 5





    I like how Cygwin is strange enough it counts as a separate OS.

    – Canageek
    Nov 28 '12 at 15:55






  • 3





    @Canageek Cymwin 'looks like' *nix, but Windows is 'around'. From memory, there were various requests to be able to differentiate Cygwin from Linux (and of course from Mac OS X, OpenBSD, ...).

    – Joseph Wright
    Nov 28 '12 at 15:59











  • Cygwin is not a question, just do jobs in Windows.

    – coanor
    Nov 29 '12 at 8:20











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f84652%2fis-there-a-macro-telling-which-os-were-using%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









23














the ifplatform package provides ifwindows, iflinux, ifmacosx and ifcygwin conditionals. i would think that would be enough; the package requires shell escape to be enabled.






share|improve this answer



















  • 5





    I like how Cygwin is strange enough it counts as a separate OS.

    – Canageek
    Nov 28 '12 at 15:55






  • 3





    @Canageek Cymwin 'looks like' *nix, but Windows is 'around'. From memory, there were various requests to be able to differentiate Cygwin from Linux (and of course from Mac OS X, OpenBSD, ...).

    – Joseph Wright
    Nov 28 '12 at 15:59











  • Cygwin is not a question, just do jobs in Windows.

    – coanor
    Nov 29 '12 at 8:20
















23














the ifplatform package provides ifwindows, iflinux, ifmacosx and ifcygwin conditionals. i would think that would be enough; the package requires shell escape to be enabled.






share|improve this answer



















  • 5





    I like how Cygwin is strange enough it counts as a separate OS.

    – Canageek
    Nov 28 '12 at 15:55






  • 3





    @Canageek Cymwin 'looks like' *nix, but Windows is 'around'. From memory, there were various requests to be able to differentiate Cygwin from Linux (and of course from Mac OS X, OpenBSD, ...).

    – Joseph Wright
    Nov 28 '12 at 15:59











  • Cygwin is not a question, just do jobs in Windows.

    – coanor
    Nov 29 '12 at 8:20














23












23








23







the ifplatform package provides ifwindows, iflinux, ifmacosx and ifcygwin conditionals. i would think that would be enough; the package requires shell escape to be enabled.






share|improve this answer













the ifplatform package provides ifwindows, iflinux, ifmacosx and ifcygwin conditionals. i would think that would be enough; the package requires shell escape to be enabled.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 28 '12 at 15:49









wasteofspacewasteofspace

4,8061918




4,8061918








  • 5





    I like how Cygwin is strange enough it counts as a separate OS.

    – Canageek
    Nov 28 '12 at 15:55






  • 3





    @Canageek Cymwin 'looks like' *nix, but Windows is 'around'. From memory, there were various requests to be able to differentiate Cygwin from Linux (and of course from Mac OS X, OpenBSD, ...).

    – Joseph Wright
    Nov 28 '12 at 15:59











  • Cygwin is not a question, just do jobs in Windows.

    – coanor
    Nov 29 '12 at 8:20














  • 5





    I like how Cygwin is strange enough it counts as a separate OS.

    – Canageek
    Nov 28 '12 at 15:55






  • 3





    @Canageek Cymwin 'looks like' *nix, but Windows is 'around'. From memory, there were various requests to be able to differentiate Cygwin from Linux (and of course from Mac OS X, OpenBSD, ...).

    – Joseph Wright
    Nov 28 '12 at 15:59











  • Cygwin is not a question, just do jobs in Windows.

    – coanor
    Nov 29 '12 at 8:20








5




5





I like how Cygwin is strange enough it counts as a separate OS.

– Canageek
Nov 28 '12 at 15:55





I like how Cygwin is strange enough it counts as a separate OS.

– Canageek
Nov 28 '12 at 15:55




3




3





@Canageek Cymwin 'looks like' *nix, but Windows is 'around'. From memory, there were various requests to be able to differentiate Cygwin from Linux (and of course from Mac OS X, OpenBSD, ...).

– Joseph Wright
Nov 28 '12 at 15:59





@Canageek Cymwin 'looks like' *nix, but Windows is 'around'. From memory, there were various requests to be able to differentiate Cygwin from Linux (and of course from Mac OS X, OpenBSD, ...).

– Joseph Wright
Nov 28 '12 at 15:59













Cygwin is not a question, just do jobs in Windows.

– coanor
Nov 29 '12 at 8:20





Cygwin is not a question, just do jobs in Windows.

– coanor
Nov 29 '12 at 8:20


















draft saved

draft discarded




















































Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f84652%2fis-there-a-macro-telling-which-os-were-using%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Why does my Macbook overheat and use so much CPU and energy when on YouTube?Why do so many insist on using...

How to prevent page numbers from appearing on glossaries?How to remove a dot and a page number in the...

Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...